• False
    • Hide

      None

      Show
      None
    • False

      Test cases should be developed for Rhel and OCP for this.

            [OPENJDK-3667] testing for hsperfdata directory removal (parent issue)

            Code merged and running against the product versions now.

            Scott Froberg added a comment - Code merged and running against the product versions now.

            Jonathan Dowland added a comment - - edited

            I've adjusted the s2i.sh test script I provided to work with Podman and --as-dockerfile:

            APPSRC=https://github.com/rh-openjdk/openjdk-container-test-applications.git
            CONTEXTDIR=spring-boot-sample-simple
            rev=master
            
            runs2i() {
                mkdir -p $CONTAINERSRC
                s2i build --pull-policy never --context-dir=$CONTEXTDIR -r=${rev} \
                    --as-dockerfile $CONTAINERSRC/Containerfile \
                    --assemble-user 185 \
                    --image-scripts-url image:///usr/local/s2i \
                    $APPSRC \
                    $BASEIMG \
                    $OUTIMG    podman build -t $OUTIMG -f $CONTAINERSRC/Containerfile $CONTAINERSRC
            }
            
            BASEIMG=registry.access.redhat.com/ubi9/openjdk-21:1.21
            podman pull $BASEIMG
            
            OUTIMG=s2i-out
            CONTAINERSRC=before
            runs2i
            # this should show the directory exists
            podman run --rm -ti $OUTIMG stat /tmp/hsperfdata_default
            
            BASEIMG=ubi9/openjdk-21:1.21
            OUTIMG=s2i-out-2
            CONTAINERSRC=after
            runs2i
            # this should show the directory does not exist
            podman run --rm -ti $OUTIMG stat /tmp/hsperfdata_default
             

             

            Jonathan Dowland added a comment - - edited I've adjusted the s2i.sh test script I provided to work with Podman and --as-dockerfile : APPSRC=https: //github.com/rh-openjdk/openjdk-container-test-applications.git CONTEXTDIR=spring-boot-sample-simple rev=master runs2i() {     mkdir -p $CONTAINERSRC     s2i build --pull-policy never --context-dir=$CONTEXTDIR -r=${rev} \         --as-dockerfile $CONTAINERSRC/Containerfile \         --assemble-user 185 \         --image-scripts-url image: ///usr/local/s2i \         $APPSRC \         $BASEIMG \         $OUTIMG    podman build -t $OUTIMG -f $CONTAINERSRC/Containerfile $CONTAINERSRC } BASEIMG=registry.access.redhat.com/ubi9/openjdk-21:1.21 podman pull $BASEIMG OUTIMG=s2i-out CONTAINERSRC=before runs2i # this should show the directory exists podman run --rm -ti $OUTIMG stat /tmp/hsperfdata_default BASEIMG=ubi9/openjdk-21:1.21 OUTIMG=s2i-out-2 CONTAINERSRC=after runs2i # this should show the directory does not exist podman run --rm -ti $OUTIMG stat /tmp/hsperfdata_default  

            Hi rhn-support-sfroberg 

            Sorry I hadn't appreciated the specific S2I issue here. The problem is the s2i binary (in normal operating mode, i.e. not using --as-dockerfile) relies on talking the docker daemon API to a socket. Therefore the behave unit testing is stuck on Docker. That's something I've wanted to fix for a long time, but haven't had a chance to prioritize.

            If you want to run the behave tests with podman, it's possible, you have to do something like this

            $ systemctl --user enable podman.service
            $ systemctl --user start podman.service
            $ export CTF_API_SOCK=unix:///run/user/1000/podman/podman.sock
            $ cekit …. test behave --steps-url https://github.com/jmtd/behave-test-steps --steps-ref  podman

            some more details in this readme: https://github.com/jmtd/behave-test-steps/tree/podman

             

             

            Jonathan Dowland added a comment - Hi rhn-support-sfroberg   Sorry I hadn't appreciated the specific S2I issue here. The problem is the s2i binary (in normal operating mode, i.e. not using --as-dockerfile ) relies on talking the docker daemon API to a socket. Therefore the behave unit testing is stuck on Docker. That's something I've wanted to fix for a long time, but haven't had a chance to prioritize. If you want to run the behave tests with podman, it's possible, you have to do something like this $ systemctl --user enable podman.service $ systemctl --user start podman.service $ export CTF_API_SOCK=unix: ///run/user/1000/podman/podman.sock $ cekit …. test behave --steps-url https: //github.com/jmtd/behave-test-steps --steps-ref  podman some more details in this readme: https://github.com/jmtd/behave-test-steps/tree/podman    

            jdowland@redhat.com 

            Can you try running this where instead of having S2i Build the container image put the build step to a containerfile. Then build with Podman. What I am finding is the hsperfdata_default folder is not there.

             

            Scott Froberg added a comment - jdowland@redhat.com   Can you try running this where instead of having S2i Build the container image put the build step to a containerfile. Then build with Podman. What I am finding is the hsperfdata_default folder is not there.  

            s2i v1.3.0 !

            Jonathan Dowland added a comment - s2i v1.3.0 !

            Comments from jdowland@redhat.com's pull request:

            BASEIMG=ubi9/openjdk-21:1.18 # substitute appropriately
            APPSRC=https://github.com/rh-openjdk/openjdk-container-test-applications.git
            CONTEXTDIR=spring-boot-sample-simple
            rev=master
            OUTIMG=s2i-out

            s2i build --pull-policy never --context-dir=$CONTEXTDIR -r=${rev} \
            $APPSRC \
            $BASEIMG \
            $OUTIMG

            docker run --rm -ti $OUTIMG stat /tmp/hsperfdata_default

            bad output:


            File: /tmp/hsperfdata_default
            Size: 4096 Blocks: 8 IO Block: 4096 directory
            Device: 4fh/79d Inode: 663433 Links: 2
            Access: (0755/drwxr-xr-x) Uid: ( 185/ default) Gid: ( 0/ root)
            Access: 2025-02-17 14:30:28.691995151 +0000
            Modify: 2025-02-17 14:30:27.000000000 +0000
            Change: 2025-02-17 14:30:28.671994155 +0000
            Birth: 2025-02-17 14:30:28.667993957 +0000

            Good output:


            No such file or directory

            Scott Froberg added a comment - Comments from jdowland@redhat.com 's pull request: BASEIMG=ubi9/openjdk-21:1.18 # substitute appropriately APPSRC= https://github.com/rh-openjdk/openjdk-container-test-applications.git CONTEXTDIR=spring-boot-sample-simple rev=master OUTIMG=s2i-out s2i build --pull-policy never --context-dir=$CONTEXTDIR -r=${rev} \ $APPSRC \ $BASEIMG \ $OUTIMG docker run --rm -ti $OUTIMG stat /tmp/hsperfdata_default bad output: … File: /tmp/hsperfdata_default Size: 4096 Blocks: 8 IO Block: 4096 directory Device: 4fh/79d Inode: 663433 Links: 2 Access: (0755/drwxr-xr-x) Uid: ( 185/ default) Gid: ( 0/ root) Access: 2025-02-17 14:30:28.691995151 +0000 Modify: 2025-02-17 14:30:27.000000000 +0000 Change: 2025-02-17 14:30:28.671994155 +0000 Birth: 2025-02-17 14:30:28.667993957 +0000 Good output: … No such file or directory

              rhn-support-sfroberg Scott Froberg
              jdowland@redhat.com Jonathan Dowland
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: