Test/filesystem.sh: update the test case to the new policy

The mountpoint policy changed as a result of COMPOSER-2030 [1]. Modify
the test case accordingly, to comprehensively test the updated
mountpoint policy.

[1] https://issues.redhat.com/browse/COMPOSER-2030

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
This commit is contained in:
Tomáš Hozza 2023-11-13 13:21:44 +01:00 committed by Tomáš Hozza
parent 5f04544af7
commit 6649e7b36e

View file

@ -156,6 +156,10 @@ size = 131072000
mountpoint = "/home"
size = 131072000
[[customizations.filesystem]]
mountpoint = "/home/shadownman"
size = 131072000
[[customizations.filesystem]]
mountpoint = "/opt"
size = 131072000
@ -171,8 +175,26 @@ size = 131072000
[[customizations.filesystem]]
mountpoint = "/data"
size = 131072000
[[customizations.filesystem]]
mountpoint = "/boot"
size = 131072000
EOF
# Workaround for RHEL-9.3 nightly pipeline
if [[ "$VERSION_ID" != "9.3" ]]; then
tee -a "$BLUEPRINT_FILE" > /dev/null << EOF
[[customizations.filesystem]]
mountpoint = "/boot/firmware"
size = 131072000
[[customizations.filesystem]]
mountpoint = "/foobar"
size = 131072000
EOF
fi
build_image "$BLUEPRINT_FILE" custom-filesystem qcow2 false
# Download the image.
@ -223,12 +245,69 @@ size = 2147483648
mountpoint = "/etc"
size = 131072000
[[customizations.filesystem]]
mountpoint = "/sys"
size = 131072000
[[customizations.filesystem]]
mountpoint = "/proc"
size = 131072000
[[customizations.filesystem]]
mountpoint = "/dev"
size = 131072000
[[customizations.filesystem]]
mountpoint = "/run"
size = 131072000
[[customizations.filesystem]]
mountpoint = "/bin"
size = 131072000
[[customizations.filesystem]]
mountpoint = "/sbin"
size = 131072000
[[customizations.filesystem]]
mountpoint = "/lib"
size = 131072000
[[customizations.filesystem]]
mountpoint = "/lib64"
size = 131072000
[[customizations.filesystem]]
mountpoint = "/lost+found"
size = 131072000
[[customizations.filesystem]]
mountpoint = "/boot/efi"
size = 131072000
[[customizations.filesystem]]
mountpoint = "/sysroot"
size = 131072000
EOF
# Workaround for RHEL-9.3 nightly pipeline
if [[ "$VERSION_ID" != "9.3" ]]; then
tee -a "$BLUEPRINT_FILE" > /dev/null << EOF
[[customizations.filesystem]]
mountpoint = "/usr/bin"
size = 131072000
[[customizations.filesystem]]
mountpoint = "/var/run"
size = 131072000
[[customizations.filesystem]]
mountpoint = "/var/lock"
size = 131072000
EOF
fi
# build_image "$BLUEPRINT_FILE" custom-filesystem-fail qcow2 true
build_image "$BLUEPRINT_FILE" custom-filesystem-fail qcow2 true
@ -236,12 +315,21 @@ build_image "$BLUEPRINT_FILE" custom-filesystem-fail qcow2 true
FAILED_MOUNTPOINTS=()
greenprint "💬 Checking expected failures"
for MOUNTPOINT in '/etc' '/lost+found' ; do
for MOUNTPOINT in '/etc' '/sys' '/proc' '/dev' '/run' '/bin' '/sbin' '/lib' '/lib64' '/lost+found' '/boot/efi' '/sysroot'; do
if ! [[ $ERROR_MSG == *"$MOUNTPOINT"* ]]; then
FAILED_MOUNTPOINTS+=("$MOUNTPOINT")
fi
done
# Workaround for RHEL-9.3 nightly pipeline
if [[ "$VERSION_ID" != "9.3" ]]; then
for MOUNTPOINT in '/usr/bin' '/var/run' '/var/lock'; do
if ! [[ $ERROR_MSG == *"$MOUNTPOINT"* ]]; then
FAILED_MOUNTPOINTS+=("$MOUNTPOINT")
fi
done
fi
# Check the result and pass scenario type
check_result "Failing"