From f293ab86c34fb1a0b9d9ee11b02ece7eced4f8bf Mon Sep 17 00:00:00 2001 From: vramik Date: Thu, 3 May 2018 11:05:01 +0200 Subject: [PATCH] KEYCLOAK-7267 change a way how to install adapters in testsuite from online to offline scripts --- .../common/cli/add-adapter-log-level.cli | 5 +- .../common/cli/remove-elytron-subsystem.cli | 5 - ...apters.bat => install-adapters-online.bat} | 28 --- ...adapters.sh => install-adapters-online.sh} | 15 -- .../servers/app-server/jboss/eap/pom.xml | 2 + .../servers/app-server/jboss/eap6/pom.xml | 22 +++ .../servers/app-server/jboss/pom.xml | 177 +++++++++++++++--- .../servers/app-server/jboss/wildfly/pom.xml | 2 + .../app-server/jboss/wildfly10/pom.xml | 2 + .../servers/app-server/jboss/wildfly9/pom.xml | 2 + .../tests/other/adapters/jboss/pom.xml | 44 ----- 11 files changed, 190 insertions(+), 114 deletions(-) delete mode 100644 testsuite/integration-arquillian/servers/app-server/jboss/common/cli/remove-elytron-subsystem.cli rename testsuite/integration-arquillian/servers/app-server/jboss/common/{install-adapters.bat => install-adapters-online.bat} (53%) rename testsuite/integration-arquillian/servers/app-server/jboss/common/{install-adapters.sh => install-adapters-online.sh} (64%) diff --git a/testsuite/integration-arquillian/servers/app-server/jboss/common/cli/add-adapter-log-level.cli b/testsuite/integration-arquillian/servers/app-server/jboss/common/cli/add-adapter-log-level.cli index eab4cb2bdc..01e7ad958d 100644 --- a/testsuite/integration-arquillian/servers/app-server/jboss/common/cli/add-adapter-log-level.cli +++ b/testsuite/integration-arquillian/servers/app-server/jboss/common/cli/add-adapter-log-level.cli @@ -1 +1,4 @@ -/subsystem=logging/logger=org.keycloak.adapters:add(level=DEBUG) \ No newline at end of file +embed-server --server-config=${server.config:standalone.xml} + +/subsystem=logging/logger=org.keycloak.adapters:add(level=DEBUG) +/subsystem=logging/console-handler=CONSOLE:change-log-level(level=DEBUG) diff --git a/testsuite/integration-arquillian/servers/app-server/jboss/common/cli/remove-elytron-subsystem.cli b/testsuite/integration-arquillian/servers/app-server/jboss/common/cli/remove-elytron-subsystem.cli deleted file mode 100644 index 8e2efd221f..0000000000 --- a/testsuite/integration-arquillian/servers/app-server/jboss/common/cli/remove-elytron-subsystem.cli +++ /dev/null @@ -1,5 +0,0 @@ -if (outcome == success) of /subsystem=elytron/:read-resource - echo Removing Elytron subsystem - /subsystem=elytron/:remove - echo -end-if diff --git a/testsuite/integration-arquillian/servers/app-server/jboss/common/install-adapters.bat b/testsuite/integration-arquillian/servers/app-server/jboss/common/install-adapters-online.bat similarity index 53% rename from testsuite/integration-arquillian/servers/app-server/jboss/common/install-adapters.bat rename to testsuite/integration-arquillian/servers/app-server/jboss/common/install-adapters-online.bat index 849e65e059..4e39e6fb3c 100644 --- a/testsuite/integration-arquillian/servers/app-server/jboss/common/install-adapters.bat +++ b/testsuite/integration-arquillian/servers/app-server/jboss/common/install-adapters-online.bat @@ -29,23 +29,6 @@ if %ERROR% neq 0 ( goto shutdown_jboss ) -if "%ELYTRON_SUPPORTED%" == "true" ( - call %JBOSS_HOME%\bin\jboss-cli.bat -c --file="%JBOSS_HOME%\bin\adapter-elytron-install.cli" - set ERROR=%ERRORLEVEL% - echo Installation of elytron ended with error code: "%ERROR%" - if %ERROR% neq 0 ( - goto shutdown_jboss - ) -) else ( - call %JBOSS_HOME%\bin\jboss-cli.bat -c --file="%CLI_PATH%\remove-elytron-subsystem.cli" - set ERROR=%ERRORLEVEL% - echo Removing elytron subsystem ended with error code: "%ERROR%" - if %ERROR% neq 0 ( - goto shutdown_jboss - ) -) - - if "%SAML_SUPPORTED%" == "true" ( call %JBOSS_HOME%\bin\jboss-cli.bat -c --file="%JBOSS_HOME%\bin\adapter-install-saml.cli" set ERROR=%ERRORLEVEL% @@ -53,19 +36,8 @@ if "%SAML_SUPPORTED%" == "true" ( if %ERROR% neq 0 ( goto shutdown_jboss ) - - if "%ELYTRON_SUPPORTED%" == "true" ( - call %JBOSS_HOME%\bin\jboss-cli.bat -c --file="%JBOSS_HOME%\bin\adapter-elytron-install-saml.cli" - set ERROR=%ERRORLEVEL% - echo Installation of saml elytron ended with error code: "%ERROR%" - if %ERROR% neq 0 ( - goto shutdown_jboss - ) - ) ) -call %JBOSS_HOME%\bin\jboss-cli.bat -c --file="%CLI_PATH%\add-adapter-log-level.cli" - :shutdown_jboss echo Shutting down with error code: "%ERROR%" call %JBOSS_HOME%\bin\jboss-cli.bat -c --command=":shutdown" diff --git a/testsuite/integration-arquillian/servers/app-server/jboss/common/install-adapters.sh b/testsuite/integration-arquillian/servers/app-server/jboss/common/install-adapters-online.sh similarity index 64% rename from testsuite/integration-arquillian/servers/app-server/jboss/common/install-adapters.sh rename to testsuite/integration-arquillian/servers/app-server/jboss/common/install-adapters-online.sh index 6570791230..b8fd61832a 100755 --- a/testsuite/integration-arquillian/servers/app-server/jboss/common/install-adapters.sh +++ b/testsuite/integration-arquillian/servers/app-server/jboss/common/install-adapters-online.sh @@ -26,27 +26,12 @@ do RESULT=$? echo "Return code of adapter-install:"${RESULT} - if [ "$ELYTRON_SUPPORTED" = true ] && [ ${RESULT} -eq 0 ]; then - echo "Installing elytron adapter." - ./jboss-cli.sh -c --file="adapter-elytron-install.cli" - RESULT=$? - else - ./jboss-cli.sh -c --file="$CLI_PATH/remove-elytron-subsystem.cli" - fi - if [ "$SAML_SUPPORTED" = true ] && [ ${RESULT} -eq 0 ]; then ./jboss-cli.sh -c --file="adapter-install-saml.cli" RESULT=$? echo "Return code of saml adapter-install:"$RESULT - - if [ "$ELYTRON_SUPPORTED" = true ] && [ ${RESULT} -eq 0 ]; then - ./jboss-cli.sh -c --file="adapter-elytron-install-saml.cli" - RESULT=$? - fi fi - ./jboss-cli.sh -c --file="$CLI_PATH/add-adapter-log-level.cli" - ./jboss-cli.sh -c --command=":shutdown" rm -rf $JBOSS_HOME/standalone/data rm -rf $JBOSS_HOME/standalone/log diff --git a/testsuite/integration-arquillian/servers/app-server/jboss/eap/pom.xml b/testsuite/integration-arquillian/servers/app-server/jboss/eap/pom.xml index d090279cf5..6d49e9dd14 100644 --- a/testsuite/integration-arquillian/servers/app-server/jboss/eap/pom.xml +++ b/testsuite/integration-arquillian/servers/app-server/jboss/eap/pom.xml @@ -39,6 +39,8 @@ keycloak-wildfly-adapter-dist keycloak-saml-wildfly-adapter-dist + + false diff --git a/testsuite/integration-arquillian/servers/app-server/jboss/eap6/pom.xml b/testsuite/integration-arquillian/servers/app-server/jboss/eap6/pom.xml index 51047ffd86..9a99b1b99e 100644 --- a/testsuite/integration-arquillian/servers/app-server/jboss/eap6/pom.xml +++ b/testsuite/integration-arquillian/servers/app-server/jboss/eap6/pom.xml @@ -62,6 +62,28 @@ + + org.codehaus.mojo + exec-maven-plugin + + + install-adapters-online + process-resources + + exec + + + ${common.resources}/install-adapters-online.${script.suffix} + ${app.server.jboss.home}/bin + + ${app.server.java.home} + ${app.server.jboss.home} + ${app.server.saml.adapter.supported} + + + + + diff --git a/testsuite/integration-arquillian/servers/app-server/jboss/pom.xml b/testsuite/integration-arquillian/servers/app-server/jboss/pom.xml index 913c8137a7..bad93dff3e 100644 --- a/testsuite/integration-arquillian/servers/app-server/jboss/pom.xml +++ b/testsuite/integration-arquillian/servers/app-server/jboss/pom.xml @@ -37,7 +37,8 @@ security.xsl ${project.version} ${project.version} - false + true + true @@ -196,21 +197,166 @@ exec-maven-plugin - install-adapters + add-adapter-log-level-standalone process-resources exec - ${common.resources}/install-adapters.${script.suffix} + ./jboss-cli.${script.suffix} ${app.server.jboss.home}/bin - - ${app.server.java.home} - ${app.server.jboss.home} - ${app.server.saml.adapter.supported} - ${app.server.elytron.adapter.supported} - ${common.resources}/cli - + + --file=${common.resources}/cli/add-adapter-log-level.cli + + + + + add-adapter-log-level-standalone-ha + process-resources + + exec + + + ./jboss-cli.${script.suffix} + ${app.server.jboss.home}/bin + + --file=${common.resources}/cli/add-adapter-log-level.cli + -Dserver.config=standalone-ha.xml + + + + + + + adapter-elytron-install-offline-standalone + process-resources + + exec + + + ${skip.elytron.adapter.installation} + ./jboss-cli.${script.suffix} + ${app.server.jboss.home}/bin + + --file=${app.server.jboss.home}/bin/adapter-elytron-install-offline.cli + + + + + + adapter-elytron-install-offline-standalone-ha + process-resources + + exec + + + ${skip.elytron.adapter.installation} + ./jboss-cli.${script.suffix} + ${app.server.jboss.home}/bin + + --file=${app.server.jboss.home}/bin/adapter-elytron-install-offline.cli + -Dserver.config=standalone-ha.xml + + + + + + adapter-elytron-install-saml-offline-standalone + process-resources + + exec + + + ${skip.elytron.adapter.installation} + ./jboss-cli.${script.suffix} + ${app.server.jboss.home}/bin + + --file=${app.server.jboss.home}/bin/adapter-elytron-install-saml-offline.cli + + + + + + adapter-elytron-install-saml-offline-standalone-ha + process-resources + + exec + + + ${skip.elytron.adapter.installation} + ./jboss-cli.${script.suffix} + ${app.server.jboss.home}/bin + + --file=${app.server.jboss.home}/bin/adapter-elytron-install-saml-offline.cli + -Dserver.config=standalone-ha.xml + + + + + + + adapter-install-offline-standalone + process-resources + + exec + + + ${skip.adapter.offline.installation} + ./jboss-cli.${script.suffix} + ${app.server.jboss.home}/bin + + --file=${app.server.jboss.home}/bin/adapter-install-offline.cli + + + + + + adapter-install-offline-standalone-ha + process-resources + + exec + + + ${skip.adapter.offline.installation} + ./jboss-cli.${script.suffix} + ${app.server.jboss.home}/bin + + --file=${app.server.jboss.home}/bin/adapter-install-offline.cli + -Dserver.config=standalone-ha.xml + + + + + + adapter-install-saml-offline-standalone + process-resources + + exec + + + ${skip.adapter.offline.installation} + ./jboss-cli.${script.suffix} + ${app.server.jboss.home}/bin + + --file=${app.server.jboss.home}/bin/adapter-install-saml-offline.cli + + + + + + adapter-install-saml-offline-standalone-ha + process-resources + + exec + + + ${skip.adapter.offline.installation} + ./jboss-cli.${script.suffix} + ${app.server.jboss.home}/bin + + --file=${app.server.jboss.home}/bin/adapter-install-saml-offline.cli + -Dserver.config=standalone-ha.xml + @@ -417,17 +563,6 @@ eap6-fuse - - - app-server-wildfly-elytron - - false - - - ${elytron.wildfly.version} - true - - diff --git a/testsuite/integration-arquillian/servers/app-server/jboss/wildfly/pom.xml b/testsuite/integration-arquillian/servers/app-server/jboss/wildfly/pom.xml index 9f74af3ec0..3bfdc969f1 100644 --- a/testsuite/integration-arquillian/servers/app-server/jboss/wildfly/pom.xml +++ b/testsuite/integration-arquillian/servers/app-server/jboss/wildfly/pom.xml @@ -39,6 +39,8 @@ keycloak-wildfly-adapter-dist keycloak-saml-wildfly-adapter-dist + + false diff --git a/testsuite/integration-arquillian/servers/app-server/jboss/wildfly10/pom.xml b/testsuite/integration-arquillian/servers/app-server/jboss/wildfly10/pom.xml index d4196304f1..d8ccb429eb 100644 --- a/testsuite/integration-arquillian/servers/app-server/jboss/wildfly10/pom.xml +++ b/testsuite/integration-arquillian/servers/app-server/jboss/wildfly10/pom.xml @@ -39,6 +39,8 @@ keycloak-wildfly-adapter-dist keycloak-saml-wildfly-adapter-dist + + false diff --git a/testsuite/integration-arquillian/servers/app-server/jboss/wildfly9/pom.xml b/testsuite/integration-arquillian/servers/app-server/jboss/wildfly9/pom.xml index b3818c7e54..27140943a7 100644 --- a/testsuite/integration-arquillian/servers/app-server/jboss/wildfly9/pom.xml +++ b/testsuite/integration-arquillian/servers/app-server/jboss/wildfly9/pom.xml @@ -39,6 +39,8 @@ keycloak-wildfly-adapter-dist keycloak-saml-wildfly-adapter-dist + + false diff --git a/testsuite/integration-arquillian/tests/other/adapters/jboss/pom.xml b/testsuite/integration-arquillian/tests/other/adapters/jboss/pom.xml index f15fcedc1c..e0faa72435 100644 --- a/testsuite/integration-arquillian/tests/other/adapters/jboss/pom.xml +++ b/testsuite/integration-arquillian/tests/other/adapters/jboss/pom.xml @@ -38,45 +38,8 @@ managed http ${auth.server.http.port} - keycloak-subsystem.xsl - - - - org.codehaus.mojo - xml-maven-plugin - - - configure-keycloak-subsystem - process-test-resources - - transform - - - - - ${app.server.home}/standalone/configuration - - standalone.xml - - ${common.resources}/xslt/${keycloak.subsystem.xsl} - ${app.server.home}/standalone/configuration - - - auth-server-host - ${auth.server.actual.protocol}://localhost:${auth.server.actual.http.port} - - - - - - - - - - - ssl @@ -92,13 +55,6 @@ ${auth.server.https.port} - - keycloak-subsystem-separate-realm - - - keycloak-subsystem_separate-realm-def.xsl - - adapter-test-jboss-submodules