test: Allow specifiying the modem

in test/test-call-settings
This commit is contained in:
Bertrand Aygon 2011-03-04 11:22:53 +01:00 committed by Denis Kenzior
parent 2cb579005a
commit 8f954f28de
1 changed files with 13 additions and 5 deletions

View File

@ -14,15 +14,12 @@ def property_changed(name, value):
if __name__ == "__main__":
if len(sys.argv) < 3:
print "Usage: %s <property> <newvalue>" % (sys.argv[0])
print "Usage: %s [modem] <property> <newvalue>" % (sys.argv[0])
print "Properties can be: VoiceCallWaiting, HideCallerId"
sys.exit(1)
canexit = False
property = sys.argv[1]
newvalue = sys.argv[2]
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
bus = dbus.SystemBus()
@ -31,8 +28,19 @@ if __name__ == "__main__":
'org.ofono.Manager')
modems = manager.GetModems()
modem = modems[0][0]
cs = dbus.Interface(bus.get_object('org.ofono', modems[0][0]),
if (len(sys.argv) == 4):
modem = sys.argv[1]
property = sys.argv[2]
newvalue = sys.argv[3]
else:
property = sys.argv[1]
newvalue = sys.argv[2]
print "Using modem %s" % modem
cs = dbus.Interface(bus.get_object('org.ofono', modem),
'org.ofono.CallSettings')
cs.connect_to_signal("PropertyChanged", property_changed)