commit 1ea3f7ae6efbc4e083c27ffa1174515dc52590f8
Author: Artem Savkov <asavkov(a)redhat.com>
Date: Fri Oct 10 13:59:41 2014 +0200
Ignorecase when parsing output in iperf module
With iperf-2.0.5 when throughput is in kilobits iperf outputs it as
'Kbits/sec', example:
[ 27] 0.0-44.3 sec 1.12 MBytes 213 Kbits/sec
lnst's iperf module however, looks for lowercase k failing to
parse output.
Added re.IGNORECASE flag so any case would work. Regexp is complex enough so
that ignorecase shouldn't introduce any false hits.
Signed-off-by: Artem Savkov <asavkov(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
test_modules/Iperf.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/test_modules/Iperf.py b/test_modules/Iperf.py
index 74fa9b6..8e5bd67 100644
--- a/test_modules/Iperf.py
+++ b/test_modules/Iperf.py
@@ -90,7 +90,7 @@ class Iperf(TestGeneric):
logging.info("Iperf connection failed!")
return (False, "Iperf connection failed!")
- m = re.search("\[[^0-9]*[0-9]*\]\s*0.0-\s*\d*\.\d sec\s*\d*(\.\d*){0,1}\s*[ kGMT]Bytes\s*(\d*(\.\d*){0,1}\s*[ kGMT]bits\/sec)", output)
+ m = re.search("\[[^0-9]*[0-9]*\]\s*0.0-\s*\d*\.\d sec\s*\d*(\.\d*){0,1}\s*[ kGMT]Bytes\s*(\d*(\.\d*){0,1}\s*[ kGMT]bits\/sec)", output, re.IGNORECASE)
if m is None:
logging.info("Could not get performance throughput!")
return (False, "Could not get performance throughput!")