mirror of
https://github.com/mmueller41/genode.git
synced 2026-01-21 12:32:56 +01:00
Improve robustness of chroot-related tests
This commit is contained in:
@@ -41,3 +41,27 @@ proc run_genode_until {{wait_for_re forever} {timeout_value 0}} {
|
||||
set output $expect_out(buffer)
|
||||
}
|
||||
|
||||
|
||||
##
|
||||
# Umount a directory that was bind-mounted beforehand
|
||||
#
|
||||
# This function is used by chroot-related tests, e.g., 'os/run/chroot.run',
|
||||
# 'os/run/chroot_loader.run'.
|
||||
#
|
||||
proc umount_and_rmdir { path } {
|
||||
|
||||
puts "umounting $path"
|
||||
|
||||
#
|
||||
# Invoke umount until it returns an error. Apparently, the unmounting
|
||||
# of bind-mounted mount points does not always take immediate effect
|
||||
# (regardless of the -l option).
|
||||
#
|
||||
while {1} {
|
||||
if {[catch { exec sudo umount -l $path }]} { break; }
|
||||
sleep 0.25
|
||||
}
|
||||
|
||||
catch { exec rmdir -p $path }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user