1# Copyright 2019 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 5from autotest_lib.server import utils 6 7AUTHOR = "ChromeOS Team" 8NAME = "firmware_Fingerprint.RDP1" 9PURPOSE = """ 10Verify that when RDP (readout protection) is set to level 1 and then changed to 11level 0, a mass erase takes place. 12""" 13CRITERIA = """ 14Fails if transitioning from RDP level 1 to RDP level 0 does not trigger a 15mass erase. 16""" 17ATTRIBUTES = "suite:fingerprint" 18TIME = "SHORT" 19TEST_CATEGORY = "Functional" 20TEST_CLASS = "firmware" 21TEST_TYPE = "server" 22DEPENDENCIES = "servo_state:WORKING, fingerprint" 23JOB_RETRIES = 0 24PY_VERSION = 3 25 26DOC = """ 27The test setup enables RDP level 1 by enabling hardware write protect and then 28enabling software write protect (with reboot of the EC); the test setup then 29disables hardware write protect, so that we can perform reads and change RDP 30levels through the bootloader (only accessible when HW write protect is 31disabled). 32 33When the test script starts, a read through the bootloader is done without 34disabling flash protection (changing RDP state). We verify that we are unable 35to read any data. 36 37Next a read through the bootloader is done, while also disabling flash 38protection (changing to RDP level 0), which triggers a mass erase. We verify 39that the bytes in the output are all 0xFF and that the firmware is no longer 40functional. 41""" 42 43test_images = [ 'TEST_IMAGE_ORIGINAL' ] 44 45args_dict = utils.args_to_dict(args) 46servo_args = hosts.CrosHost.get_servo_arguments(args_dict) 47 48def run(machine): 49 host = hosts.create_host(machine, servo_args=servo_args) 50 job.run_test("firmware_Fingerprint", host=host, 51 test_exe="rdp1.sh", 52 test_exe_args=test_images, 53 enable_hardware_write_protect=False, 54 enable_software_write_protect=True) 55 56parallel_simple(run, machines) 57