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