Skip to content

Commit dd16e49

Browse files
committed
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 <gabrioux@redhat.com> (cherry picked from commit a12f67e) (cherry picked from commit 0221997)
1 parent 3ca2d7d commit dd16e49

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

tests/conftest.py

+4
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ def node(host, request):
104104
docker = ansible_vars.get("docker")
105105
dashboard = ansible_vars.get("dashboard_enabled", True)
106106
radosgw_num_instances = ansible_vars.get("radosgw_num_instances", 1)
107+
ceph_rbd_mirror_remote_user = ansible_vars.get('ceph_rbd_mirror_remote_user', '')
107108
ceph_release_num = {
108109
'jewel': 10,
109110
'kraken': 11,
@@ -128,6 +129,9 @@ def node(host, request):
128129
request.function, group_names)
129130
pytest.skip(reason)
130131

132+
if request.node.get_closest_marker('rbdmirror_secondary') and not ceph_rbd_mirror_remote_user: # noqa E501
133+
pytest.skip('Not a valid test for a non-secondary rbd-mirror node')
134+
131135
if request.node.get_closest_marker('ceph_crash') and group_names in [['nfss'], ['iscsigws'], ['clients'], ['monitoring']]:
132136
pytest.skip('Not a valid test for nfs, client or iscsigw nodes')
133137

tests/functional/tests/rbd-mirror/test_rbd_mirror.py

+3
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44

55
class TestRbdMirrors(object):
66

7+
@pytest.mark.rbdmirror_secondary
78
@pytest.mark.no_docker
89
def test_rbd_mirror_is_installed(self, node, host):
910
assert host.package("rbd-mirror").is_installed
1011

12+
@pytest.mark.rbdmirror_secondary
1113
def test_rbd_mirror_service_enabled_and_running(self, node, host):
1214
service_name = "ceph-rbd-mirror@rbd-mirror.{hostname}".format(
1315
hostname=node["vars"]["inventory_hostname"]
@@ -16,6 +18,7 @@ def test_rbd_mirror_service_enabled_and_running(self, node, host):
1618
assert s.is_enabled
1719
assert s.is_running
1820

21+
@pytest.mark.rbdmirror_secondary
1922
def test_rbd_mirror_is_up(self, node, host, setup):
2023
hostname = node["vars"]["inventory_hostname"]
2124
cluster = setup["cluster_name"]

0 commit comments

Comments
 (0)