qa: change mon_status calls to quorum_status or tell commands

The tests were doing logs of 'ceph mon_status'; change that to
quorum_status or tell.

Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Sage Weil 2019-10-11 09:28:01 -05:00
parent 6661fe0dd7
commit 70367de903
8 changed files with 17 additions and 16 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View 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):

View 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']]

View File

@ -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

View 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():

View File

@ -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