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