Change in osmo-gsm-tester[master]: ms_driver: use the util.Dir and create one dir per instance

Holger Freyther gerrit-no-reply at lists.osmocom.org
Mon Nov 5 06:51:42 UTC 2018


Holger Freyther has uploaded this change for review. ( https://gerrit.osmocom.org/11598


Change subject: ms_driver: use the util.Dir and create one dir per instance
......................................................................

ms_driver: use the util.Dir and create one dir per instance

Change-Id: Ie0f2fe99f6a6640606eb4e69fb1a2d22eae9b2c8
---
M src/osmo_gsm_tester/ms_driver.py
M src/osmo_ms_driver/__main__.py
M src/osmo_ms_driver/starter.py
3 files changed, 7 insertions(+), 6 deletions(-)



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

diff --git a/src/osmo_gsm_tester/ms_driver.py b/src/osmo_gsm_tester/ms_driver.py
index f46efa3..f9ad559 100644
--- a/src/osmo_gsm_tester/ms_driver.py
+++ b/src/osmo_gsm_tester/ms_driver.py
@@ -16,7 +16,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 from datetime import timedelta
-from . import log
+from . import log, util
 from osmo_ms_driver.cdf import cdfs
 from osmo_ms_driver.event_server import EventServer
 from osmo_ms_driver.simple_loop import SimpleLoop
@@ -85,7 +85,8 @@
         self._ev_server.listen(self._loop)
         options = BinaryOptions("virtphy", "mobile", None)
         self._test_case = MassUpdateLocationTest("mass", options, self._num_ms, self._cdf,
-                                                 self._ev_server, self.event_server_sk_tmp_dir)
+                                                 self._ev_server,
+                                                 util.Dir(self.event_server_sk_tmp_dir))
 
         # TODO: We should pass subscribers down to the test and not get it from
         # there.
diff --git a/src/osmo_ms_driver/__main__.py b/src/osmo_ms_driver/__main__.py
index 0e3611b..7e1afa8 100644
--- a/src/osmo_ms_driver/__main__.py
+++ b/src/osmo_ms_driver/__main__.py
@@ -21,7 +21,7 @@
 from .location_update_test import MassUpdateLocationTest
 from .cdf import cdfs
 from .starter import BinaryOptions
-from osmo_gsm_tester import log
+from osmo_gsm_tester import log, util
 
 # System modules
 from datetime import timedelta
@@ -64,7 +64,7 @@
 
     loop = SimpleLoop()
 
-    tmp_dir = tempfile.mkdtemp(suffix="osmo-ms-driver")
+    tmp_dir = util.Dir(tempfile.mkdtemp(suffix="osmo-ms-driver"))
     log.log("Going to store files in ", tmp_dir=tmp_dir)
 
     # How long should starting all apps take
@@ -73,7 +73,7 @@
     time_step=datetime.timedelta(milliseconds=args.launch_interval)
 
     # Event server path
-    event_server_path = os.path.join(tmp_dir,  "osmo_ms_driver.unix")
+    event_server_path = os.path.join(str(tmp_dir),  "osmo_ms_driver.unix")
 
     # The function that decides when to start something
     cdf = cdfs[args.cdf_name](time_start, time_step)
diff --git a/src/osmo_ms_driver/starter.py b/src/osmo_ms_driver/starter.py
index 4611cd6..a24d0c6 100644
--- a/src/osmo_ms_driver/starter.py
+++ b/src/osmo_ms_driver/starter.py
@@ -31,7 +31,7 @@
         self._binary = binary
         self._env = env
         self._name_number = name_number
-        self._tmp_dir = tmp_dir
+        self._tmp_dir = tmp_dir.new_dir(self.name())
 
     def name_number(self):
         return self._name_number

-- 
To view, visit https://gerrit.osmocom.org/11598
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: Ie0f2fe99f6a6640606eb4e69fb1a2d22eae9b2c8
Gerrit-Change-Number: 11598
Gerrit-PatchSet: 1
Gerrit-Owner: Holger Freyther <holger at freyther.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181105/168bf8ce/attachment.html>


More information about the gerrit-log mailing list