Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions tmt/tests/booted/test-composefs-uki-addons.nu
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def second_boot [] {
# A switch/upgrade must *stage* the global addon under loader/addons.staged
# and leave the live loader/addons dir untouched until the next boot.
# Remount the ESP so our view is coherent with the mount bootc wrote through.
umount /var/tmp/efi
umount -l /var/tmp/efi
mount /dev/disk/by-partlabel/EFI-SYSTEM /var/tmp/efi

assert ("/var/tmp/efi/loader/addons.staged/bootc_composefs-global-cmdline.addon.efi" | path exists) "Global addon should be staged under loader/addons.staged"
Expand Down Expand Up @@ -166,7 +166,7 @@ def third_boot [] {
# The switch above staged a deployment and carried the global addon forward
# into loader/addons.staged, while the live loader/addons is left intact.
# Remount the ESP for a view coherent with bootc's own mount.
umount /var/tmp/efi
umount -l /var/tmp/efi
mount /dev/disk/by-partlabel/EFI-SYSTEM /var/tmp/efi

assert ("/var/tmp/efi/loader/addons.staged/bootc_composefs-global-cmdline.addon.efi" | path exists) "Global addon should be staged after switch"
Expand All @@ -183,7 +183,7 @@ def third_boot [] {
assert ($remove_result.exit_code == 0) "Removing the staged global addon should succeed"
assert ($remove_result.stdout | str contains "last staged global addon") "Should warn about removing the last staged global addon"

umount /var/tmp/efi
umount -l /var/tmp/efi
mount /dev/disk/by-partlabel/EFI-SYSTEM /var/tmp/efi

assert (not ("/var/tmp/efi/loader/addons.staged" | path exists)) "loader/addons.staged must be deleted after removing the last staged global addon"
Expand All @@ -193,7 +193,7 @@ def third_boot [] {
# check. With a deployment staged, `add` writes back into loader/addons.staged.
bootc uki-addon add global-cmdline global

umount /var/tmp/efi
umount -l /var/tmp/efi
mount /dev/disk/by-partlabel/EFI-SYSTEM /var/tmp/efi

assert ("/var/tmp/efi/loader/addons.staged/bootc_composefs-global-cmdline.addon.efi" | path exists) "Global addon should be re-staged"
Expand Down
2 changes: 1 addition & 1 deletion tmt/tests/booted/test-install-composefs-native.nu
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def install [image: string, ...args: string] {
let dropin = glob $"($MNT)/state/deploy/*/etc/tmpfiles.d/bootc-root-ssh.conf"
| append (glob $"($MNT)/ostree/deploy/*/deploy/*/etc/tmpfiles.d/bootc-root-ssh.conf")
| each {|p| {content: (open --raw $p | decode utf-8), mode: (stat -c %a $p | str trim)}}
umount $MNT
umount -l $MNT
rm -f $DISK
assert equal $dropin [{content: $"f~ /var/roothome/.ssh/authorized_keys 600 root root - ($KEY | encode base64)\n", mode: "644"}] "root ssh drop-in"
match [$composefs $ostree] {
Expand Down
2 changes: 1 addition & 1 deletion tmt/tests/booted/test-install-karg-delete.nu
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ let foo_found = ($entries | find "foo" | is-empty)
assert $foo_found "Found foo in bootloader entries, but it should have been deleted"

# Clean up
umount /var/mnt
umount -l /var/mnt
rm -rf disk.img

tap ok
2 changes: 1 addition & 1 deletion tmt/tests/booted/test-install-no-boot-dir.nu
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def main [] {

tap run_install $"bootc install to-filesystem --disable-selinux --bootloader=none --source-imgref ($target_image) /var/mnt"

umount /var/mnt
umount -l /var/mnt
rm -f disk.img

tap ok
Expand Down
14 changes: 7 additions & 7 deletions tmt/tests/booted/test-install-outside-container.nu
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ if $source_is_uki {
null
} catch {|err| $err }

do { umount $target_esp } | complete | ignore
do { umount $target_root } | complete | ignore
do { umount -l $target_esp } | complete | ignore
do { umount -l $target_root } | complete | ignore
do { losetup -d $loop } | complete | ignore
if $inspection_error != null {
error make { msg: $"installed target inspection failed: ($inspection_error)" }
Expand Down Expand Up @@ -217,7 +217,7 @@ for path in [$dest ($dest | path join etc) ($dest | path join var)] {
for path in [root-sentinel usr/sentinel etc/sentinel var/sentinel] {
assert_write_denied ($dest | path join $path)
}
umount -R $dest
umount -R -l $dest
rm ($dest | path join preexisting)

# By default only /etc and /var are writable.
Expand All @@ -231,7 +231,7 @@ for path in [root-sentinel usr/sentinel] {
}
"etc sentinel" | save ($dest | path join etc/sentinel)
"var sentinel" | save ($dest | path join var/sentinel)
umount -R $dest
umount -R -l $dest

# The writes must land in the deployment's persistent state on the sysroot.
let state = if (tap is_composefs) {
Expand All @@ -250,19 +250,19 @@ if not (tap is_composefs) {
bootc install mount --sysroot $sysroot --latest $dest
mkdir ($dest | path join etc/ostree)
"[etc]\ntransient = true\n" | save -f ($dest | path join etc/ostree/prepare-root.conf)
umount -R $dest
umount -R -l $dest

bootc install mount --sysroot $sysroot --latest $dest
let etc = ($dest | path join etc)
let fstype = (findmnt --json --mountpoint $etc --output FSTYPE | from json | get filesystems.0.fstype)
assert equal $fstype "overlay" "transient /etc must be an overlay"
assert (not ($etc | path join sentinel | path exists)) "transient /etc must not show the persistent copy"
"transient" | save ($etc | path join transient-sentinel)
umount -R $dest
umount -R -l $dest
assert (not ($deployment | path join etc/transient-sentinel | path exists)) "transient /etc writes must not persist"
}

umount $sysroot
umount -l $sysroot
losetup -d $loop

tap ok
2 changes: 1 addition & 1 deletion tmt/tests/booted/test-install-shared-propagation.nu
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def main [] {
bootc install to-filesystem --disable-selinux --bootloader=none --source-imgref ($target_image) /var/mnt
if findmnt /run/bootc/storage; then echo 'error: /run/bootc/storage mount leaked'; exit 1; fi"

umount /var/mnt
umount -l /var/mnt
rm -f disk.img

tap ok
Expand Down
2 changes: 1 addition & 1 deletion tmt/tests/booted/test-install-to-filesystem-var-mount.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ echo "Using loop device: $LOOP_DEV"
cleanup() {
set +e
echo "Cleaning up..."
umount -R /var/mnt/target 2>/dev/null
umount -R -l /var/mnt/target 2>/dev/null
vgchange -an BL 2>/dev/null
vgremove -f BL 2>/dev/null
losetup -d "$LOOP_DEV" 2>/dev/null
Expand Down
10 changes: 5 additions & 5 deletions tmt/tests/booted/test-multi-device-esp.nu
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const ROOT_TYPE = "4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709"
# Cleanup function for LVM and loop devices
def cleanup [vg_name: string, loops: list<string>, mountpoint: string] {
# Unmount if mounted
do { umount $mountpoint } | complete | ignore
do { umount -l $mountpoint } | complete | ignore
do { rmdir $mountpoint } | complete | ignore

# Deactivate and remove LVM
Expand Down Expand Up @@ -126,7 +126,7 @@ def setup_disk_with_root [

# Simple cleanup for non-LVM scenarios (single loop device, no VG)
def cleanup_simple [loop: string, mountpoint: string] {
do { umount $mountpoint } | complete | ignore
do { umount -l $mountpoint } | complete | ignore
do { rmdir $mountpoint } | complete | ignore

if ($loop | path exists) {
Expand All @@ -143,14 +143,14 @@ def validate_esp [esp_partition: string] {
# Check for EFI directory with bootloader files
let efi_dir = $"($esp_mount)/EFI"
if not ($efi_dir | path exists) {
umount $esp_mount
umount -l $esp_mount
rmdir $esp_mount
error make {msg: $"ESP validation failed: EFI directory not found on ($esp_partition)"}
}

# Verify there's actual content in EFI (not just empty)
let efi_contents = (ls $efi_dir | length)
umount $esp_mount
umount -l $esp_mount
rmdir $esp_mount

if $efi_contents == 0 {
Expand All @@ -164,7 +164,7 @@ def with_esp [esp_partition: string, f: closure] {
mkdir $esp_mount
mount $esp_partition $esp_mount
let r = (do $f $esp_mount)
umount $esp_mount
umount -l $esp_mount
rmdir $esp_mount
$r
}
Expand Down
Loading