Change in osmo-gsm-tester[master]: testenv: Provide tests with access to process module

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
Sat May 19 12:04:01 UTC 2018


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

Change subject: testenv: Provide tests with access to process module
......................................................................

testenv: Provide tests with access to process module

Some tests may want to start/stop/manages processes themselves. By using
the process module from osmo-gsm-tester, we make that possible easily,
providing with useful features such as requesting a suite to stop it on
cleanup.

Change-Id: I8e018107cbec81299ec2228bfff933fb3b0bb6cd
---
M src/osmo_gsm_tester/test.py
M src/osmo_gsm_tester/testenv.py
2 files changed, 6 insertions(+), 4 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved



diff --git a/src/osmo_gsm_tester/test.py b/src/osmo_gsm_tester/test.py
index 59d503c..b706dac 100644
--- a/src/osmo_gsm_tester/test.py
+++ b/src/osmo_gsm_tester/test.py
@@ -54,9 +54,9 @@
             log.large_separator(self.suite_run.trial.name(), self.suite_run.name(), self.name(), sublevel=3)
             self.status = Test.UNKNOWN
             self.start_timestamp = time.time()
-            from . import suite, sms
+            from . import suite, sms, process
             from .event_loop import MainLoop
-            testenv.setup(self.suite_run, self, suite, MainLoop, sms)
+            testenv.setup(self.suite_run, self, suite, MainLoop, sms, process)
             with self.redirect_stdout():
                 util.run_python_file('%s.%s' % (self.suite_run.definition.name(), self.basename),
                                      self.path)
diff --git a/src/osmo_gsm_tester/testenv.py b/src/osmo_gsm_tester/testenv.py
index 26b492e..ceea028 100644
--- a/src/osmo_gsm_tester/testenv.py
+++ b/src/osmo_gsm_tester/testenv.py
@@ -34,9 +34,10 @@
 prompt = None
 Timeout = None
 Sms = None
+process = None
 
-def setup(suite_run, _test, suite_module, event_module, sms_module):
-    global trial, suite, test, resources, log, dbg, err, wait, wait_no_raise, sleep, poll, prompt, Timeout, Sms
+def setup(suite_run, _test, suite_module, event_module, sms_module, process_module):
+    global trial, suite, test, resources, log, dbg, err, wait, wait_no_raise, sleep, poll, prompt, Timeout, Sms, process
     trial = suite_run.trial
     suite = suite_run
     test = _test
@@ -51,5 +52,6 @@
     prompt = suite_run.prompt
     Timeout = suite_module.Timeout
     Sms = sms_module.Sms
+    process = process_module
 
 # vim: expandtab tabstop=4 shiftwidth=4

-- 
To view, visit https://gerrit.osmocom.org/9235
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: I8e018107cbec81299ec2228bfff933fb3b0bb6cd
Gerrit-Change-Number: 9235
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
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/20180519/267b9e55/attachment.htm>


More information about the gerrit-log mailing list