resource: ipa_unit_id is expected to be a positive integer
Change-Id: I26d7a4351089b73716d193496d7161bf3d9988bb
diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py
index da543f7..f8acb9e 100644
--- a/src/osmo_gsm_tester/resource.py
+++ b/src/osmo_gsm_tester/resource.py
@@ -51,7 +51,7 @@
'ip_address[].addr': schema.IPV4,
'bts[].label': schema.STR,
'bts[].type': schema.STR,
- 'bts[].ipa_unit_id': schema.INT,
+ 'bts[].ipa_unit_id': schema.UINT,
'bts[].addr': schema.IPV4,
'bts[].band': schema.BAND,
'bts[].trx_remote_ip': schema.IPV4,
diff --git a/src/osmo_gsm_tester/schema.py b/src/osmo_gsm_tester/schema.py
index 2da80cd..b904960 100644
--- a/src/osmo_gsm_tester/schema.py
+++ b/src/osmo_gsm_tester/schema.py
@@ -66,8 +66,14 @@
return
raise ValueError('Unknown Authentication Algorithm: %r' % val)
+def uint(val):
+ n = int(val)
+ if n < 0:
+ raise ValueError('Positive value expected instead of %d' % n)
+
INT = 'int'
STR = 'str'
+UINT = 'uint'
BOOL_STR = 'bool_str'
BAND = 'band'
IPV4 = 'ipv4'
@@ -79,6 +85,7 @@
SCHEMA_TYPES = {
INT: int,
STR: str,
+ UINT: uint,
BOOL_STR: str2bool,
BAND: band,
IPV4: ipv4,