ms: Make the total test duration configurable
Change-Id: I5598d5dfd51e224e13835307ad20d108a5aa3935
This commit is contained in:
parent
874b4b4269
commit
1dc9a04bc1
|
@ -23,6 +23,8 @@ from .cdf import cdfs
|
||||||
from osmo_gsm_tester import log
|
from osmo_gsm_tester import log
|
||||||
|
|
||||||
# System modules
|
# System modules
|
||||||
|
from datetime import timedelta
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import atexit
|
import atexit
|
||||||
import datetime
|
import datetime
|
||||||
|
@ -39,6 +41,9 @@ def parser():
|
||||||
parser.add_argument('-i', '--launch-interval', dest='launch_interval',
|
parser.add_argument('-i', '--launch-interval', dest='launch_interval',
|
||||||
default=100, type=int,
|
default=100, type=int,
|
||||||
help="Time between launching in milliseconds")
|
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",
|
parser.add_argument('-d', '--distribution', dest="cdf_name",
|
||||||
choices=cdfs.keys(), default="ease_in_out",
|
choices=cdfs.keys(), default="ease_in_out",
|
||||||
help="Curve to use for starting within launch duration")
|
help="Curve to use for starting within launch duration")
|
||||||
|
@ -81,7 +86,7 @@ def main():
|
||||||
atexit.register(test.stop_all)
|
atexit.register(test.stop_all)
|
||||||
|
|
||||||
# Run until everything has been launched
|
# Run until everything has been launched
|
||||||
test.run_test(loop)
|
test.run_test(loop, timedelta(seconds=args.test_duration))
|
||||||
|
|
||||||
# Print stats
|
# Print stats
|
||||||
test.print_stats()
|
test.print_stats()
|
||||||
|
|
|
@ -55,7 +55,6 @@ class MassUpdateLocationTest(log.Origin):
|
||||||
|
|
||||||
TEMPLATE_LUA = "osmo-mobile-lu.lua"
|
TEMPLATE_LUA = "osmo-mobile-lu.lua"
|
||||||
TEMPLATE_CFG = "osmo-mobile.cfg"
|
TEMPLATE_CFG = "osmo-mobile.cfg"
|
||||||
TEST_TIME = timedelta(seconds=120)
|
|
||||||
|
|
||||||
def __init__(self, name, number_of_ms, cdf_function, event_server, tmp_dir):
|
def __init__(self, name, number_of_ms, cdf_function, event_server, tmp_dir):
|
||||||
super().__init__(log.C_RUN, name)
|
super().__init__(log.C_RUN, name)
|
||||||
|
@ -144,10 +143,10 @@ class MassUpdateLocationTest(log.Origin):
|
||||||
|
|
||||||
return current_time + step_size, sleep_time
|
return current_time + step_size, sleep_time
|
||||||
|
|
||||||
def run_test(self, loop):
|
def run_test(self, loop, test_duration):
|
||||||
self.prepare(loop)
|
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
|
tick_time = self._start_time
|
||||||
|
|
||||||
while not self.all_completed():
|
while not self.all_completed():
|
||||||
|
|
Loading…
Reference in New Issue