]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
tests: return address and ansible vars from CephNode
authorAndrew Schoen <aschoen@redhat.com>
Sun, 4 Dec 2016 02:01:30 +0000 (20:01 -0600)
committerAndrew Schoen <aschoen@redhat.com>
Tue, 6 Dec 2016 20:56:18 +0000 (14:56 -0600)
Signed-off-by: Andrew Schoen <aschoen@redhat.com>
tests/conftest.py

index a51f7d940208cbed504378b9fdd9997cba120e0a..7611a62f503ce62391b572a5689b48ca72a5bd9d 100644 (file)
@@ -2,12 +2,21 @@ import pytest
 
 
 @pytest.fixture()
-def CephNode(Ansible, request):
+def CephNode(Ansible, Interface, request):
     vars = Ansible.get_variables()
     node_type = vars["group_names"][0]
     if not request.node.get_marker(node_type):
         pytest.skip("Not a valid test for node type")
 
+    # I can assume eth1 because I know all the vagrant
+    # boxes we test with use that interface
+    address = Interface("eth1").addresses[0]
+    data = dict(
+        address=address,
+        vars=vars,
+    )
+    return data
+
 
 def pytest_collection_modifyitems(session, config, items):
     for item in items: