From: James Nunez Date: Sat, 21 Dec 2013 03:13:19 +0000 (-0700) Subject: LU-2524 test: Modify tdir to be single directory X-Git-Tag: 2.5.54~9 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=a98d44e0439ad5b20d0d7f273b29e6ea990312f0 LU-2524 test: Modify tdir to be single directory Currently, the tdir variable is a directory with a subdirectory. This requires the '-p' option when calling mkdir. We've made tdir be a single directory so calls to mkdir and test_mkdir do not require the '-p' option in most cases. tdir was changed from d0.${TESTSUITE}/d${base} to d${testnum}.${TESTSUITE} and tfile was changed from f.${TESTSUITE}.${testnum} to f${testnum}.${TESTSUITE}. Now tdir and tfile are consistent in their format and the call to remove files and directories at the beginning of many test scripts will remove these files and directories. Once this patch lands, we can remove the "-p" option from many of the calls to mkdir. Signed-off-by: James Nunez Change-Id: Ib49d7102a49ff6b5f3ec539a5b2f2f5186231a04 Reviewed-on: http://review.whamcloud.com/8123 Reviewed-by: Andreas Dilger Tested-by: Jenkins Tested-by: Maloo Reviewed-by: wangdi --- diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index 898cebe..332f740 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -4683,34 +4683,35 @@ banner() { } # -# Run a single test function and cleanup after it. +# Run a single test function and cleanup after it. # # This function should be run in a subshell so the test func can # exit() without stopping the whole script. # run_one() { - local testnum=$1 - local message=$2 - tfile=f.${TESTSUITE}.${testnum} - export tdir=d0.${TESTSUITE}/d${base} - export TESTNAME=test_$testnum - local SAVE_UMASK=`umask` - umask 0022 - - banner "test $testnum: $message" - test_${testnum} || error "test_$testnum failed with $?" - cd $SAVE_PWD - reset_fail_loc - check_grant ${testnum} || error "check_grant $testnum failed with $?" - check_catastrophe || error "LBUG/LASSERT detected" + local testnum=$1 + local message=$2 + export tfile=f${testnum}.${TESTSUITE} + export tdir=d${testnum}.${TESTSUITE} + export TESTNAME=test_$testnum + local SAVE_UMASK=`umask` + umask 0022 + + banner "test $testnum: $message" + test_${testnum} || error "test_$testnum failed with $?" + cd $SAVE_PWD + reset_fail_loc + check_grant ${testnum} || error "check_grant $testnum failed with $?" + check_catastrophe || error "LBUG/LASSERT detected" if [ "$PARALLEL" != "yes" ]; then ps auxww | grep -v grep | grep -q multiop && error "multiop still running" fi - unset TESTNAME - unset tdir - umask $SAVE_UMASK - return 0 + unset TESTNAME + unset tdir + unset tfile + umask $SAVE_UMASK + return 0 } #