summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2019-04-04 12:56:37 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2019-04-04 15:59:10 +0200
commitb27827b7bc76cee7a573318e9d4f58d85cb2dd80 (patch)
treeeef9ed2bfd1ef132900dd71cd570c236d39f5274
parente159cd206d11073e4ca46d34ba15e106357fb044 (diff)
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
-rw-r--r--src/osmo_gsm_tester/util.py15
1 files changed, 3 insertions, 12 deletions
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 @@ def change_elf_rpath(binary, paths, run_dir):
'''
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 @@ def setcap_net_raw(binary, run_dir):
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 @@ def setcap_net_admin(binary, run_dir):
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)