If threshold is not specified the test will fail with an exception.
The fix is to process threshold values for prettier output only if
it was specified.
Also if threshold is not specified the rates were printed in bps.
Now they are printed using pretty rates.
This patch also fixes pretty print of the deviation.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
test_modules/Netperf.py | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/test_modules/Netperf.py b/test_modules/Netperf.py
index 6c247f4..8848bcd 100644
--- a/test_modules/Netperf.py
+++ b/test_modules/Netperf.py
@@ -407,21 +407,22 @@ class Netperf(TestGeneric):
rate_pretty = self._pretty_rate(rate)
rate_dev_pretty = self._pretty_rate(rate_deviation,
unit=rate_pretty["unit"])
- threshold_pretty = self._pretty_rate(self._threshold["rate"])
- threshold_dev_pretty =
self._pretty_rate(self._threshold_deviation["rate"],
- unit =
threshold_pretty["unit"])
res_val = False
if self._threshold_interval is not None:
result_interval = (rate - rate_deviation,
rate + rate_deviation)
+ threshold_pretty = self._pretty_rate(self._threshold["rate"])
+ threshold_dev_pretty =
self._pretty_rate(self._threshold_deviation["rate"],
+ unit =
threshold_pretty["unit"])
+
if self._threshold_interval[0] > result_interval[1]:
res_val = False
res_data["msg"] = "Measured rate %.2f +-%.2f %s is lower
"\
"than threshold %.2f +-%.2f %s" %\
(rate_pretty["rate"],
- rate_deviation,
+ rate_dev_pretty["rate"],
rate_pretty["unit"],
threshold_pretty["rate"],
threshold_dev_pretty["rate"],
@@ -431,7 +432,7 @@ class Netperf(TestGeneric):
res_data["msg"] = "Measured rate %.2f +-%.2f %s is higher
"\
"than threshold %.2f +-%.2f %s" %\
(rate_pretty["rate"],
- rate_deviation,
+ rate_dev_pretty["rate"],
rate_pretty["unit"],
threshold_pretty["rate"],
threshold_dev_pretty["rate"],
@@ -441,8 +442,10 @@ class Netperf(TestGeneric):
res_val = True
else:
res_val = False
- res_data["msg"] = "Measured rate was %.2f +-%.2f bps" %\
- (rate, rate_deviation)
+ res_data["msg"] = "Measured rate was %.2f +-%.2f %s" %\
+ (rate_pretty["rate"],
+ rate_dev_pretty["rate"],
+ rate_pretty["unit"])
if rv != 0 and self._runs == 1:
res_data["msg"] = "Could not get performance
throughput!"
--
2.4.11
Show replies by thread
For SCTP_STREAM and other non omni tests the previously removed confidence
parsing is added.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
test_modules/Netperf.py | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/test_modules/Netperf.py b/test_modules/Netperf.py
index 8848bcd..7b9d7f7 100644
--- a/test_modules/Netperf.py
+++ b/test_modules/Netperf.py
@@ -215,6 +215,12 @@ class Netperf(TestGeneric):
return res_val
def _parse_confidence(self, output):
+ if self._is_omni():
+ return self._parse_confidence_omni(output)
+ else:
+ return self._parse_confidence_non_omni(output)
+
+ def _parse_confidence_omni(self, output):
pattern_throughput_confid = "THROUGHPUT_CONFID=([-]?\d+\.\d+)"
pattern_confidence_level = "CONFIDENCE_LEVEL=(\d+)"
throughput_confid = float(re.search(pattern_throughput_confid, output).group(1))
@@ -224,6 +230,24 @@ class Netperf(TestGeneric):
return real_confidence
+ def _parse_confidence_non_omni(self, output):
+ normal_pattern = r'\+/-(\d+\.\d*)% @ (\d+)% conf\.'
+ warning_pattern = r'!!! Confidence intervals: Throughput\s+:
(\d+\.\d*)%'
+ normal_confidence = re.search(normal_pattern, output)
+ warning_confidence = re.search(warning_pattern, output)
+
+ if normal_confidence is None:
+ logging.error("Failed to parse confidence!!")
+ return (0, 0.0)
+
+ if warning_confidence is None:
+ real_confidence = (float(normal_confidence.group(2)),
+ float(normal_confidence.group(1)))
+ else:
+ real_confidence = (float(normal_confidence.group(2)),
+ float(warning_confidence.group(1))/2)
+
+ return real_confidence
def _parse_threshold(self, threshold):
res_data = {}
--
2.4.11