Minor fixes in k8s tests
- Fix test_k8s_externaldns_coredns test
- Fix K8SSampleDeployment class
Change-Id: I4734e3987af5495c9eb9f4dda4fedd7153964cb6
diff --git a/tcp_tests/managers/k8smanager.py b/tcp_tests/managers/k8smanager.py
index a72f2f1..4cd7435 100644
--- a/tcp_tests/managers/k8smanager.py
+++ b/tcp_tests/managers/k8smanager.py
@@ -446,8 +446,6 @@
def get_pod_dom_uuid(self, pod):
uuid_name_map = self.virtlet_execute(
pod.read().spec.node_name, 'virsh list --uuid --name')['stdout']
- LOG.info("HEHEHEH {}".format(uuid_name_map))
- LOG.info("MDAMDMAD {}".format(pod.name))
for line in uuid_name_map:
if line.rstrip().endswith("-{}".format(pod.name)):
return line.split(" ")[0]
@@ -498,6 +496,7 @@
def expose(self, service_type='ClusterIP'):
service_name = "{0}-s{1}".format(self._deployment.name, self._index)
+ self._index += 1
self._svc = self._manager.kubectl.expose(
self._deployment, port=self._port,
service_name=service_name, service_type=service_type)
@@ -514,3 +513,9 @@
def is_service_available(self, svc=None, external=False):
return "Hello Kubernetes!" in self.curl(svc, external=external)
+
+ def delete(self):
+ for svc in self._manager.api.services.list_all(
+ name_prefix="{}-s".format(self._deployment.name)):
+ svc.delete()
+ self._deployment.delete()