From 59eec8d5b4c840dbecf1da556fa22b1c74624a07 Mon Sep 17 00:00:00 2001 From: Pavel Drozd Date: Tue, 20 Sep 2016 13:00:54 +0200 Subject: [PATCH] KEYCLOAK-3597 - Arquillian testuite - server preparation (overlay & patches installation) --- testsuite/integration-arquillian/pom.xml | 1 + .../app-server/jboss/common/install-patch.bat | 9 +++ .../app-server/jboss/common/install-patch.sh | 18 ++++++ .../servers/app-server/jboss/pom.xml | 55 +++++++++++++++---- .../jboss/common/install-keycloak.bat | 7 +++ .../jboss/common/install-keycloak.sh | 17 ++++++ .../jboss/common/install-patch.bat | 8 ++- .../auth-server/jboss/common/install-patch.sh | 13 +++-- .../servers/auth-server/jboss/pom.xml | 42 +++++++------- 9 files changed, 131 insertions(+), 39 deletions(-) create mode 100644 testsuite/integration-arquillian/servers/app-server/jboss/common/install-patch.bat create mode 100755 testsuite/integration-arquillian/servers/app-server/jboss/common/install-patch.sh create mode 100644 testsuite/integration-arquillian/servers/auth-server/jboss/common/install-keycloak.bat create mode 100755 testsuite/integration-arquillian/servers/auth-server/jboss/common/install-keycloak.sh diff --git a/testsuite/integration-arquillian/pom.xml b/testsuite/integration-arquillian/pom.xml index 7bada0cd38..d2b4a472e6 100644 --- a/testsuite/integration-arquillian/pom.xml +++ b/testsuite/integration-arquillian/pom.xml @@ -72,6 +72,7 @@ org.jboss.shrinkwrap.resolver shrinkwrap-resolver-impl-maven + ${version.shrinkwrap.resolvers} test diff --git a/testsuite/integration-arquillian/servers/app-server/jboss/common/install-patch.bat b/testsuite/integration-arquillian/servers/app-server/jboss/common/install-patch.bat new file mode 100644 index 0000000000..ee0ed4fdbd --- /dev/null +++ b/testsuite/integration-arquillian/servers/app-server/jboss/common/install-patch.bat @@ -0,0 +1,9 @@ +set NOPAUSE=true + +for %%a in ("%APP_PATCH_ZIPS:,=" "%") do ( + call %JBOSS_HOME%\bin\jboss-cli.bat --command="patch apply %%~a" + + if %ERRORLEVEL% neq 0 set ERROR=%ERRORLEVEL% +) + +exit /b %ERROR% \ No newline at end of file diff --git a/testsuite/integration-arquillian/servers/app-server/jboss/common/install-patch.sh b/testsuite/integration-arquillian/servers/app-server/jboss/common/install-patch.sh new file mode 100755 index 0000000000..eb23344bee --- /dev/null +++ b/testsuite/integration-arquillian/servers/app-server/jboss/common/install-patch.sh @@ -0,0 +1,18 @@ +#!/bin/bash +echo "JBOSS_HOME=$JBOSS_HOME" + +if [ ! -d "$JBOSS_HOME/bin" ] ; then + >&2 echo "JBOSS_HOME/bin doesn't exist" + exit 1 +fi + +cd $JBOSS_HOME/bin + +RESULT=0 +patches=$(echo $APP_PATCH_ZIPS | tr "," "\n") +for patch in $patches +do + ./jboss-cli.sh --command="patch apply $patch" + if [ $? -ne 0 ]; then exit 1; fi +done +exit 0 diff --git a/testsuite/integration-arquillian/servers/app-server/jboss/pom.xml b/testsuite/integration-arquillian/servers/app-server/jboss/pom.xml index c4d8f6fd2f..e325a99e07 100644 --- a/testsuite/integration-arquillian/servers/app-server/jboss/pom.xml +++ b/testsuite/integration-arquillian/servers/app-server/jboss/pom.xml @@ -193,17 +193,17 @@ exec + + ${common.resources}/install-adapters.${script.suffix} + ${app.server.jboss.home}/bin + + ${app.server.java.home} + ${app.server.jboss.home} + ${app.server.saml.adapter.supported} + + - - ${common.resources}/install-adapters.${script.suffix} - ${app.server.jboss.home}/bin - - ${app.server.java.home} - ${app.server.jboss.home} - ${app.server.saml.adapter.supported} - - @@ -284,7 +284,42 @@ - + + app-server-apply-patches + + + app.server.patch.zips + + + + + + + org.codehaus.mojo + exec-maven-plugin + + + install-patches + process-resources + + exec + + + ${common.resources}/install-patch.${script.suffix} + ${app.server.home}/bin + + ${app.server.java.home} + ${app.server.jboss.home} + ${app.server.patch.zips} + + + + + + + + + ssl diff --git a/testsuite/integration-arquillian/servers/auth-server/jboss/common/install-keycloak.bat b/testsuite/integration-arquillian/servers/auth-server/jboss/common/install-keycloak.bat new file mode 100644 index 0000000000..735b5f267b --- /dev/null +++ b/testsuite/integration-arquillian/servers/auth-server/jboss/common/install-keycloak.bat @@ -0,0 +1,7 @@ +set NOPAUSE=true + +call %JBOSS_HOME%\bin\jboss-cli.bat --file=keycloak-install.cli + +if %ERRORLEVEL% neq 0 set ERROR=%ERRORLEVEL% +exit /b %ERROR% + diff --git a/testsuite/integration-arquillian/servers/auth-server/jboss/common/install-keycloak.sh b/testsuite/integration-arquillian/servers/auth-server/jboss/common/install-keycloak.sh new file mode 100755 index 0000000000..af7cebe0d0 --- /dev/null +++ b/testsuite/integration-arquillian/servers/auth-server/jboss/common/install-keycloak.sh @@ -0,0 +1,17 @@ +#!/bin/bash +echo "JBOSS_HOME=$JBOSS_HOME" + +if [ ! -d "$JBOSS_HOME/bin" ] ; then + >&2 echo "JBOSS_HOME/bin doesn't exist" + exit 1 +fi + +cd $JBOSS_HOME/bin + +RESULT=0 +./jboss-cli.sh --file=keycloak-install.cli +if [ $? -ne 0 ]; then RESULT=1; fi + exit $RESULT +fi + +exit 1 diff --git a/testsuite/integration-arquillian/servers/auth-server/jboss/common/install-patch.bat b/testsuite/integration-arquillian/servers/auth-server/jboss/common/install-patch.bat index d3a5cc4f4b..ee0ed4fdbd 100644 --- a/testsuite/integration-arquillian/servers/auth-server/jboss/common/install-patch.bat +++ b/testsuite/integration-arquillian/servers/auth-server/jboss/common/install-patch.bat @@ -1,7 +1,9 @@ set NOPAUSE=true -call %JBOSS_HOME%\bin\jboss-cli.bat --command="patch apply %PATCH_ZIP%" +for %%a in ("%APP_PATCH_ZIPS:,=" "%") do ( + call %JBOSS_HOME%\bin\jboss-cli.bat --command="patch apply %%~a" -if %ERRORLEVEL% neq 0 set ERROR=%ERRORLEVEL% -exit /b %ERROR% + if %ERRORLEVEL% neq 0 set ERROR=%ERRORLEVEL% +) +exit /b %ERROR% \ No newline at end of file diff --git a/testsuite/integration-arquillian/servers/auth-server/jboss/common/install-patch.sh b/testsuite/integration-arquillian/servers/auth-server/jboss/common/install-patch.sh index 4a44294d03..3d1820b2bb 100755 --- a/testsuite/integration-arquillian/servers/auth-server/jboss/common/install-patch.sh +++ b/testsuite/integration-arquillian/servers/auth-server/jboss/common/install-patch.sh @@ -9,9 +9,10 @@ fi cd $JBOSS_HOME/bin RESULT=0 -./jboss-cli.sh --command="patch apply $PATCH_ZIP" -if [ $? -ne 0 ]; then RESULT=1; fi - exit $RESULT -fi - -exit 1 +patches=$(echo $AUTH_PATCH_ZIPS | tr "," "\n") +for patch in $patches +do + ./jboss-cli.sh --command="patch apply $patch" + if [ $? -ne 0 ]; then exit 1; fi +done +exit 0 diff --git a/testsuite/integration-arquillian/servers/auth-server/jboss/pom.xml b/testsuite/integration-arquillian/servers/auth-server/jboss/pom.xml index eae0512470..58c4714126 100644 --- a/testsuite/integration-arquillian/servers/auth-server/jboss/pom.xml +++ b/testsuite/integration-arquillian/servers/auth-server/jboss/pom.xml @@ -279,9 +279,9 @@ - ${auth.server.overlay.groupId} - ${auth.server.overlay.artifactId} - ${auth.server.overlay.version} + ${overlaid.container.groupId} + ${overlaid.container.artifactId} + ${overlaid.container.version} ${project.build.directory}/unpacked/${overlaid.container.unpacked.folder.name} @@ -299,11 +299,11 @@ - ${overlaid.container.groupId} - ${overlaid.container.artifactId} - ${overlaid.container.version} + ${auth.server.overlay.groupId} + ${auth.server.overlay.artifactId} + ${auth.server.overlay.version} zip - ${auth.server.home} + ${project.build.directory}/unpacked/${overlaid.container.unpacked.folder.name} @@ -311,23 +311,25 @@ - maven-antrun-plugin - 1.8 + org.codehaus.mojo + exec-maven-plugin - move-standalone-keycloak-xml - process-resources + install-server-overlay + generate-resources - run + exec - - - - - + + ${common.resources}/install-keycloak.${script.suffix} + ${auth.server.home}/bin + + ${auth.server.java.home} + ${auth.server.home} + + @@ -545,7 +547,7 @@ auth-server-apply-patch - auth.server.patch.zip + auth.server.patch.zips @@ -569,7 +571,7 @@ ${auth.server.java.home} ${auth.server.home} - ${auth.server.patch.zip} + ${auth.server.patch.zips}