Change in osmo-gsm-tester[master]: ping.py: add stricter pass/fail check

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

pespin gerrit-no-reply at lists.osmocom.org
Mon May 3 12:22:35 UTC 2021


pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-gsm-tester/+/24043 )

Change subject: ping.py: add stricter pass/fail check
......................................................................

ping.py: add stricter pass/fail check

the ping test should only pass if not a single ping is lost

Change-Id: If089f77df1ffe991f26f1546558d51aac242df83
---
M sysmocom/suites/4g/ping.py
1 file changed, 8 insertions(+), 1 deletion(-)

Approvals:
  pespin: Looks good to me, approved; Verified



diff --git a/sysmocom/suites/4g/ping.py b/sysmocom/suites/4g/ping.py
index 0297317..a78b8d6 100755
--- a/sysmocom/suites/4g/ping.py
+++ b/sysmocom/suites/4g/ping.py
@@ -20,6 +20,13 @@
 print('UE is attached')
 
 proc = ue.run_netns_wait('ping', ('ping', '-c', '10', epc.tun_addr()))
+
+# Check zero lost pings
+num_sent = int([x for x in proc.get_stdout().split('\n') if x.find('packets transmitted') != -1][0].split(' ')[0])
+num_received = int([x for x in proc.get_stdout().split('\n') if x.find('packets transmitted, ') != -1][0].split('packets transmitted, ')[1].split(' received')[0])
+if num_received != num_sent:
+  raise Exception("{}\n\nError: Detected {} lost pings".format(proc.get_stdout(), num_sent - num_received))
+
 output = proc.get_stdout()
 print(output)
-test.set_report_stdout(output)
+test.set_report_stdout(output)
\ No newline at end of file

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/24043
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: If089f77df1ffe991f26f1546558d51aac242df83
Gerrit-Change-Number: 24043
Gerrit-PatchSet: 4
Gerrit-Owner: srs_andre <andre at softwareradiosystems.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210503/2f5996ca/attachment.htm>


More information about the gerrit-log mailing list