aboutsummaryrefslogtreecommitdiffstats
path: root/functest_kubernetes/k8stest.py
diff options
context:
space:
mode:
Diffstat (limited to 'functest_kubernetes/k8stest.py')
-rw-r--r--functest_kubernetes/k8stest.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/functest_kubernetes/k8stest.py b/functest_kubernetes/k8stest.py
index 2d17a27d..b450dac4 100644
--- a/functest_kubernetes/k8stest.py
+++ b/functest_kubernetes/k8stest.py
@@ -35,7 +35,7 @@ class E2ETesting(testcase.TestCase):
k8s_gcr_repo = os.getenv("MIRROR_REPO", "k8s.gcr.io")
def __init__(self, **kwargs):
- super(E2ETesting, self).__init__(**kwargs)
+ super().__init__(**kwargs)
self.cmd = []
self.dir_results = "/home/opnfv/functest/results"
self.res_dir = os.path.join(self.dir_results, self.case_name)
@@ -74,9 +74,10 @@ class E2ETesting(testcase.TestCase):
self.__logger.info("Starting k8s test: '%s'.", cmd_line)
env = os.environ.copy()
env["KUBE_TEST_REPO_LIST"] = "{}/repositories.yml".format(self.res_dir)
- process = subprocess.Popen(cmd_line, stdout=subprocess.PIPE,
- stderr=subprocess.STDOUT, env=env)
- boutput = process.stdout.read()
+ with subprocess.Popen(
+ cmd_line, stdout=subprocess.PIPE,
+ stderr=subprocess.STDOUT, env=env) as process:
+ boutput = process.stdout.read()
with open(os.path.join(self.res_dir, 'e2e.log'), 'wb') as foutput:
foutput.write(boutput)
grp = re.search(