]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test/mon/*: prime mon with initial command before injection
authorSage Weil <sage@redhat.com>
Thu, 28 Aug 2014 17:59:18 +0000 (10:59 -0700)
committerSage Weil <sage@redhat.com>
Thu, 28 Aug 2014 17:59:18 +0000 (10:59 -0700)
The osdmonitor_prepare_command is very fragile.  Send an initial command
to the mon beforehand.  This seems to prevent the initial command from
getting combined into an early mon proposal with some other stuff.

Alternatively, we could remove these tests and this mechanism entirely as
it is likely to great in the future when the next set of mon changes are
made, but they have shown themselves to be useful it catching other
regressions, so we'll patch them up for a bit longer.

Signed-off-by: Sage Weil <sage@redhat.com>
src/test/mon/osd-crush.sh
src/test/mon/osd-erasure-code-profile.sh
src/test/mon/osd-pool-create.sh

index 8f39a1a923a8f5541faf2b101d7a1fa486abdc4e..219c2613b996acfaaa318bd9e95c2d57245a5b7f 100755 (executable)
@@ -79,6 +79,7 @@ function TEST_crush_rule_create_simple_exists() {
     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
@@ -124,6 +125,7 @@ function TEST_crush_rule_create_erasure() {
 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
@@ -135,6 +137,7 @@ function TEST_crush_rule_create_erasure_exists() {
 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
index 32bca9bed0e420d5af68ffeda5f75cb5bf30f422..66d1868119b64a43bf066c581a5fd4b157b58ef1 100755 (executable)
@@ -64,6 +64,7 @@ function SHARE_MON_TEST_set_pending() {
 
     # 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
@@ -115,6 +116,7 @@ function SHARE_MON_TEST_rm_pending() {
 
     # 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
index 0e4811b41d732445dceb7229e2a45fc75fc6a77d..d9489904342c1ff36beda59b5d59deb39351af25 100755 (executable)
@@ -100,6 +100,7 @@ function TEST_erasure_crush_rule() {
 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
@@ -112,6 +113,7 @@ function TEST_erasure_crush_rule_pending() {
 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
@@ -135,6 +137,7 @@ function TEST_erasure_code_profile_default() {
 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