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 <oleg.drokin@intel.com>
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
unset tdir
unset tfile
umask $SAVE_UMASK
+ $CLEANUP
return 0
}