iperf3: add config to adjust the duration of the iperf run
the time is passed as a string param and is then converted
into seconds when literals "h" or "m" are found.
So it would accept 2m and would convert it to 120s, for example.
Example:
+cfg-iperf3-time@15+
Change-Id: Iff28816f83670751e9e91de31ec59b1b0ad8fc0d
diff --git a/src/osmo_gsm_tester/schema.py b/src/osmo_gsm_tester/schema.py
index 7fe6689..85c5fd6 100644
--- a/src/osmo_gsm_tester/schema.py
+++ b/src/osmo_gsm_tester/schema.py
@@ -136,6 +136,11 @@
return
raise ValueError('Unknown LTE RLC DRB Mode value: %r' % val)
+def duration(val):
+ if val.isdecimal() or val.endswith('m') or val.endswith('h'):
+ return
+ raise ValueError('Invalid duration value: %r' % val)
+
INT = 'int'
STR = 'str'
UINT = 'uint'
@@ -157,6 +162,7 @@
OSMO_TRX_CLOCK_REF = 'osmo_trx_clock_ref'
LTE_TRANSMISSION_MODE = 'lte_transmission_mode'
LTE_RLC_DRB_MODE = 'lte_rlc_drb_mode'
+DURATION = 'duration'
SCHEMA_TYPES = {
INT: int,
@@ -180,6 +186,7 @@
OSMO_TRX_CLOCK_REF: osmo_trx_clock_ref,
LTE_TRANSMISSION_MODE: lte_transmission_mode,
LTE_RLC_DRB_MODE: lte_rlc_drb_mode,
+ DURATION: duration,
}
def validate(config, schema):