summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2017-08-31 18:49:47 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2017-09-14 15:56:48 +0200
commit98dcdd3a2957934d8c8193bb9257f201a38a230b (patch)
tree04652292c806b02bfff4b6d3b1b5786035059785
parentdd44c55d5c3ce6f037ff7163e3076a18ee33482e (diff)
Add features attribute to modems
The idea behind this attribute is similar to the Features one in ofono: To provide an easy-to-use list of features that a modem supports. In osmo-gsm-tester this feature list can be used to create scenarios to act as a filter for modems. For instance, if an sms related feature must be tested, then a modem supporting sms features is required. This way only modems supporting that feature are going to be selected for that test when that scenario is used. We provide our own list instead of dynamically using it for two reasons: - Accessing the list from ofono means powering on + online the modem, which requires using the modem before resource resolution is done. - ofono may state that it has support for feature X, but it still doesn't have all features required by osmo-gsm-tester or there is a bug in some part of the feature which prevents it from being used for a specific test. Change-Id: I1634049f01859ae0310174892a96e204bb670bc1
-rw-r--r--example/resources.conf4
-rw-r--r--example/scenarios/mfeature-gprs.conf4
-rw-r--r--src/osmo_gsm_tester/resource.py1
-rw-r--r--src/osmo_gsm_tester/schema.py8
4 files changed, 17 insertions, 0 deletions
diff --git a/example/resources.conf b/example/resources.conf
index 95cb8cf..3daf677 100644
--- a/example/resources.conf
+++ b/example/resources.conf
@@ -60,6 +60,7 @@ modem:
ki: '80A37E6FDEA931EAC92FFA5F671EFEAD'
auth_algo: 'xor'
ciphers: [a5_0, a5_1]
+ features: ['sms']
- label: sierra_2
path: '/sierra_2'
@@ -67,6 +68,7 @@ modem:
ki: '00969E283349D354A8239E877F2E0866'
auth_algo: 'xor'
ciphers: [a5_0, a5_1]
+ features: ['sms']
- label: gobi_0
path: '/gobi_0'
@@ -74,6 +76,7 @@ modem:
ki: 'BB70807226393CDBAC8DD3439FF54252'
auth_algo: 'xor'
ciphers: [a5_0, a5_1]
+ features: ['sms']
- label: gobi_3
path: '/gobi_3'
@@ -81,3 +84,4 @@ modem:
ki: '2F70DCA43C45ACB97E947FDD0C7CA30A'
auth_algo: 'xor'
ciphers: [a5_0, a5_1]
+ features: ['gprs']
diff --git a/example/scenarios/mfeature-gprs.conf b/example/scenarios/mfeature-gprs.conf
new file mode 100644
index 0000000..c520a90
--- /dev/null
+++ b/example/scenarios/mfeature-gprs.conf
@@ -0,0 +1,4 @@
+resources:
+ modem:
+ - features:
+ - 'gprs'
diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py
index a70b366..68cf615 100644
--- a/src/osmo_gsm_tester/resource.py
+++ b/src/osmo_gsm_tester/resource.py
@@ -69,6 +69,7 @@ RESOURCES_SCHEMA = {
'modem[].ki': schema.KI,
'modem[].auth_algo': schema.AUTH_ALGO,
'modem[].ciphers[]': schema.CIPHER,
+ 'modem[].features[]': schema.MODEM_FEATURE,
}
WANT_SCHEMA = util.dict_add(
diff --git a/src/osmo_gsm_tester/schema.py b/src/osmo_gsm_tester/schema.py
index 9a0906c..6d5f7ad 100644
--- a/src/osmo_gsm_tester/schema.py
+++ b/src/osmo_gsm_tester/schema.py
@@ -81,6 +81,11 @@ def cipher(val):
return
raise ValueError('Unknown Cipher value: %r' % val)
+def modem_feature(val):
+ if val in ('sms', 'gprs', 'voicecall', 'ussd'):
+ return
+ raise ValueError('Unknown Modem Feature: %r' % val)
+
INT = 'int'
STR = 'str'
UINT = 'uint'
@@ -94,6 +99,8 @@ MSISDN = 'msisdn'
AUTH_ALGO = 'auth_algo'
TIMES='times'
CIPHER = 'cipher'
+MODEM_FEATURE = 'modem_feature'
+
SCHEMA_TYPES = {
INT: int,
STR: str,
@@ -108,6 +115,7 @@ SCHEMA_TYPES = {
AUTH_ALGO: auth_algo,
TIMES: times,
CIPHER: cipher,
+ MODEM_FEATURE: modem_feature,
}
def validate(config, schema):