From a1ea6e7f59599e0f98c4d378c27b787407f809a1 Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Mon, 9 Oct 2017 13:48:03 +0200 Subject: [PATCH] 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 --- tests/functional/tests/mds/test_mds.py | 8 +++++--- tests/functional/tests/mgr/test_mgr.py | 11 ++++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/tests/functional/tests/mds/test_mds.py b/tests/functional/tests/mds/test_mds.py index a8665868c..6e88b53b9 100644 --- a/tests/functional/tests/mds/test_mds.py +++ b/tests/functional/tests/mds/test_mds.py @@ -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 diff --git a/tests/functional/tests/mgr/test_mgr.py b/tests/functional/tests/mgr/test_mgr.py index 146ac0062..488c7ccb9 100644 --- a/tests/functional/tests/mgr/test_mgr.py +++ b/tests/functional/tests/mgr/test_mgr.py @@ -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 -- 2.39.5