From 06b36fddf9689659b97c480b8b6644775fac907b Mon Sep 17 00:00:00 2001 From: Andrew Schoen Date: Mon, 1 May 2017 10:45:03 -0500 Subject: [PATCH 1/2] tests: adds a way to mark docker only tests Signed-off-by: Andrew Schoen --- tests/conftest.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/conftest.py b/tests/conftest.py index 4899fbcd6..9b4725ac2 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -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") From 10d39e98dde5042d98d234887ead17ff7d278e55 Mon Sep 17 00:00:00 2001 From: Andrew Schoen Date: Mon, 1 May 2017 10:45:44 -0500 Subject: [PATCH 2/2] tests: test that all docker OSDs are up and in Signed-off-by: Andrew Schoen --- tests/functional/tests/mon/test_mons.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/functional/tests/mon/test_mons.py b/tests/functional/tests/mon/test_mons.py index 73229f0a0..d97429aff 100644 --- a/tests/functional/tests/mon/test_mons.py +++ b/tests/functional/tests/mon/test_mons.py @@ -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