Merge pull request #24019 from edsantiago/quadlet-rootfs-fix

CI: Quadlet rootfs test: use container image as rootfs
This commit is contained in:
openshift-merge-bot[bot] 2024-09-20 10:55:12 +00:00 committed by GitHub
commit f7be7a365a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 14 additions and 1 deletions

View File

@ -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
@ -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" {