Change in osmo-gsm-tester[master]: util: use launch_sync API instead of manual wait

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/.

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Thu Apr 4 16:10:19 UTC 2019


Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/13525 )

Change subject: util: use launch_sync API instead of manual wait
......................................................................

util: use launch_sync API instead of manual wait

The API is available so no need to manually craft all steps in there.

Change-Id: I4afedb185f6e864929155981e8a2ec2df90110c3
---
M src/osmo_gsm_tester/util.py
1 file changed, 3 insertions(+), 12 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Pau Espin Pedrol: Looks good to me, approved



diff --git a/src/osmo_gsm_tester/util.py b/src/osmo_gsm_tester/util.py
index e9a1f30..21653be 100644
--- a/src/osmo_gsm_tester/util.py
+++ b/src/osmo_gsm_tester/util.py
@@ -52,10 +52,7 @@
     '''
     from .process import Process
     proc = Process('patchelf', run_dir, ['patchelf', '--set-rpath', paths, binary])
-    proc.launch()
-    proc.wait()
-    if proc.result != 0:
-        raise RuntimeError('patchelf finished with err code %d' % proc.result)
+    proc.launch_sync()
 
 def ip_to_iface(ip):
     try:
@@ -91,10 +88,7 @@
     from .process import Process
     SETCAP_NET_RAW_BIN = 'osmo-gsm-tester_setcap_net_raw.sh'
     proc = Process(SETCAP_NET_RAW_BIN, run_dir, ['sudo', SETCAP_NET_RAW_BIN, binary])
-    proc.launch()
-    proc.wait()
-    if proc.result != 0:
-        raise RuntimeError('%s finished with err code %d' % (SETCAP_NET_RAW_BIN, proc.result))
+    proc.launch_sync()
 
 def setcap_net_admin(binary, run_dir):
     '''
@@ -104,10 +98,7 @@
     from .process import Process
     SETCAP_NET_ADMIN_BIN = 'osmo-gsm-tester_setcap_net_admin.sh'
     proc = Process(SETCAP_NET_ADMIN_BIN, run_dir, ['sudo', SETCAP_NET_ADMIN_BIN, binary])
-    proc.launch()
-    proc.wait()
-    if proc.result != 0:
-        raise RuntimeError('%s finished with err code %d' % (SETCAP_NET_ADMIN_BIN, proc.result))
+    proc.launch_sync()
 
 def import_path_prepend(pathname):
     dir = os.path.realpath(pathname)

-- 
To view, visit https://gerrit.osmocom.org/13525
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I4afedb185f6e864929155981e8a2ec2df90110c3
Gerrit-Change-Number: 13525
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190404/a26256bd/attachment.htm>


More information about the gerrit-log mailing list