Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CIAM-800] Fix the failing com.redhat.xpaas.sso.ImageTest.testDeclaredEnvironmentVariables test #251

Open
wants to merge 1 commit into
base: sso76-dev
Choose a base branch
from

Conversation

iankko
Copy link
Collaborator

@iankko iankko commented Jun 13, 2022

[CIAM-800] Fix the failing
com.redhat.xpaas.sso.ImageTest.testDeclaredEnvironmentVariables test --
the JAVA_HOME and JAVA_VENDOR environment variables are expected to be
defined this test to pass

The latest JBoss EAP 7.4 with OpenJDK11 for OpenShift container image
defines these variables since using "jboss.container.openjdk.jdk"
module:

* https://github.com/jboss-openshift/cct_module/blob/0.45.4/jboss/container/openjdk/jdk/11/module.yaml

But the RH-SSO 7.5.X+ container images don't define these two env
vars due to the use of internal "sso-jdk/11" module

Signed-off-by: Jan Lieskovsky <[email protected]>

Note: Once this is reviewed & merged, it should be merged back to previous sso75-dev branch too (so future 7.5.X images have the fix too).

Thanks for submitting your Pull Request!

Please make sure your PR meets the following requirements:

  • Pull Request title is properly formatted: [CLOUD-XYA] Subject
  • Pull Request contains link to the JIRA issue
  • Pull Request contains description of the issue
  • Pull Request does not include fixes for issues other than the main ticket
  • Attached commits represent units of work and are properly formatted
  • You have read and agreed to the Developer Certificate of Origin (DCO) (see CONTRIBUTING.md)
  • Every commit contains Signed-off-by: Your Name <[email protected]> - use git commit -s

com.redhat.xpaas.sso.ImageTest.testDeclaredEnvironmentVariables test --
the JAVA_HOME and JAVA_VENDOR environment variables are expected to be
defined this test to pass

The latest JBoss EAP 7.4 with OpenJDK11 for OpenShift container image
defines these variables since using "jboss.container.openjdk.jdk"
module:

* https://github.com/jboss-openshift/cct_module/blob/0.45.4/jboss/container/openjdk/jdk/11/module.yaml

But the RH-SSO 7.5.X+ container images don't define these two env
vars due to the use of internal "sso-jdk/11" module

Signed-off-by: Jan Lieskovsky <[email protected]>
@iankko iankko requested review from ASzc and drichtarik June 13, 2022 12:00
@iankko
Copy link
Collaborator Author

iankko commented Jun 13, 2022

Running the om.redhat.xpaas.sso.ImageTest.testDeclaredEnvironmentVariables XPaaS test on the current 7.5.X+ images returns the following output:

Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 31.472 s <<< FAILURE! - in com.redhat.xpaas.sso.ImageTest
testDeclaredEnvironmentVariables(com.redhat.xpaas.sso.ImageTest)  Time elapsed: 0.074 s  <<< FAILURE!
java.lang.AssertionError:

