diff --git a/tests/scripts/run_tests.sh b/tests/scripts/run_tests.sh index 86ca63a..52a2a17 100755 --- a/tests/scripts/run_tests.sh +++ b/tests/scripts/run_tests.sh @@ -30,6 +30,12 @@ function running { echo -e "\n\n#### RUN: $1\n" } +# unmount the dirs lazily because sometimes some outside thing is still touching them +function umount_dirs { + umount --lazy "$IMGDIR" + umount --lazy "$ISODIR" +} + [ -e "$ISODIR" ] || mkdir "$ISODIR" [ -e "$IMGDIR" ] || mkdir "$IMGDIR" @@ -43,8 +49,7 @@ function ks_only { test_ks status "Add kickstart" - umount "$IMGDIR" - umount "$ISODIR" + umount_dirs } function test_ks { @@ -71,8 +76,7 @@ function ks_serial { test_ks_serial status "Add kickstart and serial cmdline" - umount "$IMGDIR" - umount "$ISODIR" + umount_dirs } function test_ks_serial { @@ -95,8 +99,7 @@ function new_volid { test_volid status "Use a new VOLID" - umount "$IMGDIR" - umount "$ISODIR" + umount_dirs } function test_volid { @@ -118,8 +121,7 @@ function add_files { test_files status "Add files" - umount "$IMGDIR" - umount "$ISODIR" + umount_dirs } function test_files { @@ -139,8 +141,7 @@ function run_all { test_files status "Use all the options" - umount "$IMGDIR" - umount "$ISODIR" + umount_dirs }