Fix tox.ini to run unit tests on CI
Change-Id: I64a998b04e432397dcb34f70e7a0167374147eef
diff --git a/tcp_tests/managers/k8smanager.py b/tcp_tests/managers/k8smanager.py
index 12dd2dc..6394141 100644
--- a/tcp_tests/managers/k8smanager.py
+++ b/tcp_tests/managers/k8smanager.py
@@ -289,15 +289,17 @@
ns = self.api.namespaces.get(name=name)
LOG.info("Namespace '{0}' is already exists".format(ns.name))
except ApiException as e:
- if hasattr(e,"status") and 404 == e.status:
- LOG.info("Creating Namespace in k8s cluster")
- ns = self.api.namespaces.create(body={'metadata': {'name': name}})
- LOG.info("Namespace '{0}' is created".format(ns.name))
- # wait 10 seconds until a token for new service account is created
- time.sleep(10)
- ns = self.api.namespaces.get(name=ns.name)
- else:
- raise
+ if hasattr(e, "status") and 404 == e.status:
+ LOG.info("Creating Namespace in k8s cluster")
+ ns = self.api.namespaces.create(
+ body={'metadata': {'name': name}})
+ LOG.info("Namespace '{0}' is created".format(ns.name))
+ # wait 10 seconds until a token for new service account
+ # is created
+ time.sleep(10)
+ ns = self.api.namespaces.get(name=ns.name)
+ else:
+ raise
return ns
def create_objects(self, path):
@@ -409,7 +411,6 @@
cmd = "apt install jq -y"
return self.__underlay.check_call(cmd, node_name=self.ctl_host)
-
def git_clone(self, project, target):
cmd = "git clone {0} {1}".format(project, target)
return self.__underlay.check_call(cmd, node_name=self.ctl_host)
@@ -494,4 +495,4 @@
cmd = ("~/virtlet/examples/virsh.sh domblklist {} | "
"tail -n +3 | awk {{'print $2'}}".format(domain_id))
result = self.__underlay.check_call(cmd, node_name=self.ctl_host)
- return result['stdout'].strip()
\ No newline at end of file
+ return result['stdout'].strip()