From: Guillaume Abrioux Date: Mon, 1 Aug 2022 21:12:13 +0000 (+0200) Subject: tests: skip rbdmirror tests on non-secondary daemon X-Git-Tag: v4.0.70.12~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9167e19b1cf5b9cc348257367d0c9cdc5e773299;p=ceph-ansible.git tests: skip rbdmirror tests on non-secondary daemon the daemon is not running on the 'primary' daemon. Therefore, these tests are not needed. Signed-off-by: Guillaume Abrioux (cherry picked from commit 37e67fb67253b3864a938e592b4a8e52d9a36d3f) --- diff --git a/tests/conftest.py b/tests/conftest.py index b22e43802..4baf457ef 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -106,6 +106,7 @@ def node(host, request): docker = ansible_vars.get("docker") dashboard = ansible_vars.get("dashboard_enabled", True) radosgw_num_instances = ansible_vars.get("radosgw_num_instances", 1) + ceph_rbd_mirror_remote_user = ansible_vars.get('ceph_rbd_mirror_remote_user', '') ceph_release_num = { 'jewel': 10, 'kraken': 11, @@ -127,7 +128,10 @@ def node(host, request): request.function, group_names) pytest.skip(reason) - if request.node.get_closest_marker('ceph_crash') and group_names in [['nfss'], ['iscsigws'], ['clients'], ['grafana-server']]: + if request.node.get_closest_marker('rbdmirror_secondary') and not ceph_rbd_mirror_remote_user: # noqa E501 + pytest.skip('Not a valid test for a non-secondary rbd-mirror node') + + if request.node.get_closest_marker('ceph_crash') and group_names in [['nfss'], ['iscsigws'], ['clients'], ['grafana-server']]: # noqa E501 pytest.skip('Not a valid test for nfs, client or iscsigw nodes') if request.node.get_closest_marker("no_docker") and docker: diff --git a/tests/functional/tests/rbd-mirror/test_rbd_mirror.py b/tests/functional/tests/rbd-mirror/test_rbd_mirror.py index f72d0a505..eb5b74981 100644 --- a/tests/functional/tests/rbd-mirror/test_rbd_mirror.py +++ b/tests/functional/tests/rbd-mirror/test_rbd_mirror.py @@ -4,10 +4,12 @@ import json class TestRbdMirrors(object): + @pytest.mark.rbdmirror_secondary @pytest.mark.no_docker def test_rbd_mirror_is_installed(self, node, host): assert host.package("rbd-mirror").is_installed + @pytest.mark.rbdmirror_secondary def test_rbd_mirror_service_enabled_and_running(self, node, host): service_name = "ceph-rbd-mirror@rbd-mirror.{hostname}".format( hostname=node["vars"]["inventory_hostname"] @@ -16,6 +18,7 @@ class TestRbdMirrors(object): assert s.is_enabled assert s.is_running + @pytest.mark.rbdmirror_secondary def test_rbd_mirror_is_up(self, node, host, setup): hostname = node["vars"]["inventory_hostname"] cluster = setup["cluster_name"]