Add k8s tests, cleanup
diff --git a/cvp_checks/__init__.pyc b/cvp_checks/__init__.pyc
deleted file mode 100644
index 3e354f3..0000000
--- a/cvp_checks/__init__.pyc
+++ /dev/null
Binary files differ
diff --git a/cvp_checks/fixtures/__init__.pyc b/cvp_checks/fixtures/__init__.pyc
deleted file mode 100644
index cc3d431..0000000
--- a/cvp_checks/fixtures/__init__.pyc
+++ /dev/null
Binary files differ
diff --git a/cvp_checks/fixtures/base.pyc b/cvp_checks/fixtures/base.pyc
deleted file mode 100644
index f36eff1..0000000
--- a/cvp_checks/fixtures/base.pyc
+++ /dev/null
Binary files differ
diff --git a/cvp_checks/tests/__init__.pyc b/cvp_checks/tests/__init__.pyc
deleted file mode 100644
index c5b5b46..0000000
--- a/cvp_checks/tests/__init__.pyc
+++ /dev/null
Binary files differ
diff --git a/cvp_checks/tests/__pycache__/conftest.cpython-27-PYTEST.pyc b/cvp_checks/tests/__pycache__/conftest.cpython-27-PYTEST.pyc
deleted file mode 100644
index 9529827..0000000
--- a/cvp_checks/tests/__pycache__/conftest.cpython-27-PYTEST.pyc
+++ /dev/null
Binary files differ
diff --git a/cvp_checks/tests/__pycache__/test_contrail.cpython-27-PYTEST.pyc b/cvp_checks/tests/__pycache__/test_contrail.cpython-27-PYTEST.pyc
deleted file mode 100644
index 12c3420..0000000
--- a/cvp_checks/tests/__pycache__/test_contrail.cpython-27-PYTEST.pyc
+++ /dev/null
Binary files differ
diff --git a/cvp_checks/tests/__pycache__/test_default_gateway.cpython-27-PYTEST.pyc b/cvp_checks/tests/__pycache__/test_default_gateway.cpython-27-PYTEST.pyc
deleted file mode 100644
index d449fb7..0000000
--- a/cvp_checks/tests/__pycache__/test_default_gateway.cpython-27-PYTEST.pyc
+++ /dev/null
Binary files differ
diff --git a/cvp_checks/tests/__pycache__/test_galera_cluster.cpython-27-PYTEST.pyc b/cvp_checks/tests/__pycache__/test_galera_cluster.cpython-27-PYTEST.pyc
deleted file mode 100644
index 2dd98e0..0000000
--- a/cvp_checks/tests/__pycache__/test_galera_cluster.cpython-27-PYTEST.pyc
+++ /dev/null
Binary files differ
diff --git a/cvp_checks/tests/__pycache__/test_mtu.cpython-27-PYTEST.pyc b/cvp_checks/tests/__pycache__/test_mtu.cpython-27-PYTEST.pyc
deleted file mode 100644
index 4fab58c..0000000
--- a/cvp_checks/tests/__pycache__/test_mtu.cpython-27-PYTEST.pyc
+++ /dev/null
Binary files differ
diff --git a/cvp_checks/tests/__pycache__/test_ntp_sync.cpython-27-PYTEST.pyc b/cvp_checks/tests/__pycache__/test_ntp_sync.cpython-27-PYTEST.pyc
deleted file mode 100644
index 0c139d4..0000000
--- a/cvp_checks/tests/__pycache__/test_ntp_sync.cpython-27-PYTEST.pyc
+++ /dev/null
Binary files differ
diff --git a/cvp_checks/tests/__pycache__/test_packet_checker.cpython-27-PYTEST.pyc b/cvp_checks/tests/__pycache__/test_packet_checker.cpython-27-PYTEST.pyc
deleted file mode 100644
index 816e78f..0000000
--- a/cvp_checks/tests/__pycache__/test_packet_checker.cpython-27-PYTEST.pyc
+++ /dev/null
Binary files differ
diff --git a/cvp_checks/tests/__pycache__/test_rabbit_cluster.cpython-27-PYTEST.pyc b/cvp_checks/tests/__pycache__/test_rabbit_cluster.cpython-27-PYTEST.pyc
deleted file mode 100644
index ff5eeb0..0000000
--- a/cvp_checks/tests/__pycache__/test_rabbit_cluster.cpython-27-PYTEST.pyc
+++ /dev/null
Binary files differ
diff --git a/cvp_checks/tests/__pycache__/test_repo_list.cpython-27-PYTEST.pyc b/cvp_checks/tests/__pycache__/test_repo_list.cpython-27-PYTEST.pyc
deleted file mode 100644
index 1de85b4..0000000
--- a/cvp_checks/tests/__pycache__/test_repo_list.cpython-27-PYTEST.pyc
+++ /dev/null
Binary files differ
diff --git a/cvp_checks/tests/__pycache__/test_services.cpython-27-PYTEST.pyc b/cvp_checks/tests/__pycache__/test_services.cpython-27-PYTEST.pyc
deleted file mode 100644
index f28935a..0000000
--- a/cvp_checks/tests/__pycache__/test_services.cpython-27-PYTEST.pyc
+++ /dev/null
Binary files differ
diff --git a/cvp_checks/tests/__pycache__/test_single_vip.cpython-27-PYTEST.pyc b/cvp_checks/tests/__pycache__/test_single_vip.cpython-27-PYTEST.pyc
deleted file mode 100644
index 692eefd..0000000
--- a/cvp_checks/tests/__pycache__/test_single_vip.cpython-27-PYTEST.pyc
+++ /dev/null
Binary files differ
diff --git a/cvp_checks/tests/ceph/__pycache__/test_ceph.cpython-27-PYTEST.pyc b/cvp_checks/tests/ceph/__pycache__/test_ceph.cpython-27-PYTEST.pyc
deleted file mode 100644
index c0451ed..0000000
--- a/cvp_checks/tests/ceph/__pycache__/test_ceph.cpython-27-PYTEST.pyc
+++ /dev/null
Binary files differ
diff --git a/cvp_checks/tests/ceph/__pycache__/test_ceph_haproxy.cpython-27-PYTEST.pyc b/cvp_checks/tests/ceph/__pycache__/test_ceph_haproxy.cpython-27-PYTEST.pyc
deleted file mode 100644
index 71abde3..0000000
--- a/cvp_checks/tests/ceph/__pycache__/test_ceph_haproxy.cpython-27-PYTEST.pyc
+++ /dev/null
Binary files differ
diff --git a/cvp_checks/tests/test_k8s.py b/cvp_checks/tests/test_k8s.py
new file mode 100644
index 0000000..d7aed4b
--- /dev/null
+++ b/cvp_checks/tests/test_k8s.py
@@ -0,0 +1,47 @@
+import pytest
+import json
+
+def test_k8s_get_cs_status(local_salt_client):
+ result = local_salt_client.cmd(
+ 'etcd:server', 'cmd.run',
+ ['kubectl get cs'],
+ expr_form='pillar'
+ )
+ errors = []
+ if not result:
+ pytest.skip("k8s is not found on this environment")
+ for node in result:
+ for line in result[node].split('\n'):
+ line = line.strip()
+ if 'MESSAGE' in line:
+ continue
+ else:
+ if 'Healthy' not in line:
+ errors.append (line)
+ break
+ assert not errors, 'k8s is not healthy: {}'.format(json.dumps(
+ errors,
+ indent=4))
+
+
+def test_k8s_get_nodes_status(local_salt_client):
+ result = local_salt_client.cmd(
+ 'etcd:server', 'cmd.run',
+ ['kubectl get nodes'],
+ expr_form='pillar'
+ )
+ errors = []
+ if not result:
+ pytest.skip("k8s is not found on this environment")
+ for node in result:
+ for line in result[node].split('\n'):
+ line = line.strip()
+ if 'STATUS' in line:
+ continue
+ else:
+ if 'Ready' not in line:
+ errors.append (line)
+ break
+ assert not errors, 'k8s is not healthy: {}'.format(json.dumps(
+ errors,
+ indent=4))
diff --git a/cvp_checks/utils/__init__.pyc b/cvp_checks/utils/__init__.pyc
deleted file mode 100644
index 1a1feed..0000000
--- a/cvp_checks/utils/__init__.pyc
+++ /dev/null
Binary files differ