]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/standalone/ceph-helpers: factor rbd pool create out of run_mon
authorSage Weil <sage@redhat.com>
Fri, 21 Jul 2017 22:01:23 +0000 (18:01 -0400)
committerSage Weil <sage@redhat.com>
Tue, 25 Jul 2017 02:11:50 +0000 (22:11 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
15 files changed:
qa/standalone/ceph-helpers.sh
qa/standalone/crush/crush-classes.sh
qa/standalone/erasure-code/test-erasure-code-plugins.sh
qa/standalone/erasure-code/test-erasure-code.sh
qa/standalone/erasure-code/test-erasure-eio.sh
qa/standalone/misc/rados-striper.sh
qa/standalone/mon/misc.sh
qa/standalone/mon/mon-bind.sh
qa/standalone/mon/osd-crush.sh
qa/standalone/osd/osd-copy-from.sh
qa/standalone/osd/osd-fast-mark-down.sh
qa/standalone/osd/osd-reuse-id.sh
qa/standalone/osd/osd-scrub-repair.sh
qa/standalone/osd/osd-scrub-snaps.sh
src/ceph-disk/tests/ceph-disk.sh

index 3c623681e0d07d43cb7cf8edacba54598948c53e..219e301942027b378155aa807eba77dad7982819 100755 (executable)
@@ -388,7 +388,7 @@ function test_kill_daemons() {
 # @param ... can be any option valid for ceph-mon
 # @return 0 on success, 1 on error
 #
-function run_mon_no_pool() {
+function run_mon() {
     local dir=$1
     shift
     local id=$1
@@ -420,6 +420,7 @@ function run_mon_no_pool() {
         --run-dir=$dir \
         --pid-file=$dir/\$name.pid \
        --mon-allow-pool-delete \
+       --mon-osd-backfillfull-ratio .99 \
         "$@" || return 1
 
     cat > $dir/ceph.conf <<EOF
@@ -429,35 +430,19 @@ mon host = $(get_config mon $id mon_host)
 EOF
 }
 
-function run_mon() {
-    local dir=$1
-    shift
-    local id=$1
-    shift
-
-    run_mon_no_pool $dir $id "$@" || return 1
-
-    ceph osd pool create rbd 8
-
-    if test -z "$(get_config mon $id mon_initial_members)" ; then
-        ceph osd pool delete rbd rbd --yes-i-really-really-mean-it || return 1
-        ceph osd pool create rbd $PG_NUM || return 1
-        ceph osd set-backfillfull-ratio .99
-       rbd pool init rbd
-    fi
-}
-
 function test_run_mon() {
     local dir=$1
 
     setup $dir || return 1
 
     run_mon $dir a --mon-initial-members=a || return 1
+    create_rbd_pool || return 1
     # rbd has not been deleted / created, hence it has pool id 0
     ceph osd dump | grep "pool 1 'rbd'" || return 1
     kill_daemons $dir || return 1
 
     run_mon $dir a || return 1
+    create_rbd_pool || return 1
     # rbd has been deleted / created, hence it does not have pool id 0
     ! ceph osd dump | grep "pool 1 'rbd'" || return 1
     local size=$(CEPH_ARGS='' ceph --format=json daemon $(get_asok_path mon.a) \
@@ -485,6 +470,12 @@ function test_run_mon() {
     teardown $dir || return 1
 }
 
+function create_rbd_pool() {
+    ceph osd pool delete rbd rbd --yes-i-really-really-mean-it || return 1
+    ceph osd pool create rbd $PG_NUM || return 1
+    rbd pool init rbd
+}
+
 #######################################################################
 
 function run_mgr() {
@@ -813,7 +804,9 @@ function test_get_osds() {
     run_mgr $dir x || return 1
     run_osd $dir 0 || return 1
     run_osd $dir 1 || return 1
+    create_rbd_pool || return 1
     wait_for_clean || return 1
+    create_rbd_pool || return 1
     get_osds rbd GROUP | grep --quiet '^[0-1] [0-1]$' || return 1
     teardown $dir || return 1
 }
@@ -879,6 +872,7 @@ function test_get_pg() {
     run_mon $dir a --osd_pool_default_size=1 || return 1
     run_mgr $dir x || return 1
     run_osd $dir 0 || return 1
+    create_rbd_pool || return 1
     wait_for_clean || return 1
     get_pg rbd GROUP | grep --quiet '^[0-9]\.[0-9a-f][0-9a-f]*$' || return 1
     teardown $dir || return 1
@@ -983,6 +977,7 @@ function test_get_primary() {
     local osd=0
     run_mgr $dir x || return 1
     run_osd $dir $osd || return 1
+    create_rbd_pool || return 1
     wait_for_clean || return 1
     test $(get_primary rbd GROUP) = $osd || return 1
     teardown $dir || return 1
@@ -1016,6 +1011,7 @@ function test_get_not_primary() {
     run_mgr $dir x || return 1
     run_osd $dir 0 || return 1
     run_osd $dir 1 || return 1
+    create_rbd_pool || return 1
     wait_for_clean || return 1
     local primary=$(get_primary rbd GROUP)
     local not_primary=$(get_not_primary rbd GROUP)
@@ -1073,6 +1069,7 @@ function test_objectstore_tool() {
     local osd=0
     run_mgr $dir x || return 1
     run_osd $dir $osd || return 1
+    create_rbd_pool || return 1
     wait_for_clean || return 1
     rados --pool rbd put GROUP /etc/group || return 1
     objectstore_tool $dir $osd GROUP get-bytes | \
@@ -1136,6 +1133,7 @@ function test_get_num_active_clean() {
     run_mon $dir a --osd_pool_default_size=1 || return 1
     run_mgr $dir x || return 1
     run_osd $dir 0 || return 1
+    create_rbd_pool || return 1
     wait_for_clean || return 1
     local num_active_clean=$(get_num_active_clean)
     test "$num_active_clean" = $PG_NUM || return 1
@@ -1162,6 +1160,7 @@ function test_get_num_pgs() {
     run_mon $dir a --osd_pool_default_size=1 || return 1
     run_mgr $dir x || return 1
     run_osd $dir 0 || return 1
+    create_rbd_pool || return 1
     wait_for_clean || return 1
     local num_pgs=$(get_num_pgs)
     test "$num_pgs" -gt 0 || return 1
@@ -1191,6 +1190,7 @@ function test_get_osd_id_used_by_pgs() {
     run_mon $dir a --osd_pool_default_size=1 || return 1
     run_mgr $dir x || return 1
     run_osd $dir 0 || return 1
+    create_rbd_pool || return 1
     wait_for_clean || return 1
     local osd_ids=$(get_osd_id_used_by_pgs | uniq)
     test "$osd_ids" = "0" || return 1
@@ -1232,6 +1232,7 @@ function test_wait_osd_id_used_by_pgs() {
     run_mon $dir a --osd_pool_default_size=1 || return 1
     run_mgr $dir x || return 1
     run_osd $dir 0 || return 1
+    create_rbd_pool || return 1
     wait_for_clean || return 1
     wait_osd_id_used_by_pgs 0 8 || return 1
     ! TIMEOUT=1 wait_osd_id_used_by_pgs 123 5 || return 1
@@ -1263,6 +1264,7 @@ function test_get_last_scrub_stamp() {
     run_mon $dir a --osd_pool_default_size=1 || return 1
     run_mgr $dir x || return 1
     run_osd $dir 0 || return 1
+    create_rbd_pool || return 1
     wait_for_clean || return 1
     stamp=$(get_last_scrub_stamp 2.0)
     test -n "$stamp" || return 1
@@ -1290,6 +1292,7 @@ function test_is_clean() {
     run_mon $dir a --osd_pool_default_size=1 || return 1
     run_mgr $dir x || return 1
     run_osd $dir 0 || return 1
+    create_rbd_pool || return 1
     wait_for_clean || return 1
     is_clean || return 1
     teardown $dir || return 1
@@ -1388,6 +1391,7 @@ function test_wait_for_clean() {
     setup $dir || return 1
     run_mon $dir a --osd_pool_default_size=1 || return 1
     run_mgr $dir x || return 1
+    create_rbd_pool || return 1
     ! TIMEOUT=1 wait_for_clean || return 1
     run_osd $dir 0 || return 1
     wait_for_clean || return 1
@@ -1460,6 +1464,7 @@ function test_repair() {
     run_mon $dir a --osd_pool_default_size=1 || return 1
     run_mgr $dir x || return 1
     run_osd $dir 0 || return 1
+    create_rbd_pool || return 1
     wait_for_clean || return 1
     repair 2.0 || return 1
     kill_daemons $dir KILL osd || return 1
@@ -1499,6 +1504,7 @@ function test_pg_scrub() {
     run_mon $dir a --osd_pool_default_size=1 || return 1
     run_mgr $dir x || return 1
     run_osd $dir 0 || return 1
+    create_rbd_pool || return 1
     wait_for_clean || return 1
     pg_scrub 2.0 || return 1
     kill_daemons $dir KILL osd || return 1
@@ -1590,6 +1596,7 @@ function test_wait_for_scrub() {
     run_mon $dir a --osd_pool_default_size=1 || return 1
     run_mgr $dir x || return 1
     run_osd $dir 0 || return 1
+    create_rbd_pool || return 1
     wait_for_clean || return 1
     local pgid=2.0
     ceph pg repair $pgid
@@ -1781,6 +1788,7 @@ function test_flush_pg_stats()
     run_mon $dir a --osd_pool_default_size=1 || return 1
     run_mgr $dir x || return 1
     run_osd $dir 0 || return 1
+    create_rbd_pool || return 1
     rados -p rbd put obj /etc/group
     flush_pg_stats
     local jq_filter='.pools | .[] | select(.name == "rbd") | .stats'
index b674acfe4f00cda29b555c53e319f7d1c1de6238..1cbc6f5f7a8a1c090a9f6c18ea0eb26ef70553c6 100755 (executable)
@@ -64,6 +64,7 @@ function TEST_classes() {
     run_osd $dir 0 || return 1
     run_osd $dir 1 || return 1
     run_osd $dir 2 || return 1
+    create_rbd_pool || return 1
 
     test "$(get_osds_up rbd SOMETHING)" == "1 2 0" || return 1
     add_something $dir SOMETHING || return 1
index 2f7ef3afa8a8bb387b6c31621c9e99febe0a18ef..26aff64aa1a1afc58967ffeac0bad2c90d0bf31a 100755 (executable)
@@ -96,6 +96,7 @@ function TEST_ec_profile_warning() {
     for id in $(seq 0 2) ; do
         run_osd $dir $id || return 1
     done
+    create_rbd_pool || return 1
     wait_for_clean || return 1
 
     for plugin in ${legacy_jerasure_plugins[*]}; do
index c97762e46284c32486d48356aa5975fccc5499d3..95126ead058586f76646fc9091fdcfbc14644d49 100755 (executable)
@@ -36,6 +36,7 @@ function run() {
     for id in $(seq 0 10) ; do
         run_osd $dir $id || return 1
     done
+    create_rbd_pool || return 1
     wait_for_clean || return 1
     # check that erasure code plugins are preloaded
     CEPH_ARGS='' ceph --admin-daemon $(get_asok_path osd.0) log flush || return 1
index 60069ddab74dcc0b3aafe386ec90daafd3f2385e..678088e94140879710559f8d0a673069aeea18d2 100755 (executable)
@@ -32,6 +32,8 @@ function run() {
         setup $dir || return 1
         run_mon $dir a || return 1
        run_mgr $dir x || return 1
+       create_rbd_pool || return 1
+
         # check that erasure code plugins are preloaded
         CEPH_ARGS='' ceph --admin-daemon $(get_asok_path mon.a) log flush || return 1
         grep 'load: jerasure.*lrc' $dir/mon.a.log || return 1
index 2844a5930c3d7b990803276beac708bb8d5655b2..03151531cd8d59ce8b1e3cad31315b6fb4d8c510 100755 (executable)
@@ -33,6 +33,7 @@ function run() {
     run_osd $dir 0 || return 1
     run_osd $dir 1 || return 1
     run_osd $dir 2 || return 1
+    create_rbd_pool || return 1
 
     # create toyfile
     dd if=/dev/urandom of=$dir/toyfile bs=1234 count=1
index bd0aa1c3650808f0c521f152e5cc23062fb66e9a..8abf6c5b125c469baeafd864d28dc2243db00852 100755 (executable)
@@ -39,6 +39,7 @@ function TEST_osd_pool_get_set() {
 
     setup $dir || return 1
     run_mon $dir a || return 1
+    create_rbd_pool || return 1
     ceph osd pool create $TEST_POOL 8
 
     local flag
index c0e0e0142feb7f33dd92bce07a39ede2c66ae854..f87157c78abb4cecbe2def20ad1f99f0fb3167c2 100755 (executable)
@@ -62,7 +62,7 @@ function TEST_mon_client_connect_fails() {
     # from the public-addr.
     CEPH_ARGS+="--mon-initial-members=a "
     CEPH_ARGS+="--mon-host=${MON_IP}:${MONA_PUBLIC} "
-    run_mon_no_pool $dir a --mon-host=${MON_IP}:${MONA_PUBLIC} --public-bind-addr=${MON_IP}:${MONA_BIND} || return 1
+    run_mon $dir a --mon-host=${MON_IP}:${MONA_PUBLIC} --public-bind-addr=${MON_IP}:${MONA_BIND} || return 1
 
     # now attempt to ping it that should fail.
     timeout 3 ceph ping mon.a || return 0
@@ -76,7 +76,7 @@ function TEST_mon_client_connect() {
     # from the public-addr.
     CEPH_ARGS+="--mon-initial-members=a "
     CEPH_ARGS+="--mon-host=${MON_IP}:${MONA_PUBLIC} "
-    run_mon_no_pool $dir a --mon-host=${MON_IP}:${MONA_PUBLIC} --public-bind-addr=${MON_IP}:${MONA_BIND} || return 1
+    run_mon $dir a --mon-host=${MON_IP}:${MONA_PUBLIC} --public-bind-addr=${MON_IP}:${MONA_BIND} || return 1
 
     # now forward the public port to the bind port.
     port_forward ${MONA_PUBLIC} ${MONA_BIND}
@@ -92,9 +92,9 @@ function TEST_mon_quorum() {
     # from the public-addr.
     CEPH_ARGS+="--mon-initial-members=a,b,c "
     CEPH_ARGS+="--mon-host=${MON_IP}:${MONA_PUBLIC},${MON_IP}:${MONB_PUBLIC},${MON_IP}:${MONC_PUBLIC} "
-    run_mon_no_pool $dir a --public-addr=${MON_IP}:${MONA_PUBLIC} --public-bind-addr=${MON_IP}:${MONA_BIND} || return 1
-    run_mon_no_pool $dir b --public-addr=${MON_IP}:${MONB_PUBLIC} --public-bind-addr=${MON_IP}:${MONB_BIND} || return 1
-    run_mon_no_pool $dir c --public-addr=${MON_IP}:${MONC_PUBLIC} --public-bind-addr=${MON_IP}:${MONC_BIND} || return 1
+    run_mon $dir a --public-addr=${MON_IP}:${MONA_PUBLIC} --public-bind-addr=${MON_IP}:${MONA_BIND} || return 1
+    run_mon $dir b --public-addr=${MON_IP}:${MONB_PUBLIC} --public-bind-addr=${MON_IP}:${MONB_BIND} || return 1
+    run_mon $dir c --public-addr=${MON_IP}:${MONC_PUBLIC} --public-bind-addr=${MON_IP}:${MONC_BIND} || return 1
 
     # now forward the public port to the bind port.
     port_forward ${MONA_PUBLIC} ${MONA_BIND}
@@ -119,9 +119,9 @@ function TEST_put_get() {
     # from the public-addr.
     CEPH_ARGS+="--mon-initial-members=a,b,c "
     CEPH_ARGS+="--mon-host=${MON_IP}:${MONA_PUBLIC},${MON_IP}:${MONB_PUBLIC},${MON_IP}:${MONC_PUBLIC} "
-    run_mon_no_pool $dir a --public-addr=${MON_IP}:${MONA_PUBLIC} --public-bind-addr=${MON_IP}:${MONA_BIND} || return 1
-    run_mon_no_pool $dir b --public-addr=${MON_IP}:${MONB_PUBLIC} --public-bind-addr=${MON_IP}:${MONB_BIND} || return 1
-    run_mon_no_pool $dir c --public-addr=${MON_IP}:${MONC_PUBLIC} --public-bind-addr=${MON_IP}:${MONC_BIND} || return 1
+    run_mon $dir a --public-addr=${MON_IP}:${MONA_PUBLIC} --public-bind-addr=${MON_IP}:${MONA_BIND} || return 1
+    run_mon $dir b --public-addr=${MON_IP}:${MONB_PUBLIC} --public-bind-addr=${MON_IP}:${MONB_BIND} || return 1
+    run_mon $dir c --public-addr=${MON_IP}:${MONC_PUBLIC} --public-bind-addr=${MON_IP}:${MONC_BIND} || return 1
 
     # now forward the public port to the bind port.
     port_forward ${MONA_PUBLIC} ${MONA_BIND}
index cc754af2cf181dcdf610763b3cdab9c4a82a0e47..747e30db5ae0cff59795d293b1dca31c8a304c67 100755 (executable)
@@ -213,6 +213,7 @@ function TEST_crush_reject_empty() {
     run_mon $dir a || return 1
     # should have at least one OSD
     run_osd $dir 0 || return 1
+    create_rbd_pool || return 1
 
     local empty_map=$dir/empty_map
     :> $empty_map.txt
index 37851fab9a6fc0a12ee78f7237440d974c03d5ed..3dcb0a8fa52a37a802759ca81be7ccbdf9ee472e 100755 (executable)
@@ -43,6 +43,7 @@ function TEST_copy_from() {
     run_mgr $dir x || return 1
     run_osd $dir 0 || return 1
     run_osd $dir 1 || return 1
+    create_rbd_pool || return 1
 
     # success
     rados -p rbd put foo $(which rados)
index 3d27930e6e6e994f98f7076ea3049e8eb1da308a..3b8e5a31b50013ca8c4ebe24303773f34f7d9d0d 100755 (executable)
@@ -77,6 +77,8 @@ function test_fast_kill() {
      pids[$oi]=$(cat $dir/osd.$oi.pid)
    done
 
+   create_rbd_pool || return 1
+
    # make some objects so osds to ensure connectivity between osds
    rados -p rbd bench 10 write -b 4096 --max-objects 128 --no-cleanup
    sleep 1
index 04666e1b634f7e35298adf942e4a1741aebca0b4..807c0abe5cb4c2ea8af378fe9764787292f39d62 100755 (executable)
@@ -39,6 +39,7 @@ function TEST_reuse_id() {
     run_mgr $dir x || return 1
     run_osd $dir 0 || return 1
     run_osd $dir 1 || return 1
+    create_rbd_pool || return 1
     wait_for_clean || return 1
     destroy_osd $dir 1 || return 1
     run_osd $dir 1 || return 1
index 9b3083b05ab322df70286983ed47574b4c111cfa..26c7772613fc4715d01e8369aae75fe833904fff 100755 (executable)
@@ -83,6 +83,7 @@ function TEST_corrupt_and_repair_replicated() {
     run_mgr $dir x || return 1
     run_osd $dir 0 || return 1
     run_osd $dir 1 || return 1
+    create_rbd_pool || return 1
     wait_for_clean || return 1
 
     add_something $dir $poolname || return 1
@@ -213,6 +214,7 @@ function auto_repair_erasure_coded() {
             run_osd $dir $id $ceph_osd_args || return 1
        fi
     done
+    create_rbd_pool || return 1
     wait_for_clean || return 1
 
     # Create an EC pool
@@ -265,6 +267,7 @@ function corrupt_and_repair_jerasure() {
             run_osd $dir $id || return 1
        fi
     done
+    create_rbd_pool || return 1
     wait_for_clean || return 1
 
     create_ec_pool $poolname $allow_overwrites k=2 m=2 || return 1
@@ -298,6 +301,7 @@ function corrupt_and_repair_lrc() {
             run_osd $dir $id || return 1
        fi
     done
+    create_rbd_pool || return 1
     wait_for_clean || return 1
 
     create_ec_pool $poolname $allow_overwrites k=4 m=2 l=3 plugin=lrc || return 1
@@ -332,6 +336,7 @@ function unfound_erasure_coded() {
             run_osd $dir $id || return 1
        fi
     done
+    create_rbd_pool || return 1
     wait_for_clean || return 1
 
     create_ec_pool $poolname $allow_overwrites k=2 m=2 || return 1
@@ -402,6 +407,7 @@ function list_missing_erasure_coded() {
             run_osd $dir $id || return 1
        fi
     done
+    create_rbd_pool || return 1
     wait_for_clean || return 1
 
     create_ec_pool $poolname $allow_overwrites k=2 m=1 || return 1
@@ -436,6 +442,7 @@ function list_missing_erasure_coded() {
     for id in $(seq 0 2) ; do
         activate_osd $dir $id >&2 || return 1
     done
+    create_rbd_pool || return 1
     wait_for_clean || return 1
 
     # Get get - both objects should in the same PG
@@ -477,6 +484,7 @@ function TEST_corrupt_scrub_replicated() {
     run_mgr $dir x || return 1
     run_osd $dir 0 || return 1
     run_osd $dir 1 || return 1
+    create_rbd_pool || return 1
     wait_for_clean || return 1
 
     ceph osd pool create $poolname 1 1 || return 1
@@ -1605,6 +1613,7 @@ function corrupt_scrub_erasure() {
             run_osd $dir $id || return 1
        fi
     done
+    create_rbd_pool || return 1
     wait_for_clean || return 1
 
     create_ec_pool $poolname $allow_overwrites k=2 m=1 stripe_unit=2K --force || return 1
@@ -2535,6 +2544,7 @@ function TEST_periodic_scrub_replicated() {
     local ceph_osd_args="--osd-scrub-interval-randomize-ratio=0 --osd-deep-scrub-randomize-ratio=0"
     run_osd $dir 0 $ceph_osd_args || return 1
     run_osd $dir 1 $ceph_osd_args || return 1
+    create_rbd_pool || return 1
     wait_for_clean || return 1
 
     ceph osd pool create $poolname 1 1 || return 1
index 4ddd08eb68dfc434010293756eabc09dec73814f..020363683e94afb3f7af881ff7c4ff7989b2d6f2 100755 (executable)
@@ -42,6 +42,7 @@ function TEST_scrub_snaps() {
     run_mgr $dir x || return 1
     run_osd $dir 0 || return 1
 
+    create_rbd_pool || return 1
     wait_for_clean || return 1
 
     # Create a pool with a single pg
@@ -153,6 +154,7 @@ function TEST_scrub_snaps() {
     rm -f $dir/bad
 
     run_osd $dir 0 || return 1
+    create_rbd_pool || return 1
     wait_for_clean || return 1
 
     local pgid="${poolid}.0"
index de349f95d27a5042bf09b2049abe15144664d4ea..511d600941e2ac2c8e07922bd6e23bab58b97835 100755 (executable)
@@ -171,6 +171,7 @@ function test_mark_init() {
     shift
 
     run_mon $dir a
+    create_rbd_pool
 
     local osd_data=$dir/dir
     $mkdir -p $osd_data
@@ -292,6 +293,7 @@ function test_reuse_osd_id() {
 
     run_mon $dir a || return 1
     run_mgr $dir x || return 1
+    create_rbd_pool
 
     test_activate $dir $dir/dir1 --osd-uuid $(uuidgen) || return 1
 
@@ -335,6 +337,7 @@ function test_activate_dir() {
 
     run_mon $dir a || return 1
     run_mgr $dir x || return 1
+    create_rbd_pool
     $@
 
     test_activate $dir $dir/dir || return 1
@@ -345,6 +348,7 @@ function test_activate_dir_bluestore() {
 
     run_mon $dir a || return 1
     run_mgr $dir x || return 1
+    create_rbd_pool
 
     local osd_data=$dir/dir
     $mkdir -p $osd_data
@@ -416,6 +420,7 @@ function test_crush_device_class() {
     shift
 
     run_mon $dir a
+    create_rbd_pool
 
     local osd_data=$dir/dir
     $mkdir -p $osd_data