Change in osmo-gsm-tester[master]: process.py: Add execution of local processes

2020-11-23 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21299 )

Change subject: process.py: Add execution of local processes
..


Patch Set 1: Code-Review-1

(1 comment)

https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21299/1/src/osmo_gsm_tester/core/process.py
File src/osmo_gsm_tester/core/process.py:

https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21299/1/src/osmo_gsm_tester/core/process.py@454
PS1, Line 454: proc.launch()
You cannot do this, since you must track the process object from before you 
launch it, otherwise it an exception occurs you may leave the process running 
in the background, that's why other functions use launch_sync (which takes care 
of exceptions happening and killing the process iirc).
See testenv.remember_to_stop().



--
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21299
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: I627acfefa1b476ebb767f6af44ba717db79afd51
Gerrit-Change-Number: 21299
Gerrit-PatchSet: 1
Gerrit-Owner: ninjab3s 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Mon, 23 Nov 2020 19:41:49 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-gsm-tester[master]: process.py: Add execution of local processes

2020-11-23 Thread ninjab3s
ninjab3s has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21299 )


Change subject: process.py: Add execution of local processes
..

process.py: Add execution of local processes

run_local() encapsulates the execution of local processes.

Change-Id: I627acfefa1b476ebb767f6af44ba717db79afd51
---
M src/osmo_gsm_tester/core/process.py
1 file changed, 9 insertions(+), 2 deletions(-)



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

diff --git a/src/osmo_gsm_tester/core/process.py 
b/src/osmo_gsm_tester/core/process.py
index eaf8de7..ffc42c1 100644
--- a/src/osmo_gsm_tester/core/process.py
+++ b/src/osmo_gsm_tester/core/process.py
@@ -443,14 +443,21 @@
 super().__init__(name, run_dir, remote_user, remote_host, remote_cwd, 
args, **popen_kwargs)

 def run_local_sync(run_dir, name, popen_args):
-run_dir =run_dir.new_dir(name)
+run_dir = run_dir.new_dir(name)
 proc = Process(name, run_dir, popen_args)
 proc.launch_sync()
 return proc

+def run_local(run_dir, name, popen_args):
+run_dir = run_dir.new_dir(name)
+proc = Process(name, run_dir, popen_args)
+proc.launch()
+return proc
+
 def run_local_netns_sync(run_dir, name, netns, popen_args):
-run_dir =run_dir.new_dir(name)
+run_dir = run_dir.new_dir(name)
 proc = NetNSProcess(name, run_dir, netns, popen_args)
 proc.launch_sync()
 return proc
+
 # vim: expandtab tabstop=4 shiftwidth=4

--
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21299
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: I627acfefa1b476ebb767f6af44ba717db79afd51
Gerrit-Change-Number: 21299
Gerrit-PatchSet: 1
Gerrit-Owner: ninjab3s 
Gerrit-MessageType: newchange