Skip to content

Commit 3d005d2

Browse files
committed
tmt: Fix var-mount test to use booted container image
Use copy-to-storage to add the booted container to podman storage instead of pulling a remote image. This matches the pattern used by other TMT tests and ensures we test the actual bootc under test. Changes: - Use localhost/bootc from copy-to-storage instead of remote image - Disable LBIs via bind mount of /usr/share/empty - Remove unnecessary host modifications (usr-overlay, dnf install, etc.) - Use 100%FREE for root LV to ensure sufficient space for deployment Assisted-by: OpenCode (Opus 4.5) Signed-off-by: ckyrouac <ckyrouac@redhat.com>
1 parent d5c6515 commit 3d005d2

1 file changed

Lines changed: 8 additions & 22 deletions

File tree

tmt/tests/booted/test-install-to-filesystem-var-mount.sh

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,13 @@
1616

1717
set -xeuo pipefail
1818

19-
# Use a generic target image to test skew between the bootc binary doing
20-
# the install and the target image
21-
TARGET_IMAGE="docker://quay.io/centos-bootc/centos-bootc:stream10"
19+
# Use the currently booted image (copied to container storage)
20+
TARGET_IMAGE="localhost/bootc"
2221

2322
echo "Testing bootc install to-filesystem with separate /var mount"
2423

25-
# Disable SELinux enforcement for the install
26-
setenforce 0
27-
28-
# Enable usr-overlay to allow modifications
29-
bootc usr-overlay
30-
31-
# Install required packages (bootc images are immutable, so we need to install
32-
# after usr-overlay is enabled)
33-
dnf install -y parted lvm2 dosfstools e2fsprogs
34-
35-
# Mask off conflicting ostree state
36-
if test -d /sysroot/ostree; then
37-
mount --bind /usr/share/empty /sysroot/ostree
38-
fi
39-
rm -vrf /usr/lib/bootupd/updates
40-
rm -vrf /usr/lib/bootc/bound-images.d
24+
# Copy the currently booted image to container storage for podman to use
25+
bootc image copy-to-storage
4126

4227
# Create a 12GB sparse disk image in /var/tmp (not /tmp which may be tmpfs)
4328
DISK_IMG=/var/tmp/disk-var-mount-test.img
@@ -91,7 +76,7 @@ vgcreate BL "$LVM_PART"
9176

9277
# Create logical volumes
9378
lvcreate -L 4G -n var02 BL
94-
lvcreate -L 5G -n root02 BL
79+
lvcreate -l 100%FREE -n root02 BL
9580

9681
# Create filesystems on logical volumes
9782
mkfs.ext4 -F /dev/BL/var02
@@ -122,12 +107,13 @@ echo "Filesystem layout:"
122107
mount | grep /var/mnt/target || true
123108
df -h /var/mnt/target /var/mnt/target/boot /var/mnt/target/boot/efi /var/mnt/target/var
124109

125-
# Run bootc install to-filesystem
126-
# This should succeed and handle the separate /var mount correctly
110+
# Run bootc install to-filesystem from within the container image under test
111+
# The bind mount of /usr/share/empty to /usr/lib/bootc/bound-images.d disables LBIs
127112
podman run \
128113
--rm --privileged \
129114
-v /var/mnt/target:/target \
130115
-v /dev:/dev \
116+
-v /usr/share/empty:/usr/lib/bootc/bound-images.d \
131117
--pid=host \
132118
--security-opt label=type:unconfined_t \
133119
"$TARGET_IMAGE" \

0 commit comments

Comments
 (0)