Merge pull request #1485 from ceph/docker-osd-tests

tests: test all docker osds are up and in
pull/1449/merge
Andrew Schoen 2017-05-01 14:05:57 -05:00 committed by GitHub
commit 05743e1a7e
2 changed files with 13 additions and 0 deletions

View File

@ -20,6 +20,9 @@ def node(Ansible, Interface, Command, request):
if request.node.get_marker("no_docker") and docker:
pytest.skip("Not a valid test for containerized deployments or atomic hosts")
if request.node.get_marker("docker") and not docker:
pytest.skip("Not a valid test for non-containerized deployments or atomic hosts")
journal_collocation_test = ansible_vars.get("journal_collocation") or ansible_vars.get("dmcrypt_journal_collocation")
if request.node.get_marker("journal_collocation") and not journal_collocation_test:
pytest.skip("Scenario is not using journal collocation")

View File

@ -37,3 +37,13 @@ class TestOSDs(object):
output = Command.check_output(cmd)
phrase = "{num_osds} osds: {num_osds} up, {num_osds} in".format(num_osds=node["total_osds"])
assert phrase in output
@pytest.mark.docker
def test_all_docker_osds_are_up_and_in(self, node, Command):
cmd = "sudo docker exec ceph-mon-ceph-{} ceph --cluster={} --connect-timeout 5 -s".format(
node["vars"]["inventory_hostname"],
node["cluster_name"]
)
output = Command.check_output(cmd)
phrase = "{num_osds} osds: {num_osds} up, {num_osds} in".format(num_osds=node["total_osds"])
assert phrase in output