There is a bug when running non omni output test, like SCTP tests,
with nperf_cpu_util alias not defined, the value stored in
self._cpu_util is None and not 'None' and the result rate is set 0
because the condition is met, bad regex is created and this regex
does not match the output.
This patch fixes that.
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
---
test_modules/Netperf.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/test_modules/Netperf.py b/test_modules/Netperf.py
index 8081070..6cbd504 100644
--- a/test_modules/Netperf.py
+++ b/test_modules/Netperf.py
@@ -235,7 +235,7 @@ class Netperf(TestGeneric):
# pattern for SCTP streams and other tests
# decimal decimal decimal float (float)
pattern = "\d+\s+\d+\s+\d+\s+\d+\.\d+\s+(\d+(?:\.\d+){0,1})"
- if self._cpu_util != 'None':
+ if self._cpu_util != 'None' and self._cpu_util is not None:
# cpu utilization data in format: float float
pattern += "\s+(\d+(?:\.\d+){0,1})\s+(\d+(?:\.\d+){0,1})"
@@ -245,7 +245,7 @@ class Netperf(TestGeneric):
rate = 0.0
else:
rate = float(r2.group(1))
- if self._cpu_util != 'None':
+ if self._cpu_util != 'None' and self._cpu_util is not None:
res_val["LOCAL_CPU_UTIL"] = float(r2.group(2))
res_val["REMOTE_CPU_UTIL"] = float(r2.group(3))
--
2.9.3