Vic Yang | 38d4885 | 2012-08-28 10:40:02 +0800 | [diff] [blame] | 1 | # Copyright (c) 2012 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 | |
Tom Wai-Hong Tam | 9233ebb | 2012-09-28 19:37:48 +0800 | [diff] [blame] | 5 | from autotest_lib.server import utils |
| 6 | |
Vic Yang | 38d4885 | 2012-08-28 10:40:02 +0800 | [diff] [blame] | 7 | AUTHOR = "Chrome OS Team" |
| 8 | NAME = "firmware_ECWriteProtect" |
| 9 | PURPOSE = "Servo based EC write protect test" |
| 10 | CRITERIA = "This test will fail if EC write protect misbehaved" |
| 11 | TIME = "LONG" |
| 12 | TEST_CATEGORY = "Functional" |
| 13 | TEST_CLASS = "firmware" |
| 14 | TEST_TYPE = "server" |
| 15 | |
| 16 | DOC = """ |
| 17 | This test starts with RO normal mode and enables EC write protect. Software sync |
| 18 | supposed to write protect the entire EC flash, so we expect the following |
| 19 | write protect flags: |
| 20 | - wp_gpio_asserted |
| 21 | - ro_at_boot |
| 22 | - ro_now |
| 23 | - all_now |
| 24 | These flags are checked under following situations: |
| 25 | - Cold reset. RO normal. |
| 26 | - Cold reset. Two stop. |
| 27 | - Cold reset by ectool. Two stop. |
| 28 | At the end of the test, write protect is deactivated and firmware is restored to |
| 29 | RO normal mode. |
| 30 | """ |
| 31 | |
Tom Wai-Hong Tam | 9233ebb | 2012-09-28 19:37:48 +0800 | [diff] [blame] | 32 | args_dict = utils.args_to_dict(args) |
J. Richard Barnette | 964fba0 | 2012-10-24 17:34:29 -0700 | [diff] [blame^] | 33 | servo_args = hosts.SiteHost.get_servo_arguments(args_dict) |
Tom Wai-Hong Tam | 9233ebb | 2012-09-28 19:37:48 +0800 | [diff] [blame] | 34 | |
Vic Yang | 38d4885 | 2012-08-28 10:40:02 +0800 | [diff] [blame] | 35 | def run_ecwriteprotect(machine): |
J. Richard Barnette | 964fba0 | 2012-10-24 17:34:29 -0700 | [diff] [blame^] | 36 | host = hosts.create_host(machine, servo_args=servo_args) |
Vic Yang | 38d4885 | 2012-08-28 10:40:02 +0800 | [diff] [blame] | 37 | job.run_test("firmware_ECWriteProtect", host=host, cmdline_args=args, |
| 38 | use_faft=True, disable_sysinfo=True, |
| 39 | dev_mode=True, tag="dev") |
| 40 | |
| 41 | parallel_simple(run_ecwriteprotect, machines) |