From 65285f40092e857065e17b0a2e3ea02680b2fcd7 Mon Sep 17 00:00:00 2001 From: "Gustavo F. Padovan" Date: Wed, 24 Nov 2010 16:21:39 -0200 Subject: [PATCH] test: Providers is no longer a manager property --- Makefile.am | 8 +++---- test/list-providers | 63 --------------------------------------------------- test/monitor-manager | 2 +- test/monitor-services | 2 +- test/test-manager | 12 +++------- 5 files changed, 9 insertions(+), 78 deletions(-) delete mode 100755 test/list-providers diff --git a/Makefile.am b/Makefile.am index cba6b9c..b4d4250 100644 --- a/Makefile.am +++ b/Makefile.am @@ -182,10 +182,10 @@ test_scripts = test/get-state test/list-profiles test/list-services \ test/set-address test/test-profile \ test/simple-agent test/show-introspection test/test-compat \ test/test-manager test/test-connman test/monitor-connman \ - test/connect-vpn test/disconnect-vpn test/list-providers \ - test/monitor-manager test/test-counter test/set-ip-method \ - test/set-nameservers test/set-domains test/find-service \ - test/get-services test/get-proxy-autoconfig test/set-proxy \ + test/connect-vpn test/disconnect-vpn test/monitor-manager \ + test/test-counter test/set-ip-method test/set-nameservers \ + test/set-domains test/find-service test/get-services \ + test/get-proxy-autoconfig test/set-proxy \ test/enable-tethering test/disable-tethering test/backtrace if TEST diff --git a/test/list-providers b/test/list-providers deleted file mode 100755 index 8497685..0000000 --- a/test/list-providers +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/python - -import dbus - -def extract_values(values): - val = "{" - for key in values.keys(): - val += " " + key + "=" - if key in ["PrefixLength"]: - val += "%s" % (int(values[key])) - else: - if key in ["Servers", "Excludes"]: - val += extract_list(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", "/"), - "org.moblin.connman.Manager") - -properties = manager.GetProperties() - -for path in properties["Providers"]: - service = dbus.Interface(bus.get_object("org.moblin.connman", path), - "org.moblin.connman.Service") - - properties = service.GetProperties() - - print "[ %s ]" % (path) - - for key in properties.keys(): - if key in ["IPv4", "IPv4.Configuration", - "IPv6", "IPv6.Configuration", - "Proxy", "Proxy.Configuration", - "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 = properties[key] - print " %s = %s" % (key, val) - - print diff --git a/test/monitor-manager b/test/monitor-manager index f9fe26a..ebb53f7 100755 --- a/test/monitor-manager +++ b/test/monitor-manager @@ -6,7 +6,7 @@ import dbus import dbus.mainloop.glib def property_changed(name, value): - if name in ["Profiles", "Services", "Providers", "Technologies"]: + if name in ["Profiles", "Services", "Technologies"]: val = "[" for i in value: val = val + " " + i[i.rfind("/") + 1:] diff --git a/test/monitor-services b/test/monitor-services index 235adfe..2f81c71 100755 --- a/test/monitor-services +++ b/test/monitor-services @@ -25,7 +25,7 @@ def extract_list(list): def property_changed(name, value, path): service = path[path.rfind("/") + 1:] - if name in ["Profiles", "Services", "Providers", "Technologies"]: + if name in ["Profiles", "Services", "Technologies"]: val = "[" for i in value: val = val + " " + i[i.rfind("/") + 1:] diff --git a/test/test-manager b/test/test-manager index 2a80b75..6c694a0 100755 --- a/test/test-manager +++ b/test/test-manager @@ -33,7 +33,7 @@ properties = manager.GetProperties() def print_properties(key, value): if key == "Profiles": interface = "org.moblin.connman.Profile" - elif key in ["Services", "Providers"]: + elif key == "Services": interface = "org.moblin.connman.Service" elif key == "Technologies": interface = "org.moblin.connman.Technology" @@ -49,7 +49,7 @@ def print_properties(key, value): properties = obj.GetProperties() for key in properties.keys(): - if key in ["Services", "Providers", "Technologies"]: + if key in ["Services", "Technologies"]: continue elif key in ["Powered", "Scanning", "Connected", @@ -85,16 +85,10 @@ def print_properties(key, value): val = str(path) list = list + val[val.rfind("/") + 1:] + " " print " Services = [ %s]" % (list) - if "Providers" in properties.keys(): - list = "" - for path in properties["Providers"]: - val = str(path) - list = list + val[val.rfind("/") + 1:] + " " - print " Providers = [ %s]" % (list) for key in properties.keys(): - if key in ["Profiles", "Services", "Providers", "Technologies"]: + if key in ["Profiles", "Services", "Technologies"]: print_properties(key, properties[key]) elif key in ["AvailableTechnologies", "EnabledTechnologies", "ConnectedTechnologies", -- 2.7.4