Minor fix for the iperf output parsing.
Case 1: [ 5] 0.0-10.0 sec 5.21 GBytes 4.47 Gbits/sec
Case 2: [ 5] 0.0- 5.0 sec 3.52 GBytes 6.04 Gbits/sec
In case #2 the space after dash was not expected and resulted in parsing error. The fix corrects this and handles both cases.
--- Tests/TestIperf.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Tests/TestIperf.py b/Tests/TestIperf.py index 9b67d40..f6ba232 100644 --- a/Tests/TestIperf.py +++ b/Tests/TestIperf.py @@ -91,7 +91,7 @@ class TestIperf(TestGeneric): output = client.read_nonblocking() if self.threshold is not None: # check if expected threshold is reached - m = re.search("[[^0-9]*[0-9]*]\s*0.0-\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) if m is None: logging.info("Could not get performance throughput!") return False
lnst-developers@lists.fedorahosted.org