Fixing ceph tests, part 1
diff --git a/cvp_checks/tests/ceph/config.yaml b/cvp_checks/tests/ceph/config.yaml
deleted file mode 100644
index bfc8e70..0000000
--- a/cvp_checks/tests/ceph/config.yaml
+++ /dev/null
@@ -1,3 +0,0 @@
----
-ceph_monitors: ['ceph-003*', 'ceph-004*', 'ceph-005*']
-ceph_osd_probe_node: ['ceph-001*']
diff --git a/cvp_checks/tests/ceph/test_ceph.py b/cvp_checks/tests/ceph/test_ceph.py
index 05a61c2..c14778d 100644
--- a/cvp_checks/tests/ceph/test_ceph.py
+++ b/cvp_checks/tests/ceph/test_ceph.py
@@ -1,11 +1,14 @@
-from cvp_checks import utils
+import pytest
def test_check_ceph_osd(local_salt_client):
- config = utils.get_configuration(__file__)
- osd_fail = \
- local_salt_client.cmd(config["ceph_osd_probe_node"][0], 'cmd.run',
- ['ceph osd tree | grep down'])
+ osd_fail = local_salt_client.cmd(
+ 'ceph:osd',
+ 'cmd.run',
+ ['ceph osd tree | grep up'],
+ expr_form='pillar')
+ if not osd_fail:
+ pytest.skip("Ceph is not found on this environment")
assert not osd_fail.values()[0], \
"Some osds are in down state or ceph is not found".format(
osd_fail.values()[0])
diff --git a/cvp_checks/tests/ceph/test_ceph_haproxy.py b/cvp_checks/tests/ceph/test_ceph_haproxy.py
index 2f2e1e0..7bff15b 100644
--- a/cvp_checks/tests/ceph/test_ceph_haproxy.py
+++ b/cvp_checks/tests/ceph/test_ceph_haproxy.py
@@ -1,21 +1,23 @@
-from cvp_checks import utils
+import pytest
def test_ceph_haproxy(local_salt_client):
- config = utils.get_configuration(__file__)
-
+ pytest.skip("This test doesn't work. Skipped")
fail = {}
- for monitor in config["ceph_monitors"]:
- monitor_info = local_salt_client.cmd(monitor, 'cmd.run',
- ["echo 'show stat' | nc -U "
- "/var/run/haproxy/admin.sock | "
- "grep ceph_mon_radosgw_cluster"])
+ monitor_info = local_salt_client.cmd(
+ 'ceph:mon',
+ 'cmd.run',
+ ["echo 'show stat' | nc -U "
+ "/var/run/haproxy/admin.sock | "
+ "grep ceph_mon_radosgw_cluster"],
+ expr_form='pillar')
+ if not monitor_info:
+ pytest.skip("Ceph is not found on this environment")
- for name, info in monitor_info.iteritems():
- if "OPEN" and "UP" in info:
- continue
- else:
- fail[name] = info
-
+ for name, info in monitor_info.iteritems():
+ if "OPEN" and "UP" in info:
+ continue
+ else:
+ fail[name] = info
assert not fail, "Failed monitors: {}".format(fail)