From: Ruediger Meier Date: Wed, 7 Mar 2018 16:51:35 +0000 (+0100) Subject: tests: don't use unlocked resources X-Git-Tag: v2.32~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b0d9114a6160b23a65c545a4cd65cfba45c493ff;p=thirdparty%2Futil-linux.git tests: don't use unlocked resources The test-suite did not survive when flock timeouts after 30s because then ts_cleanup_on_exit() may use resources (e.g. rmmod scsi_debug) while not having the lock. Signed-off-by: Ruediger Meier --- diff --git a/tests/functions.sh b/tests/functions.sh index 02f9a94f7e..004ef0f3c4 100644 --- a/tests/functions.sh +++ b/tests/functions.sh @@ -512,6 +512,12 @@ function ts_cleanup_on_exit { done unset TS_LOOP_DEVS + # just informative warnings, currently not seen + for resource in "${!TS_LOCKFILE_FD[@]}"; do + test -n "${TS_LOCKFILE_FD["resource"]}" || continue + echo "[$$ $TS_TESTNAME] warning: found unlocked $resource" + done + ts_scsi_debug_rmmod } @@ -660,6 +666,7 @@ function ts_fstab_add { } function ts_fstab_clean { + ts_have_lock "fstab" || return 0 sed --in-place " /#