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@redhat.com --- test_modules/Iperf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
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!")
lnst-developers@lists.fedorahosted.org