summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2008-10-04 13:00:00 +0200
committerJohan Hedberg <johan.hedberg@nokia.com>2008-10-04 13:00:00 +0200
commitffcd40c827921adc5865b2bbf9662e1f259b15d1 (patch)
tree0a2130772baa323b250772aa4f8bb8831e3bca6f
parent2ab16c09f43aabeaf6545d6d19ffa88c404c4abf (diff)
Add test script for dummy telephony plugin
-rwxr-xr-xtest/test-telephony78
1 files changed, 78 insertions, 0 deletions
diff --git a/test/test-telephony b/test/test-telephony
new file mode 100755
index 00000000..99e7c197
--- /dev/null
+++ b/test/test-telephony
@@ -0,0 +1,78 @@
+#!/usr/bin/python
+
+import sys
+import dbus
+
+bus = dbus.SystemBus()
+
+test = dbus.Interface(bus.get_object("org.bluez", "/org/bluez/test"),
+ "org.bluez.TelephonyTest")
+if len(sys.argv) < 2:
+ print """Usage: %s <command>
+
+ outgoing <number>
+ incoming <number>
+ cancel
+ signal <level>
+ battery <level>
+ roaming <yes|no>
+ registration <status>
+ subscriber <number>
+ """ % sys.argv[0]
+ sys.exit(1)
+
+if sys.argv[1] == "outgoing":
+ if len(sys.argv) > 2:
+ test.OutgoingCall(sys.argv[2])
+ else:
+ print "Need number parameter"
+ sys.exit(0)
+
+if sys.argv[1] == "incoming":
+ if len(sys.argv) > 2:
+ test.IncomingCall(sys.argv[2])
+ else:
+ print "Need number parameter"
+ sys.exit(0)
+
+if sys.argv[1] == "cancel":
+ test.CancelCall()
+ sys.exit(0)
+
+if sys.argv[1] == "signal":
+ if len(sys.argv) > 2:
+ test.SignalStrength(sys.argv[2])
+ else:
+ print "Need signal strength parameter"
+ sys.exit(0)
+
+if sys.argv[1] == "battery":
+ if len(sys.argv) > 2:
+ test.BatteryLevel(sys.argv[2])
+ else:
+ print "Need battery level parameter"
+ sys.exit(0)
+
+if sys.argv[1] == "roaming":
+ if len(sys.argv) > 2:
+ test.RoamingStatus(sys.argv[2] == "yes" or False)
+ else:
+ print "Need yes/no parameter"
+ sys.exit(0)
+
+if sys.argv[1] == "registration":
+ if len(sys.argv) > 2:
+ test.RegistrationStatus(sys.argv[2] == "yes" or False)
+ else:
+ print "Need yes/no parameter"
+ sys.exit(0)
+
+if sys.argv[1] == "subscriber":
+ if len(sys.argv) > 2:
+ test.SetSubscriberNumber(sys.argv[2])
+ else:
+ print "Need number parameter"
+ sys.exit(0)
+
+print "Unknown command"
+sys.exit(1)