tests: adds an osds parameter to the node fixture

The osds are named differently for systemd in containerized deployments
so this new parameter is used to make that change transparent in the
tests.

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
pull/1150/head
Andrew Schoen 2016-12-07 19:24:40 -06:00
parent ae18b2db65
commit 6baf2192cd
2 changed files with 11 additions and 6 deletions

View File

@ -25,6 +25,7 @@ def node(Ansible, Interface, Command, request):
pytest.skip("Scenario is not using journal collocation")
osd_ids = []
osds = []
cluster_address = ""
if node_type == "osds":
result = Command.check_output('sudo ls /var/lib/ceph/osd/ | grep -oP "\d+$"')
@ -33,6 +34,9 @@ def node(Ansible, Interface, Command, request):
# boxes we test with use that interface. OSDs are the only
# nodes that have this interface.
cluster_address = Interface("eth2").addresses[0]
osds = osd_ids
if docker:
osds = [device.split("/")[-1] for device in ansible_vars["devices"]]
# I can assume eth1 because I know all the vagrant
# boxes we test with use that interface
@ -57,6 +61,7 @@ def node(Ansible, Interface, Command, request):
conf_path=conf_path,
cluster_address=cluster_address,
docker=docker,
osds=osds,
)
return data

View File

@ -26,14 +26,14 @@ class TestOSDs(object):
)).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"]:
assert Service("ceph-osd@%s" % osd_id).is_running
# TODO: figure out way to paramaterize node['osds'] for this test
for osd in node["osds"]:
assert Service("ceph-osd@%s" % osd).is_running
def test_osd_services_are_enabled(self, node, Service):
# TODO: figure out way to paramaterize node['osd_ids'] for this test
for osd_id in node["osd_ids"]:
assert Service("ceph-osd@%s" % osd_id).is_enabled
# TODO: figure out way to paramaterize node['osds'] for this test
for osd in node["osds"]:
assert Service("ceph-osd@%s" % osd).is_enabled
@pytest.mark.no_docker
def test_osd_are_mounted(self, node, MountPoint):