diff --git a/testsuite/integration-arquillian/HOW-TO-RUN.md b/testsuite/integration-arquillian/HOW-TO-RUN.md index fa0e432cfe..efc9b75da7 100644 --- a/testsuite/integration-arquillian/HOW-TO-RUN.md +++ b/testsuite/integration-arquillian/HOW-TO-RUN.md @@ -278,7 +278,7 @@ Run the test (Update according to your DB connection, versions etc): mvn -B -f testsuite/integration-arquillian/pom.xml \ clean install \ - -Pjpa,auth-server-wildfly,db-mariadb,auth-server-migration \ + -Pjpa,auth-server-wildfly,db-mariadb,auth-server-migration-legacy \ -Dauth.server.jboss.startup.timeout=900 \ -Dtest=MigrationTest \ -Dmigration.mode=auto \ diff --git a/testsuite/integration-arquillian/servers/migration/assembly.xml b/testsuite/integration-arquillian/servers/migration/assembly.xml index 22e57acaa1..d3a9600ea4 100644 --- a/testsuite/integration-arquillian/servers/migration/assembly.xml +++ b/testsuite/integration-arquillian/servers/migration/assembly.xml @@ -17,7 +17,7 @@ - auth-server-migration-${migrated.auth.server.version} + ${auth.server.output.directory}-${migrated.auth.server.version} zip @@ -28,14 +28,14 @@ ${auth.server.home} - auth-server-migration + ${auth.server.output.directory} **/*.sh ${auth.server.home} - auth-server-migration + ${auth.server.output.directory} **/*.sh diff --git a/testsuite/integration-arquillian/servers/migration/legacy/pom.xml b/testsuite/integration-arquillian/servers/migration/legacy/pom.xml new file mode 100644 index 0000000000..acf6368c0a --- /dev/null +++ b/testsuite/integration-arquillian/servers/migration/legacy/pom.xml @@ -0,0 +1,154 @@ + + + + + + org.keycloak.testsuite + integration-arquillian-migration-server-parent + 999-SNAPSHOT + + 4.0.0 + + integration-arquillian-migration-server-legacy + pom + Migration Server Legacy + + + ${basedir}/../../auth-server/jboss/common + scenario-standalone + keycloak-server-dist + auth-server-migration-legacy + + + + + + + maven-resources-plugin + + + copy-keystore + process-resources + + copy-resources + + + ${auth.server.home}/standalone/configuration + + + ${common.resources}/keystore + + keycloak.jks + keycloak.truststore + + + + + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + configure-server-jpa + generate-resources + + run + + + + + + + + ${jdbc.driver.tmp.dir} + ${jdbc.mvn.artifactId} + ${jdbc.mvn.version} + ${keycloak.connectionsJpa.url} + ${keycloak.connectionsJpa.user} + ${keycloak.connectionsJpa.password} + ${keycloak.connectionsJpa.schema} + + + + + + inject-truststore + generate-resources + + run + + + + + + + + + ant-apply-prepared-clis + process-resources + + run + + + + + + + + + + + move-driver-module + process-test-resources + + run + + + + + + + + + + + org.apache.maven.plugins + maven-assembly-plugin + + + create-zip + package + + single + + + + ../assembly.xml + + false + + + + + + + diff --git a/testsuite/integration-arquillian/servers/migration/pom.xml b/testsuite/integration-arquillian/servers/migration/pom.xml index 8495269d9a..db0cbc4ac0 100644 --- a/testsuite/integration-arquillian/servers/migration/pom.xml +++ b/testsuite/integration-arquillian/servers/migration/pom.xml @@ -1,6 +1,6 @@ - - - ${jdbc.driver.tmp.dir} - ${jdbc.mvn.artifactId} - ${jdbc.mvn.version} - ${keycloak.connectionsJpa.url} - ${keycloak.connectionsJpa.user} - ${keycloak.connectionsJpa.password} - ${keycloak.connectionsJpa.schema} - - - - - - inject-truststore - generate-resources - - run - - - - - - - - - ant-apply-prepared-clis - process-resources - - run - - - - - - - - - - - move-driver-module - process-test-resources - - run - - - - - - - - - - - org.apache.maven.plugins - maven-assembly-plugin - - - create-zip - package - - single - - - - assembly.xml - - false - - - - + + auth-server-migration-legacy + + legacy + + + keycloak-server-dist + + + + + auth-server-migration + + quarkus + + + keycloak-quarkus-dist + + + community @@ -263,6 +173,7 @@ + productized-server @@ -275,4 +186,4 @@ - + \ No newline at end of file diff --git a/testsuite/integration-arquillian/servers/migration/quarkus/pom.xml b/testsuite/integration-arquillian/servers/migration/quarkus/pom.xml new file mode 100644 index 0000000000..4563a40824 --- /dev/null +++ b/testsuite/integration-arquillian/servers/migration/quarkus/pom.xml @@ -0,0 +1,62 @@ + + + + + + org.keycloak.testsuite + integration-arquillian-migration-server-parent + 999-SNAPSHOT + + 4.0.0 + + integration-arquillian-migration-server-quarkus + pom + + Migration Server Quarkus + + + keycloak-quarkus-dist + auth-server-migration + + + + + + org.apache.maven.plugins + maven-assembly-plugin + + + create-zip + package + + single + + + + ../assembly.xml + + false + + + + + + + diff --git a/testsuite/integration-arquillian/servers/pom.xml b/testsuite/integration-arquillian/servers/pom.xml index 1db1a7323e..d28c41a28d 100644 --- a/testsuite/integration-arquillian/servers/pom.xml +++ b/testsuite/integration-arquillian/servers/pom.xml @@ -66,6 +66,13 @@ + + auth-server-migration-legacy + + migration + + + win diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/AuthServerTestEnricher.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/AuthServerTestEnricher.java index d0d0391ba1..da6a568f41 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/AuthServerTestEnricher.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/AuthServerTestEnricher.java @@ -338,15 +338,15 @@ public class AuthServerTestEnricher { // init migratedAuthServerInfo for (ContainerInfo container : suiteContext.getContainers()) { // migrated auth server - if (container.getQualifier().equals("auth-server-jboss-migration")) { + if (container.getQualifier().equals("auth-server-jboss-migration") || container.getQualifier().equals("auth-server-migration")) { updateWithAuthServerInfo(container); suiteContext.setMigratedAuthServerInfo(container); } } // validate setup if (suiteContext.getMigratedAuthServerInfo() == null) { - throw new RuntimeException(String.format("Migration test was enabled but no auth server from which to migrate was activated. " - + "A container matching auth-server-jboss-migration needs to be enabled in arquillian.xml.")); + throw new RuntimeException("Migration test was enabled but no auth server from which to migrate was activated. " + + "A container matching 'auth-server-jboss-migration' or 'auth-server-migration' needs to be enabled in arquillian.xml."); } } diff --git a/testsuite/integration-arquillian/tests/base/src/test/resources/arquillian.xml b/testsuite/integration-arquillian/tests/base/src/test/resources/arquillian.xml index a7d1d8a560..6778791fac 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/resources/arquillian.xml +++ b/testsuite/integration-arquillian/tests/base/src/test/resources/arquillian.xml @@ -729,7 +729,7 @@ - ${auth.server.jboss.migration} + ${auth.server.migration.legacy} org.jboss.as.arquillian.container.managed.ManagedDeployableContainer ${keycloak.migration.home} @@ -745,5 +745,20 @@ ${auth.server.jboss.startup.timeout} - + + + + ${auth.server.migration} + org.keycloak.testsuite.arquillian.containers.KeycloakQuarkusServerDeployableContainer + ${auth.server.port.offset} + -Xms512m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=512m -Djava.net.preferIPv4Stack=true + + ${migration.import.props.previous} + ${auth.server.memory.settings} + -Dauth.server.db.host=${auth.server.db.host} + + ${auth.server.management.port} + + + diff --git a/testsuite/integration-arquillian/tests/pom.xml b/testsuite/integration-arquillian/tests/pom.xml index f6c6417688..f57fe8d266 100755 --- a/testsuite/integration-arquillian/tests/pom.xml +++ b/testsuite/integration-arquillian/tests/pom.xml @@ -1784,6 +1784,89 @@ + + auth-server-migration-legacy + + target/test-classes/migration-test/migration-realm-${migrated.auth.server.version}.json + + -Dkeycloak.migration.action=import + -Dkeycloak.migration.provider=singleFile + -Dkeycloak.migration.file=${migration.import.file} + -Dkeycloak.migration.strategy=OVERWRITE_EXISTING + + true + + + + org.wildfly.arquillian + wildfly-arquillian-container-managed + + + + + + maven-enforcer-plugin + + + + enforce + + + + + migrated.auth.server.version + + + migration.mode + + + + + + + + + + + maven-dependency-plugin + + + unpack-migrated-auth-server-jboss + generate-resources + + unpack + + + + + org.keycloak.testsuite + integration-arquillian-migration-server-legacy + ${project.version} + zip + + + ${containers.home} + true + + + + + + maven-surefire-plugin + + + ${migrated.auth.server.version} + true + ${containers.home}/auth-server-migration-legacy + ${migration.import.props.previous} + + + + + + + + auth-server-migration @@ -1825,7 +1908,7 @@ maven-dependency-plugin - unpack-migrated-auth-server-jboss + unpack-migrated-auth-server generate-resources unpack @@ -1850,7 +1933,7 @@ ${migrated.auth.server.version} - true + true ${containers.home}/auth-server-migration ${migration.import.props.previous}