From cf35a4648bcb93aaf1ac63918ee5c4b0f422d7d5 Mon Sep 17 00:00:00 2001 From: vramik Date: Fri, 8 Mar 2019 13:27:29 +0100 Subject: [PATCH] KEYCLOAK-9780 Replace XSLT transformations by ant/CLI scripts --- testsuite/integration-arquillian/pom.xml | 1 + .../servers/app-server/jboss/pom.xml | 4 - .../servers/auth-server/README.md | 8 +- .../jboss/common/add-dialect-logger.xsl | 45 --- .../jboss/common/ant/configure.xml | 210 +++++++++- .../jboss/common/datasource-jdbc-url.xsl | 32 -- .../auth-server/jboss/common/datasource.xsl | 125 ------ .../servers/auth-server/jboss/common/io.xsl | 40 -- .../jboss/common/ispn-cache-owners.xsl | 54 --- .../jboss-cli/add-infinispan-log-level.cli | 4 + .../common/jboss-cli/configure-server-jpa.cli | 22 + .../jboss/common/jboss-cli/cross-dc-setup.cli | 8 +- .../auth-server/jboss/common/jboss-cli/io.cli | 4 + .../common/jboss-cli/ispn-cache-owners.cli | 10 + .../jboss-cli/keycloak-server-subsystem.cli | 23 ++ .../migration/configure-server-jpa-legacy.cli | 21 + .../common/jboss-cli/replace-jdbc-url.cli | 3 + .../set-manual-migration-strategy.cli | 5 + .../undertow-subsystem-cluster-setup.cli | 5 - .../common/jboss-cli/update-jpa-schema.cli | 3 + .../common/keycloak-server-subsystem.xsl | 88 ---- .../jboss/common/migration-strategy.xsl | 57 --- .../auth-server/jboss/eap/src/.dont-delete | 1 + .../eap/src/main/resources/xslt/module.xsl | 54 --- .../servers/auth-server/jboss/pom.xml | 377 +++++------------- .../jboss/wildfly/src/.dont-delete | 1 + .../src/main/resources/xslt/module.xsl | 55 --- .../servers/cache-server/jboss/pom.xml | 1 - .../servers/migration/assembly.xml | 4 +- .../servers/migration/pom.xml | 135 +++---- .../src/main/xslt/add-dialect-logger.xsl | 45 --- .../migration/src/main/xslt/datasource.xsl | 106 ----- .../migration/src/main/xslt/module.xsl | 54 --- .../integration-arquillian/servers/pom.xml | 17 +- .../arquillian/h2/H2TestEnricher.java | 5 +- .../integration-arquillian/tests/pom.xml | 3 +- 36 files changed, 459 insertions(+), 1171 deletions(-) delete mode 100644 testsuite/integration-arquillian/servers/auth-server/jboss/common/add-dialect-logger.xsl delete mode 100644 testsuite/integration-arquillian/servers/auth-server/jboss/common/datasource-jdbc-url.xsl delete mode 100644 testsuite/integration-arquillian/servers/auth-server/jboss/common/datasource.xsl delete mode 100644 testsuite/integration-arquillian/servers/auth-server/jboss/common/io.xsl delete mode 100644 testsuite/integration-arquillian/servers/auth-server/jboss/common/ispn-cache-owners.xsl create mode 100644 testsuite/integration-arquillian/servers/auth-server/jboss/common/jboss-cli/add-infinispan-log-level.cli create mode 100644 testsuite/integration-arquillian/servers/auth-server/jboss/common/jboss-cli/configure-server-jpa.cli create mode 100644 testsuite/integration-arquillian/servers/auth-server/jboss/common/jboss-cli/io.cli create mode 100644 testsuite/integration-arquillian/servers/auth-server/jboss/common/jboss-cli/ispn-cache-owners.cli create mode 100644 testsuite/integration-arquillian/servers/auth-server/jboss/common/jboss-cli/keycloak-server-subsystem.cli create mode 100644 testsuite/integration-arquillian/servers/auth-server/jboss/common/jboss-cli/migration/configure-server-jpa-legacy.cli create mode 100644 testsuite/integration-arquillian/servers/auth-server/jboss/common/jboss-cli/replace-jdbc-url.cli create mode 100644 testsuite/integration-arquillian/servers/auth-server/jboss/common/jboss-cli/set-manual-migration-strategy.cli create mode 100644 testsuite/integration-arquillian/servers/auth-server/jboss/common/jboss-cli/update-jpa-schema.cli delete mode 100644 testsuite/integration-arquillian/servers/auth-server/jboss/common/keycloak-server-subsystem.xsl delete mode 100644 testsuite/integration-arquillian/servers/auth-server/jboss/common/migration-strategy.xsl create mode 100644 testsuite/integration-arquillian/servers/auth-server/jboss/eap/src/.dont-delete delete mode 100644 testsuite/integration-arquillian/servers/auth-server/jboss/eap/src/main/resources/xslt/module.xsl create mode 100644 testsuite/integration-arquillian/servers/auth-server/jboss/wildfly/src/.dont-delete delete mode 100644 testsuite/integration-arquillian/servers/auth-server/jboss/wildfly/src/main/resources/xslt/module.xsl delete mode 100644 testsuite/integration-arquillian/servers/migration/src/main/xslt/add-dialect-logger.xsl delete mode 100644 testsuite/integration-arquillian/servers/migration/src/main/xslt/datasource.xsl delete mode 100644 testsuite/integration-arquillian/servers/migration/src/main/xslt/module.xsl diff --git a/testsuite/integration-arquillian/pom.xml b/testsuite/integration-arquillian/pom.xml index b4fb6f8b75..1e64db8a03 100644 --- a/testsuite/integration-arquillian/pom.xml +++ b/testsuite/integration-arquillian/pom.xml @@ -93,6 +93,7 @@ sa jdbc:h2:mem:test;MVCC=TRUE;DB_CLOSE_DELAY=-1 + DEFAULT diff --git a/testsuite/integration-arquillian/servers/app-server/jboss/pom.xml b/testsuite/integration-arquillian/servers/app-server/jboss/pom.xml index 195d9177b9..f4312340bc 100644 --- a/testsuite/integration-arquillian/servers/app-server/jboss/pom.xml +++ b/testsuite/integration-arquillian/servers/app-server/jboss/pom.xml @@ -34,7 +34,6 @@ ${project.parent.basedir}/common ${project.parent.basedir}/assembly.xml ${containers.home}/${app.server.jboss.unpacked.folder.name} - security.xsl ${project.version} ${project.version} true @@ -740,9 +739,6 @@ eap6 - - security-eap6.xsl - eap6 diff --git a/testsuite/integration-arquillian/servers/auth-server/README.md b/testsuite/integration-arquillian/servers/auth-server/README.md index 1fed446c35..311fc716de 100644 --- a/testsuite/integration-arquillian/servers/auth-server/README.md +++ b/testsuite/integration-arquillian/servers/auth-server/README.md @@ -11,7 +11,7 @@ Common configurations of Keycloak server on JBoss-based container (Wildfly/EAP). ### Submodules -#### `wildfly` Wildfly 10 +#### `wildfly` Wildfly latest - Builds keycloak server on top of latest Wildfly. - Activated by __`-Pauth-server-wildfly`__ @@ -32,14 +32,10 @@ By setting `-Dserver-overlay=true` you can switch to server overlay instead. See Configures Keycloak JDBC datasource in `standalone.xml`. See profile `jpa`. -### SSL - -Configures SSL in `standalone.xml`. See profile `ssl`. - ### Cluster Configures in `standalone-ha.xml`: -- h2 datasource over TCP +- h2 datasource over TCP (if not executed together with jpa) - parameters of Keycloak Infinispan caches See profile `auth-server-cluster`. diff --git a/testsuite/integration-arquillian/servers/auth-server/jboss/common/add-dialect-logger.xsl b/testsuite/integration-arquillian/servers/auth-server/jboss/common/add-dialect-logger.xsl deleted file mode 100644 index 6b9e94a1ce..0000000000 --- a/testsuite/integration-arquillian/servers/auth-server/jboss/common/add-dialect-logger.xsl +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/testsuite/integration-arquillian/servers/auth-server/jboss/common/ant/configure.xml b/testsuite/integration-arquillian/servers/auth-server/jboss/common/ant/configure.xml index bfd021192b..3a1c70c8a8 100644 --- a/testsuite/integration-arquillian/servers/auth-server/jboss/common/ant/configure.xml +++ b/testsuite/integration-arquillian/servers/auth-server/jboss/common/ant/configure.xml @@ -1,12 +1,27 @@ - - - - crossdc-configured: ${crossdc-configured} - cluster-configured: ${cluster-configured} + + + + + + + + + + + + + + + + + + + + server.config: ${server.config} - + @@ -16,7 +31,7 @@ - + @@ -25,24 +40,181 @@ - - + + + +
+ embed-server --server-config=${server.config} +
+ +
- + -
- - - - - - - - + + cli scripts for standalone prepared + + cli scripts for cluster prepared + + + + cli scripts for crossdc prepared + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Updating schema?: ${update.schema} + keycloak.connectionsJpa.schema: ${keycloak.connectionsJpa.schema} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Updating infinispan log level?: ${set.ispn.log.level} + infinispan.log.level: ${infinispan.log.level} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/testsuite/integration-arquillian/servers/auth-server/jboss/common/datasource-jdbc-url.xsl b/testsuite/integration-arquillian/servers/auth-server/jboss/common/datasource-jdbc-url.xsl deleted file mode 100644 index 445b9733ff..0000000000 --- a/testsuite/integration-arquillian/servers/auth-server/jboss/common/datasource-jdbc-url.xsl +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/testsuite/integration-arquillian/servers/auth-server/jboss/common/datasource.xsl b/testsuite/integration-arquillian/servers/auth-server/jboss/common/datasource.xsl deleted file mode 100644 index b3f4c89df2..0000000000 --- a/testsuite/integration-arquillian/servers/auth-server/jboss/common/datasource.xsl +++ /dev/null @@ -1,125 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/testsuite/integration-arquillian/servers/auth-server/jboss/common/io.xsl b/testsuite/integration-arquillian/servers/auth-server/jboss/common/io.xsl deleted file mode 100644 index 03d518a13e..0000000000 --- a/testsuite/integration-arquillian/servers/auth-server/jboss/common/io.xsl +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/testsuite/integration-arquillian/servers/auth-server/jboss/common/ispn-cache-owners.xsl b/testsuite/integration-arquillian/servers/auth-server/jboss/common/ispn-cache-owners.xsl deleted file mode 100644 index 727e32ece4..0000000000 --- a/testsuite/integration-arquillian/servers/auth-server/jboss/common/ispn-cache-owners.xsl +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/testsuite/integration-arquillian/servers/auth-server/jboss/common/jboss-cli/add-infinispan-log-level.cli b/testsuite/integration-arquillian/servers/auth-server/jboss/common/jboss-cli/add-infinispan-log-level.cli new file mode 100644 index 0000000000..96e8196be8 --- /dev/null +++ b/testsuite/integration-arquillian/servers/auth-server/jboss/common/jboss-cli/add-infinispan-log-level.cli @@ -0,0 +1,4 @@ + +echo *** Adding infinispan logger *** +/subsystem=logging/logger=org.infinispan:add(level=@INFINISPAN_LOG_LEVEL@) +/subsystem=logging/console-handler=CONSOLE:change-log-level(level=@INFINISPAN_LOG_LEVEL@) diff --git a/testsuite/integration-arquillian/servers/auth-server/jboss/common/jboss-cli/configure-server-jpa.cli b/testsuite/integration-arquillian/servers/auth-server/jboss/common/jboss-cli/configure-server-jpa.cli new file mode 100644 index 0000000000..bab55a6b40 --- /dev/null +++ b/testsuite/integration-arquillian/servers/auth-server/jboss/common/jboss-cli/configure-server-jpa.cli @@ -0,0 +1,22 @@ + +echo *** Creating module.xml in modules *** +module add --module-root-dir=../modules/system/layers/base/ \ + --name=test.jdbc.@DATABASE@ \ + --resources=@DRIVER_TMP_DIR@/@DATABASE@-@DRIVER_VERSION@.jar \ + --dependencies=javax.api,javax.transaction.api,javax.xml.bind.api + +echo *** Updating datasource subsystem *** +echo ** Adding driver definition ** +/subsystem=datasources/jdbc-driver=@DATABASE@:add(driver-name=@DATABASE@,driver-module-name=test.jdbc.@DATABASE@) + +echo ** Updating connection properties ** +/subsystem=datasources/data-source=KeycloakDS/:write-attribute(name=connection-url,value="@JDBC_URL@") +/subsystem=datasources/data-source=KeycloakDS/:write-attribute(name=driver-name,value="@DATABASE@") +/subsystem=datasources/data-source=KeycloakDS/:write-attribute(name=user-name,value="@USER@") +/subsystem=datasources/data-source=KeycloakDS/:write-attribute(name=password,value="@PASSWORD@") +/subsystem=datasources/data-source=KeycloakDS/:write-attribute(name=min-pool-size,value="10") +/subsystem=datasources/data-source=KeycloakDS/:write-attribute(name=max-pool-size,value="50") +/subsystem=datasources/data-source=KeycloakDS/:write-attribute(name=pool-prefill,value="true") + +echo *** Adding dialect logger *** +/subsystem=logging/logger=org.hibernate.dialect:add(level=${org.hibernate.dialect.Dialect:ALL}) diff --git a/testsuite/integration-arquillian/servers/auth-server/jboss/common/jboss-cli/cross-dc-setup.cli b/testsuite/integration-arquillian/servers/auth-server/jboss/common/jboss-cli/cross-dc-setup.cli index 362018fcc4..c6fccd151e 100644 --- a/testsuite/integration-arquillian/servers/auth-server/jboss/common/jboss-cli/cross-dc-setup.cli +++ b/testsuite/integration-arquillian/servers/auth-server/jboss/common/jboss-cli/cross-dc-setup.cli @@ -1,8 +1,5 @@ -embed-server --server-config=standalone-ha.xml -echo **** Begin **** - -echo *** Update jgoups subsystem *** +echo *** Update jgroups subsystem *** /subsystem=jgroups/stack=udp/transport=UDP:write-attribute(name=site, value=${jboss.site.name}) echo *** Update infinispan subsystem *** @@ -148,6 +145,3 @@ echo *** Update undertow subsystem *** echo *** Update keycloak-server subsystem, infinispan remoteStoreSecurity *** /subsystem=keycloak-server/spi=connectionsInfinispan/provider=default:map-put(name=properties,key=remoteStoreSecurityEnabled,value=${keycloak.connectionsInfinispan.default.remoteStoreSecurityEnabled:true}) - - -echo **** End **** diff --git a/testsuite/integration-arquillian/servers/auth-server/jboss/common/jboss-cli/io.cli b/testsuite/integration-arquillian/servers/auth-server/jboss/common/jboss-cli/io.cli new file mode 100644 index 0000000000..e978a225a5 --- /dev/null +++ b/testsuite/integration-arquillian/servers/auth-server/jboss/common/jboss-cli/io.cli @@ -0,0 +1,4 @@ + +echo *** Update io subsystem *** +/subsystem=io/worker=default:write-attribute(name=io-threads,value=@IO_WORKER_IO_THREADS@) +/subsystem=io/worker=default:write-attribute(name=task-max-threads,value=@IO_WORKER_TASK_MAX_THREADS@) diff --git a/testsuite/integration-arquillian/servers/auth-server/jboss/common/jboss-cli/ispn-cache-owners.cli b/testsuite/integration-arquillian/servers/auth-server/jboss/common/jboss-cli/ispn-cache-owners.cli new file mode 100644 index 0000000000..ee6a434b03 --- /dev/null +++ b/testsuite/integration-arquillian/servers/auth-server/jboss/common/jboss-cli/ispn-cache-owners.cli @@ -0,0 +1,10 @@ + +echo *** Updating infinispan cache owners *** +/subsystem=infinispan/cache-container=keycloak/distributed-cache=sessions:write-attribute(name=owners, value=@SESSION_CACHE_OWNERS@) +/subsystem=infinispan/cache-container=keycloak/distributed-cache=authenticationSessions:write-attribute(name=owners, value=@SESSION_CACHE_OWNERS@) +/subsystem=infinispan/cache-container=keycloak/distributed-cache=clientSessions:write-attribute(name=owners, value=@SESSION_CACHE_OWNERS@) + +/subsystem=infinispan/cache-container=keycloak/distributed-cache=offlineSessions:write-attribute(name=owners, value=@OFFLINE_SESSION_CACHE_OWNERS@) +/subsystem=infinispan/cache-container=keycloak/distributed-cache=offlineClientSessions:write-attribute(name=owners, value=@OFFLINE_SESSION_CACHE_OWNERS@) + +/subsystem=infinispan/cache-container=keycloak/distributed-cache=loginFailures:write-attribute(name=owners, value=@LOGIN_FAILURE_CACHE_OWNERS@) diff --git a/testsuite/integration-arquillian/servers/auth-server/jboss/common/jboss-cli/keycloak-server-subsystem.cli b/testsuite/integration-arquillian/servers/auth-server/jboss/common/jboss-cli/keycloak-server-subsystem.cli new file mode 100644 index 0000000000..e89d6e70c3 --- /dev/null +++ b/testsuite/integration-arquillian/servers/auth-server/jboss/common/jboss-cli/keycloak-server-subsystem.cli @@ -0,0 +1,23 @@ + +echo *** Updating keycloak-server subsystem *** +echo ** Adding truststore spi** +/subsystem=keycloak-server/spi=truststore/:add +/subsystem=keycloak-server/spi=truststore/provider=file/:add(enabled=true,properties={ \ + file => "${auth.server.truststore:${jboss.home.dir}/standalone/configuration/keycloak.truststore}", \ + password => "${auth.server.truststore.password:secret}", \ + hostname-verification-policy => "WILDCARD", \ + disabled => "false"}) + +echo ** Adding login-protocol spi ** +/subsystem=keycloak-server/spi=login-protocol/:add +/subsystem=keycloak-server/spi=login-protocol/provider=saml/:add(enabled=true,properties={knownProtocols => "[\"http=${auth.server.http.port}\",\"https=${auth.server.https.port}\"]"}) + +echo ** Adding theme modules ** +/subsystem=keycloak-server/theme=defaults/:write-attribute(name=modules,value=[org.keycloak.testsuite.integration-arquillian-testsuite-providers]) + +echo ** Adding provider ** +/subsystem=keycloak-server/:write-attribute(name=providers, \ + value=[ classpath:${jboss.home.dir}/providers/*, \ + module:org.keycloak.testsuite.integration-arquillian-testsuite-providers \ + ] \ +) diff --git a/testsuite/integration-arquillian/servers/auth-server/jboss/common/jboss-cli/migration/configure-server-jpa-legacy.cli b/testsuite/integration-arquillian/servers/auth-server/jboss/common/jboss-cli/migration/configure-server-jpa-legacy.cli new file mode 100644 index 0000000000..40436e9a54 --- /dev/null +++ b/testsuite/integration-arquillian/servers/auth-server/jboss/common/jboss-cli/migration/configure-server-jpa-legacy.cli @@ -0,0 +1,21 @@ + +echo *** Creating module.xml in modules *** +module add --name=test.jdbc.@DATABASE@ \ + --resources=@DRIVER_TMP_DIR@/@DATABASE@-@DRIVER_VERSION@.jar \ + --dependencies=javax.api,javax.transaction.api,javax.xml.bind.api + +echo *** Updating datasource subsystem *** +echo ** Adding driver definition ** +/subsystem=datasources/jdbc-driver=@DATABASE@:add(driver-name=@DATABASE@,driver-module-name=test.jdbc.@DATABASE@) + +echo ** Updating connection properties ** +/subsystem=datasources/data-source=KeycloakDS/:write-attribute(name=connection-url,value="@JDBC_URL@") +/subsystem=datasources/data-source=KeycloakDS/:write-attribute(name=driver-name,value="@DATABASE@") +/subsystem=datasources/data-source=KeycloakDS/:write-attribute(name=user-name,value="@USER@") +/subsystem=datasources/data-source=KeycloakDS/:write-attribute(name=password,value="@PASSWORD@") +/subsystem=datasources/data-source=KeycloakDS/:write-attribute(name=min-pool-size,value="10") +/subsystem=datasources/data-source=KeycloakDS/:write-attribute(name=max-pool-size,value="50") +/subsystem=datasources/data-source=KeycloakDS/:write-attribute(name=pool-prefill,value="true") + +echo *** Adding dialect logger *** +/subsystem=logging/logger=org.hibernate.dialect:add(level=${org.hibernate.dialect.Dialect:ALL}) diff --git a/testsuite/integration-arquillian/servers/auth-server/jboss/common/jboss-cli/replace-jdbc-url.cli b/testsuite/integration-arquillian/servers/auth-server/jboss/common/jboss-cli/replace-jdbc-url.cli new file mode 100644 index 0000000000..1153d64cbf --- /dev/null +++ b/testsuite/integration-arquillian/servers/auth-server/jboss/common/jboss-cli/replace-jdbc-url.cli @@ -0,0 +1,3 @@ + +echo ** Updating jdbc url properties ** +/subsystem=datasources/data-source=KeycloakDS/:write-attribute(name=connection-url,value="@JDBC_URL@") diff --git a/testsuite/integration-arquillian/servers/auth-server/jboss/common/jboss-cli/set-manual-migration-strategy.cli b/testsuite/integration-arquillian/servers/auth-server/jboss/common/jboss-cli/set-manual-migration-strategy.cli new file mode 100644 index 0000000000..1b3fae685d --- /dev/null +++ b/testsuite/integration-arquillian/servers/auth-server/jboss/common/jboss-cli/set-manual-migration-strategy.cli @@ -0,0 +1,5 @@ + +echo *** Updating keycloak-server subsystem *** +echo ** Changing migration strategy to manual ** +/subsystem=keycloak-server/spi=connectionsJpa/provider=default/:write-attribute(name=properties.migrationStrategy,value=manual) +/subsystem=keycloak-server/spi=connectionsJpa/provider=default/:write-attribute(name=properties.initializeEmpty,value=false) diff --git a/testsuite/integration-arquillian/servers/auth-server/jboss/common/jboss-cli/undertow-subsystem-cluster-setup.cli b/testsuite/integration-arquillian/servers/auth-server/jboss/common/jboss-cli/undertow-subsystem-cluster-setup.cli index 3b923e3b21..2c22234227 100644 --- a/testsuite/integration-arquillian/servers/auth-server/jboss/common/jboss-cli/undertow-subsystem-cluster-setup.cli +++ b/testsuite/integration-arquillian/servers/auth-server/jboss/common/jboss-cli/undertow-subsystem-cluster-setup.cli @@ -1,8 +1,3 @@ -embed-server --server-config=standalone-ha.xml - -echo **** Begin **** echo *** Update undertow subsystem *** /subsystem=undertow/server=default-server/http-listener=default:write-attribute(name=proxy-address-forwarding,value=true) - -echo **** End **** diff --git a/testsuite/integration-arquillian/servers/auth-server/jboss/common/jboss-cli/update-jpa-schema.cli b/testsuite/integration-arquillian/servers/auth-server/jboss/common/jboss-cli/update-jpa-schema.cli new file mode 100644 index 0000000000..d1fe4c5f4f --- /dev/null +++ b/testsuite/integration-arquillian/servers/auth-server/jboss/common/jboss-cli/update-jpa-schema.cli @@ -0,0 +1,3 @@ + +echo *** Updating schema within keycloak-server subsystem connectionsJpa spi *** +/subsystem=keycloak-server/spi=connectionsJpa/provider=default/:write-attribute(name=properties.schema,value=@SCHEMA@) diff --git a/testsuite/integration-arquillian/servers/auth-server/jboss/common/keycloak-server-subsystem.xsl b/testsuite/integration-arquillian/servers/auth-server/jboss/common/keycloak-server-subsystem.xsl deleted file mode 100644 index a1433b18a6..0000000000 --- a/testsuite/integration-arquillian/servers/auth-server/jboss/common/keycloak-server-subsystem.xsl +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - org.keycloak.testsuite.integration-arquillian-testsuite-providers - - - - - - - - - - module:org.keycloak.testsuite.integration-arquillian-testsuite-providers - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/testsuite/integration-arquillian/servers/auth-server/jboss/common/migration-strategy.xsl b/testsuite/integration-arquillian/servers/auth-server/jboss/common/migration-strategy.xsl deleted file mode 100644 index 5bc33b86aa..0000000000 --- a/testsuite/integration-arquillian/servers/auth-server/jboss/common/migration-strategy.xsl +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/testsuite/integration-arquillian/servers/auth-server/jboss/eap/src/.dont-delete b/testsuite/integration-arquillian/servers/auth-server/jboss/eap/src/.dont-delete new file mode 100644 index 0000000000..63f93b0dd0 --- /dev/null +++ b/testsuite/integration-arquillian/servers/auth-server/jboss/eap/src/.dont-delete @@ -0,0 +1 @@ +This file is to mark this Maven project as a valid option for building auth server artifact diff --git a/testsuite/integration-arquillian/servers/auth-server/jboss/eap/src/main/resources/xslt/module.xsl b/testsuite/integration-arquillian/servers/auth-server/jboss/eap/src/main/resources/xslt/module.xsl deleted file mode 100644 index ba9c260b82..0000000000 --- a/testsuite/integration-arquillian/servers/auth-server/jboss/eap/src/main/resources/xslt/module.xsl +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/testsuite/integration-arquillian/servers/auth-server/jboss/pom.xml b/testsuite/integration-arquillian/servers/auth-server/jboss/pom.xml index 1ec06496d2..a8317fb34a 100644 --- a/testsuite/integration-arquillian/servers/auth-server/jboss/pom.xml +++ b/testsuite/integration-arquillian/servers/auth-server/jboss/pom.xml @@ -61,7 +61,8 @@ false - security.xsl + + scenario-standalone @@ -145,62 +146,6 @@ maven-enforcer-plugin - - org.codehaus.mojo - xml-maven-plugin - - - io-worker-threads - process-resources - - transform - - - - - ${auth.server.home}/standalone/configuration - - standalone.xml - standalone-ha.xml - - ${common.resources}/io.xsl - ${auth.server.home}/standalone/configuration - - - worker.io-threads - ${auth.server.worker.io-threads} - - - worker.task-max-threads - ${auth.server.worker.task-max-threads} - - - - - - - - inject-provider-and-truststore - process-resources - - transform - - - - - ${auth.server.home}/standalone/configuration - - standalone.xml - standalone-ha.xml - - ${common.resources}/keycloak-server-subsystem.xsl - ${auth.server.home}/standalone/configuration - - - - - - maven-resources-plugin @@ -259,13 +204,45 @@ - - org.codehaus.mojo - exec-maven-plugin - org.apache.maven.plugins maven-antrun-plugin + + + ant-generate-default + generate-resources + + run + + + + + + + + ${auth.server.worker.io-threads} + ${auth.server.worker.task-max-threads} + + ${session.cache.owners} + ${offline.session.cache.owners} + ${login.failure.cache.owners} + + + + + + ant-apply-prepared-clis + process-resources + + run + + + + + + + + maven-assembly-plugin @@ -356,12 +333,12 @@ + jpa - ${auth.server.home}/modules/system/layers/base/test/jdbc/${jdbc.mvn.artifactId}/main + ${project.build.directory}/jdbc-driver true - DEFAULT @@ -378,23 +355,26 @@ jdbc.mvn.groupId + ((?!com.h2database).)* + jdbc.mvn.groupId property is not set correctly: ${jdbc.mvn.groupId}. Profile jpa is not supported for default h2 values! jdbc.mvn.artifactId + ((?!h2).)* + jdbc.mvn.artifactId property is not set correctly: ${jdbc.mvn.artifactId}. Profile jpa is not supported for default h2 values! jdbc.mvn.version - - - keycloak.connectionsJpa.user + ((?!${h2.version}).)* + jdbc.mvn.version property is not set correctly: ${jdbc.mvn.version}. Profile jpa is not supported for default h2 values! keycloak.connectionsJpa.password - - - keycloak.connectionsJpa.url + ^(?!\s*$).+ + keycloak.connectionsJpa.password property cannot be empty string! + true @@ -404,7 +384,7 @@ jdbc-driver - process-resources + generate-resources copy @@ -417,85 +397,37 @@ jar - ${jdbc.mvn.driver.deployment.dir} + ${jdbc.driver.tmp.dir} true - org.codehaus.mojo - xml-maven-plugin + org.apache.maven.plugins + maven-antrun-plugin - configure-wildfly-datasource - process-resources + configure-server-jpa + generate-resources - transform + run - - - - ${auth.server.home}/modules/system/layers/base/com/h2database/h2/main - src/main/resources/xslt/module.xsl - - module.xml - - ${jdbc.mvn.driver.deployment.dir} - - - database - ${jdbc.mvn.artifactId} - - - version - ${jdbc.mvn.version} - - - - - - ${auth.server.home}/standalone/configuration - ${common.resources}/datasource.xsl - - standalone.xml - standalone-ha.xml - - ${auth.server.home}/standalone/configuration - - - db.jdbc_url - ${keycloak.connectionsJpa.url} - - - driver - ${jdbc.mvn.artifactId} - - - username - ${keycloak.connectionsJpa.user} - - - password - ${keycloak.connectionsJpa.password} - - - schema - ${keycloak.connectionsJpa.schema} - - - - - - ${auth.server.home}/standalone/configuration - ${common.resources}/add-dialect-logger.xsl - - standalone.xml - - ${auth.server.home}/standalone/configuration - - + + + + + + ${jdbc.driver.tmp.dir} + ${jdbc.mvn.artifactId} + ${jdbc.mvn.version} + ${keycloak.connectionsJpa.url} + ${keycloak.connectionsJpa.user} + ${keycloak.connectionsJpa.password} + ${keycloak.connectionsJpa.schema} + + @@ -504,7 +436,7 @@ - + migration-manual @@ -517,47 +449,28 @@ - org.codehaus.mojo - xml-maven-plugin + org.apache.maven.plugins + maven-antrun-plugin set-manual-migration-strategy - process-resources + generate-resources - transform + run - - - - ${auth.server.home}/standalone/configuration - - standalone.xml - - ${common.resources}/migration-strategy.xsl - ${auth.server.home}/standalone/configuration - - - migration.strategy - manual - - - initialize.empty - false - - - - + + + - - + auth-server-apply-patch @@ -598,7 +511,9 @@ auth-servers-crossdc-jboss - jdbc:h2:tcp://localhost:9092/mem:keycloak-dc-shared;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE + scenario-crossdc + + jdbc:h2:tcp://localhost:9092/mem:keycloak-dc-shared;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE @@ -631,55 +546,20 @@ - - org.codehaus.mojo - xml-maven-plugin - - - jpa-h2-tcp - process-resources - - transform - - - ${skip.h2.tcp} - - - ${auth.server.home}/standalone/configuration - - standalone-ha.xml - - ${common.resources}/datasource-jdbc-url.xsl - ${auth.server.home}/standalone/configuration - - - pool.name - KeycloakDS - - - jdbc.url - ${crossdc.jboss.jdbc.url} - - - - - - - - org.apache.maven.plugins maven-antrun-plugin - configure-crossdc - process-resources + jpa-h2-tcp + generate-resources run + ${skip.h2.tcp} - + @@ -689,10 +569,12 @@ - + auth-server-cluster + scenario-cluster + 1 1 1 @@ -702,92 +584,25 @@ Any other value configures it with dynamic-load-provider using the particular `load.metric`. Supported metrics: https://docs.jboss.org/mod_cluster/1.2.0/html/java.AS7config.html#LoadMetric --> + jdbc:h2:tcp://${jboss.bind.address:localhost}:9092/mem:keycloak;DB_CLOSE_DELAY=-1 - - org.codehaus.mojo - xml-maven-plugin - - - jpa-h2-tcp - process-resources - - transform - - - - - ${auth.server.home}/standalone/configuration - - standalone-ha.xml - - ${common.resources}/datasource-jdbc-url.xsl - ${auth.server.home}/standalone/configuration - - - pool.name - KeycloakDS - - - jdbc.url - jdbc:h2:tcp://${jboss.bind.address:localhost}:9092/mem:keycloak;DB_CLOSE_DELAY=-1 - - - - - ${skip.h2.tcp} - - - - keycloak-ispn-caches - process-resources - - transform - - - - - ${auth.server.home}/standalone/configuration - - standalone-ha.xml - - ${common.resources}/ispn-cache-owners.xsl - ${auth.server.home}/standalone/configuration - - - sessionCacheOwners - ${session.cache.owners} - - - offlineSessionCacheOwners - ${offline.session.cache.owners} - - - loginFailureCacheOwners - ${login.failure.cache.owners} - - - - - - - - org.apache.maven.plugins maven-antrun-plugin - configure-undertow-subsystem - process-resources + jpa-h2-tcp + generate-resources run + ${skip.h2.tcp} - + @@ -834,9 +649,6 @@ auth-server-wildfly - - security-wildfly.xsl - wildfly @@ -848,7 +660,6 @@ - db-failover-mariadb diff --git a/testsuite/integration-arquillian/servers/auth-server/jboss/wildfly/src/.dont-delete b/testsuite/integration-arquillian/servers/auth-server/jboss/wildfly/src/.dont-delete new file mode 100644 index 0000000000..63f93b0dd0 --- /dev/null +++ b/testsuite/integration-arquillian/servers/auth-server/jboss/wildfly/src/.dont-delete @@ -0,0 +1 @@ +This file is to mark this Maven project as a valid option for building auth server artifact diff --git a/testsuite/integration-arquillian/servers/auth-server/jboss/wildfly/src/main/resources/xslt/module.xsl b/testsuite/integration-arquillian/servers/auth-server/jboss/wildfly/src/main/resources/xslt/module.xsl deleted file mode 100644 index d635b645bd..0000000000 --- a/testsuite/integration-arquillian/servers/auth-server/jboss/wildfly/src/main/resources/xslt/module.xsl +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/testsuite/integration-arquillian/servers/cache-server/jboss/pom.xml b/testsuite/integration-arquillian/servers/cache-server/jboss/pom.xml index 5d3c223519..f510f9d42b 100644 --- a/testsuite/integration-arquillian/servers/cache-server/jboss/pom.xml +++ b/testsuite/integration-arquillian/servers/cache-server/jboss/pom.xml @@ -35,7 +35,6 @@ ${containers.home}/${cache.server.jboss.unpacked.folder.name} true true - security.xsl diff --git a/testsuite/integration-arquillian/servers/migration/assembly.xml b/testsuite/integration-arquillian/servers/migration/assembly.xml index 958f9bf81b..22e57acaa1 100644 --- a/testsuite/integration-arquillian/servers/migration/assembly.xml +++ b/testsuite/integration-arquillian/servers/migration/assembly.xml @@ -27,14 +27,14 @@ - ${keycloak.server.home} + ${auth.server.home} auth-server-migration **/*.sh - ${keycloak.server.home} + ${auth.server.home} auth-server-migration **/*.sh diff --git a/testsuite/integration-arquillian/servers/migration/pom.xml b/testsuite/integration-arquillian/servers/migration/pom.xml index 1e64cd919d..4498a31410 100644 --- a/testsuite/integration-arquillian/servers/migration/pom.xml +++ b/testsuite/integration-arquillian/servers/migration/pom.xml @@ -30,8 +30,10 @@ Migration Server - ${project.build.directory}/unpacked/keycloak-${migrated.auth.server.version} - ${keycloak.server.home}/modules/system/layers/base/test/jdbc/${jdbc.mvn.artifactId}/main + ${basedir}/../auth-server/jboss/common + scenario-standalone + ${project.build.directory}/unpacked/keycloak-${migrated.auth.server.version} + ${project.build.directory}/jdbc-driver @@ -49,24 +51,24 @@ migrated.auth.server.version + jdbc.mvn.version.legacy + keycloak.connectionsJpa.user + keycloak.connectionsJpa.url jdbc.mvn.groupId + ((?!com.h2database).)* + jdbc.mvn.groupId property is not set correctly: ${jdbc.mvn.groupId}. Profile jpa is not supported for default h2 values! jdbc.mvn.artifactId - - - jdbc.mvn.version.legacy - - - keycloak.connectionsJpa.user + ((?!h2).)* + jdbc.mvn.artifactId property is not set correctly: ${jdbc.mvn.artifactId}. Profile jpa is not supported for default h2 values! keycloak.connectionsJpa.password - - - keycloak.connectionsJpa.url + ^(?!\s*$).+ + keycloak.connectionsJpa.password property cannot be empty string! @@ -110,80 +112,63 @@ jar - ${jdbc.mvn.driver.deployment.dir} + ${jdbc.driver.tmp.dir} true - org.codehaus.mojo - xml-maven-plugin + org.apache.maven.plugins + maven-antrun-plugin - configure-wildfly-datasource - process-resources + configure-server-jpa + generate-resources - transform + run - - - - ${keycloak.server.home}/modules/system/layers/base/com/h2database/h2/main - src/main/xslt/module.xsl - - module.xml - - ${jdbc.mvn.driver.deployment.dir} - - - database - ${jdbc.mvn.artifactId} - - - version - ${jdbc.mvn.version.legacy} - - - - - - ${keycloak.server.home}/standalone/configuration - src/main/xslt/datasource.xsl - - standalone.xml - - ${keycloak.server.home}/standalone/configuration - - - db.jdbc_url - ${keycloak.connectionsJpa.url} - - - driver - ${jdbc.mvn.artifactId} - - - username - ${keycloak.connectionsJpa.user} - - - password - ${keycloak.connectionsJpa.password} - - - - - - ${keycloak.server.home}/standalone/configuration - src/main/xslt/add-dialect-logger.xsl - - standalone.xml - - ${keycloak.server.home}/standalone/configuration - - + + + + + + ${jdbc.driver.tmp.dir} + ${jdbc.mvn.artifactId} + ${jdbc.mvn.version.legacy} + ${keycloak.connectionsJpa.url} + ${keycloak.connectionsJpa.user} + ${keycloak.connectionsJpa.password} + ${keycloak.connectionsJpa.schema} + + + + + + ant-apply-prepared-clis + process-resources + + run + + + + + + + + + + + move-driver-module + process-test-resources + + run + + + + + @@ -238,7 +223,7 @@ - ${project.build.directory}/unpacked/${previous.product.unpacked.folder.name} + ${project.build.directory}/unpacked/${previous.product.unpacked.folder.name} diff --git a/testsuite/integration-arquillian/servers/migration/src/main/xslt/add-dialect-logger.xsl b/testsuite/integration-arquillian/servers/migration/src/main/xslt/add-dialect-logger.xsl deleted file mode 100644 index 6b9e94a1ce..0000000000 --- a/testsuite/integration-arquillian/servers/migration/src/main/xslt/add-dialect-logger.xsl +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/testsuite/integration-arquillian/servers/migration/src/main/xslt/datasource.xsl b/testsuite/integration-arquillian/servers/migration/src/main/xslt/datasource.xsl deleted file mode 100644 index 52df81925e..0000000000 --- a/testsuite/integration-arquillian/servers/migration/src/main/xslt/datasource.xsl +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/testsuite/integration-arquillian/servers/migration/src/main/xslt/module.xsl b/testsuite/integration-arquillian/servers/migration/src/main/xslt/module.xsl deleted file mode 100644 index 778d67d980..0000000000 --- a/testsuite/integration-arquillian/servers/migration/src/main/xslt/module.xsl +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/testsuite/integration-arquillian/servers/pom.xml b/testsuite/integration-arquillian/servers/pom.xml index a8359abc34..e31962ca2c 100644 --- a/testsuite/integration-arquillian/servers/pom.xml +++ b/testsuite/integration-arquillian/servers/pom.xml @@ -31,27 +31,22 @@ sh - + 7.5.21.Final-redhat-1 7.1.5.GA-redhat-00002 7.1.1.Final - 3.0.3 - 6.1.0.redhat-379 - - 6.2.1.redhat-084 - 9.4.6.Final-redhat-00002 - + 16 128 500 2 4 - + jboss-cli.sh @@ -62,14 +57,14 @@ - + auth-server-migration migration - + win @@ -84,5 +79,5 @@ - + diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/h2/H2TestEnricher.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/h2/H2TestEnricher.java index 965e2119c1..ecb6582d62 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/h2/H2TestEnricher.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/h2/H2TestEnricher.java @@ -18,11 +18,12 @@ public class H2TestEnricher { protected final Logger log = Logger.getLogger(this.getClass()); boolean runH2 = Boolean.parseBoolean(System.getProperty("run.h2", "false")); + boolean dockerDatabaseSkip = Boolean.parseBoolean(System.getProperty("docker.database.skip", "true")); private Server server = null; public void startH2(@Observes(precedence = 3) BeforeSuite event) throws SQLException { - if (runH2) { + if (runH2 && dockerDatabaseSkip) { log.info("Starting H2 database."); server = Server.createTcpServer(); server.start(); @@ -31,7 +32,7 @@ public class H2TestEnricher { } public void stopH2(@Observes(precedence = -2) AfterSuite event) { - if (runH2 && server.isRunning(false)) { + if (runH2 && dockerDatabaseSkip && server.isRunning(false)) { log.info("Stopping H2 database."); server.stop(); assert !server.isRunning(false); diff --git a/testsuite/integration-arquillian/tests/pom.xml b/testsuite/integration-arquillian/tests/pom.xml index 7ce912f6d4..4e7ba208c0 100755 --- a/testsuite/integration-arquillian/tests/pom.xml +++ b/testsuite/integration-arquillian/tests/pom.xml @@ -1180,7 +1180,8 @@ true - + ${docker.database.skip} + false ${auth.server.backend1.home}