If no packets are received there's no rtt data reported by ping.
Still, this could be a valid case, e.g. when we expect no packets
should pass.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
lnst/Tests/Ping.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/lnst/Tests/Ping.py b/lnst/Tests/Ping.py
index b6ab9d55..c42e2f6a 100644
--- a/lnst/Tests/Ping.py
+++ b/lnst/Tests/Ping.py
@@ -82,9 +82,10 @@ class Ping(BaseTestModule):
match = re.search(stat_pttr2, stdout)
if not match:
- self._res_data = {"msg": "expected pattern not found"}
- logging.error(self._res_data["msg"])
- return False
+ if self._res_data['rate'] > 0:
+ self._res_data = {"msg": "expected pattern not
found"}
+ logging.error(self._res_data["msg"])
+ return False
else:
tmin, tavg, tmax, tmdev = [float(x) for x in match.groups()]
logging.debug("rtt min \"%.3f\", avg \"%.3f\", max
\"%.3f\", "
--
2.21.1