From 11c127dac776955e4b31a4bf50f660169009a58e Mon Sep 17 00:00:00 2001 From: Samuel Ortiz Date: Mon, 2 Aug 2010 19:33:39 +0200 Subject: Fix test-manager --- test/test-manager | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/test-manager b/test/test-manager index 92f70858..b5a2530c 100755 --- a/test/test-manager +++ b/test/test-manager @@ -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", "/"), @@ -34,12 +52,25 @@ def print_properties(key, value): "Providers", "Technologies"]: continue - if key in ["Powered", "Scanning", "Connected", - "Available", "Remember", "Default"]: + elif key in ["Powered", "Scanning", "Connected", + "Available", "Remember", "Default", + "Favorite", "Immutable", "AutoConnect", + "LoginRequired", "SetupRequired", + "PassphraseRequired"]: if properties[key] == dbus.Boolean(1): val = "true" else: val = "false" + + elif 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 ["Strength", "Priority"]: val = int(properties[key]) else: -- cgit v1.2.3