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
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):