tests: return address and ansible vars from CephNode

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
pull/1150/head
Andrew Schoen 2016-12-03 20:01:30 -06:00
parent b5552239e7
commit 05be43c546
1 changed files with 10 additions and 1 deletions

View File

@ -2,12 +2,21 @@ import pytest
@pytest.fixture() @pytest.fixture()
def CephNode(Ansible, request): def CephNode(Ansible, Interface, request):
vars = Ansible.get_variables() vars = Ansible.get_variables()
node_type = vars["group_names"][0] node_type = vars["group_names"][0]
if not request.node.get_marker(node_type): if not request.node.get_marker(node_type):
pytest.skip("Not a valid test for 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): def pytest_collection_modifyitems(session, config, items):
for item in items: for item in items: