1 # Copyright 2016 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 5 import cStringIO 6 import requests 7 8 from autotest_lib.client.common_lib import error 9 from autotest_lib.server import test 10 11 12 class brillo_ADBLogcatTest(test.test): 13 """Verify that adb logcat and adb shell dmesg work correctly.""" 14 version = 1 15 16 17 def run_once(self, host=None): 18 """Body of the test.""" 19 logcat_log = cStringIO.StringIO() 20 21 host.adb_run('logcat -d', stdout=logcat_log) 22 result = host.run('dmesg') 23 24 if not len(logcat_log.getvalue()): 25 raise error.TestFail('No output from logcat') 26 if not len(result.stdout): 27 raise error.TestFail('No output from dmesg') 28