From aa99929e06d208d879b3325017546cc91d81996e Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Sat, 16 May 2015 11:26:08 +0200 Subject: [PATCH] tests: test/erasure-code/test-erasure-code.sh uses ceph-helpers.sh 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 --- src/test/erasure-code/test-erasure-code.sh | 28 ++++++++++------------ 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/src/test/erasure-code/test-erasure-code.sh b/src/test/erasure-code/test-erasure-code.sh index 5ba2f8fa04de..76e98ae5a187 100755 --- a/src/test/erasure-code/test-erasure-code.sh +++ b/src/test/erasure-code/test-erasure-code.sh @@ -17,11 +17,10 @@ # 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" -- 2.47.3