From 32ec53c728f77cf2fd1a68acb4c37abdea6c1a24 Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Thu, 11 Nov 2021 10:18:50 -0800 Subject: [PATCH] gating: Use lazy unmount --- tests/scripts/run_tests.sh | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/tests/scripts/run_tests.sh b/tests/scripts/run_tests.sh index 4894eb5..8cd29e9 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 }