Govindraj Raja | 6750173 | 2023-09-22 16:27:06 -0500 | [diff] [blame] | 1 | # |
Slava Andrianov | 192ee17 | 2025-06-11 15:40:43 -0500 | [diff] [blame^] | 2 | # Copyright (c) 2023-2025 Arm Limited. All rights reserved. |
Govindraj Raja | 6750173 | 2023-09-22 16:27:06 -0500 | [diff] [blame] | 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | # Expect script for Trusted Firmware Test Framework |
| 7 | # |
| 8 | |
| 9 | expect_string "Booting trusted firmware test framework" "TFTF is booting" |
| 10 | |
| 11 | expect_re "Running at NS-EL(1|2)" |
| 12 | |
Slava Andrianov | 192ee17 | 2025-06-11 15:40:43 -0500 | [diff] [blame^] | 13 | # Compares event log of TF-A in BL2 against event logs of BL32 and BL33 |
| 14 | # currently not available for all measured boot tests |
Harrison Mutai | fbadee4 | 2025-02-18 10:47:48 +0000 | [diff] [blame] | 15 | if {[info exists ::env(measured_boot)]} { |
Slava Andrianov | 192ee17 | 2025-06-11 15:40:43 -0500 | [diff] [blame^] | 16 | capture_and_compare_log tftf_event_log "TEST COMPLETE" $TFA_EVENT_LOG |
Harrison Mutai | fbadee4 | 2025-02-18 10:47:48 +0000 | [diff] [blame] | 17 | } |
| 18 | |
Slava Andrianov | 192ee17 | 2025-06-11 15:40:43 -0500 | [diff] [blame^] | 19 | set uart_return_value "" |
Govindraj Raja | 6750173 | 2023-09-22 16:27:06 -0500 | [diff] [blame] | 20 | expect { |
| 21 | "Tests Failed : 0" { |
| 22 | expect_string "Exiting tests." "all TFTF tests passed" |
Slava Andrianov | 192ee17 | 2025-06-11 15:40:43 -0500 | [diff] [blame^] | 23 | set uart_return_value 0 |
Govindraj Raja | 6750173 | 2023-09-22 16:27:06 -0500 | [diff] [blame] | 24 | } |
| 25 | "Tests Passed : 0" { |
| 26 | expect_string "Exiting tests." "no TFTF tests passed" |
Slava Andrianov | 192ee17 | 2025-06-11 15:40:43 -0500 | [diff] [blame^] | 27 | set uart_return_value -1 |
Govindraj Raja | 6750173 | 2023-09-22 16:27:06 -0500 | [diff] [blame] | 28 | } |
| 29 | -re "Tests Failed : \[^0]" { |
| 30 | expect_string "Exiting tests." "one or more TFTF tests failed" |
Slava Andrianov | 192ee17 | 2025-06-11 15:40:43 -0500 | [diff] [blame^] | 31 | set uart_return_value -1 |
Govindraj Raja | 6750173 | 2023-09-22 16:27:06 -0500 | [diff] [blame] | 32 | } |
| 33 | } |
Slava Andrianov | 192ee17 | 2025-06-11 15:40:43 -0500 | [diff] [blame^] | 34 | |
| 35 | # Verifies the hashes in the TF-A event log for measured boot tests |
| 36 | if {[info exists ::env(verify_hashes)]} { |
| 37 | message "Starting measured boot hash verification" |
| 38 | source [file join [file dirname [info script]] compare_hashes.inc] |
| 39 | } |
| 40 | |
| 41 | exit_uart $uart_return_value |