diff options
author | Guillaume Zajac <guillaume.zajac@linux.intel.com> | 2012-05-30 10:28:16 +0200 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2012-05-30 08:50:21 -0500 |
commit | 87a9f32ae1378f5cdeb7a972fc3672978c45006c (patch) | |
tree | 9e2e0e793f53981427e3cee1c8df1a4960cd6bae /test | |
parent | da80dd7d97af475bff8dfd3ec25d254d6d66b858 (diff) | |
download | ofono-87a9f32ae1378f5cdeb7a972fc3672978c45006c.tar.bz2 |
test: Add new script for SS GCF test cases
This script uses dynamic SS codes in input and
displays answers to the different requests.
It handles all SS: call barring, call forwarding,
call waiting, CLIP, CLIR, ...
Diffstat (limited to 'test')
-rwxr-xr-x | test/test-ss | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/test/test-ss b/test/test-ss new file mode 100755 index 00000000..d5488d74 --- /dev/null +++ b/test/test-ss @@ -0,0 +1,42 @@ +#!/usr/bin/python + +import sys +import dbus + +bus = dbus.SystemBus() + +manager = dbus.Interface(bus.get_object('org.ofono', '/'), + 'org.ofono.Manager') + +modems = manager.GetModems() +modem = modems[0][0] + +if (len(sys.argv) == 2): + ss_code = sys.argv[1] +else: + modem = sys.argv[1] + ss_code = sys.argv[2] + +ss = dbus.Interface(bus.get_object('org.ofono', modem), + 'org.ofono.SupplementaryServices') + +try: + ss_type, properties = ss.Initiate(ss_code, timeout=100) +except dbus.DBusException, e: + print "Unable to perform operation: ", e + sys.exit(1); + +if (ss_type == "CallBarring"): + print "%s : Operation [ %s ] Service Type [ %s ]" % (ss_type, properties[0], properties[1]) + for key in properties[2]: + print "%s : %s" % (key, properties[2][key]) +elif (ss_type == "CallForwarding"): + print "%s : Operation [ %s ] Service Type [ %s ]" % (ss_type, properties[0], properties[1]) + for key in properties[2]: + print "%s : %s" % (key, properties[2][key]) +elif (ss_type == "CallWaiting"): + print "%s : Operation [ %s ]" % (ss_type, properties[0]) + for key in properties[1]: + print "%s : %s" % (key, properties[1][key]) +else: + print "%s : Operation [ %s ] Status [ %s ]" % (ss_type, properties[0], properties[1]) |