Change in osmo-gsm-tester[master]: suites/gprs/: beautify output result of ping tests

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 Apr 6 12:50:20 UTC 2020


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

Change subject: suites/gprs/: beautify output result of ping tests
......................................................................

suites/gprs/: beautify output result of ping tests

Print ping output at the end and replace the whole test stdout report
with ping execution.

Change-Id: I90001ddc6bc1145ac9d115aee762f4f3500e8dc8
---
M suites/gprs/ping.py
M suites/gprs/ping_idle_ping.py
2 files changed, 25 insertions(+), 6 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, approved



diff --git a/suites/gprs/ping.py b/suites/gprs/ping.py
index 9186fe6..22fe80a 100755
--- a/suites/gprs/ping.py
+++ b/suites/gprs/ping.py
@@ -51,7 +51,8 @@
 print("Setting up data plan for %r" % repr(ctx_id_v4))
 ms.setup_context_data_plane(ctx_id_v4)
 print("Running 10 ping requests for %r" % repr(ctx_id_v4))
-ms.run_netns_wait('ping', ('ping', '-c', '10', ggsn.addr()))
+proc = ms.run_netns_wait('ping', ('ping', '-c', '10', ggsn.addr()))
+output = proc.get_stdout()
 ms.deactivate_context(ctx_id_v4)
 
 # We need to use inet46 since ofono qmi only uses ipv4v6 eua (OS#2713)
@@ -65,3 +66,6 @@
 # sleep(5)
 # TODO: send ping to server or open TCP conn with a socket in python
 # ms.deactivate_context(ctx_id_v46)
+
+print(output)
+test.set_report_stdout(output)
diff --git a/suites/gprs/ping_idle_ping.py b/suites/gprs/ping_idle_ping.py
index e0968ac..02e2cdf 100755
--- a/suites/gprs/ping_idle_ping.py
+++ b/suites/gprs/ping_idle_ping.py
@@ -55,12 +55,27 @@
 ctx_id_v4 = ms.activate_context(apn='inet46', protocol=ms.CTX_PROT_IPv4)
 print("Setting up data plane for %r" % repr(ctx_id_v4))
 ms.setup_context_data_plane(ctx_id_v4)
-print("[1] Running 10 ping requests for %r" % repr(ctx_id_v4))
-ms.run_netns_wait('ping1', ('ping', '-c', '10', ggsn.addr()))
+str = "[1] Running 10 ping requests for %r" % repr(ctx_id_v4)
+output = str + '\n'
+print(str)
+proc = ms.run_netns_wait('ping1', ('ping', '-c', '10', ggsn.addr()))
+str = proc.get_stdout()
+output += str
+print(str)
 
-print("Sleeping for 60 seconds")
+str = "Sleeping for 60 seconds"
+output += str + '\n'
+print(str)
 sleep(60)
 
-print("[2] Running 10 ping requests for %r" % repr(ctx_id_v4))
-ms.run_netns_wait('ping2', ('ping', '-c', '10', ggsn.addr()))
+str = "[2] Running 10 ping requests for %r" % repr(ctx_id_v4)
+output += str + '\n'
+print(str)
+proc = ms.run_netns_wait('ping2', ('ping', '-c', '10', ggsn.addr()))
+str = proc.get_stdout()
+output += str
+print(str)
+
 ms.deactivate_context(ctx_id_v4)
+
+test.set_report_stdout(output)

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/17731
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: I90001ddc6bc1145ac9d115aee762f4f3500e8dc8
Gerrit-Change-Number: 17731
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
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/20200406/0b5d2fa1/attachment.htm>


More information about the gerrit-log mailing list