summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2010-08-02 19:24:59 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2010-08-02 19:24:59 +0200
commit92f2e80a211396981a276e170c958520a6636853 (patch)
tree1eac91ae21c72402478dcd1f3d881f8522cb5ba2 /test
parent975eb084b25466f54bc86ebba2fddbcb9b156ad1 (diff)
downloadconnman-92f2e80a211396981a276e170c958520a6636853.tar.gz
connman-92f2e80a211396981a276e170c958520a6636853.tar.bz2
connman-92f2e80a211396981a276e170c958520a6636853.zip
Update test scripts for the new provider interface
Diffstat (limited to 'test')
-rwxr-xr-xtest/get-services3
-rwxr-xr-xtest/list-providers38
-rwxr-xr-xtest/list-services2
-rwxr-xr-xtest/test-manager4
4 files changed, 39 insertions, 8 deletions
diff --git a/test/get-services b/test/get-services
index cfce68d5..d337e0ca 100755
--- a/test/get-services
+++ b/test/get-services
@@ -33,7 +33,8 @@ for entry in services:
for key in properties.keys():
if key in ["IPv4", "IPv4.Configuration",
"IPv6", "IPv6.Configuration",
- "Proxy", "Ethernet"]:
+ "Proxy", "Ethernet",
+ "Provider"]:
val = extract_values(properties[key])
elif key in ["Nameservers", "Nameservers.Configuration",
"Domains", "Domains.Configuration"]:
diff --git a/test/list-providers b/test/list-providers
index d808fa03..94375d55 100755
--- a/test/list-providers
+++ b/test/list-providers
@@ -2,6 +2,24 @@
import dbus
+def extract_values(values):
+ val = "{"
+ for key in values.keys():
+ val += " " + key + "="
+ if key in ["PrefixLength"]:
+ val += "%s" % (int(values[key]))
+ else:
+ val += str(values[key])
+ val += " }"
+ return val
+
+def extract_list(list):
+ val = "["
+ for i in list:
+ val += " " + str(i)
+ val += " ]"
+ return val
+
bus = dbus.SystemBus()
manager = dbus.Interface(bus.get_object("org.moblin.connman", "/"),
@@ -11,17 +29,31 @@ properties = manager.GetProperties()
for path in properties["Providers"]:
service = dbus.Interface(bus.get_object("org.moblin.connman", path),
- "org.moblin.connman.Provider")
+ "org.moblin.connman.Service")
properties = service.GetProperties()
print "[ %s ]" % (path)
for key in properties.keys():
- if key in ["Strength"]:
+ if key in ["IPv4", "IPv4.Configuration",
+ "IPv6", "IPv6.Configuration",
+ "Proxy", "Ethernet", "Provider"]:
+ val = extract_values(properties[key])
+ elif key in ["Nameservers", "Nameservers.Configuration",
+ "Domains", "Domains.Configuration"]:
+ val = extract_list(properties[key])
+ elif key in ["Favorite", "Immutable", "AutoConnect",
+ "LoginRequired", "SetupRequired",
+ "PassphraseRequired"]:
+ if properties[key] == dbus.Boolean(1):
+ val = "true"
+ else:
+ val = "false"
+ elif key in ["Strength"]:
val = int(properties[key])
else:
- val = str(properties[key])
+ val = properties[key]
print " %s = %s" % (key, val)
print
diff --git a/test/list-services b/test/list-services
index bd962377..a8940921 100755
--- a/test/list-services
+++ b/test/list-services
@@ -38,7 +38,7 @@ for path in properties["Services"]:
for key in properties.keys():
if key in ["IPv4", "IPv4.Configuration",
"IPv6", "IPv6.Configuration",
- "Proxy", "Ethernet"]:
+ "Proxy", "Ethernet", "Provider"]:
val = extract_values(properties[key])
elif key in ["Nameservers", "Nameservers.Configuration",
"Domains", "Domains.Configuration"]:
diff --git a/test/test-manager b/test/test-manager
index e2d72d11..92f70858 100755
--- a/test/test-manager
+++ b/test/test-manager
@@ -14,10 +14,8 @@ def print_properties(key, value):
interface = "org.moblin.connman.Profile"
elif key == "Devices":
interface = "org.moblin.connman.Device"
- elif key == "Services":
+ elif key in ["Services", "Providers"]:
interface = "org.moblin.connman.Service"
- elif key == "Providers":
- interface = "org.moblin.connman.Provider"
elif key == "Technologies":
interface = "org.moblin.connman.Technology"
else: