From 6a1fdb8f711df130b4d467f66299afbea09a0ed1 Mon Sep 17 00:00:00 2001 From: Oleg Drokin Date: Mon, 28 Mar 2016 14:54:12 -0400 Subject: [PATCH] LU-7931 tests: Allow per-subtest setup/cleanup This brings back ability to have per-subtest setup/cleanup logic. Most frequently used in the past as: SETUP=setup CLEANUP=cleanup sh sanity.sh to do unmount/remount of the whole stack after every test to better pinpoint memory/lock leacks and other accumulated behavior only visible at unmount. Change-Id: I13bf42ce56a6c1873c034a357ad3bdfbee5c6c1f Signed-off-by: Oleg Drokin --- lustre/tests/test-framework.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index eaa4878..8270f99 100755 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -4959,6 +4959,10 @@ run_one() { local SAVE_UMASK=`umask` umask 0022 + if ! grep -q $DIR /proc/mounts; then + $SETUP + fi + banner "test $testnum: $message" test_${testnum} || error "test_$testnum failed with $?" cd $SAVE_PWD @@ -4974,6 +4978,7 @@ run_one() { unset tdir unset tfile umask $SAVE_UMASK + $CLEANUP return 0 } -- 1.8.3.1