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
--- /dev/null
+
+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