1# Copyright (c) 2011 The Chromium OS Authors. All rights reserved. 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5import dbus 6 7from autotest_lib.client.bin import test 8from autotest_lib.client.common_lib import error 9 10class platform_DebugDaemonTracePath(test.test): 11 version = 1 12 13 def run_once(self, *args, **kwargs): 14 bus = dbus.SystemBus() 15 proxy = bus.get_object('org.chromium.debugd', '/org/chromium/debugd') 16 self.iface = dbus.Interface(proxy, 17 dbus_interface='org.chromium.debugd') 18 handle = self.iface.TracePathStart( 19 1, "127.0.0.1", {}, signature="hsa{sv}") 20 self.iface.TracePathStop(handle) 21 got_exception = False 22 try: 23 self.iface.TracePathStop(handle) 24 except dbus.DBusException as e: 25 if e.get_dbus_name() == 'org.chromium.debugd.error.NoSuchProcess': 26 got_exception = True 27 else: 28 print "Unexpected exception %s" % e.get_dbus_name() 29 if not got_exception: 30 raise error.TestFail("Didn't get expected exception.") 31