]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
tests: ensure all osds are listening on the cluster network
authorAndrew Schoen <aschoen@redhat.com>
Tue, 6 Dec 2016 22:52:02 +0000 (16:52 -0600)
committerAndrew Schoen <aschoen@redhat.com>
Wed, 7 Dec 2016 16:36:07 +0000 (10:36 -0600)
Signed-off-by: Andrew Schoen <aschoen@redhat.com>
tests/conftest.py
tests/functional/tests/osd/test_osds.py

index ef87c6cc7d042ec637a799687a3fa378f4b9c01c..be43f6655c8c4c875acf57066c4b8ee3ae9aab12 100644 (file)
@@ -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
 
index f10985d1f571f80f5871eb1f77a3996fdde3bd41..c92282926d5a2be09eae60d8886230f5409ade30 100644 (file)
@@ -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"]: