epc: refactor run_wait() method and rename to prepare_proc()

this refactor no longer enforces blocking operation of the process.
Instead it returns the process object to the caller who
can now run either proc.launch() for non-blocking operation
or proc.launch_sync() for blocking mode.

The non-block mode allos doing other stuff in the background,
for example controlling the rfemu while running a ping.

Change-Id: Ia6372e55a8829f722e40db537d9dfd63a94d1be9
This commit is contained in:
Andre Puschmann 2020-06-12 12:08:02 +02:00 committed by srs_andre
parent e66e3aebb4
commit b0ebcbcf10
2 changed files with 6 additions and 4 deletions

View File

@ -76,13 +76,14 @@ class EPC(log.Origin, metaclass=ABCMeta):
return epc_class(testenv, run_node)
def run_wait(self, name, popen_args):
''' Execute process on EPC node, useful for MT traffic '''
def prepare_process(self, name, popen_args):
''' Prepare and return a process to run on EPC node.
Caller calls either launch() or launch_sync()
for non-blocking or blocking operation respectively '''
if self._run_node.is_local():
proc = process.Process(name, self.run_dir, popen_args)
else:
proc = self.rem_host.RemoteProcess(name, popen_args)
proc.launch_sync()
return proc
###################

View File

@ -27,7 +27,8 @@ print('UE is RRC idle')
sleep(5)
# Generate MO traffic, send single ping
proc = epc.run_wait('ping', ('ping', '-c', '1', ue.get_assigned_addr()))
proc = epc.prepare_process('ping', ('ping', '-c', '1', ue.get_assigned_addr()))
proc.launch_sync()
output = proc.get_stdout()
# Check paging received