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

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Thu Apr 4 14:39:14 UTC 2019


Pau Espin Pedrol has uploaded this change for review. ( 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(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/25/13525/1

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: newchange
Gerrit-Change-Id: I4afedb185f6e864929155981e8a2ec2df90110c3
Gerrit-Change-Number: 13525
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190404/4676554d/attachment-0001.html>


More information about the gerrit-log mailing list