This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
Neels Hofmeyr gerrit-no-reply at lists.osmocom.orgNeels Hofmeyr has submitted this change and it was merged.
Change subject: Add features attribute to modems
......................................................................
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
---
M example/resources.conf
A example/scenarios/mfeature-gprs.conf
M src/osmo_gsm_tester/resource.py
M src/osmo_gsm_tester/schema.py
4 files changed, 17 insertions(+), 0 deletions(-)
Approvals:
Neels Hofmeyr: Looks good to me, approved
Jenkins Builder: Verified
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 @@
ki: '80A37E6FDEA931EAC92FFA5F671EFEAD'
auth_algo: 'xor'
ciphers: [a5_0, a5_1]
+ features: ['sms']
- label: sierra_2
path: '/sierra_2'
@@ -67,6 +68,7 @@
ki: '00969E283349D354A8239E877F2E0866'
auth_algo: 'xor'
ciphers: [a5_0, a5_1]
+ features: ['sms']
- label: gobi_0
path: '/gobi_0'
@@ -74,6 +76,7 @@
ki: 'BB70807226393CDBAC8DD3439FF54252'
auth_algo: 'xor'
ciphers: [a5_0, a5_1]
+ features: ['sms']
- label: gobi_3
path: '/gobi_3'
@@ -81,3 +84,4 @@
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 dab3453..f1697ea 100644
--- a/src/osmo_gsm_tester/resource.py
+++ b/src/osmo_gsm_tester/resource.py
@@ -69,6 +69,7 @@
'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 @@
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 @@
AUTH_ALGO = 'auth_algo'
TIMES='times'
CIPHER = 'cipher'
+MODEM_FEATURE = 'modem_feature'
+
SCHEMA_TYPES = {
INT: int,
STR: str,
@@ -108,6 +115,7 @@
AUTH_ALGO: auth_algo,
TIMES: times,
CIPHER: cipher,
+ MODEM_FEATURE: modem_feature,
}
def validate(config, schema):
--
To view, visit https://gerrit.osmocom.org/3763
To unsubscribe, visit https://gerrit.osmocom.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I1634049f01859ae0310174892a96e204bb670bc1
Gerrit-PatchSet: 9
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>