Uploaded image for project: 'OpenJDK'
  1. OpenJDK
  2. OPENJDK-2807

Container OS testing fails because of a sed command is inserting the username into the container hash.

XMLWordPrintable

    • False
    • Hide

      None

      Show
      None
    • False

      This is an interesting one.

      The code:

      https://github.com/rh-openjdk/jdkContainerOsTests/blob/main/containersQa/testlib.bash#L523C1-L552C2

      function s2iLocal()

      {   prepareS2I   setUser   if [ "x$s2iBin" == "xundef" -o "x$s2iBin" == "x" ] ; then     echo $SKIPPED     return   fi   local d=`mktemp -d`   pushd $d     DF=s2iDockerFile     # branch needed here to allow for the added variables needed for a Jenkins Build. $JENKINS_BUILD will be      # defined in the calling function if it is attempting to build a Jenkins plug-in.     if [[ "$JENKINS_BUILD" == "yes" ]] ; then         # copy the jenkins settings file to the local tmp directory         $s2iBin build -e "$MAIN" -e "$ARGS" -e "$SETTING_ARGS" "$REPO" "$HASH" "$NAME" --as-dockerfile $DF.orig         cp $LIBCQA_SCRIPT_DIR/jenkins_settings.xml  upload/src     else         $s2iBin build -e "$MAIN" -e "$ARGS" "$REPO" "$HASH" "$NAME" --as-dockerfile $DF.orig     fi     if [ "x$OVERWRITE_USER" == x ] ; then       #update the container file for proper functionality       cat $DF.orig | sed "s;/usr/libexec;/usr/local;g" | sed "s;1001:0;$USERNAME:$USERNAME;g" | sed "s;1001;$USERNAME;g" | sed "s;/s2i/run;/s2i/run $ADDS;g;" > $DF.nw1     else       cat $DF.orig | sed "s;/s2i/run;/s2i/run $ADDS;g;" > $DF.nw1     fi     cat $DF.nw1 | tee $DF     buildFileWithHash $DF   popd   rm -rf $d }

      This sed command sed "s;1001;$USERNAME;g" is causing the username to get inserted into the container hash:
      http://hydra.brq.redhat.com:8080/job/containerqa-jp21-ojdk21~rhel9~ubi~containers-el9z.x86_64-all.sdk-el9z.x86_64.vagrant-x11.defaultgc.legacy.lnxagent.jfroff/9/

      http://hydra.brq.redhat.com:8080/job/containerqa-jp21-ojdk21~rhel9~ubi~containers-el9z.x86_64-all.sdk-el9z.x86_64.vagrant-x11.defaultgc.legacy.lnxagent.jfroff/9/artifact/results/211_s2iLocaDepsWorks.sh-result/report.txt

      Should be this: 

      64628742ee2a8225eb0eb8a55112f030c41001e8c00e1deb2cd37e5ef0c66c1e

      Is

      64628742ee2a8225eb0eb8a55112f030c4defaulte8c00e1deb2cd37e5ef0c66c1e

       

      Also change this:
      Whilst you're at it, if you add "--image-scripts-url image:///usr/local/s2i"
      would remove the need for this sed

          + sed 's;/usr/libexec;/usr/local;g'

       

            rhn-support-sfroberg Scott Froberg
            rhn-support-sfroberg Scott Froberg
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: