diff options
author | Samuel Ortiz <sameo@linux.intel.com> | 2010-07-28 19:59:05 +0200 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2010-07-29 02:12:54 +0200 |
commit | ecb349ca3e73b55f745642be49c2e6f0ac7a1a82 (patch) | |
tree | a746ffd6c7ddfd11740598140418205b7b95dfad /test/set-address | |
parent | 7f54267c96a58191004e30ac2c01acf369f1df33 (diff) | |
download | connman-ecb349ca3e73b55f745642be49c2e6f0ac7a1a82.tar.gz connman-ecb349ca3e73b55f745642be49c2e6f0ac7a1a82.tar.bz2 connman-ecb349ca3e73b55f745642be49c2e6f0ac7a1a82.zip |
Update test scripts for IPv6 support
Diffstat (limited to 'test/set-address')
-rwxr-xr-x | test/set-address | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/test/set-address b/test/set-address index 529b6351..4933c601 100755 --- a/test/set-address +++ b/test/set-address @@ -4,7 +4,7 @@ import sys import dbus if (len(sys.argv) < 3): - print "Usage: %s <address> <netmask> <gateway>" % (sys.argv[0]) + print "Usage: %s <address> <netmask | prefix length> <gateway> [version]" % (sys.argv[0]) sys.exit(1) bus = dbus.SystemBus() @@ -20,10 +20,26 @@ for path in properties["Services"]: properties = service.GetProperties() - print "Setting address %s for %s" % (sys.argv[1], path) - service.SetProperty("IPv4.Configuration", - { "Method": "manual", "Address": sys.argv[1], - "Netmask": sys.argv[2], "Gateway": sys.argv[3]}) + + if (len(sys.argv) == 5 and sys.argv[4] == "ipv6"): + ipv = 6 + else: + ipv = 4 + + print "Setting IPv%d address %s for %s" % (ipv, sys.argv[1], path) + + if (ipv == 4): + service.SetProperty("IPv4.Configuration", + { "Method": "manual", + "Address": sys.argv[1], + "Netmask": sys.argv[2], + "Gateway": sys.argv[3]}) + else: + service.SetProperty("IPv6.Configuration", + { "Method": "manual", + "Address": sys.argv[1], + "PrefixLength": sys.argv[2], + "Gateway": sys.argv[3]}) print |