Expecting:
 <{"AB_JOLOKIA_AUTH_OPENSHIFT"="true", "AB_JOLOKIA_HTTPS"="true", "AB_JOLOKIA_PASSWORD_RANDOM"="true", "AB_PROMETHEUS_JMX_EXPORTER_CONFIG"="/opt/jboss/container/prometheus/etc/jmx-exporter-config.yaml", "CONFIG_ADJUSTMENT_MODE"="xml_cli", "DELETE_BUILD_ARTIFACTS"="true", "EAP_FULL_GROUPID"="org.jboss.eap", "GALLEON_BUILD_FP_MAVEN_ARGS_APPEND"="-Dcom.redhat.xpaas.repo.jbossorg", "GALLEON_DEFAULT_FAT_SERVER"="/opt/jboss/container/eap/galleon/definitions/fat-default-server", "GALLEON_DEFAULT_SERVER"="/opt/jboss/container/eap/galleon/definitions/slim-default-server", "GALLEON_DEFINITIONS"="/opt/jboss/container/eap/galleon/definitions", "GALLEON_FP_COMMON_PKG_NAME"="eap.s2i.common", "GALLEON_FP_PATH"="/opt/jboss/container/eap/galleon/eap-s2i-galleon-pack", "GALLEON_LOCAL_MAVEN_REPO"="/opt/jboss/container/wildfly/s2i/galleon/galleon-m2-repository", "GALLEON_MAVEN_BUILD_IMG_SETTINGS_XML"="/opt/jboss/container/wildfly/s2i/galleon/build-image-settings.xml", "GALLEON_MAVEN_REPO_HOOK_SCRIPT"="/opt/jboss/container/eap/galleon/patching.sh", "GALLEON_MAVEN_SETTINGS_XML"="/opt/jboss/container/wildfly/s2i/galleon/settings.xml", "GALLEON_PROVISON_FP_MAVEN_ARGS_APPEND"="-Dcom.redhat.xpaas.repo.jbossorg", "GALLEON_S2I_FP_ARTIFACT_ID"="eap-s2i-galleon-pack", "GALLEON_S2I_FP_GROUP_ID"="org.jboss.eap.galleon.s2i", "GALLEON_S2I_PRODUCER_NAME"="eap-s2i", "GALLEON_VERSION"="4.2.8.Final", "GALLEON_WILDFLY_VERSION"="5.1.2.Final", "HOME"="/home/jboss", "JAVA_VERSION"="11.0", "JBOSS_CONTAINER_EAP_GALLEON_FP_PACKAGES"="/opt/jboss/container/eap/galleon/eap-s2i-galleon-pack/src/main/resources/packages", "JBOSS_CONTAINER_JAVA_JVM_MODULE"="/opt/jboss/container/java/jvm", "JBOSS_CONTAINER_JAVA_PROXY_MODULE"="/opt/jboss/container/java/proxy", "JBOSS_CONTAINER_JOLOKIA_MODULE"="/opt/jboss/container/jolokia", "JBOSS_CONTAINER_MAVEN_35_MODULE"="/opt/jboss/container/maven/35/", "JBOSS_CONTAINER_MAVEN_36_MODULE"="/opt/jboss/container/maven/36/", "JBOSS_CONTAINER_MAVEN_DEFAULT_MODULE"="/opt/jboss/container/maven/default/", "JBOSS_CONTAINER_MAVEN_S2I_MODULE"="/opt/jboss/container/maven/s2i", "JBOSS_CONTAINER_OPENJDK_JDK_MODULE"="/opt/jboss/container/openjdk/jdk", "JBOSS_CONTAINER_PROMETHEUS_MODULE"="/opt/jboss/container/prometheus", "JBOSS_CONTAINER_S2I_CORE_MODULE"="/opt/jboss/container/s2i/core/", "JBOSS_CONTAINER_UTIL_LOGGING_MODULE"="/opt/jboss/container/util/logging/", "JBOSS_CONTAINER_WILDFLY_S2I_GALLEON_DIR"="/opt/jboss/container/wildfly/s2i/galleon", "JBOSS_CONTAINER_WILDFLY_S2I_GALLEON_PROVISION"="/opt/jboss/container/wildfly/s2i/galleon/provisioning/generic_provisioning", "JBOSS_CONTAINER_WILDFLY_S2I_MODULE"="/opt/jboss/container/wildfly/s2i", "JBOSS_EAP_VERSION"="7.4.4", "JBOSS_HOME"="/opt/eap", "JBOSS_IMAGE_NAME"="rh-sso-7/sso76-openshift-rhel8", "JBOSS_IMAGE_VERSION"="7.6", "JBOSS_MODULES_SYSTEM_PKGS"="jdk.nashorn.api,com.sun.crypto.provider", "JBOSS_PRODUCT"="sso", "JBOSS_SSO_VERSION"="7.6.0.GA", "JOLOKIA_VERSION"="1.6.2", "LAUNCH_JBOSS_IN_BACKGROUND"="true", "LD_PRELOAD"="libnss_wrapper.so", "MAVEN_OPTS"="-Duser.home=", "MAVEN_VERSION"="3.6", "NSS_WRAPPER_GROUP"="/etc/group", "NSS_WRAPPER_PASSWD"="/home/jboss/passwd", "OFFLINER_URLS"="--url https://repo1.maven.org/maven2/ --url https://repository.jboss.org/nexus/content/groups/public/ --url https://maven.repository.redhat.com/ga/", "OFFLINER_VERSION"="1.6", "PATH"="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "PRODUCT_VERSION"="7.6.0.GA", "S2I_COPY_SERVER"="true", "S2I_FP_VERSION"="23.0.0.Final", "S2I_SOURCE_DEPLOYMENTS_FILTER"="*.war *.ear *.rar *.jar", "SSO_FORCE_LEGACY_SECURITY"="true", "TMP_GALLEON_LOCAL_MAVEN_REPO"="/opt/jboss/container/wildfly/s2i/galleon/tmp-galleon-m2-repository", "WILDFLY_DIST_MAVEN_LOCATION"="https://repository.jboss.org/nexus/content/groups/public/org/wildfly/wildfly-dist", "WILDFLY_S2I_OUTPUT_DIR"="/s2i-output", "WILDFLY_VERSION"="7.4.4.GA-redhat-00011", "container"="oci"}>
to contain:
 <[JBOSS_HOME=/opt/eap,
    JAVA_HOME=/usr/lib/jvm/java-11,
    JAVA_VENDOR=openjdk,
    JAVA_VERSION=11.0,
    HOME=/home/jboss,
    JBOSS_PRODUCT=sso,
    JBOSS_SSO_VERSION=7.6.0.GA,
    PRODUCT_VERSION=7.6.0.GA]>
but could not find:
 <[JAVA_HOME=/usr/lib/jvm/java-11, JAVA_VENDOR=openjdk]>

        at com.redhat.xpaas.sso.ImageTest.testDeclaredEnvironmentVariables(ImageTest.java:71)
...

This is because instead of using the "jboss.container.openjdk.jdk" CCT module, which defines these env vars, the RH-SSO images are using internal "sso/sso-jdk/11" module, which lacks definition of these two env vars, leading to test failure.

@iankko
Copy link
Collaborator Author

iankko commented Jun 13, 2022

@drichtarik @ASzc @pskopek PTAL once got a chance

Thx, Jan

Copy link
Collaborator

@ASzc ASzc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That path should point at the latest Java 11 on the jenkins VMs

Copy link
Collaborator

@drichtarik drichtarik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Merge possible if it was tested in our custom pipeline

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants