From 73d5bdb987ddf2be99dcfe9a1511fc29f5a8edf4 Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Fri, 3 Oct 2014 16:12:12 +0200 Subject: [PATCH] tests: remove tests requiring osdmonitor_prepare_command Although they have been useful, their maintenance and fragility caused more trouble than their benefits. Signed-off-by: Loic Dachary (cherry picked from commit 038de0031bc0892359201012dafb82ac1b1a4d0f) --- src/test/mon/osd-crush.sh | 42 ----------------------- src/test/mon/osd-erasure-code-profile.sh | 32 ------------------ src/test/mon/osd-pool-create.sh | 43 ------------------------ 3 files changed, 117 deletions(-) diff --git a/src/test/mon/osd-crush.sh b/src/test/mon/osd-crush.sh index be4542bf70c7e..56c85735df2f9 100755 --- a/src/test/mon/osd-crush.sh +++ b/src/test/mon/osd-crush.sh @@ -74,20 +74,6 @@ function TEST_crush_rule_rm() { ! ./ceph osd crush rule ls | grep $ruleset || return 1 } -function TEST_crush_rule_create_simple_exists() { - local dir=$1 - local ruleset=ruleset2 - local root=default - local failure_domain=host - ./ceph osd erasure-code-profile ls - # add to the pending OSD map without triggering a paxos proposal - result=$(echo '{"prefix":"osdmonitor_prepare_command","prepare":"osd crush rule create-simple","name":"'$ruleset'","root":"'$root'","type":"'$failure_domain'"}' | nc -U $dir/a/ceph-mon.a.asok | cut --bytes=5-) - test $result = true || return 1 - ./ceph osd crush rule create-simple $ruleset $root $failure_domain 2>&1 | \ - grep "$ruleset already exists" || return 1 - ./ceph osd crush rule rm $ruleset || return 1 -} - function TEST_crush_rule_create_erasure() { local dir=$1 local ruleset=ruleset3 @@ -122,34 +108,6 @@ function TEST_crush_rule_create_erasure() { ! ./ceph osd crush rule ls | grep $ruleset || return 1 } -function TEST_crush_rule_create_erasure_exists() { - local dir=$1 - local ruleset=ruleset5 - ./ceph osd erasure-code-profile ls - # add to the pending OSD map without triggering a paxos proposal - result=$(echo '{"prefix":"osdmonitor_prepare_command","prepare":"osd crush rule create-erasure","name":"'$ruleset'"}' | nc -U $dir/a/ceph-mon.a.asok | cut --bytes=5-) - test $result = true || return 1 - ./ceph osd crush rule create-erasure $ruleset 2>&1 | \ - grep "$ruleset already exists" || return 1 - ./ceph osd crush rule rm $ruleset || return 1 -} - -function TEST_crush_rule_create_erasure_profile_default_exists() { - local dir=$1 - local ruleset=ruleset6 - ./ceph osd erasure-code-profile ls - ./ceph osd erasure-code-profile rm default || return 1 - ! ./ceph osd erasure-code-profile ls | grep default || return 1 - # add to the pending OSD map without triggering a paxos proposal - result=$(echo '{"prefix":"osdmonitor_prepare_command","prepare":"osd erasure-code-profile set","name":"default"}' | nc -U $dir/a/ceph-mon.a.asok | cut --bytes=5-) - test $result = true || return 1 - ./ceph osd crush rule create-erasure $ruleset || return 1 - CEPH_ARGS='' ./ceph --admin-daemon $dir/a/ceph-mon.a.asok log flush || return 1 - grep 'profile default already pending' $dir/a/log || return 1 - ./ceph osd crush rule rm $ruleset || return 1 - ./ceph osd erasure-code-profile ls | grep default || return 1 -} - function check_ruleset_id_match_rule_id() { local rule_name=$1 rule_id=`./ceph osd crush rule dump $rule_name | grep "\"rule_id\":" | awk -F ":|," '{print int($2)}'` diff --git a/src/test/mon/osd-erasure-code-profile.sh b/src/test/mon/osd-erasure-code-profile.sh index 6464a14d3e219..fd0cf73692e30 100755 --- a/src/test/mon/osd-erasure-code-profile.sh +++ b/src/test/mon/osd-erasure-code-profile.sh @@ -58,23 +58,6 @@ function SHARE_MON_TEST_set() { ./ceph osd erasure-code-profile rm $profile # cleanup } -function SHARE_MON_TEST_set_pending() { - local dir=$1 - local id=$2 - - # try again if the profile is pending - local profile=profile - ./ceph osd erasure-code-profile ls - # add to the pending OSD map without triggering a paxos proposal - result=$(echo '{"prefix":"osdmonitor_prepare_command","prepare":"osd erasure-code-profile set","name":"'$profile'"}' | nc -U $dir/$id/ceph-mon.$id.asok | cut --bytes=5-) - test $result = true || return 1 - ./ceph osd erasure-code-profile set $profile --force || return 1 - CEPH_ARGS='' ./ceph --admin-daemon $dir/$id/ceph-mon.$id.asok log flush || return 1 - grep "$profile try again" $dir/$id/log || return 1 - - ./ceph osd erasure-code-profile rm $profile # cleanup -} - function SHARE_MON_TEST_ls() { local dir=$1 local id=$2 @@ -111,21 +94,6 @@ function SHARE_MON_TEST_rm() { ./ceph osd erasure-code-profile rm $profile # cleanup } -function SHARE_MON_TEST_rm_pending() { - local dir=$1 - local id=$2 - - # try again if the profile is pending - local profile=myprofile - ./ceph osd erasure-code-profile ls - # add to the pending OSD map without triggering a paxos proposal - result=$(echo '{"prefix":"osdmonitor_prepare_command","prepare":"osd erasure-code-profile set","name":"'$profile'"}' | nc -U $dir/$id/ceph-mon.$id.asok | cut --bytes=5-) - test $result = true || return 1 - ./ceph osd erasure-code-profile rm $profile || return 1 - CEPH_ARGS='' ./ceph --admin-daemon $dir/$id/ceph-mon.$id.asok log flush || return 1 - grep "$profile: creation canceled" $dir/$id/log || return 1 -} - function SHARE_MON_TEST_get() { local dir=$1 local id=$2 diff --git a/src/test/mon/osd-pool-create.sh b/src/test/mon/osd-pool-create.sh index 6bd3ec0e9d3b4..cbcd65c7b8175 100755 --- a/src/test/mon/osd-pool-create.sh +++ b/src/test/mon/osd-pool-create.sh @@ -107,35 +107,6 @@ function TEST_erasure_crush_rule() { ! ./ceph osd pool create $poolname 12 12 erasure myprofile INVALIDRULESET || return 1 } -function TEST_erasure_crush_rule_pending() { - local dir=$1 - run_mon $dir a --public-addr 127.0.0.1 - ./ceph osd erasure-code-profile ls - # try again if the ruleset creation is pending - crush_ruleset=erasure_ruleset - # add to the pending OSD map without triggering a paxos proposal - result=$(echo '{"prefix":"osdmonitor_prepare_command","prepare":"osd crush rule create-erasure","name":"'$crush_ruleset'"}' | nc -U $dir/a/ceph-mon.a.asok | cut --bytes=5-) - test $result = true || return 1 - ./ceph osd pool create pool_erasure 12 12 erasure default $crush_ruleset || return 1 - CEPH_ARGS='' ./ceph --admin-daemon $dir/a/ceph-mon.a.asok log flush || return 1 - grep "$crush_ruleset try again" $dir/a/log || return 1 -} - -function TEST_simple_crush_rule_pending() { - local dir=$1 - run_mon $dir a --public-addr 127.0.0.1 - ./ceph osd erasure-code-profile ls - # try again if the ruleset creation is pending - crush_ruleset=simple_ruleset - ./ceph osd crush add-bucket host1 host - # add to the pending OSD map without triggering a paxos proposal - result=$(echo '{"prefix":"osdmonitor_prepare_command","prepare":"osd crush rule create-simple","name":"'$crush_ruleset'","root":"host1","type":"host"}' | nc -U $dir/a/ceph-mon.a.asok | cut --bytes=5-) - test $result = true || return 1 - ./ceph osd pool create pool_simple 12 12 replicated $crush_ruleset || return 1 - CEPH_ARGS='' ./ceph --admin-daemon $dir/a/ceph-mon.a.asok log flush || return 1 - grep "$crush_ruleset try again" $dir/a/log || return 1 -} - function TEST_erasure_code_profile_default() { local dir=$1 run_mon $dir a --public-addr 127.0.0.1 @@ -145,20 +116,6 @@ function TEST_erasure_code_profile_default() { ./ceph osd erasure-code-profile ls | grep default || return 1 } -function TEST_erasure_code_profile_default_pending() { - local dir=$1 - run_mon $dir a --public-addr 127.0.0.1 - ./ceph osd erasure-code-profile ls - ./ceph osd erasure-code-profile rm default || return 1 - ! ./ceph osd erasure-code-profile ls | grep default || return 1 - # add to the pending OSD map without triggering a paxos proposal - result=$(echo '{"prefix":"osdmonitor_prepare_command","prepare":"osd erasure-code-profile set","name":"default"}' | nc -U $dir/a/ceph-mon.a.asok | cut --bytes=5-) - test $result = true || return 1 - ./ceph osd pool create pool_erasure 12 12 erasure default || return 1 - CEPH_ARGS='' ./ceph --admin-daemon $dir/a/ceph-mon.a.asok log flush || return 1 - grep 'profile default already pending' $dir/a/log || return 1 -} - function TEST_erasure_crush_stripe_width() { local dir=$1 # the default stripe width is used to initialize the pool -- 2.47.3