summaryrefslogtreecommitdiffstats
path: root/src/osmo_gsm_tester/schema.py
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2017-09-12 15:19:18 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2017-09-12 17:06:55 +0200
commitd761efc80fe36443fd747d50bbb546ea212639a4 (patch)
tree68ffe490dc57e2b46dee70c8c05ae4c036476262 /src/osmo_gsm_tester/schema.py
parentf111ee775eba76d92ee9dde223a60c2ccd016f04 (diff)
resource: times is expected to be a non-zero positive integer
Diffstat (limited to 'src/osmo_gsm_tester/schema.py')
-rw-r--r--src/osmo_gsm_tester/schema.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/osmo_gsm_tester/schema.py b/src/osmo_gsm_tester/schema.py
index b904960..dcdfdb1 100644
--- a/src/osmo_gsm_tester/schema.py
+++ b/src/osmo_gsm_tester/schema.py
@@ -71,6 +71,11 @@ def uint(val):
if n < 0:
raise ValueError('Positive value expected instead of %d' % n)
+def times(val):
+ n = int(val)
+ if n < 1:
+ raise ValueError('Positive value >0 expected instead of %d' % n)
+
INT = 'int'
STR = 'str'
UINT = 'uint'
@@ -82,6 +87,7 @@ IMSI = 'imsi'
KI = 'ki'
MSISDN = 'msisdn'
AUTH_ALGO = 'auth_algo'
+TIMES='times'
SCHEMA_TYPES = {
INT: int,
STR: str,
@@ -94,6 +100,7 @@ SCHEMA_TYPES = {
KI: ki,
MSISDN: msisdn,
AUTH_ALGO: auth_algo,
+ TIMES: times,
}
def validate(config, schema):