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.RDP0" 9PURPOSE = """ 10Verify that we can read flash when RDP (readout protection) is set to level 0. 11""" 12CRITERIA = """ 13Fails if the bytes that we read do not exactly match the firmware that was 14flashed. 15""" 16ATTRIBUTES = "suite:fingerprint" 17TIME = "SHORT" 18TEST_CATEGORY = "Functional" 19TEST_CLASS = "firmware" 20TEST_TYPE = "server" 21DEPENDENCIES = "servo_state:WORKING, fingerprint" 22JOB_RETRIES = 0 23PY_VERSION = 3 24 25DOC = """ 26The test setup ensures that neither hardware or software write protect is 27enabled, which means that RDP is set to level 0. The test script then reads the 28flash and verifies that the bytes exactly match the originally flashed 29firmware. 30""" 31 32test_images = [ 'TEST_IMAGE_ORIGINAL' ] 33 34args_dict = utils.args_to_dict(args) 35servo_args = hosts.CrosHost.get_servo_arguments(args_dict) 36 37def run(machine): 38 host = hosts.create_host(machine, servo_args=servo_args) 39 job.run_test("firmware_Fingerprint", host=host, 40 test_exe="rdp0.sh", 41 test_exe_args=test_images, 42 enable_hardware_write_protect=False, 43 enable_software_write_protect=False, 44 # This test requires a forced flash without entropy 45 # initialization to ensure that we get an exact match between 46 # the original firmware that was flashed and the value that is 47 # read. 48 force_firmware_flashing=True, 49 init_entropy=False) 50 51parallel_simple(run, machines) 52