lava-expect: migrate expect into lava-expect scripts
Parent commit enables Lava Interactive Actions into FVP LAVA jobs and
this commit feeds with 'lava expect' strings targeting mainly 'UART0
scripts'.
This work is done in a separate folder, `lava-expect`,
instead of expect with a reason: both expect strings should be
developed in parallel, where the expect strings are either used by
Legacy CI or local development and `lava-expect` strings are intended
for Open CI LAVA testing.
Note that this patch does not migrate all current expect strings, several
are pending as indicated in the list below. Coming patches would cover
these:
* hold_uart.exp
* linux-tpm.exp
* spm-edk2-uart0.exp
* spm-edk2-uart2.exp
* spm-linux-uart0.exp
* spm-optee-sp-uart1.exp
* spm-uart2.exp
* timeout.exp
* timeout_spmin_roxlattables.exp
* timeout_test.exp
* tpm-logs.exp
Signed-off-by: Leonardo Sandoval <leonardo.sandoval@linaro.org>
Change-Id: I386be3fb1a73c491f01a27fb05a4215f0e789f26
diff --git a/lava-expect/trusted-firmware.inc b/lava-expect/trusted-firmware.inc
new file mode 100644
index 0000000..7133da6
--- /dev/null
+++ b/lava-expect/trusted-firmware.inc
@@ -0,0 +1,24 @@
+#
+# Copyright (c) 2021, Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Script to interact with AArch64 Trusted Firmware-A.
+#
+
+# Initial boot message won't be present if we're starting at BL31. Skip waiting
+# for them by inspecting the environment variable 'skip_early_boot_msgs'.
+if [ -z "$skip_early_boot_msgs" ]; then
+
+ expect_string+=('Booting Trusted Firmware')
+
+ prompt='Booting BL2'
+ # Catch all 3 possible BL2 loading error messages, namely:
+ # "Failure in pre image load handling of BL2"
+ # "Failed to load BL2 firmware."
+ # "Failure in post image load handling of BL2"
+ failures='Fail.*load.*BL2'
+ expect_string+=("${prompt};;${failures}")
+
+ expect_string+=('BL1: Booting BL31')
+fi