aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2023-12-07 18:41:16 +0100
committerCédric Ollivier <cedric.ollivier@orange.com>2023-12-07 18:42:41 +0100
commit9305c60e49ac98f1cb4ab01b067d65f44ac1b3dd (patch)
tree386fe5fb44756997b82c5ffe0680a24400dea9b0
parenta2f667f8e23d1bb193063de1c0d894bf40a17e05 (diff)
netperf csv output dir must be writable
It changes working dir in a writable one. Change-Id: I358233cff30c35da0d04921ac0521645a00b2656 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com> (cherry picked from commit 677e872910555585f0400e99585d821491cd1c43)
-rw-r--r--functest_kubernetes/netperf/netperf.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/functest_kubernetes/netperf/netperf.py b/functest_kubernetes/netperf/netperf.py
index b0cd8e40..7f77807b 100644
--- a/functest_kubernetes/netperf/netperf.py
+++ b/functest_kubernetes/netperf/netperf.py
@@ -44,18 +44,19 @@ class Netperf(testcase.TestCase):
try:
if not os.path.exists(self.res_dir):
os.makedirs(self.res_dir)
+ os.chdir(self.res_dir)
cmd = ['launch', '-iterations', '1', '-kubeConfig',
- f'{Path.home()}/.kube/config']
- output = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
+ f'{Path.home()}/.kube/config', '-v', '3']
+ output = subprocess.check_output(
+ cmd, stderr=subprocess.STDOUT, timeout=3600)
self.__logger.info("%s\n%s", " ".join(cmd), output.decode("utf-8"))
lfiles = glob.glob(os.path.join(
'results_netperf-latest', 'netperf-latest*.csv'))
results = max(lfiles, key=os.path.getmtime)
- shutil.move(results, os.path.join(self.res_dir, 'netperf.csv'))
- cmd = ['plotperf', '-c',
- os.path.join(self.res_dir, 'netperf.csv'),
+ cmd = ['plotperf', '-c', results,
'-o', self.res_dir, '-s', 'netperf']
- output = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
+ output = subprocess.check_output(
+ cmd, stderr=subprocess.STDOUT, timeout=60)
self.__logger.info("%s\n%s", " ".join(cmd), output.decode("utf-8"))
self.result = 100
status = testcase.TestCase.EX_OK