Whamcloud - gitweb
LU-2524 test: Modify tdir to be single directory 23/8123/5
authorJames Nunez <james.a.nunez@intel.com>
Sat, 21 Dec 2013 03:13:19 +0000 (20:13 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Sat, 11 Jan 2014 02:24:23 +0000 (02:24 +0000)
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 <james.a.nunez@intel.com>
Change-Id: Ib49d7102a49ff6b5f3ec539a5b2f2f5186231a04
Reviewed-on: http://review.whamcloud.com/8123
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: wangdi <di.wang@intel.com>
lustre/tests/test-framework.sh

index 898cebe..332f740 100644 (file)
@@ -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() {
 #
 # 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
        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
 }
 
 #
 }
 
 #