Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(232)

Side by Side Diff: client/bin/site_utils.py

Issue 6544018: kernel_BootMessagesServer: initial add of new test (Closed) Base URL: http://git.chromium.org/git/autotest.git@master
Patch Set: Fix spacing. Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | server/site_tests/kernel_BootMessagesServer/control » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import logging, os, platform, time 5 import logging, os, platform, time
6 from autotest_lib.client.common_lib import error 6 from autotest_lib.client.common_lib import error
7 7
8 8
9 class TimeoutError(error.TestError): 9 class TimeoutError(error.TestError):
10 """Error raised when we time out when waiting on a condition.""" 10 """Error raised when we time out when waiting on a condition."""
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 """ 54 """
55 # The QEMU monitor has been redirected to the guest serial port located at 55 # The QEMU monitor has been redirected to the guest serial port located at
56 # /dev/ttyUSB0. To save the state of the VM, we just send the 'savevm' 56 # /dev/ttyUSB0. To save the state of the VM, we just send the 'savevm'
57 # command to the serial port. 57 # command to the serial port.
58 proc = platform.processor() 58 proc = platform.processor()
59 if 'QEMU' in proc and os.path.exists('/dev/ttyUSB0'): 59 if 'QEMU' in proc and os.path.exists('/dev/ttyUSB0'):
60 logging.info('Saving VM state "%s"' % checkpoint) 60 logging.info('Saving VM state "%s"' % checkpoint)
61 serial = open('/dev/ttyUSB0', 'w') 61 serial = open('/dev/ttyUSB0', 'w')
62 serial.write("savevm %s\r\n" % checkpoint) 62 serial.write("savevm %s\r\n" % checkpoint)
63 logging.info('Done saving VM state "%s"' % checkpoint) 63 logging.info('Done saving VM state "%s"' % checkpoint)
64
65
66 def check_raw_dmesg(dmesg, message_level, whitelist):
67 """Checks dmesg for unexpected warnings.
68
69 This function parses dmesg for message with message_level <= message_level
70 which do not appear in the whitelist.
71
72 Arguments:
73 dmesg - string containing raw dmesg buffer
74 message_level - minimum message priority to check
75 whitelist - messages to ignore
76
77 Returns:
78 List of unexpected warnings
79 """
80
81 unexpected = []
82 for line in dmesg.splitlines():
83 if int(line[1]) <= message_level:
84 if not 'used greatest stack depth' in line:
85 stripped_line = line.split('] ', 1)[1]
86 if not stripped_line in whitelist:
87 unexpected.append(stripped_line)
88 return unexpected
OLDNEW
« no previous file with comments | « no previous file | server/site_tests/kernel_BootMessagesServer/control » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698