blob: cef41e765726325003d22859ff595f3de2496b4c [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)
33servo_host = args_dict.get('servo_host', 'localhost')
34servo_port = args_dict.get('servo_port', None)
35
Vic Yang38d48852012-08-28 10:40:02 +080036def run_ecwriteprotect(machine):
Tom Wai-Hong Tam9233ebb2012-09-28 19:37:48 +080037 host = hosts.create_host(machine, servo_host=servo_host,
38 servo_port=servo_port)
Vic Yang38d48852012-08-28 10:40:02 +080039 job.run_test("firmware_ECWriteProtect", host=host, cmdline_args=args,
40 use_faft=True, disable_sysinfo=True,
41 dev_mode=True, tag="dev")
42
43parallel_simple(run_ecwriteprotect, machines)