test: fixing type conversion bug in test-session
[framework/connectivity/connman.git] / test / set-nameservers
1 #!/usr/bin/python
2
3 import sys
4 import dbus
5
6 if (len(sys.argv) < 2):
7         print "Usage: %s <service> [nameserver*]" % (sys.argv[0])
8         sys.exit(1)
9
10 bus = dbus.SystemBus()
11 path = "/net/connman/service/" + sys.argv[1]
12 service = dbus.Interface(bus.get_object('net.connman', path),
13                                         'net.connman.Service')
14
15 properties = service.GetProperties()
16
17 print "Setting nameserver to %s" % (sys.argv[2:])
18
19 service.SetProperty("Nameservers.Configuration", 
20         dbus.Array(sys.argv[2:], signature=dbus.Signature('s')))