From 9975e4daa482c2a4ca3d46b0294a7e4136ece647 Mon Sep 17 00:00:00 2001
From: grev <grev>
Date: Tue, 12 Feb 2008 14:04:55 +0000
Subject: [PATCH] b=13979 i=Adilger

change tdir to start from d0 to be cleaned up automatically
---
 lustre/tests/recovery-small.sh    | 1 -
 lustre/tests/replay-dual.sh       | 1 -
 lustre/tests/replay-ost-single.sh | 1 -
 lustre/tests/replay-single.sh     | 1 -
 lustre/tests/sanity.sh            | 2 +-
 lustre/tests/test-framework.sh    | 5 ++---
 6 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/lustre/tests/recovery-small.sh b/lustre/tests/recovery-small.sh
index 6014d52748..2db107c920 100755
--- a/lustre/tests/recovery-small.sh
+++ b/lustre/tests/recovery-small.sh
@@ -23,7 +23,6 @@ SETUP=${SETUP:-""}
 CLEANUP=${CLEANUP:-""}
 
 cleanup_and_setup_lustre
-rm -rf $DIR/${TESTSUITE}/[df][0-9]* # bug 13798 new t-f tdir staff
 rm -rf $DIR/[df][0-9]*
 
 test_1() {
diff --git a/lustre/tests/replay-dual.sh b/lustre/tests/replay-dual.sh
index a6aae0d5fc..a367d95e00 100755
--- a/lustre/tests/replay-dual.sh
+++ b/lustre/tests/replay-dual.sh
@@ -24,7 +24,6 @@ init_test_env $@
 build_test_filter
 
 cleanup_and_setup_lustre
-rm -rf $DIR/${TESTSUITE}/[df][0-9]* # bug 13798 new t-f tdir staff
 rm -rf $DIR/[df][0-9]*
 
 [ "$DAEMONFILE" ] && $LCTL debug_daemon start $DAEMONFILE $DAEMONSIZE
diff --git a/lustre/tests/replay-ost-single.sh b/lustre/tests/replay-ost-single.sh
index f0da27e437..ffa8dbd8b8 100755
--- a/lustre/tests/replay-ost-single.sh
+++ b/lustre/tests/replay-ost-single.sh
@@ -30,7 +30,6 @@ OSTCOUNT=1
 build_test_filter
 
 REFORMAT=--reformat cleanup_and_setup_lustre
-rm -rf $DIR/${TESTSUITE}/[df][0-9]* # bug 13798 new t-f tdir staff
 rm -rf $DIR/[df][0-9]*
 
 test_0a() {
diff --git a/lustre/tests/replay-single.sh b/lustre/tests/replay-single.sh
index 4f1d050146..afae2aa391 100755
--- a/lustre/tests/replay-single.sh
+++ b/lustre/tests/replay-single.sh
@@ -30,7 +30,6 @@ cleanup_and_setup_lustre
 
 mkdir -p $DIR
 
-rm -rf $DIR/${TESTSUITE}/[df][0-9]* # bug 13798 new t-f tdir staff
 rm -rf $DIR/[df][0-9]*
 
 test_0() {
diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh
index 17eeb904ac..78ebb54b10 100644
--- a/lustre/tests/sanity.sh
+++ b/lustre/tests/sanity.sh
@@ -126,7 +126,7 @@ MAXFREE=${MAXFREE:-$((200000 * $OSTCOUNT))}
 
 [ -f $DIR/d52a/foo ] && chattr -a $DIR/d52a/foo
 [ -f $DIR/d52b/foo ] && chattr -i $DIR/d52b/foo
-rm -rf $DIR/[Rdfs][1-9]*
+rm -rf $DIR/[Rdfs][0-9]*
 
 # $RUNAS_ID may get set incorrectly somewhere else
 [ $UID -eq 0 -a $RUNAS_ID -eq 0 ] && error "\$RUNAS_ID set to 0, but \$UID is also 0!"
diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh
index 2a02950274..c6f7e02665 100644
--- a/lustre/tests/test-framework.sh
+++ b/lustre/tests/test-framework.sh
@@ -1002,8 +1002,7 @@ cleanup_and_setup_lustre() {
 
 check_and_cleanup_lustre() {
     if [ "`mount | grep $MOUNT`" ]; then
-        rm -rf $DIR/[Rdfs][0-9]*
-        rm -f $DIR/${TESTSUITE}/[Rdfs][1-9]*
+        [ -n "$DIR" ] && rm -rf $DIR/[Rdfs][0-9]*
     fi
     if [ "$I_MOUNTED" = "yes" ]; then
         cleanupall -f || error "cleanup failed"
@@ -1328,7 +1327,7 @@ run_one() {
     testnum=$1
     message=$2
     tfile=f${testnum}
-    export tdir=d${TESTSUITE}/d${base}
+    export tdir=d0.${TESTSUITE}/d${base}
     local SAVE_UMASK=`umask`
     umask 0022
     mkdir -p $DIR/$tdir
-- 
GitLab