OLD | NEW |
---|---|
(Empty) | |
1 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. | |
Sameer Nanda
2011/02/18 17:27:40
2011?
| |
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 logging, os | |
6 from autotest_lib.client.bin import utils | |
7 from autotest_lib.client.common_lib import error | |
8 from autotest_lib.server import test | |
9 | |
10 _KERN_WARNING = 4 | |
11 | |
12 _WARNINGS_WHITELIST = [ | |
13 "Kernel-defined memdesc doesn't match the one from EFI!", | |
14 "Warning only 1919MB will be used.", | |
15 "Use a HIGHMEM enabled kernel.", | |
16 "pnp 00:01: io resource (0x164e-0x164f) overlaps 0000:00:1c.0 BAR 7 (0x1000- 0x1fff), disabling", | |
Sameer Nanda
2011/02/18 17:27:40
> 80 chars
| |
17 "i915 0000:00:02.0: Invalid ROM contents", | |
18 "[drm:intel_init_bios] *ERROR* VBT signature missing", | |
19 "usb 1-2: config 1 has an invalid interface number: 1 but max is 0", | |
20 "usb 1-2: config 1 has no interface number 0", | |
21 "device-mapper: verity: Failed to acquire device 'ROOT_DEV': -1", | |
22 "device-mapper: table: 254:0: verity: Device lookup failed", | |
23 "dm: starting dm-0 (vroot) failed", | |
24 "EXT3-fs warning: maximal mount count reached, running e2fsck is recommended ", | |
Sameer Nanda
2011/02/18 17:27:40
> 80 chars
| |
25 "i2c i2c-2: The new_device interface is still experimental and may change in a near future", | |
Sameer Nanda
2011/02/18 17:27:40
> 80 chars
| |
26 "industrialio: module is from the staging directory, the quality is unknown, you have been warned.", | |
Sameer Nanda
2011/02/18 17:27:40
> 80 chars
| |
27 "tsl2563: module is from the staging directory, the quality is unknown, you have been warned.", | |
Sameer Nanda
2011/02/18 17:27:40
> 80 chars
| |
28 ] | |
Sameer Nanda
2011/02/18 17:27:40
Do you want to make the warnings whitelist platfor
| |
29 | |
30 class kernel_BootMessagesServer(test.test): | |
31 version = 1 | |
32 | |
33 | |
34 def read_dmesg(self, filename): | |
35 f = open(filename, 'w') | |
36 self.client.run('dmesg -r', stdout_tee=f) | |
37 f.close() | |
38 | |
39 | |
40 def reboot_machine(self): | |
41 self.client.run('reboot') | |
42 self.client.wait_down() | |
43 self.client.wait_up() | |
44 | |
45 | |
46 def run_once(self, host=None): | |
47 self.client = host | |
48 self.client_test = 'kernel_BootMessages' | |
49 dmesg_filename = os.path.join(self.resultsdir, 'dmesg') | |
50 | |
51 self.reboot_machine() | |
52 self.read_dmesg(dmesg_filename) | |
53 dmesg = utils.read_file(dmesg_filename) | |
54 unexpected = False | |
55 | |
56 f = open(os.path.join(self.resultsdir, 'dmesg.err'), 'w') | |
57 for line in dmesg.split('\n'): | |
Sameer Nanda
2011/02/18 17:27:40
use dmesg.splitlines instead?
| |
58 if line and int(line[1]) <= _KERN_WARNING: | |
59 if not 'used greatest stack depth' in line: | |
60 stripped_line = line.split('] ', 1)[1] | |
61 if not stripped_line in _WARNINGS_WHITELIST: | |
62 logging.error('UNEXPECTED DMESG: %s' % stripped_line) | |
63 unexpected = True | |
64 f.write('%s\n' % line) | |
65 f.close() | |
66 | |
67 if unexpected: | |
68 raise error.TestFail("Unexpected dmesg warnings and/or errors.") | |
OLD | NEW |