keycloak-scim/testsuite/integration-arquillian/tests/other/server-config-migration
Jan Lieskovsky 16ba4c0104 [KEYCLOAK-16723] Upgrade to Wildfly 22
Base fixes:
* [KEYCLOAK-16724] Upgrade Keycloak to Wildfly 22.0.0.Beta1 / Wildfly Core 14.0.0.Beta4
* [KEYCLOAK-16822] Upgrade Keycloak to Wildfly 22.0.0.Final / Wildfly Core 14.0.0.Final
* [KEYCLOAK-17158] Upgrade Keycloak to Wildfly 22.0.1.Final / Wildfly Core 14.0.1.Final

Other (related) fixes:
* [KEYCLOAK-16174] Upgrade (RH-SSO adapters) to EAP CD 21
* [KEYCLOAK-16202] Don't upgrade versions of httpclient and httpcore in the Fuse adapter
                   as part of the Wildfly upgrade script run
* [KEYCLOAK-16737] Keycloak core depends on org.bouncycastle:bcprov-jdk15on:1.65, which
                   suffers from CVE-2020-28052
* [KEYCLOAK-16907] ConfigMigrationTest fails after upgrade to Wildfly 22.0.0.Final
* [KEYCLOAK-17156] org.keycloak.test.config.migration.ConfigMigrationTest fails with
                   'illegal reflective access to method com.sun.net.ssl.internal.ssl.Provider.isFIPS()'

Signed-off-by: Jan Lieskovsky <jlieskov@redhat.com>
2021-04-29 12:36:03 +02:00
..
src KEYCLOAK-14087 migration from 9.0.3 2020-06-15 14:47:13 +02:00
pom.xml [KEYCLOAK-16723] Upgrade to Wildfly 22 2021-04-29 12:36:03 +02:00
README.md KEYCLOAK-7594 Upgrade to Wildfly 13. Cross-DC: Upgrade to infinispan server 9.2.4 and JDG 7.2 2018-08-27 12:52:53 +02:00

Keycloak Server Config Migration Testsuite

Test workflow

There are performed several steps before actual test is executed. The steps are divided into different maven lifecycle phases to make sure it goes in specified wanted order.

process-resources

Unpack clean keycloak-server-dist

compile

Copy standalone/domain resources to ${jbossHome}/standalone/configuration and ${jbossHome}/domain/configuration

process-classes

maven-exec-plugin is used to read current master configs and saves the output to ${project.build.directory}/master-${config.name}.txt

generate-test-sources

Files ${jbossHome}/standalone/configuration/keycloak-server.json and ${jbossHome}/domain/configuration/keycloak-server.json are created.

Configuration files (standalone.xml, standalone-ha.xml, domain.xml, host-master.xml) are overwritten by those from previous version.

process-test-sources

Migration scripts are applied using offline mode. Temporary data are removed.

generate-test-resources

wildfly-maven-plugin is used to start and shutdown container with different configs. It is done to let subsystems to upgrade themselves during first run.

process-test-resources

maven-exec-plugin is used to read migrated configs and saves the output to ${project.build.directory}/migrated-${config.name}.txt

default-test

org.keycloak.test.config.migration.ConfigMigrationTest is executed. It compares generated outputs from ${project.build.directory}

If config outputs don't equal to each other, by default the test will compare outputs more deeply to get more readable output. It fails on first found difference.

This can be overwritten by adding property: -Dget.simple.full.comparison=true to the test command. In that case it'll perform assert on the two config outputs.

Properties

maven

  • jbossHome
    • default: ${project.build.directory}/keycloak-${project.version}
    • specifies path to jbossHome dir
  • migrated.version
    • default: 1.8.1
    • specifies version it is migrated from
  • master.version
    • default: ${project.version}
    • specifies version it is migrated to

How to run tests

note: keycloak-server-dist module has to be build first (mvn install -f keycloak/pom.xml -Pdistribution)

  • mvn clean install tests migration from 1.8.1.Final to current master. It goes thru whole test workflow. Deep comparison is done.
  • mvn clean install -Dget.simple.full.comparison=true does assert on outputs instead of deep comparison.
  • mvn clean process-test-sources -Dskip.rename.configs=true applies migration scripts to current master. It can be used to make sure the current keycloak version doesn't break the scripts.
  • mvn clean install -Dskip.rename.configs=true applies scripts to current master and verifies the scripts doesn't actually change anything.