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

CI: Quadlet rootfs test: use container image as rootfs #24019

Merged
merged 1 commit into from
Sep 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Comment on lines 724 to 725
Copy link
Member

Choose a reason for hiding this comment

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

I am somewhat sure these can be removed now?

Copy link
Member Author

Choose a reason for hiding this comment

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

Wouldn't the mounts need complicated unshare? Would those work inside quadlet?

Copy link
Member

Choose a reason for hiding this comment

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

ah right yes you would need to use unshare rootless but yes as they all share the same userns the mounts should work with quadlet. Anyway I guess it is not really important to test it rootless. (although I do not get the no_selinux skip either)

I guess I just merge it as it is the same as before

/lgtm


# 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