]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
qa: change mon_status calls to quorum_status or tell commands
authorSage Weil <sage@redhat.com>
Fri, 11 Oct 2019 14:28:01 +0000 (09:28 -0500)
committerSage Weil <sage@redhat.com>
Sat, 12 Oct 2019 17:05:36 +0000 (12:05 -0500)
The tests were doing logs of 'ceph mon_status'; change that to
quorum_status or tell.

Signed-off-by: Sage Weil <sage@redhat.com>
qa/standalone/ceph-helpers.sh
qa/standalone/mon/misc.sh
qa/standalone/mon/mon-bind.sh
qa/tasks/ceph_manager.py
qa/tasks/mgr/dashboard/helper.py
qa/workunits/cephtool/test.sh
qa/workunits/mon/caps.py
qa/workunits/mon/caps.sh

index 7b87556c5c7395b96ca5fe16a90303329b86a6a1..2b0dcd8c340c362ccd0f34470961689aaade081e 100755 (executable)
@@ -996,7 +996,7 @@ function wait_for_quorum() {
     fi
 
     if [[ -z "$quorumsize" ]]; then
-      timeout $timeout ceph mon_status --format=json >&/dev/null || return 1
+      timeout $timeout ceph quorum_status --format=json >&/dev/null || return 1
       return 0
     fi
 
@@ -1004,7 +1004,7 @@ function wait_for_quorum() {
     wait_until=$((`date +%s` + $timeout))
     while [[ $(date +%s) -lt $wait_until ]]; do
         jqfilter='.quorum | length == '$quorumsize
-        jqinput="$(timeout $timeout ceph mon_status --format=json 2>/dev/null)"
+        jqinput="$(timeout $timeout ceph quorum_status --format=json 2>/dev/null)"
         res=$(echo $jqinput | jq "$jqfilter")
         if [[ "$res" == "true" ]]; then
           no_quorum=0
index da847d579804dd1563fe811db301fddcb816c309..7eb6d97586ccde479cdf9123fbd4db3bd3479678 100755 (executable)
@@ -179,7 +179,7 @@ function TEST_mon_features() {
     timeout 120 ceph -s > /dev/null || return 1
 
     # expect monmap to contain 3 monitors (a, b, and c)
-    jqinput="$(ceph mon_status --format=json 2>/dev/null)"
+    jqinput="$(ceph quorum_status --format=json 2>/dev/null)"
     jq_success "$jqinput" '.monmap.mons | length == 3' || return 1
     # quorum contains two monitors
     jq_success "$jqinput" '.quorum | length == 2' || return 1
@@ -223,7 +223,7 @@ function TEST_mon_features() {
 
     timeout 300 ceph -s > /dev/null || return 1
 
-    jqinput="$(ceph mon_status --format=json 2>/dev/null)"
+    jqinput="$(ceph quorum_status --format=json 2>/dev/null)"
     # expect quorum to have all three monitors
     jqfilter='.quorum | length == 3'
     jq_success "$jqinput" "$jqfilter" || return 1
index 49b0079ace1cdd5b35d30f1f8438e9640a75e75c..b0a092a533abb6066c87d34d15bbb344319de4c3 100755 (executable)
@@ -102,7 +102,7 @@ function TEST_mon_quorum() {
     port_forward ${MONC_PUBLIC} ${MONC_BIND}
 
     # expect monmap to contain 3 monitors (a, b, and c)
-    jqinput="$(ceph mon_status --format=json 2>/dev/null)"
+    jqinput="$(ceph quorum_status --format=json 2>/dev/null)"
     jq_success "$jqinput" '.monmap.mons | length == 3' || return 1
 
     # quorum should form
index a635af3de5083726eb9d96ce88662dc71876e6bc..a42f2c7f1d8f37782fba1ef392001f7fdc47ac52 100644 (file)
@@ -2665,8 +2665,7 @@ class CephManager:
         """
         Extract all the monitor status information from the cluster
         """
-        addr = self.ctx.ceph[self.cluster].mons['mon.%s' % mon]
-        out = self.raw_cluster_cmd('-m', addr, 'mon_status')
+        out = self.raw_cluster_cmd('tell', 'mon.%s' % mon, 'mon_status')
         return json.loads(out)
 
     def get_mon_quorum(self):
index bd8183a3620343c466d4140b135d8786d383d474..90e5d61dc19b225d9a8eba6b0ccd28548b1e4822 100644 (file)
@@ -398,7 +398,7 @@ class DashboardTestCase(MgrTestCase):
 
     @classmethod
     def mons(cls):
-        out = cls.ceph_cluster.mon_manager.raw_cluster_cmd('mon_status')
+        out = cls.ceph_cluster.mon_manager.raw_cluster_cmd('quorum_status')
         j = json.loads(out)
         return [mon['name'] for mon in j['monmap']['mons']]
 
index 9aa31a24a1a1c5925278b746a57f89886f02e955..da4ad429fefd5fe35fa77de6113191f29757e3e4 100755 (executable)
@@ -1169,8 +1169,10 @@ function test_mon_mon()
   ceph mon dump
   ceph mon getmap -o $TEMP_DIR/monmap.$$
   [ -s $TEMP_DIR/monmap.$$ ]
+
   # ceph mon tell
-  ceph mon_status
+  first=$(ceph mon dump -f json | jq -r '.mons[0].name')
+  ceph tell mon.$first mon_status
 
   # test mon features
   ceph mon feature ls
index 7bc8c923920fced0b4f399139c6dbe88480e1d51..60bd09d74d7f216d1ba958ecf0fad6c47325f860 100644 (file)
@@ -343,9 +343,9 @@ def test_misc():
   expect_to_file(
       'ceph auth get-or-create client.caps mon \'allow command "auth caps"' \
           ' with entity="client.caps"\'', 0, k)
-  expect('ceph -n client.caps -k {kf} mon_status'.format(kf=k), errno.EACCES)
+  expect('ceph -n client.caps -k {kf} quorum_status'.format(kf=k), errno.EACCES)
   expect('ceph -n client.caps -k {kf} auth caps client.caps mon \'allow *\''.format(kf=k), 0)
-  expect('ceph -n client.caps -k {kf} mon_status'.format(kf=k), 0)
+  expect('ceph -n client.caps -k {kf} quorum_status'.format(kf=k), 0)
   destroy_keyring(k)
 
 def main():
index c5db5650031a242308e47378c8ae15930f478c31..5ccbcf036bec632b69d74500f57aa03bae1b64bd 100755 (executable)
@@ -33,12 +33,12 @@ expect()
 }
 
 expect "ceph auth get-or-create client.bazar > $tmp.bazar.keyring" 0
-expect "ceph -k $tmp.bazar.keyring --user bazar mon_status" 13
+expect "ceph -k $tmp.bazar.keyring --user bazar quorum_status" 13
 ceph auth del client.bazar
 
-c="'allow command \"auth ls\", allow command mon_status'"
+c="'allow command \"auth ls\", allow command quorum_status'"
 expect "ceph auth get-or-create client.foo mon $c > $tmp.foo.keyring" 0
-expect "ceph -k $tmp.foo.keyring --user foo mon_status" 0
+expect "ceph -k $tmp.foo.keyring --user foo quorum_status" 0
 expect "ceph -k $tmp.foo.keyring --user foo auth ls" 0
 expect "ceph -k $tmp.foo.keyring --user foo auth export" 13
 expect "ceph -k $tmp.foo.keyring --user foo auth del client.bazar" 13
@@ -57,9 +57,9 @@ export CEPH_ARGS=''
 expect "ceph -k $tmp.foo.keyring --user foo quorum_status" 13
 ceph auth del client.foo
 
-c="'allow command service with prefix=list, allow command mon_status'"
+c="'allow command service with prefix=list, allow command quorum_status'"
 expect "ceph auth get-or-create client.bar mon $c > $tmp.bar.keyring" 0
-expect "ceph -k $tmp.bar.keyring --user bar mon_status" 0
+expect "ceph -k $tmp.bar.keyring --user bar quorum_status" 0
 expect "ceph -k $tmp.bar.keyring --user bar auth ls" 13
 expect "ceph -k $tmp.bar.keyring --user bar auth export" 13
 expect "ceph -k $tmp.bar.keyring --user bar auth del client.foo" 13