Skip to content

Commit

Permalink
Merge pull request #24019 from edsantiago/quadlet-rootfs-fix
Browse files Browse the repository at this point in the history
CI: Quadlet rootfs test: use container image as rootfs
  • Loading branch information
openshift-merge-bot[bot] committed Sep 20, 2024
2 parents e38f86c + a08ae98 commit f7be7a3
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion test/system/252-quadlet.bats
Original file line number Diff line number Diff line change
Expand Up @@ -723,10 +723,18 @@ EOF
@test "quadlet - rootfs" {
skip_if_no_selinux
skip_if_rootless

# Mount a container image to use as rootfs. Because we (may) run in
# parallel, mount a working container, not $IMAGE
cname="c-$(safename)"
run_podman run -d --name $cname $IMAGE top
run_podman container mount $cname
mountpoint="$output"

local quadlet_file=$PODMAN_TMPDIR/basic_$(safename).container
cat > $quadlet_file <<EOF
[Container]
Rootfs=/:O
Rootfs=$mountpoint:O
Exec=sh -c "echo STARTED CONTAINER; echo "READY=1" | socat -u STDIN unix-sendto:\$NOTIFY_SOCKET; top -b"
Notify=yes
EOF
Expand All @@ -735,6 +743,11 @@ EOF
service_setup $QUADLET_SERVICE_NAME

wait_for_output "STARTED CONTAINER" $QUADLET_CONTAINER_NAME

# Done. Clean up.
service_cleanup $QUADLET_SERVICE_NAME failed
run_podman container unmount $cname
run_podman rm -f -t0 $cname
}

@test "quadlet - selinux disable" {
Expand Down

1 comment on commit f7be7a3

@packit-as-a-service
Copy link

Choose a reason for hiding this comment

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

podman-next COPR build failed. @containers/packit-build please check.

Please sign in to comment.