Skip to content

Commit

Permalink
KEYCLOAK-7267 change a way how to install adapters in testsuite from …
Browse files Browse the repository at this point in the history
…online to offline scripts
  • Loading branch information
vramik authored and pdrozd committed Jun 11, 2018
1 parent db60abc commit f293ab8
Show file tree
Hide file tree
Showing 11 changed files with 190 additions and 114 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
/subsystem=logging/logger=org.keycloak.adapters:add(level=DEBUG)
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)

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -29,43 +29,15 @@ 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%
echo Installation of SAML adapter ended with error code: "%ERROR%"
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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@

<app.server.oidc.adapter.artifactId>keycloak-wildfly-adapter-dist</app.server.oidc.adapter.artifactId>
<app.server.saml.adapter.artifactId>keycloak-saml-wildfly-adapter-dist</app.server.saml.adapter.artifactId>

<skip.elytron.adapter.installation>false</skip.elytron.adapter.installation>
</properties>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,28 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>install-adapters-online</id>
<phase>process-resources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>${common.resources}/install-adapters-online.${script.suffix}</executable>
<workingDirectory>${app.server.jboss.home}/bin</workingDirectory>
<environmentVariables>
<JAVA_HOME>${app.server.java.home}</JAVA_HOME>
<JBOSS_HOME>${app.server.jboss.home}</JBOSS_HOME>
<SAML_SUPPORTED>${app.server.saml.adapter.supported}</SAML_SUPPORTED>
</environmentVariables>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
177 changes: 156 additions & 21 deletions testsuite/integration-arquillian/servers/app-server/jboss/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
<security.xslt>security.xsl</security.xslt>
<oidc-adapter.version>${project.version}</oidc-adapter.version>
<saml-adapter.version>${project.version}</saml-adapter.version>
<app.server.elytron.adapter.supported>false</app.server.elytron.adapter.supported>
<skip.elytron.adapter.installation>true</skip.elytron.adapter.installation>
<skip.adapter.offline.installation>true</skip.adapter.offline.installation>
</properties>

<profiles>
Expand Down Expand Up @@ -196,21 +197,166 @@
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>install-adapters</id>
<id>add-adapter-log-level-standalone</id>
<phase>process-resources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>${common.resources}/install-adapters.${script.suffix}</executable>
<executable>./jboss-cli.${script.suffix}</executable>
<workingDirectory>${app.server.jboss.home}/bin</workingDirectory>
<environmentVariables>
<JAVA_HOME>${app.server.java.home}</JAVA_HOME>
<JBOSS_HOME>${app.server.jboss.home}</JBOSS_HOME>
<SAML_SUPPORTED>${app.server.saml.adapter.supported}</SAML_SUPPORTED>
<ELYTRON_SUPPORTED>${app.server.elytron.adapter.supported}</ELYTRON_SUPPORTED>
<CLI_PATH>${common.resources}/cli</CLI_PATH>
</environmentVariables>
<arguments>
<argument>--file=${common.resources}/cli/add-adapter-log-level.cli</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>add-adapter-log-level-standalone-ha</id>
<phase>process-resources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>./jboss-cli.${script.suffix}</executable>
<workingDirectory>${app.server.jboss.home}/bin</workingDirectory>
<arguments>
<argument>--file=${common.resources}/cli/add-adapter-log-level.cli</argument>
<argument>-Dserver.config=standalone-ha.xml</argument>
</arguments>
</configuration>
</execution>

<execution>
<!--OIDC: eap, wf11-->
<id>adapter-elytron-install-offline-standalone</id>
<phase>process-resources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<skip>${skip.elytron.adapter.installation}</skip>
<executable>./jboss-cli.${script.suffix}</executable>
<workingDirectory>${app.server.jboss.home}/bin</workingDirectory>
<arguments>
<argument>--file=${app.server.jboss.home}/bin/adapter-elytron-install-offline.cli</argument>
</arguments>
</configuration>
</execution>
<execution>
<!--OIDC: eap, wf11-->
<id>adapter-elytron-install-offline-standalone-ha</id>
<phase>process-resources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<skip>${skip.elytron.adapter.installation}</skip>
<executable>./jboss-cli.${script.suffix}</executable>
<workingDirectory>${app.server.jboss.home}/bin</workingDirectory>
<arguments>
<argument>--file=${app.server.jboss.home}/bin/adapter-elytron-install-offline.cli</argument>
<argument>-Dserver.config=standalone-ha.xml</argument>
</arguments>
</configuration>
</execution>
<execution>
<!--SAML: eap, wf11-->
<id>adapter-elytron-install-saml-offline-standalone</id>
<phase>process-resources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<skip>${skip.elytron.adapter.installation}</skip>
<executable>./jboss-cli.${script.suffix}</executable>
<workingDirectory>${app.server.jboss.home}/bin</workingDirectory>
<arguments>
<argument>--file=${app.server.jboss.home}/bin/adapter-elytron-install-saml-offline.cli</argument>
</arguments>
</configuration>
</execution>
<execution>
<!--SAML: eap, wf11-->
<id>adapter-elytron-install-saml-offline-standalone-ha</id>
<phase>process-resources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<skip>${skip.elytron.adapter.installation}</skip>
<executable>./jboss-cli.${script.suffix}</executable>
<workingDirectory>${app.server.jboss.home}/bin</workingDirectory>
<arguments>
<argument>--file=${app.server.jboss.home}/bin/adapter-elytron-install-saml-offline.cli</argument>
<argument>-Dserver.config=standalone-ha.xml</argument>
</arguments>
</configuration>
</execution>

<execution>
<!--OIDC: wf10, wf9-->
<id>adapter-install-offline-standalone</id>
<phase>process-resources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<skip>${skip.adapter.offline.installation}</skip>
<executable>./jboss-cli.${script.suffix}</executable>
<workingDirectory>${app.server.jboss.home}/bin</workingDirectory>
<arguments>
<argument>--file=${app.server.jboss.home}/bin/adapter-install-offline.cli</argument>
</arguments>
</configuration>
</execution>
<execution>
<!--OIDC: wf10, wf9-->
<id>adapter-install-offline-standalone-ha</id>
<phase>process-resources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<skip>${skip.adapter.offline.installation}</skip>
<executable>./jboss-cli.${script.suffix}</executable>
<workingDirectory>${app.server.jboss.home}/bin</workingDirectory>
<arguments>
<argument>--file=${app.server.jboss.home}/bin/adapter-install-offline.cli</argument>
<argument>-Dserver.config=standalone-ha.xml</argument>
</arguments>
</configuration>
</execution>
<execution>
<!--SAML: wf10, wf9-->
<id>adapter-install-saml-offline-standalone</id>
<phase>process-resources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<skip>${skip.adapter.offline.installation}</skip>
<executable>./jboss-cli.${script.suffix}</executable>
<workingDirectory>${app.server.jboss.home}/bin</workingDirectory>
<arguments>
<argument>--file=${app.server.jboss.home}/bin/adapter-install-saml-offline.cli</argument>
</arguments>
</configuration>
</execution>
<execution>
<!--SAML: wf10, wf9-->
<id>adapter-install-saml-offline-standalone-ha</id>
<phase>process-resources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<skip>${skip.adapter.offline.installation}</skip>
<executable>./jboss-cli.${script.suffix}</executable>
<workingDirectory>${app.server.jboss.home}/bin</workingDirectory>
<arguments>
<argument>--file=${app.server.jboss.home}/bin/adapter-install-saml-offline.cli</argument>
<argument>-Dserver.config=standalone-ha.xml</argument>
</arguments>
</configuration>
</execution>
</executions>
Expand Down Expand Up @@ -417,17 +563,6 @@
<module>eap6-fuse</module>
</modules>
</profile>

<profile>
<id>app-server-wildfly-elytron</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<properties>
<wildfly.version>${elytron.wildfly.version}</wildfly.version>
<app.server.elytron.adapter.supported>true</app.server.elytron.adapter.supported>
</properties>
</profile>
</profiles>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@

<app.server.oidc.adapter.artifactId>keycloak-wildfly-adapter-dist</app.server.oidc.adapter.artifactId>
<app.server.saml.adapter.artifactId>keycloak-saml-wildfly-adapter-dist</app.server.saml.adapter.artifactId>

<skip.elytron.adapter.installation>false</skip.elytron.adapter.installation>
</properties>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@

<app.server.oidc.adapter.artifactId>keycloak-wildfly-adapter-dist</app.server.oidc.adapter.artifactId>
<app.server.saml.adapter.artifactId>keycloak-saml-wildfly-adapter-dist</app.server.saml.adapter.artifactId>

<skip.adapter.offline.installation>false</skip.adapter.offline.installation>
</properties>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@

<app.server.oidc.adapter.artifactId>keycloak-wildfly-adapter-dist</app.server.oidc.adapter.artifactId>
<app.server.saml.adapter.artifactId>keycloak-saml-wildfly-adapter-dist</app.server.saml.adapter.artifactId>

<skip.adapter.offline.installation>false</skip.adapter.offline.installation>
</properties>

</project>
Loading

0 comments on commit f293ab8

Please sign in to comment.