tests: adapt current testing for collocation scenario

Since we introduced collocation testing scenario, we need to adapt
current tests to this new scenario.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
pull/2014/head
Guillaume Abrioux 2017-10-09 13:48:03 +02:00 committed by Sébastien Han
parent 88a37ca990
commit a1ea6e7f59
2 changed files with 13 additions and 6 deletions

View File

@ -34,6 +34,8 @@ class TestMDSs(object):
hostname=node["vars"]["inventory_hostname"],
cluster=node["cluster_name"]
)
output = host.check_output(cmd)
daemons = json.loads(output)["fsmap"]["by_rank"][0]["name"]
assert hostname in daemons
output_raw = host.check_output(cmd)
output_json = json.loads(output_raw)
active_daemon = output_json["fsmap"]["by_rank"][0]["name"]
if active_daemon != hostname:
assert output_json['fsmap']['up:standby'] == 1

View File

@ -39,6 +39,11 @@ class TestMGRs(object):
hostname=node["vars"]["inventory_hostname"],
cluster=node["cluster_name"]
)
output = host.check_output(cmd)
daemons = json.loads(output)["mgrmap"]["active_name"]
assert hostname in daemons
output_raw = host.check_output(cmd)
output_json = json.loads(output_raw)
daemons = output_json['mgrmap']['active_name']
standbys = [i['name'] for i in output_json['mgrmap']['standbys']]
result = hostname in daemons
if not result:
result = hostname in standbys
assert result