Skip to content

Commit

Permalink
testing: CephNode should return osd_ids
Browse files Browse the repository at this point in the history
This is an empty list on anything but an OSD node. These ids will be
used for further OSD testing.

Signed-off-by: Andrew Schoen <[email protected]>
  • Loading branch information
andrewschoen committed Dec 6, 2016
1 parent 0e7133c commit e13da73
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@


@pytest.fixture()
def CephNode(Ansible, Interface, request):
def CephNode(Ansible, Interface, Command, request):
vars = Ansible.get_variables()
node_type = vars["group_names"][0]
if not request.node.get_marker(node_type) and not request.node.get_marker('all'):
pytest.skip("Not a valid test for node type")

osd_ids = []
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 eth1 because I know all the vagrant
# boxes we test with use that interface
address = Interface("eth1").addresses[0]
Expand All @@ -16,6 +21,7 @@ def CephNode(Ansible, Interface, request):
address=address,
subnet=subnet,
vars=vars,
osd_ids=osd_ids,
)
return data

Expand Down

0 comments on commit e13da73

Please sign in to comment.