Skip to content

Commit 3e012d4

Browse files
ckyrouaccgwalters
authored andcommitted
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> Signed-off-by: Colin Walters <walters@verbum.org>
1 parent 204d729 commit 3e012d4

1 file changed

Lines changed: 12 additions & 21 deletions

File tree

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

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,20 @@
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+
# Build a derived image with LBIs removed for installation
20+
TARGET_IMAGE="localhost/bootc-install"
2221

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

25-
# Disable SELinux enforcement for the install
26-
setenforce 0
24+
# Copy the currently booted image to container storage for podman to use
25+
bootc image copy-to-storage
2726

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
27+
# Build a derived image that removes LBIs
28+
cat > /tmp/Containerfile.drop-lbis <<'EOF'
29+
FROM localhost/bootc
30+
RUN rm -rf /usr/lib/bootc/bound-images.d/*
31+
EOF
32+
podman build -t "$TARGET_IMAGE" -f /tmp/Containerfile.drop-lbis
4133

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

9284
# Create logical volumes
9385
lvcreate -L 4G -n var02 BL
94-
lvcreate -L 5G -n root02 BL
86+
lvcreate -l 100%FREE -n root02 BL
9587

9688
# Create filesystems on logical volumes
9789
mkfs.ext4 -F /dev/BL/var02
@@ -122,8 +114,7 @@ echo "Filesystem layout:"
122114
mount | grep /var/mnt/target || true
123115
df -h /var/mnt/target /var/mnt/target/boot /var/mnt/target/boot/efi /var/mnt/target/var
124116

125-
# Run bootc install to-filesystem
126-
# This should succeed and handle the separate /var mount correctly
117+
# Run bootc install to-filesystem from within the container image under test
127118
podman run \
128119
--rm --privileged \
129120
-v /var/mnt/target:/target \

0 commit comments

Comments
 (0)