ms: Make the total test duration configurable

Change-Id: I5598d5dfd51e224e13835307ad20d108a5aa3935
This commit is contained in:
Holger Hans Peter Freyther 2018-06-23 22:27:23 +01:00
parent 874b4b4269
commit 1dc9a04bc1
2 changed files with 8 additions and 4 deletions

View File

@ -23,6 +23,8 @@ from .cdf import cdfs
from osmo_gsm_tester import log
# System modules
from datetime import timedelta
import argparse
import atexit
import datetime
@ -39,6 +41,9 @@ def parser():
parser.add_argument('-i', '--launch-interval', dest='launch_interval',
default=100, type=int,
help="Time between launching in milliseconds")
parser.add_argument('-t', '--test-duration', dest="test_duration",
default=120, type=int,
help="Time of the test duration in seconds")
parser.add_argument('-d', '--distribution', dest="cdf_name",
choices=cdfs.keys(), default="ease_in_out",
help="Curve to use for starting within launch duration")
@ -81,7 +86,7 @@ def main():
atexit.register(test.stop_all)
# Run until everything has been launched
test.run_test(loop)
test.run_test(loop, timedelta(seconds=args.test_duration))
# Print stats
test.print_stats()

View File

@ -55,7 +55,6 @@ class MassUpdateLocationTest(log.Origin):
TEMPLATE_LUA = "osmo-mobile-lu.lua"
TEMPLATE_CFG = "osmo-mobile.cfg"
TEST_TIME = timedelta(seconds=120)
def __init__(self, name, number_of_ms, cdf_function, event_server, tmp_dir):
super().__init__(log.C_RUN, name)
@ -144,10 +143,10 @@ class MassUpdateLocationTest(log.Origin):
return current_time + step_size, sleep_time
def run_test(self, loop):
def run_test(self, loop, test_duration):
self.prepare(loop)
to_complete_time = self._start_time + self.TEST_TIME.total_seconds()
to_complete_time = self._start_time + test_duration.total_seconds()
tick_time = self._start_time
while not self.all_completed():