]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
tests: adapt current testing for collocation scenario
authorGuillaume Abrioux <gabrioux@redhat.com>
Mon, 9 Oct 2017 11:48:03 +0000 (13:48 +0200)
committerSébastien Han <seb@redhat.com>
Mon, 9 Oct 2017 15:25:45 +0000 (17:25 +0200)
Since we introduced collocation testing scenario, we need to adapt
current tests to this new scenario.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
tests/functional/tests/mds/test_mds.py
tests/functional/tests/mgr/test_mgr.py

index a8665868c4c5ee7645ad79493143783300e7b081..6e88b53b90bf3510b10d15a8a75cb37f34f147a9 100644 (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
index 146ac00620d143a37e8a7fd4307e924a68d9e66a..488c7ccb9c1bf6f42b702bf2577d8501606740c1 100644 (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