[sheepdog] [PATCH 09/14] tests: use different directory for each test case

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Tue Apr 30 10:30:04 CEST 2013


With this patch, log files aren't removed by the succeeding tests, and
it makes it easier for us to look into the cause of errors.

Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 tests/check         | 1 +
 tests/common.config | 3 ++-
 tests/common.rc     | 4 ++--
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/tests/check b/tests/check
index 95c5a1d..b05c823 100755
--- a/tests/check
+++ b/tests/check
@@ -425,6 +425,7 @@ seq="check"
 
 for seq in $list
 do
+    STORE="$WD/$seq"
     err=false
     echo -n "$seq"
     if [ -n "$TESTS_REMAINING_LOG" ] ; then
diff --git a/tests/common.config b/tests/common.config
index 2196477..aae756f 100644
--- a/tests/common.config
+++ b/tests/common.config
@@ -73,7 +73,8 @@ export BC_PROG="`set_prog_path bc`"
 [ "$BC_PROG" = "" ] && _fatal "bc not found"
 
 export DRIVER=${DRIVER:-local}
-export STORE=${STORE:-/tmp/sheepdog}
+export WD=${WD:-/tmp/sheepdog}
+export STORE
 export SHEEP_PROG=${SHEEP_PROG:-../sheep/sheep}
 export SHEEP=${SHEEP:-$SHEEP_PROG}
 export COLLIE_PROG=${COLLIE_PROG:-../collie/collie}
diff --git a/tests/common.rc b/tests/common.rc
index de95fb0..a2de9de 100644
--- a/tests/common.rc
+++ b/tests/common.rc
@@ -288,7 +288,7 @@ _kill_all_collies()
 
 _kill_all_sheeps()
 {
-    pkill -9 -f "$SHEEP_PROG $STORE"
+    pkill -9 -f "$SHEEP_PROG $WD"
 
     _wait_for_sheep_stop
 }
@@ -384,7 +384,7 @@ _make_device()
 _cleanup_devices()
 {
     local d
-    for d in `mount | grep -o $STORE/. | sort | uniq`; do
+    for d in `mount | grep -o $WD/.../. | sort | uniq`; do
         umount -l $d
         rm -f $d.img
     done
-- 
1.8.1.3.566.gaa39828




More information about the sheepdog mailing list