virtual: Separate starting virtphy/mobile from the test
Move the starting code out of the Update Location "test". In the mid
term we can have a SMS test run in addition to waiting the Update
Location tests.
A mass-test testcase will have a life-cycle of:
* Creation
* Configure (number of subscribers, probably all subs)
* Pre-Start trigger (same as configure so it can be omitted)
* Post-Start (all processes run)
* Query if the test has completed
The next step is an actual implementation to send SMS.
Change-Id: Ie15f5123775d11dd44243b2741d047ed93f318f9
diff --git a/src/osmo_gsm_tester/ms_driver.py b/src/osmo_gsm_tester/ms_driver.py
index 3cfcad6..329662a 100644
--- a/src/osmo_gsm_tester/ms_driver.py
+++ b/src/osmo_gsm_tester/ms_driver.py
@@ -20,7 +20,7 @@
from osmo_ms_driver.cdf import cdfs
from osmo_ms_driver.event_server import EventServer
from osmo_ms_driver.simple_loop import SimpleLoop
-from osmo_ms_driver.location_update_test import MassUpdateLocationTest
+from osmo_ms_driver.location_update_test import MassUpdateLocationTest, MobileTestStarter
from osmo_ms_driver.starter import BinaryOptions
import os.path
@@ -92,14 +92,18 @@
self._ev_server = EventServer("ev_server", event_server_path)
self._ev_server.listen(self._loop)
+ self._results = {}
options = self.build_binary_options()
- self._test_case = MassUpdateLocationTest("mass", options, self._cdf,
- self._ev_server,
- util.Dir(self.event_server_sk_tmp_dir),
- suite_run=self._suite_run)
+ self._starter = MobileTestStarter("mass", options, self._cdf,
+ self._ev_server,
+ util.Dir(self.event_server_sk_tmp_dir),
+ self._results, suite_run=self._suite_run)
+ self._test_case = MassUpdateLocationTest("mass", self._ev_server, self._results)
for sub in self._subscribers:
- self._test_case.subscriber_add(sub)
+ self._starter.subscriber_add(sub)
+
+ self._test_case.configure(len(self._subscribers))
self._configured = True
def run_test(self):
@@ -110,7 +114,8 @@
"""
if not self._configured:
self.configure()
- self._test_case.run_test(self._loop, self._test_duration)
+ deadline = self._starter.start_all(self._loop, self._test_duration)
+ self._test_case.wait_for_test(self._loop, deadline)
def print_stats(self):
"""