Refactoring of k8s manager and tests
Changes:
- Official kubernetes python lib
- Rewrite k8s api wrapper in OOP manner
- Use api where its possible instead of cli
- Remove virtlet code because its can be replaced with pod api
- Remove unused/oudated manager code
- Remove bug workaround in k8s upgrade template
- Remove netchecker obsolete code
- Remove unfinished test_rbd_flexvolume_driver
Change-Id: I446a240123282196a6ba54f588aea84791f175ba
Related-PROD: PROD-21700
diff --git a/tcp_tests/tests/system/test_install_k8s.py b/tcp_tests/tests/system/test_install_k8s.py
index ec90863..8066cd9 100644
--- a/tcp_tests/tests/system/test_install_k8s.py
+++ b/tcp_tests/tests/system/test_install_k8s.py
@@ -47,29 +47,22 @@
11. Optionally run k8s e2e tests
"""
- # STEP #5
- # k8s_actions = k8s_deployed
- sl_actions = stacklight_deployed
+
show_step(5)
- k8sclient = k8s_deployed.api
- assert k8sclient.nodes.list() is not None, "Can not get nodes list"
- netchecker_port = netchecker.get_service_port(k8sclient)
+ sl_actions = stacklight_deployed
+ nch = netchecker.Netchecker(k8s_deployed.api)
+
show_step(6)
- netchecker.get_netchecker_pod_status(k8s=k8s_deployed,
- namespace='netchecker')
+ nch.wait_netchecker_pods_running(netchecker.NETCHECKER_SERVER_PREFIX)
show_step(7)
- netchecker.get_netchecker_pod_status(k8s=k8s_deployed,
- pod_name='netchecker-agent',
- namespace='netchecker')
+ nch.wait_netchecker_pods_running(netchecker.NETCHECKER_AGENT_PREFIX)
- # show_step(8)
- netchecker.wait_check_network(k8sclient, namespace='netchecker',
- netchecker_pod_port=netchecker_port)
+ show_step(8)
+ nch.wait_check_network(works=True)
+
show_step(9)
- res = netchecker.get_metric(k8sclient,
- netchecker_pod_port=netchecker_port,
- namespace='netchecker')
+ res = nch.get_metric()
assert res.status_code == 200, 'Unexpected response code {}'\
.format(res)
@@ -144,12 +137,9 @@
7. Optionally run k8s e2e conformance
"""
- k8s_actions = k8s_deployed
- sl_actions = stacklight_deployed
- # STEP #5
+
show_step(5)
- k8sclient = k8s_deployed.api
- assert k8sclient.nodes.list() is not None, "Can not get nodes list"
+ sl_actions = stacklight_deployed
prometheus_client = stacklight_deployed.api
try:
@@ -186,7 +176,7 @@
if config.k8s.k8s_conformance_run:
show_step(7)
- k8s_actions.run_conformance()
+ k8s_deployed.run_conformance()
LOG.info("*************** DONE **************")
@pytest.mark.extract(container_system='docker', extract_from='conformance',
@@ -211,8 +201,8 @@
5. Run conformance if need
"""
- k8s_actions = k8s_deployed
+
if config.k8s.k8s_conformance_run:
show_step(5)
- k8s_actions.run_conformance()
+ k8s_deployed.run_conformance()
LOG.info("*************** DONE **************")