]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tests: ceph-helpers.sh remove redundant setup in main
authorLoic Dachary <ldachary@redhat.com>
Sun, 17 May 2015 10:26:06 +0000 (12:26 +0200)
committerLoic Dachary <ldachary@redhat.com>
Sun, 17 May 2015 11:31:25 +0000 (13:31 +0200)
And add setup/teardown in tests that do not have it.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
src/test/ceph-helpers.sh
src/test/mon/mon-handle-forward.sh
src/test/osd/osd-bench.sh

index af14f4eb04ffc292acfde7975369277f3f17736c..58eea9bbebd19f56840a2af194c28491b273c714 100755 (executable)
@@ -1091,7 +1091,6 @@ function main() {
     export CEPH_CONF=/dev/null
     unset CEPH_ARGS
 
-    setup $dir || return 1
     local code
     if run $dir "$@" ; then
         code=0
index 54104207ccafadfd6e2a02cb5ca7b4c60231ab63..15fbdc561efedb5caf99f897a275b401414e4918 100755 (executable)
@@ -20,6 +20,8 @@ source test/ceph-helpers.sh
 function run() {
     local dir=$1
 
+    setup $dir || return 1
+
     MONA=127.0.0.1:7300
     MONB=127.0.0.1:7301
     (
@@ -51,6 +53,8 @@ function run() {
     features=$(sed -n -e 's|.*127.0.0.1:0.*accept features \([0-9][0-9]*\)|\1|p' < \
         $dir/mon.b.log)
     grep ' forward(mon_command(.*"POOL2".*con_features '$features $dir/mon.a.log
+
+    teardown $dir || return 1
 }
 
 main mon-handle-forward "$@"
index d99a92ad84f3a554af228c91b23fa52f00c0c59a..e40000f2046f3723aab55abb7e5a35798d7f0362 100755 (executable)
@@ -29,7 +29,9 @@ function run() {
 
     local funcs=${@:-$(set | sed -n -e 's/^\(TEST_[0-9a-z_]*\) .*/\1/p')}
     for func in $funcs ; do
+        setup $dir || return 1
         $func $dir || return 1
+        teardown $dir || return 1
     done
 }