From: Andrew Schoen Date: Mon, 5 Dec 2016 21:05:23 +0000 (-0600) Subject: tests: adds some basic tests for OSD nodes X-Git-Tag: v2.1.0~26^2~24 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=0665167afa5709e61502dc461a4cb1463c7e2195;p=ceph-ansible.git tests: adds some basic tests for OSD nodes Signed-off-by: Andrew Schoen --- diff --git a/tests/functional/tests/mon/test_mons.py b/tests/functional/tests/mon/test_mons.py index fa5b389cc..4a72d970c 100644 --- a/tests/functional/tests/mon/test_mons.py +++ b/tests/functional/tests/mon/test_mons.py @@ -15,3 +15,12 @@ class TestMons(object): def test_can_get_cluster_health(self, CephNode, Command): output = Command.check_output("sudo ceph -s") assert output.strip().startswith("cluster") + + +class TestOSDs(object): + + def test_all_osds_are_up_and_in(self, CephNode, Command): + output = Command.check_output("sudo ceph -s") + num_osds = len(CephNode["vars"]["devices"]) + phrase = "{num_osds} osds: {num_osds} up, {num_osds} in".format(num_osds=num_osds) + assert phrase in output diff --git a/tests/functional/tests/osd/test_osds.py b/tests/functional/tests/osd/test_osds.py new file mode 100644 index 000000000..3029f16b2 --- /dev/null +++ b/tests/functional/tests/osd/test_osds.py @@ -0,0 +1,18 @@ + +class TestOSDs(object): + + def test_ceph_osd_package_is_installed(self, CephNode, Package): + assert Package("ceph-osd").is_installed + + def test_osd_listens_on_6800(self, CephNode, Socket): + assert Socket("tcp://%s:6800" % CephNode["address"]).is_listening + + def test_osd_services_are_running(self, CephNode, Service): + # TODO: figure out way to paramaterize CephNode['osd_ids'] for this test + for osd_id in CephNode["osd_ids"]: + assert Service("ceph-osd@%s" % osd_id).is_running + + def test_osd_services_are_enabled(self, CephNode, Service): + # TODO: figure out way to paramaterize CephNode['osd_ids'] for this test + for osd_id in CephNode["osd_ids"]: + assert Service("ceph-osd@%s" % osd_id).is_enabled