summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>2013-02-04 10:48:53 +0200
committerPatrik Flykt <patrik.flykt@linux.intel.com>2013-02-05 13:29:13 +0200
commitb5e3ef7c5448f78d28571ba2dcf9d10770324469 (patch)
tree03e177ce0755236657d75e9432241edda4ce5ff5 /test
parent370414cebfb7073d4ccc31df49591211b2ffabd1 (diff)
downloadconnman-b5e3ef7c5448f78d28571ba2dcf9d10770324469.tar.gz
connman-b5e3ef7c5448f78d28571ba2dcf9d10770324469.tar.bz2
connman-b5e3ef7c5448f78d28571ba2dcf9d10770324469.zip
test: Fix simple-agent so it can run even if service files are missing
Fixes BMC#25964
Diffstat (limited to 'test')
-rwxr-xr-xtest/simple-agent23
1 files changed, 15 insertions, 8 deletions
diff --git a/test/simple-agent b/test/simple-agent
index 2487b7bb..01c82baf 100755
--- a/test/simple-agent
+++ b/test/simple-agent
@@ -276,7 +276,7 @@ def vpnNameOwnerChanged(proxy):
'net.connman.vpn.Manager')
vpn_manager.RegisterAgent(path)
except:
- print "vpn agent registered"
+ print "vpn agent is not registered"
else:
print("vpnd is disconnected from system bus")
vpn_manager = None
@@ -307,10 +307,14 @@ if __name__ == '__main__':
path = "/test/agent"
object = Agent(bus, path)
- vpn_manager = dbus.Interface(bus.get_object('net.connman.vpn', "/"),
- 'net.connman.vpn.Manager')
- vpn_path = "/test/vpn_agent"
- vpn_object = VpnAgent(bus, vpn_path)
+ try:
+ vpn_manager = dbus.Interface(bus.get_object('net.connman.vpn', "/"),
+ 'net.connman.vpn.Manager')
+ vpn_path = "/test/vpn_agent"
+ vpn_object = VpnAgent(bus, vpn_path)
+ except:
+ vpn_manager = None
+ print "net.connman.vpn is not present"
if len(sys.argv) >= 2:
for arg in sys.argv[1:]:
@@ -340,9 +344,12 @@ if __name__ == '__main__':
except:
print "Cannot register connman agent."
- vpn_manager.RegisterAgent(vpn_path)
-
- bus.watch_name_owner('net.connman.vpn', vpnNameOwnerChanged)
+ if vpn_manager != None:
+ try:
+ vpn_manager.RegisterAgent(vpn_path)
+ bus.watch_name_owner('net.connman.vpn', vpnNameOwnerChanged)
+ except:
+ "Cannot register vpn agent"
mainloop = gobject.MainLoop()
mainloop.run()