Skip to content

Commit 7c3fda9

Browse files
committed
Fix mount_option_boot_efi_nosuid test scenarios.
1 parent 82a26ab commit 7c3fda9

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

linux_os/guide/system/permissions/partitions/mount_option_boot_efi_nosuid/tests/vfat_with_nosuid.pass.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# This test verifies that the rule passes when /boot/efi is mounted with vfat filesystem
44
# Even with nosuid set, vfat is excluded from the requirement (nosuid has no effect on vfat)
55

6+
# packages = dosfstools
7+
68
. $SHARED/partition.sh
79

810
clean_up_partition /boot/efi
@@ -14,7 +16,11 @@ mkfs.vfat $VFAT_PARTITION
1416

1517
# Add to fstab with nosuid option (should still pass because vfat is excluded)
1618
mkdir -p /boot/efi
17-
echo "$VFAT_PARTITION /boot/efi vfat rw,nosuid,relatime 0 0" >> /etc/fstab
19+
echo "$VFAT_PARTITION /boot/efi vfat rw,nosuid,relatime,loop 0 0" >> /etc/fstab
1820

1921
# Mount the partition
2022
mount /boot/efi
23+
24+
# Add verification step to ensure the mount is active and correct
25+
# This helps the script exit with a failure if mount failed unexpectedly
26+
findmnt --target /boot/efi > /dev/null 2>&1

linux_os/guide/system/permissions/partitions/mount_option_boot_efi_nosuid/tests/vfat_without_nosuid.pass.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# This test verifies that the rule passes when /boot/efi is mounted with vfat filesystem
44
# The nosuid requirement is not applicable to vfat filesystems
55

6+
# packages = dosfstools
7+
68
. $SHARED/partition.sh
79

810
clean_up_partition /boot/efi
@@ -14,7 +16,7 @@ mkfs.vfat $VFAT_PARTITION
1416

1517
# Add to fstab without nosuid option (should pass because vfat is excluded)
1618
mkdir -p /boot/efi
17-
echo "$VFAT_PARTITION /boot/efi vfat rw,relatime 0 0" >> /etc/fstab
19+
echo "$VFAT_PARTITION /boot/efi vfat rw,relatime,loop 0 0" >> /etc/fstab
1820

1921
# Mount the partition
2022
mount /boot/efi

0 commit comments

Comments
 (0)