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/busybox.inc b/lava-expect/busybox.inc
new file mode 100644
index 0000000..a437906
--- /dev/null
+++ b/lava-expect/busybox.inc
@@ -0,0 +1,12 @@
+#
+# Copyright (c) 2021 Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Script to interact with a Busybox filesystem
+#
+# This script is not standalone and should be sourced by a top expect script.
+#
+
+expect_string+=('init.sh')
+expect_string+=('.* # ')
diff --git a/lava-expect/cactus.exp b/lava-expect/cactus.exp
new file mode 100644
index 0000000..2762ec9
--- /dev/null
+++ b/lava-expect/cactus.exp
@@ -0,0 +1,11 @@
+#
+# Copyright (c) 2021 Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Expect script for the test Secure Partition Cactus
+#
+
+expect_string+=('Booting test Secure Partition Cactus')
+
+source $ci_root/lava-expect/uart-hold.inc
diff --git a/lava-expect/crash_panic.exp b/lava-expect/crash_panic.exp
new file mode 100644
index 0000000..8c443b5
--- /dev/null
+++ b/lava-expect/crash_panic.exp
@@ -0,0 +1,9 @@
+#
+# Copyright (c) 2021, Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Expect script for Trusted Firmware Test Framework
+#
+
+expect_string+=('PANIC at PC :')
diff --git a/lava-expect/crash_roxlattables_unhandled_exception_at_el3.exp b/lava-expect/crash_roxlattables_unhandled_exception_at_el3.exp
new file mode 100644
index 0000000..3667411
--- /dev/null
+++ b/lava-expect/crash_roxlattables_unhandled_exception_at_el3.exp
@@ -0,0 +1,90 @@
+#
+# Copyright (c) 2021, Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Expect script for Trusted Firmware Test Framework
+#
+
+expect_string+=('Translation tables are now read-only at EL3.')
+expect_string+=('Unhandled Exception in EL3.')
+expect_string+=('x30')
+expect_string+=('x0')
+expect_string+=('x1')
+expect_string+=('x2')
+expect_string+=('x3')
+expect_string+=('x4')
+expect_string+=('x5')
+expect_string+=('x6')
+expect_string+=('x7')
+expect_string+=('x8')
+expect_string+=('x9')
+expect_string+=('x10')
+expect_string+=('x11')
+expect_string+=('x12')
+expect_string+=('x13')
+expect_string+=('x14')
+expect_string+=('x15')
+expect_string+=('x16')
+expect_string+=('x17')
+expect_string+=('x18')
+expect_string+=('x19')
+expect_string+=('x20')
+expect_string+=('x21')
+expect_string+=('x22')
+expect_string+=('x23')
+expect_string+=('x24')
+expect_string+=('x25')
+expect_string+=('x26')
+expect_string+=('x27')
+expect_string+=('x28')
+expect_string+=('x29')
+expect_string+=('scr_el3')
+expect_string+=('sctlr_el3')
+expect_string+=('cptr_el3')
+expect_string+=('tcr_el3')
+expect_string+=('daif')
+expect_string+=('mair_el3')
+expect_string+=('spsr_el3')
+expect_string+=('elr_el3')
+expect_string+=('ttbr0_el3')
+expect_string+=('esr_el3')
+expect_string+=('far_el3')
+expect_string+=('spsr_el1')
+expect_string+=('elr_el1')
+expect_string+=('spsr_abt')
+expect_string+=('spsr_und')
+expect_string+=('spsr_irq')
+expect_string+=('spsr_fiq')
+expect_string+=('sctlr_el1')
+expect_string+=('actlr_el1')
+expect_string+=('cpacr_el1')
+expect_string+=('csselr_el1')
+expect_string+=('sp_el1')
+expect_string+=('esr_el1')
+expect_string+=('ttbr0_el1')
+expect_string+=('ttbr1_el1')
+expect_string+=('mair_el1')
+expect_string+=('amair_el1')
+expect_string+=('tcr_el1')
+expect_string+=('tpidr_el1')
+expect_string+=('tpidr_el0')
+expect_string+=('tpidrro_el0')
+expect_string+=('par_el1')
+expect_string+=('mpidr_el1')
+expect_string+=('afsr0_el1')
+expect_string+=('afsr1_el1')
+expect_string+=('contextidr_el1')
+expect_string+=('vbar_el1')
+expect_string+=('cntp_ctl_el0')
+expect_string+=('cntp_cval_el0')
+expect_string+=('cntv_ctl_el0')
+expect_string+=('cntv_cval_el0')
+expect_string+=('cntkctl_el1')
+expect_string+=('sp_el0')
+expect_string+=('isr_el1')
+expect_string+=('dacr32_el2')
+expect_string+=('ifsr32_el2')
+expect_string+=('icc_hppir0_el1')
+expect_string+=('icc_hppir1_el1')
+expect_string+=('icc_ctlr_el3')
diff --git a/lava-expect/crash_test.exp b/lava-expect/crash_test.exp
new file mode 100644
index 0000000..4ec8f3f
--- /dev/null
+++ b/lava-expect/crash_test.exp
@@ -0,0 +1,92 @@
+#
+# Copyright (c) 2021 Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Expect script for Trusted Firmware Test Framework
+#
+
+expect_string+=('Unhandled External Abort received')
+expect_string+=('BACKTRACE: START: plat_ea_handler')
+expect_string+=('BACKTRACE: END: plat_ea_handler')
+expect_string+=('PANIC in EL3')
+expect_string+=('x30')
+expect_string+=('x0')
+expect_string+=('x1')
+expect_string+=('x2')
+expect_string+=('x3')
+expect_string+=('x4')
+expect_string+=('x5')
+expect_string+=('x6')
+expect_string+=('x7')
+expect_string+=('x8')
+expect_string+=('x9')
+expect_string+=('x10')
+expect_string+=('x11')
+expect_string+=('x12')
+expect_string+=('x13')
+expect_string+=('x14')
+expect_string+=('x15')
+expect_string+=('x16')
+expect_string+=('x17')
+expect_string+=('x18')
+expect_string+=('x19')
+expect_string+=('x20')
+expect_string+=('x21')
+expect_string+=('x22')
+expect_string+=('x23')
+expect_string+=('x24')
+expect_string+=('x25')
+expect_string+=('x26')
+expect_string+=('x27')
+expect_string+=('x28')
+expect_string+=('x29')
+expect_string+=('scr_el3')
+expect_string+=('sctlr_el3')
+expect_string+=('cptr_el3')
+expect_string+=('tcr_el3')
+expect_string+=('daif')
+expect_string+=('mair_el3')
+expect_string+=('spsr_el3')
+expect_string+=('elr_el3')
+expect_string+=('ttbr0_el3')
+expect_string+=('esr_el3')
+expect_string+=('far_el3')
+expect_string+=('spsr_el1')
+expect_string+=('elr_el1')
+expect_string+=('spsr_abt')
+expect_string+=('spsr_und')
+expect_string+=('spsr_irq')
+expect_string+=('spsr_fiq')
+expect_string+=('sctlr_el1')
+expect_string+=('actlr_el1')
+expect_string+=('cpacr_el1')
+expect_string+=('csselr_el1')
+expect_string+=('sp_el1')
+expect_string+=('esr_el1')
+expect_string+=('ttbr0_el1')
+expect_string+=('ttbr1_el1')
+expect_string+=('mair_el1')
+expect_string+=('amair_el1')
+expect_string+=('tcr_el1')
+expect_string+=('tpidr_el1')
+expect_string+=('tpidr_el0')
+expect_string+=('tpidrro_el0')
+expect_string+=('par_el1')
+expect_string+=('mpidr_el1')
+expect_string+=('afsr0_el1')
+expect_string+=('afsr1_el1')
+expect_string+=('contextidr_el1')
+expect_string+=('vbar_el1')
+expect_string+=('cntp_ctl_el0')
+expect_string+=('cntp_cval_el0')
+expect_string+=('cntv_ctl_el0')
+expect_string+=('cntv_cval_el0')
+expect_string+=('cntkctl_el1')
+expect_string+=('sp_el0')
+expect_string+=('isr_el1')
+expect_string+=('dacr32_el2')
+expect_string+=('ifsr32_el2')
+expect_string+=('icc_hppir0_el1')
+expect_string+=('icc_hppir1_el1')
+expect_string+=('icc_ctlr_el3')
diff --git a/lava-expect/disable_dyn_auth.inc b/lava-expect/disable_dyn_auth.inc
new file mode 100644
index 0000000..a50a31a
--- /dev/null
+++ b/lava-expect/disable_dyn_auth.inc
@@ -0,0 +1,27 @@
+#
+# Copyright (c) 2021, Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Script to interact with an TF-A built with Trusted Board Boot
+#
+# This script tries to catch if dynamic authentication of images is enabled
+# during trusted board boot(BL2). The authentication is done using certificates.
+
+expect_string+=('BL1: Booting BL2')
+
+prompt='Disabling authentication of images dynamically'
+# Catch all loading of authentication certificates i.e.,
+# TRUSTED_BOOT_FW_CERT_ID U(6)
+# TRUSTED_KEY_CERT_ID U(7)
+# SCP_FW_KEY_CERT_ID U(8)
+# SOC_FW_KEY_CERT_ID U(9)
+# TRUSTED_OS_FW_KEY_CERT_ID U(10)
+# NON_TRUSTED_FW_KEY_CERT_ID U(11)
+# SCP_FW_CONTENT_CERT_ID U(12)
+# SOC_FW_CONTENT_CERT_ID U(13)
+# TRUSTED_OS_FW_CONTENT_CERT_ID U(14)
+# NON_TRUSTED_FW_CONTENT_CERT_ID U(15)
+expect_string+=("${prompt};;Loading image id=(6|7|8|9|10|11|12|13|14|15) at address ")
+
+expect_string+=('BL1: Booting BL31')
diff --git a/lava-expect/disable_dyn_auth_tftf.exp b/lava-expect/disable_dyn_auth_tftf.exp
new file mode 100644
index 0000000..1b8eff7
--- /dev/null
+++ b/lava-expect/disable_dyn_auth_tftf.exp
@@ -0,0 +1,18 @@
+#
+# Copyright (c) 2021 Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Expect script for Trusted Firmware Test Framework
+#
+
+source $ci_root/lava-expect/disable_dyn_auth.inc
+
+prompt='Booting trusted firmware test framework'
+successes='Running at NS-EL(1|2)'
+expect_string+=("${prompt};${successes}")
+
+prompt='Tests Failed : 0'
+successes='Exiting tests.'
+failures='Tests Passed : 0'
+expect_string+=("${prompt};${successes};${failures}")
diff --git a/lava-expect/el3-test-payload.exp b/lava-expect/el3-test-payload.exp
new file mode 100644
index 0000000..d4379c5
--- /dev/null
+++ b/lava-expect/el3-test-payload.exp
@@ -0,0 +1,15 @@
+#
+# Copyright (c) 2021 Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Expect script for Trusted Firmware + EL3 Test Payload
+#
+# Refer to handle-arguments.inc for the list of parameters.
+#
+
+# Trusted Firmware boot section
+source $ci_root/lava-expect/trusted-firmware.inc
+
+expect_string+=('Booting the EL3 test payload')
+expect_string+=('All CPUs booted!')
diff --git a/lava-expect/hold_uart.exp b/lava-expect/hold_uart.exp
new file mode 100644
index 0000000..a8beb89
--- /dev/null
+++ b/lava-expect/hold_uart.exp
@@ -0,0 +1,14 @@
+#
+# Copyright (c) 2021 Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Expect script
+#
+
+# If we exit from the uart, and if that had lots of prints, then the model
+# will stall. This may also occur even when the uart does not have any print.
+# See: https://jira.arm.com/browse/SDDKW-43675. So, we wait here expect for
+# something that never arrives.
+
+# TODO
diff --git a/lava-expect/ivy.exp b/lava-expect/ivy.exp
new file mode 100644
index 0000000..89bf442
--- /dev/null
+++ b/lava-expect/ivy.exp
@@ -0,0 +1,11 @@
+#
+# Copyright (c) 2021 Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Expect script for the test Secure Partition Ivy
+#
+
+expect_string+=('Booting test Secure Partition Ivy')
+
+source $ci_root/lava-expect/uart-hold.inc
diff --git a/lava-expect/linux-bl33.exp b/lava-expect/linux-bl33.exp
new file mode 100644
index 0000000..1f0565d
--- /dev/null
+++ b/lava-expect/linux-bl33.exp
@@ -0,0 +1,21 @@
+#
+# Copyright (c) 2021 Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Expect script for Trusted Firmware + Linux boot process
+#
+
+# Trusted Firmware boot section
+source $ci_root/lava-expect/trusted-firmware.inc
+
+# Linux kernel boot section
+expect_string+=('Booting Linux on physical CPU')
+expect_string+=('Linux version')
+
+# The kernel prints some information it takes from the preloaded DTB.
+# Check for following information to see that we actually got the right DTB.
+# 1. Machine model
+# 2. Command line passed via the "/chosen" node
+expect_string+=('Machine model: FVP (Base|Foundation)')
+expect_string+=('Kernel command line: console=ttyAMA0')
diff --git a/lava-expect/linux-oe-rst-bl31.exp b/lava-expect/linux-oe-rst-bl31.exp
new file mode 100644
index 0000000..85457da
--- /dev/null
+++ b/lava-expect/linux-oe-rst-bl31.exp
@@ -0,0 +1,18 @@
+#
+# Copyright (c) 2021 Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Expect script for Trusted Firmware + U-Boot + Linux boot process with
+# OpenEmbedded rootfs in /dev/vda2
+# TF with reset to BL3-1
+#
+
+# Trusted Firmware boot section
+source $ci_root/lava-expect/trusted-firmware-rst-to-bl31.inc
+
+# Linux kernel boot section
+source $ci_root/lava-expect/linux.inc
+
+# OpenEmbedded filesystem section
+source $ci_root/lava-expect/openembedded.inc
diff --git a/lava-expect/linux-oe.exp b/lava-expect/linux-oe.exp
new file mode 100644
index 0000000..9da20c6
--- /dev/null
+++ b/lava-expect/linux-oe.exp
@@ -0,0 +1,17 @@
+#
+# Copyright (c) 2021 Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Expect script for Trusted Firmware + U-Boot + Linux boot process with
+# OpenEmbedded rootfs in /dev/vda2
+#
+
+# Trusted Firmware boot section
+source $ci_root/lava-expect/trusted-firmware.inc
+
+# Linux kernel boot section
+source $ci_root/lava-expect/linux.inc
+
+# OpenEmbedded filesystem section
+source $ci_root/lava-expect/openembedded.inc
diff --git a/lava-expect/linux-rd-busybox-aarch32.exp b/lava-expect/linux-rd-busybox-aarch32.exp
new file mode 100644
index 0000000..13af72f
--- /dev/null
+++ b/lava-expect/linux-rd-busybox-aarch32.exp
@@ -0,0 +1,19 @@
+#
+# Copyright (c) 2021 Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Expect script for AArch32 Trusted Firmware + U-Boot + Linux boot process
+# with a AArch32 minimal initrd. The linux image must be a zImage and the
+# initrd must include the U-boot header.
+# TF with reset to BL1
+#
+
+# Trusted Firmware boot section
+source $ci_root/lava-expect/trusted-firmware-aarch32.inc
+
+# Linux kernel boot section
+source $ci_root/lava-expect/linux.inc
+
+# Busybox filesystem section
+source $ci_root/lava-expect/busybox.inc
diff --git a/lava-expect/linux-rd-busybox.exp b/lava-expect/linux-rd-busybox.exp
new file mode 100644
index 0000000..4d6465f
--- /dev/null
+++ b/lava-expect/linux-rd-busybox.exp
@@ -0,0 +1,16 @@
+#
+# Copyright (c) 2021 Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Expect script for Trusted Firmware + UEFI + Linux boot process with RAM Disk
+#
+
+# Trusted Firmware boot section
+source $ci_root/lava-expect/trusted-firmware.inc
+
+# Linux kernel boot section
+source $ci_root/lava-expect/linux.inc
+
+# Busybox filesystem section
+source $ci_root/lava-expect/busybox.inc
diff --git a/lava-expect/linux-tpm.exp b/lava-expect/linux-tpm.exp
new file mode 100644
index 0000000..f0755da
--- /dev/null
+++ b/lava-expect/linux-tpm.exp
@@ -0,0 +1,9 @@
+#
+# Copyright (c) 2021, Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Expect script for Linux/Buildroot using Measured Boot & fTPM
+#
+
+# TODO
diff --git a/lava-expect/linux.inc b/lava-expect/linux.inc
new file mode 100644
index 0000000..8430f2b
--- /dev/null
+++ b/lava-expect/linux.inc
@@ -0,0 +1,16 @@
+#
+# Copyright (c) 2021 Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Script to interact with a Linux kernel
+#
+
+# Expect 8 CPUs in total by default
+if [ -z "${num_cpus}" ]; then
+ num_cpus=8
+fi
+
+expect_string+=('Linux version')
+expect_string+=("SMP: Total of ${num_cpus} processors activated")
+expect_string+=('Freeing unused kernel memory')
diff --git a/lava-expect/openembedded.inc b/lava-expect/openembedded.inc
new file mode 100644
index 0000000..a816299
--- /dev/null
+++ b/lava-expect/openembedded.inc
@@ -0,0 +1,12 @@
+#
+# Copyright (c) 2021 Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Script to interact with an OpenEmbedded file system
+#
+# This script is not standalone and should be sourced by a top expect script.
+#
+
+expect_string+=('INIT:')
+expect_string+=('root@genericarmv8:~#;(Power down|System halted);;shutdown -h now\r')
diff --git a/lava-expect/readonly_el1_xlat_tables.exp b/lava-expect/readonly_el1_xlat_tables.exp
new file mode 100644
index 0000000..43b935e
--- /dev/null
+++ b/lava-expect/readonly_el1_xlat_tables.exp
@@ -0,0 +1,9 @@
+#
+# Copyright (c) 2021 Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Expect script for Trusted Firmware Test Framework
+#
+
+expect_string+=('Translation tables are now read-only at EL1.')
diff --git a/lava-expect/spm-edk2-uart0.exp b/lava-expect/spm-edk2-uart0.exp
new file mode 100644
index 0000000..f635c99
--- /dev/null
+++ b/lava-expect/spm-edk2-uart0.exp
@@ -0,0 +1,27 @@
+#
+# Copyright (c) 2021 Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Expect script for Trusted Firmware + EDK2 UART0
+#
+# Refer to handle-arguments.inc for the list of parameters.
+#
+
+# Trusted Firmware boot section
+source $ci_root/lava-expect/trusted-firmware.inc
+
+# EDK2 section
+expect_string+=('UEFI firmware')
+
+expect_string+=('UEFI Interactive Shell')
+
+expect_string+=('any other key to continue.;;;\r')
+
+expect_string+=('Shell>;;;fs0:\r')
+
+expect_string+=('FS0:;;;UefiInfo.efi\r')
+
+expect_string+=('Loading driver at .* UefiInfo.efi')
+
+expect_string+=('FS0:')
diff --git a/lava-expect/spm-edk2-uart2.exp b/lava-expect/spm-edk2-uart2.exp
new file mode 100644
index 0000000..d598d4b
--- /dev/null
+++ b/lava-expect/spm-edk2-uart2.exp
@@ -0,0 +1,9 @@
+#
+# Copyright (c) 2021 Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Expect script for Standalone MM partition UART2
+#
+
+# TODO
diff --git a/lava-expect/spm-linux-uart0.exp b/lava-expect/spm-linux-uart0.exp
new file mode 100644
index 0000000..ebab8a7
--- /dev/null
+++ b/lava-expect/spm-linux-uart0.exp
@@ -0,0 +1,9 @@
+#
+# Copyright (c) 2021, Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+
+expect_string+=('Please press Enter to activate this console.;;;\r')
+expect_string+=('/ # ;;;insmod hafnium.ko\n')
+expect_string+=('Hafnium successfully loaded with 1 VMs:')
diff --git a/lava-expect/spm-optee-sp-uart1.exp b/lava-expect/spm-optee-sp-uart1.exp
new file mode 100644
index 0000000..aa57540
--- /dev/null
+++ b/lava-expect/spm-optee-sp-uart1.exp
@@ -0,0 +1,5 @@
+#
+# Copyright (c) 2021, Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
diff --git a/lava-expect/spm-uart2.exp b/lava-expect/spm-uart2.exp
new file mode 100644
index 0000000..c662671
--- /dev/null
+++ b/lava-expect/spm-uart2.exp
@@ -0,0 +1,7 @@
+#
+# Copyright (c) 2021, Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+
+# TODO
diff --git a/lava-expect/tftf-aarch32.exp b/lava-expect/tftf-aarch32.exp
new file mode 100644
index 0000000..4627317
--- /dev/null
+++ b/lava-expect/tftf-aarch32.exp
@@ -0,0 +1,17 @@
+#
+# Copyright (c) 2021, Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Expect script for Trusted Firmware Test Framework
+#
+
+source $ci_root/lava-expect/trusted-firmware-aarch32.inc
+
+prompt='Booting trusted firmware test framework'
+successes='Running in AArch32 HYP mode'
+expect_string+=("${prompt};${successes}")
+
+prompt='Tests Failed : 0'
+failures='Tests Passed : 0'
+expect_string+=("${prompt};;${failures}")
diff --git a/lava-expect/tftf.exp b/lava-expect/tftf.exp
new file mode 100644
index 0000000..8640ffe
--- /dev/null
+++ b/lava-expect/tftf.exp
@@ -0,0 +1,18 @@
+#
+# Copyright (c) 2021 Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Expect script for Trusted Firmware Test Framework
+#
+
+source $ci_root/lava-expect/trusted-firmware.inc
+
+prompt='Booting trusted firmware test framework'
+successes='Running at NS-EL(1|2)'
+expect_string+=("${prompt};${successes}")
+
+prompt='Tests Failed : 0'
+successes='Exiting tests.'
+failures='Tests Passed : 0'
+expect_string+=("${prompt};${successes};${failures}")
diff --git a/lava-expect/tftf_fault.exp b/lava-expect/tftf_fault.exp
new file mode 100644
index 0000000..d9bce3a
--- /dev/null
+++ b/lava-expect/tftf_fault.exp
@@ -0,0 +1,12 @@
+#
+# Copyright (c) 2021 Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Expect script
+#
+
+# Expect the test to have set a fault message
+if [ -n "${tftf_fault_msg}" ]; then
+ expect_string+=("${tftf_fault_msg}")
+fi
diff --git a/lava-expect/timeout.exp b/lava-expect/timeout.exp
new file mode 100644
index 0000000..7c84a7f
--- /dev/null
+++ b/lava-expect/timeout.exp
@@ -0,0 +1,9 @@
+#
+# Copyright (c) 2021, Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Expect script for Trusted Firmware Test Framework
+#
+
+# TODO
diff --git a/lava-expect/timeout_spmin_roxlattables.exp b/lava-expect/timeout_spmin_roxlattables.exp
new file mode 100644
index 0000000..c37c7dc
--- /dev/null
+++ b/lava-expect/timeout_spmin_roxlattables.exp
@@ -0,0 +1,8 @@
+#
+# Copyright (c) 2021, Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Expect script for Trusted Firmware Test Framework
+#
+# TODO
diff --git a/lava-expect/timeout_test.exp b/lava-expect/timeout_test.exp
new file mode 100644
index 0000000..4852695
--- /dev/null
+++ b/lava-expect/timeout_test.exp
@@ -0,0 +1,9 @@
+#
+# Copyright (c) 2021 Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Expect script for Trusted Firmware Test Framework
+#
+
+# TODO
diff --git a/lava-expect/tpm-logs.exp b/lava-expect/tpm-logs.exp
new file mode 100644
index 0000000..eb5a886
--- /dev/null
+++ b/lava-expect/tpm-logs.exp
@@ -0,0 +1,9 @@
+#
+# Copyright (c) 2021, Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Expect script for fTPM debug logs
+#
+
+# TODO
diff --git a/lava-expect/trusted-firmware-aarch32.inc b/lava-expect/trusted-firmware-aarch32.inc
new file mode 100644
index 0000000..31ca9de
--- /dev/null
+++ b/lava-expect/trusted-firmware-aarch32.inc
@@ -0,0 +1,27 @@
+#
+# Copyright (c) 2021, Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Script to interact with AArch32 Trusted Firmware-A.
+#
+
+# Initial boot message won't be present if we're starting at SP_MIN. 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='BL1: 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 BL32')
+fi
+
+expect_string+=('SP_MIN:')
diff --git a/lava-expect/trusted-firmware-load-error.exp b/lava-expect/trusted-firmware-load-error.exp
new file mode 100644
index 0000000..f198bda
--- /dev/null
+++ b/lava-expect/trusted-firmware-load-error.exp
@@ -0,0 +1,8 @@
+#
+# Copyright (c) 2021 Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+
+# Expect an error while loading BL2 image.
+expect_string+=('Loading of FW_CONFIG failed;;BL1: Booting BL2')
diff --git a/lava-expect/trusted-firmware-rst-to-bl31.inc b/lava-expect/trusted-firmware-rst-to-bl31.inc
new file mode 100644
index 0000000..f77906c
--- /dev/null
+++ b/lava-expect/trusted-firmware-rst-to-bl31.inc
@@ -0,0 +1,9 @@
+#
+# Copyright (c) 2021 Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Script to interact with Trusted Firmware when resetting to BL31.
+#
+
+expect_string+=('NOTICE: BL3-?1:')
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
diff --git a/lava-expect/tsp.exp b/lava-expect/tsp.exp
new file mode 100644
index 0000000..8d2ed02
--- /dev/null
+++ b/lava-expect/tsp.exp
@@ -0,0 +1,9 @@
+#
+# Copyright (c) 2021 Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Expect script for TSP
+#
+
+# TODO
diff --git a/lava-expect/uart-hold.inc b/lava-expect/uart-hold.inc
new file mode 100644
index 0000000..5ed1351
--- /dev/null
+++ b/lava-expect/uart-hold.inc
@@ -0,0 +1,10 @@
+#
+# Copyright (c) 2021 Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# If we exit from a secondary uart, and if that had lots of prints, then the
+# model will stall. See: https://jira.arm.com/browse/SDDKW-43675. So, we wait
+# here expect for something that never arrives.
+
+# TODO
diff --git a/lava-expect/ubsan-test-trap.exp b/lava-expect/ubsan-test-trap.exp
new file mode 100644
index 0000000..f1ac565
--- /dev/null
+++ b/lava-expect/ubsan-test-trap.exp
@@ -0,0 +1,12 @@
+#
+# Copyright (c) 2021 Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Expect script for Trusted Firmware Test Framework
+#
+
+# Value for trap BRK instruction
+trap_value=0x00003e8
+
+expect_string+=("Unexpected BRK instruction with value $trap_value")