]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tests: test/erasure-code/test-erasure-code.sh uses ceph-helpers.sh
authorLoic Dachary <ldachary@redhat.com>
Sat, 16 May 2015 09:26:08 +0000 (11:26 +0200)
committerLoic Dachary <ldachary@redhat.com>
Sun, 17 May 2015 11:31:25 +0000 (13:31 +0200)
The ceph-helpers.sh was already included, along with
mon/mon-test-helpers.sh and osd/osd-test-helpers.sh which creates
confusion.

  * replace check_osd_status with wait_for_osd

  * modifying the .asok and .log names to match the ceph-helpers.sh
    conventions

Signed-off-by: Loic Dachary <ldachary@redhat.com>
src/test/erasure-code/test-erasure-code.sh

index 5ba2f8fa04de198c02d70662ef727061e6aa7856..76e98ae5a187118752376e99e6fe88a17adf9fde 100755 (executable)
 #
 
 source test/ceph-helpers.sh
-source test/mon/mon-test-helpers.sh
-source test/osd/osd-test-helpers.sh
 
 function run() {
     local dir=$1
+    shift
 
     export CEPH_MON="127.0.0.1:7101"
     export CEPH_ARGS
@@ -30,25 +29,24 @@ function run() {
     CEPH_ARGS+="--mon-host=$CEPH_MON "
 
     setup $dir || return 1
-    run_mon $dir a --public-addr $CEPH_MON || return 1
+    run_mon $dir a || return 1
     # check that erasure code plugins are preloaded
-    CEPH_ARGS='' ./ceph --admin-daemon $dir/a/ceph-mon.a.asok log flush || return 1
-    grep 'load: jerasure.*lrc' $dir/a/log || return 1
+    CEPH_ARGS='' ./ceph --admin-daemon $dir/ceph-mon.a.asok log flush || return 1
+    grep 'load: jerasure.*lrc' $dir/mon.a.log || return 1
     for id in $(seq 0 10) ; do
         run_osd $dir $id || return 1
     done
     wait_for_clean || return 1
     # check that erasure code plugins are preloaded
     CEPH_ARGS='' ./ceph --admin-daemon $dir/ceph-osd.0.asok log flush || return 1
-    grep 'load: jerasure.*lrc' $dir/osd-0.log || return 1
+    grep 'load: jerasure.*lrc' $dir/osd.0.log || return 1
     create_erasure_coded_pool ecpool || return 1
-    FUNCTIONS=${FUNCTIONS:-$(set | sed -n -e 's/^\(TEST_[0-9a-z_]*\) .*/\1/p')}
-    for TEST_function in $FUNCTIONS ; do
-        if ! $TEST_function $dir ; then
-            #cat $dir/a/log
-            return 1
-        fi
+
+    local funcs=${@:-$(set | sed -n -e 's/^\(TEST_[0-9a-z_]*\) .*/\1/p')}
+    for func in $funcs ; do
+        $func $dir || return 1
     done
+
     delete_pool ecpool || return 1
     teardown $dir || return 1
 }
@@ -167,7 +165,7 @@ function TEST_rados_put_get_isa() {
     ./ceph osd erasure-code-profile set profile-isa \
         plugin=isa \
         ruleset-failure-domain=osd || return 1
-    ./ceph osd pool create $poolname 12 12 erasure profile-isa \
+    ./ceph osd pool create $poolname 1 1 erasure profile-isa \
         || return 1
 
     rados_put_get $dir $poolname || return 1
@@ -343,7 +341,7 @@ function TEST_rados_get_dataeio_no_subreadall_jerasure() {
        CEPH_ARGS='' ./ceph --admin-daemon $dir/ceph-osd.${initial_osds[$shardid]}.asok config set \
             filestore_fail_eio false || return 1
        rados_put_get $dir $poolname $objname || return 1
-       check_osd_status ${initial_osds[$shardid]} "down" || return 1
+       wait_for_osd down ${initial_osds[$shardid]} || return 1
 
         # restart the crashed OSDs, note it could crash multiple OSDs,
         # since after the primary's crash, the second replica could be
@@ -441,7 +439,7 @@ function TEST_rados_get_dataeio_no_subreadall_jerasure() {
 #    ./ceph osd erasure-code-profile rm $profile
 #}
 
-main test-erasure-code
+main test-erasure-code "$@"
 
 # Local Variables:
 # compile-command: "cd ../.. ; make -j4 && test/erasure-code/test-erasure-code.sh"