X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=test%2Fdisable-network;h=beea2f10fc59780434a42ebb667e569d7e82b3c2;hb=647a017fc5c757d99dd39e2a65f113abe3ea0a3e;hp=645fa5d37394d37c83f5773f3556522be61addd5;hpb=8e0a0c3a63075f0769fd909c574ee264671e1da1;p=connman diff --git a/test/disable-network b/test/disable-network index 645fa5d..beea2f1 100755 --- a/test/disable-network +++ b/test/disable-network @@ -7,16 +7,22 @@ bus = dbus.SystemBus() manager = dbus.Interface(bus.get_object("org.moblin.connman", "/"), "org.moblin.connman.Manager") -elements = manager.ListElements() +properties = manager.GetProperties() -for path in elements: - element = dbus.Interface(bus.get_object("org.moblin.connman", path), - "org.moblin.connman.Element") +for path in properties["Devices"]: + device = dbus.Interface(bus.get_object("org.moblin.connman", path), + "org.moblin.connman.Device") - properties = element.GetProperties() - if (properties["Type"] != "network"): - continue + properties = device.GetProperties() - if (properties["Connected"] == dbus.Boolean(1)): - print "Disconnecting %s" % (path) - element.Disconnect() + print "[ %s ]" % (path) + + for path in properties["Networks"]: + network = dbus.Interface(bus.get_object("org.moblin.connman", path), + "org.moblin.connman.Network") + + properties = network.GetProperties() + + if (properties["Connected"] == dbus.Boolean(1)): + print "Disconnecting %s" % (path) + network.Disconnect()