From: Andrew Schoen Date: Tue, 6 Dec 2016 22:52:02 +0000 (-0600) Subject: tests: ensure all osds are listening on the cluster network X-Git-Tag: v2.1.0~26^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f5fb924189db8fb03019044d2b0a42a576a08d6c;p=ceph-ansible.git tests: ensure all osds are listening on the cluster network Signed-off-by: Andrew Schoen --- diff --git a/tests/conftest.py b/tests/conftest.py index ef87c6cc7..be43f6655 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -21,9 +21,14 @@ def node(Ansible, Interface, Command, request): pytest.skip("Scenario is not using journal collocation") osd_ids = [] + cluster_address = "" if node_type == "osds": result = Command.check_output('sudo ls /var/lib/ceph/osd/ | grep -oP "\d+$"') osd_ids = result.split("\n") + # I can assume eth2 because I know all the vagrant + # boxes we test with use that interface. OSDs are the only + # nodes that have this interface. + cluster_address = Interface("eth2").addresses[0] # I can assume eth1 because I know all the vagrant # boxes we test with use that interface @@ -42,6 +47,7 @@ def node(Ansible, Interface, Command, request): num_devices=num_devices, cluster_name=cluster_name, conf_path=conf_path, + cluster_address=cluster_address, ) return data diff --git a/tests/functional/tests/osd/test_osds.py b/tests/functional/tests/osd/test_osds.py index f10985d1f..c92282926 100644 --- a/tests/functional/tests/osd/test_osds.py +++ b/tests/functional/tests/osd/test_osds.py @@ -13,6 +13,15 @@ class TestOSDs(object): port=port, )).is_listening + def test_osds_listen_on_cluster_network(self, node, Socket): + # TODO: figure out way to paramaterize this test + for x in range(0, node["num_devices"] * 2): + port = "680{}".format(x) + assert Socket("tcp://{address}:{port}".format( + address=node["cluster_address"], + port=port, + )).is_listening + def test_osd_services_are_running(self, node, Service): # TODO: figure out way to paramaterize node['osd_ids'] for this test for osd_id in node["osd_ids"]: