]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
tests: support update scenarios in test_rbd_mirror_is_up()
authorGuillaume Abrioux <gabrioux@redhat.com>
Wed, 18 Jul 2018 09:07:49 +0000 (11:07 +0200)
committermergify[bot] <mergify[bot]@users.noreply.github.com>
Thu, 2 Aug 2018 10:06:55 +0000 (10:06 +0000)
`test_rbd_mirror_is_up()` is failing on update scenarios because it
assumes the `ceph_stable_release` is still set to the value of the
original ceph release, it means it won't enter in the right part of the
condition and fails.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit d8281e50f12eb299e2b419befab41cb7a0f39de2)

tests/conftest.py
tests/functional/tests/rbd-mirror/test_rbd_mirror.py
tox.ini

index 54b1535aa71688768785d5c542e0a5233d717a81..23fbdedcdb38a2e029325d47a9b7bb9ac0bf3b9a 100644 (file)
@@ -17,6 +17,7 @@ def node(host, request):
     # because testinfra does not collect and provide ansible config passed in
     # from using --extra-vars
     ceph_stable_release = os.environ.get("CEPH_STABLE_RELEASE", "luminous")
+    rolling_update = os.environ.get("ROLLING_UPDATE", "False")
     group_names = ansible_vars["group_names"]
     docker = ansible_vars.get("docker")
     osd_auto_discovery = ansible_vars.get("osd_auto_discovery")
@@ -119,6 +120,7 @@ def node(host, request):
         osds=osds,
         ceph_stable_release=ceph_stable_release,
         ceph_release_num=ceph_release_num,
+        rolling_update=rolling_update,
     )
     return data
 
index 9f0145d5acd37ca1846d94ec3627172975f52821..1f17462c7bf78415beef3841036f11a7a2a5c4b8 100644 (file)
@@ -64,6 +64,7 @@ class TestRbdMirrors(object):
         ceph_stable_release=node['ceph_stable_release']
         hostname=node["vars"]["inventory_hostname"]
         cluster=node["cluster_name"]
+        rolling_update=node["rolling_update"]
         daemons = []
         if node['docker']:
             docker_exec_cmd = 'docker exec ceph-rbd-mirror-{hostname}'.format(hostname=hostname)
@@ -79,7 +80,7 @@ class TestRbdMirrors(object):
         output = host.check_output(cmd)
         status = json.loads(output)
         daemon_ids = [i for i in status["servicemap"]["services"]["rbd-mirror"]["daemons"].keys() if i != "summary"]
-        if ceph_release_num[ceph_stable_release] > ceph_release_num['luminous']:
+        if ceph_release_num[ceph_stable_release] > ceph_release_num['luminous'] or (ceph_release_num[ceph_stable_release] == ceph_release_num['luminous'] and rolling_update=='True'):
             for daemon_id in daemon_ids:
                 daemons.append(status["servicemap"]["services"]["rbd-mirror"]["daemons"][daemon_id]["metadata"]["hostname"])
             result = hostname in daemons
diff --git a/tox.ini b/tox.ini
index 8f0708e8422555e93793cc90a9cab4bd4bfd5309..3bae45c74699463ad041570da339eaa4ff77f644 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -161,6 +161,8 @@ setenv=
   luminous: UPDATE_CEPH_DOCKER_IMAGE_TAG = latest
   lvm_osds: CEPH_STABLE_RELEASE = luminous
   bluestore_lvm_osds: CEPH_STABLE_RELEASE = luminous
+  update_cluster: ROLLING_UPDATE = True
+  update_docker_cluster: ROLLING_UPDATE = True
 deps= -r{toxinidir}/tests/requirements.txt
 changedir=
   # tests a 1 mon, 1 osd, 1 mds and 1 rgw xenial cluster using non-collocated OSD scenario