Home | History | Annotate | Download | only in tests
      1 #!/bin/bash
      2 
      3 # Copyright 2019 The Chromium OS Authors. All rights reserved.
      4 # Use of this source code is governed by a BSD-style license that can be
      5 # found in the LICENSE file.
      6 
      7 set -e
      8 
      9 . $(dirname "$(readlink -f "${0}")")/common.sh
     10 
     11 echo "Running test to verify booting into RO works"
     12 
     13 echo "Making sure all write protect is enabled"
     14 enable_sw_write_protect
     15 check_hw_and_sw_write_protect_enabled
     16 
     17 echo "Validating initial state"
     18 check_has_mp_rw_firmware
     19 check_has_mp_ro_firmware
     20 check_running_rw_firmware
     21 check_is_rollback_set_to_initial_val
     22 
     23 echo "Rebooting into RO version"
     24 reboot_ec_to_ro
     25 
     26 echo "Validating that we're now running the RO version"
     27 check_running_ro_firmware
     28 
     29 echo "Validating flash protection hasn't changed"
     30 check_hw_and_sw_write_protect_enabled
     31 
     32 echo "Rebooting back into RW"
     33 reboot_ec
     34 
     35 echo "Validating we're now running RW version"
     36 check_running_rw_firmware
     37 
     38 echo "Validating flash protection hasn't changed"
     39 check_hw_and_sw_write_protect_enabled
     40