faft: Delete firmware_ECWriteProtect testcase
Part of the RO-normal logic deprecation effort.
The main code of this testcase entirely depends on
the RO-normal flag enabled. If disabled, no testing happens.
The test firmware_ECUpdateId already covers what is tested here.
BUG=b:138221809
TEST=workstation
Change-Id: I7199f9a76d3240aa379a837d3b124a4f531436e5
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/1860398
Tested-by: Oleg Loskutoff <olegmikhail@google.com>
Commit-Queue: Oleg Loskutoff <olegmikhail@google.com>
Reviewed-by: Wai-Hong Tam <waihong@google.com>
diff --git a/server/site_tests/firmware_ECWriteProtect/control b/server/site_tests/firmware_ECWriteProtect/control
deleted file mode 100644
index 01cb1e6..0000000
--- a/server/site_tests/firmware_ECWriteProtect/control
+++ /dev/null
@@ -1,43 +0,0 @@
-# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-from autotest_lib.server import utils
-
-AUTHOR = "Chrome OS Team"
-NAME = "firmware_ECWriteProtect"
-PURPOSE = "Servo based EC write protect test"
-CRITERIA = "This test will fail if EC write protect misbehaved"
-ATTRIBUTES = "suite:faft_ec, suite:faft_ec_au_1, suite:faft_ec_au_2, suite:faft_ec_au_3, suite:faft_ec3po, suite:faft_ec_tot"
-TIME = "SHORT"
-TEST_CATEGORY = "Functional"
-TEST_CLASS = "firmware"
-TEST_TYPE = "server"
-DEPENDENCIES = "ec:cros"
-JOB_RETRIES = 4
-
-DOC = """
-This test starts with RO normal mode and enables EC write protect. Software sync
-supposed to write protect the entire EC flash, so we expect the following
-write protect flags:
- - wp_gpio_asserted
- - ro_at_boot
- - ro_now
- - all_now
-These flags are checked under following situations:
- - Cold reset. RO normal.
- - Cold reset. Two stop.
- - Cold reset by ectool. Two stop.
-At the end of the test, write protect is deactivated and firmware is restored to
-RO normal mode.
-"""
-
-args_dict = utils.args_to_dict(args)
-servo_args = hosts.CrosHost.get_servo_arguments(args_dict)
-
-def run_ecwriteprotect(machine):
- host = hosts.create_host(machine, servo_args=servo_args)
- job.run_test("firmware_ECWriteProtect", host=host, cmdline_args=args,
- disable_sysinfo=True, dev_mode=False, tag="normal")
-
-parallel_simple(run_ecwriteprotect, machines)
diff --git a/server/site_tests/firmware_ECWriteProtect/control.dev b/server/site_tests/firmware_ECWriteProtect/control.dev
deleted file mode 100644
index 4fa0bd9..0000000
--- a/server/site_tests/firmware_ECWriteProtect/control.dev
+++ /dev/null
@@ -1,43 +0,0 @@
-# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-from autotest_lib.server import utils
-
-AUTHOR = "Chrome OS Team"
-NAME = "firmware_ECWriteProtect.dev"
-PURPOSE = "Servo based EC write protect test"
-CRITERIA = "This test will fail if EC write protect misbehaved"
-ATTRIBUTES = "suite:faft_ec, suite:faft_ec_au_1, suite:faft_ec_au_2, suite:faft_ec_au_3, suite:faft_ec3po, suite:faft_ec_tot"
-TIME = "SHORT"
-TEST_CATEGORY = "Functional"
-TEST_CLASS = "firmware"
-TEST_TYPE = "server"
-DEPENDENCIES = "ec:cros"
-JOB_RETRIES = 4
-
-DOC = """
-This test starts with RO normal mode and enables EC write protect. Software sync
-supposed to write protect the entire EC flash, so we expect the following
-write protect flags:
- - wp_gpio_asserted
- - ro_at_boot
- - ro_now
- - all_now
-These flags are checked under following situations:
- - Cold reset. RO normal.
- - Cold reset. Two stop.
- - Cold reset by ectool. Two stop.
-At the end of the test, write protect is deactivated and firmware is restored to
-RO normal mode.
-"""
-
-args_dict = utils.args_to_dict(args)
-servo_args = hosts.CrosHost.get_servo_arguments(args_dict)
-
-def run_ecwriteprotect(machine):
- host = hosts.create_host(machine, servo_args=servo_args)
- job.run_test("firmware_ECWriteProtect", host=host, cmdline_args=args,
- disable_sysinfo=True, dev_mode=True, tag="dev")
-
-parallel_simple(run_ecwriteprotect, machines)
diff --git a/server/site_tests/firmware_ECWriteProtect/firmware_ECWriteProtect.py b/server/site_tests/firmware_ECWriteProtect/firmware_ECWriteProtect.py
deleted file mode 100644
index 44bec84..0000000
--- a/server/site_tests/firmware_ECWriteProtect/firmware_ECWriteProtect.py
+++ /dev/null
@@ -1,88 +0,0 @@
-# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import logging
-
-from autotest_lib.client.common_lib import error
-from autotest_lib.server.cros import vboot_constants as vboot
-from autotest_lib.server.cros.faft.firmware_test import FirmwareTest
-
-
-class firmware_ECWriteProtect(FirmwareTest):
- """
- Servo based EC write protect test.
- """
- version = 1
-
- def write_protect_checker(self):
- """Checker that ensure the following write protect flags are set:
- - wp_gpio_asserted
- - ro_at_boot
- - ro_now
- - all_now
- """
- try:
- self.ec.send_command_get_output("flashinfo",
- ["Flags:\s+wp_gpio_asserted\s+ro_at_boot\s+ro_now\s+all_now"])
- return True
- except error.TestFail:
- # Didn't get expected flags
- return False
-
- def initialize(self, host, cmdline_args, dev_mode=False):
- super(firmware_ECWriteProtect, self).initialize(host, cmdline_args,
- ec_wp=False)
- # Don't bother if there is no Chrome EC.
- if not self.check_ec_capability():
- raise error.TestNAError("Nothing needs to be tested on this device")
- self.backup_firmware()
- self.switcher.setup_mode('dev' if dev_mode else 'normal')
- self.ec.send_command("chan 0")
-
- def cleanup(self):
- try:
- self.ec.send_command("chan 0xffffffff")
- self.restore_firmware()
- except Exception as e:
- logging.error("Caught exception: %s", str(e))
- super(firmware_ECWriteProtect, self).cleanup()
-
- def run_once(self):
- """Execute the main body of the test.
- """
- flags = self.faft_client.Bios.GetPreambleFlags('a')
- if flags & vboot.PREAMBLE_USE_RO_NORMAL == 0:
- logging.info('The firmware USE_RO_NORMAL flag is disabled.')
- return
-
- logging.info("Expected EC RO boot, enable WP and reboot EC.")
- self.check_state((self.checkers.ro_normal_checker, 'A'))
- self.switcher.mode_aware_reboot(
- 'custom', lambda:self.set_ec_write_protect_and_reboot(True))
-
- logging.info("Expected EC RO boot, write protected. Disable RO flag "
- "and reboot EC.")
- self.check_state([(self.checkers.ro_normal_checker, 'A'),
- self.write_protect_checker])
- self.faft_client.Bios.SetPreambleFlags('a', 0)
- self.switcher.mode_aware_reboot(reboot_type='cold')
-
- logging.info("Expected EC RW boot, write protected. Reboot EC by "
- "ectool.")
- self.check_state((self.checkers.ro_normal_checker, ('A', True)))
- self.check_state(self.write_protect_checker)
- self.switcher.mode_aware_reboot(
- 'custom', lambda:self.sync_and_ec_reboot('hard'))
-
- logging.info("Expected EC RW boot, write protected. Restore RO "
- "normal flag and deactivate write protect.")
- self.check_state((self.checkers.ro_normal_checker, ('A', True)))
- self.check_state(self.write_protect_checker)
- self.faft_client.Bios.SetPreambleFlags(('a',
- vboot.PREAMBLE_USE_RO_NORMAL))
- self.switcher.mode_aware_reboot(
- 'custom', lambda:self.set_ec_write_protect_and_reboot(False))
-
- logging.info("Expected EC RO boot.")
- self.check_state((self.checkers.ro_normal_checker, 'A'))