]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
tests: tests mon services to ensure they are running correctly
authorAndrew Schoen <aschoen@redhat.com>
Sun, 4 Dec 2016 02:10:35 +0000 (20:10 -0600)
committerAndrew Schoen <aschoen@redhat.com>
Tue, 6 Dec 2016 20:56:19 +0000 (14:56 -0600)
Signed-off-by: Andrew Schoen <aschoen@redhat.com>
tests/functional/tests/mon/test_mons.py [new file with mode: 0644]

diff --git a/tests/functional/tests/mon/test_mons.py b/tests/functional/tests/mon/test_mons.py
new file mode 100644 (file)
index 0000000..fa5b389
--- /dev/null
@@ -0,0 +1,17 @@
+
+class TestMons(object):
+
+    def test_mon_listens_on_6789(self, CephNode, Socket):
+        assert Socket("tcp://%s:6789" % CephNode["address"]).is_listening
+
+    def test_mon_service_is_running(self, CephNode, Service):
+        service_name = "ceph-mon@ceph-%s" % CephNode["vars"]["inventory_hostname"]
+        assert Service(service_name).is_running
+
+    def test_mon_service_is_enabled(self, CephNode, Service):
+        service_name = "ceph-mon@ceph-%s" % CephNode["vars"]["inventory_hostname"]
+        assert Service(service_name).is_enabled
+
+    def test_can_get_cluster_health(self, CephNode, Command):
+        output = Command.check_output("sudo ceph -s")
+        assert output.strip().startswith("cluster")