diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2009-03-25 17:14:19 -0700 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2009-03-25 17:14:19 -0700 |
commit | c1beabceca8862bb17efc2155e0ca4811928407f (patch) | |
tree | ef5a378d64d6dde5f5e41937150a320a3cef9bd4 /test/set-priority | |
parent | d768f6821cdb93ffbce08fbb19777202e61682b7 (diff) | |
download | connman-c1beabceca8862bb17efc2155e0ca4811928407f.tar.gz connman-c1beabceca8862bb17efc2155e0ca4811928407f.tar.bz2 connman-c1beabceca8862bb17efc2155e0ca4811928407f.zip |
Add test script for setting device priorities
Diffstat (limited to 'test/set-priority')
-rwxr-xr-x | test/set-priority | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/set-priority b/test/set-priority new file mode 100755 index 00000000..37a0e72d --- /dev/null +++ b/test/set-priority @@ -0,0 +1,28 @@ +#!/usr/bin/python + +import sys +import dbus + +if (len(sys.argv) < 3): + print "Usage: %s <device> <priority>" % (sys.argv[0]) + sys.exit(1) + +bus = dbus.SystemBus() + +manager = dbus.Interface(bus.get_object('org.moblin.connman', "/"), + 'org.moblin.connman.Manager') + +properties = manager.GetProperties() + +for path in properties["Devices"]: + device = dbus.Interface(bus.get_object('org.moblin.connman', path), + 'org.moblin.connman.Device') + + properties = device.GetProperties() + + if properties["Interface"] != sys.argv[1]: + continue; + + print "Setting priority %d for device %s" % (int(sys.argv[2]), path) + + device.SetProperty("Priority", dbus.Byte(int(sys.argv[2]))); |