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/.
Holger Freyther gerrit-no-reply at lists.osmocom.orgHolger Freyther has uploaded this change for review. ( https://gerrit.osmocom.org/9712
Change subject: Begin to refactor and be able to share functionality
......................................................................
Begin to refactor and be able to share functionality
Change-Id: I840af0396f08744ce8ee6a2967f880d5cb7f815f
---
M src/osmo_ms_driver/location_update_test.py
A src/osmo_ms_driver/test_support.py
2 files changed, 57 insertions(+), 30 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/12/9712/1
diff --git a/src/osmo_ms_driver/location_update_test.py b/src/osmo_ms_driver/location_update_test.py
index 0d27d0e..2a3c246 100644
--- a/src/osmo_ms_driver/location_update_test.py
+++ b/src/osmo_ms_driver/location_update_test.py
@@ -1,5 +1,5 @@
-# osmo_ms_driver: Starter for processes
-# Help to start processes over time.
+# osmo_ms_driver: Locationg Update Test
+# Create MS's and wait for the Location Update to succeed.
#
# Copyright (C) 2018 by Holger Hans Peter Freyther
#
@@ -19,46 +19,22 @@
from osmo_gsm_tester import log
from .starter import OsmoVirtPhy, OsmoMobile
+from .test_support import imsi_ki_gen, Results
from datetime import timedelta
import time
-def imsi_ki_gen():
- """
- Generate IMSIs and KIs to be used by test.
- """
- n = 1010000000000
- while True:
- yield ("%.15d" % n, "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00")
- n += 1
-
-class Results(log.Origin):
+class LUResult(Results):
def __init__(self, name):
- super().__init__(log.C_RUN, name)
- self._time_of_registration = None
- self._time_of_launch = None
+ super().__init__(name)
self._time_of_lu = None
- def set_start_time(self, time):
- assert self._time_of_registration is None
- self._time_of_registration = time
-
- def set_launch_time(self, time):
- assert self._time_of_launch is None
- self._time_of_launch = time
-
def set_lu_time(self, time):
assert self._time_of_lu is None
self._time_of_lu = time
- def start_time(self):
- return self._time_of_registration or 0
-
- def launch_time(self):
- return self._time_of_launch or 0
-
def lu_time(self):
return self._time_of_lu or 0
@@ -98,7 +74,7 @@
self.TEMPLATE_CFG, imsi_gen,
phy.phy_filename(),
event_server.server_path())
- self._results[ms_name] = Results(ms_name)
+ self._results[ms_name] = LUResult(ms_name)
self._unstarted.append(launcher)
self._event_server = event_server
self._event_server.register(self.handle_msg)
diff --git a/src/osmo_ms_driver/test_support.py b/src/osmo_ms_driver/test_support.py
new file mode 100644
index 0000000..f1c34fb
--- /dev/null
+++ b/src/osmo_ms_driver/test_support.py
@@ -0,0 +1,51 @@
+# osmo_ms_driver: Test helpers and base classes
+#
+# Copyright (C) 2018 by Holger Hans Peter Freyther
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+from osmo_gsm_tester import log
+
+def imsi_ki_gen():
+ """
+ Generate IMSIs and KIs to be used by test.
+ """
+ n = 1010000000000
+ while True:
+ yield ("%.15d" % n, "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00")
+ n += 1
+
+class Results(log.Origin):
+ """
+ A base class to collect results from tests.
+ """
+
+ def __init__(self, name):
+ super().__init__(log.C_RUN, name)
+ self._time_of_registration = None
+ self._time_of_launch = None
+
+ def set_start_time(self, time):
+ assert self._time_of_registration is None
+ self._time_of_registration = time
+
+ def set_launch_time(self, time):
+ assert self._time_of_launch is None
+ self._time_of_launch = time
+
+ def start_time(self):
+ return self._time_of_registration or 0
+
+ def launch_time(self):
+ return self._time_of_launch or 0
--
To view, visit https://gerrit.osmocom.org/9712
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: I840af0396f08744ce8ee6a2967f880d5cb7f815f
Gerrit-Change-Number: 9712
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/20180623/a160c85a/attachment.htm>