blob: f60b498da7afa2851b0b1b49497ba00fec853f49 [file] [log] [blame]
# Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import dbus
import logging
from autotest_lib.client.bin import test
from autotest_lib.client.common_lib import error
class platform_DebugDaemonGetPerfData(test.test):
version = 1
def run_once(self, *args, **kwargs):
bus = dbus.SystemBus()
proxy = bus.get_object('org.chromium.debugd', '/org/chromium/debugd')
self.iface = dbus.Interface(proxy,
profile_duration_seconds = 2
result = self.iface.GetPerfData(profile_duration_seconds)'Result: %s', result)
if not result:
raise error.TestFail('No perf output found: %s' % result)
if len(result) < 10:
raise error.TestFail('Perf output too small')
magic_prefix = "\nX\nN"
for i in range(len(magic_prefix)):
if magic_prefix[i] != chr(result[i]):
raise error.TestFail('Magic signature missing in output')