fix(expect): update crash test expectations

This change updates the crash test expectations to reflect the real
output of their tests, as they've become outdated. We haven't noticed
because these scripts were not attached to the payload UART of any
tests, which is the only situation in which the result of the Expect
script could determine the success of the test.

This change also ensures that tests using these scripts have them set as
the payload script, as opposed to the timeout scripts they typically
use.

Signed-off-by: Chris Kay <chris.kay@arm.com>
Change-Id: Ic9870a0aa6a191cdb6b02fcedeaea0490377704c
diff --git a/expect-lava/crash_rng_trap_unhandled_exception_at_el3.exp b/expect-lava/crash_rng_trap_unhandled_exception_at_el3.exp
index 5bff8ce..791117c 100644
--- a/expect-lava/crash_rng_trap_unhandled_exception_at_el3.exp
+++ b/expect-lava/crash_rng_trap_unhandled_exception_at_el3.exp
@@ -80,8 +80,6 @@
 expect_string+=('i;cntkctl_el1')
 expect_string+=('i;sp_el0')
 expect_string+=('i;isr_el1')
-expect_string+=('i;dacr32_el2')
-expect_string+=('i;ifsr32_el2')
 expect_string+=('i;icc_hppir0_el1')
 expect_string+=('i;icc_hppir1_el1')
 expect_string+=('i;icc_ctlr_el3')
diff --git a/expect-lava/crash_roxlattables_unhandled_exception_at_el3.exp b/expect-lava/crash_roxlattables_unhandled_exception_at_el3.exp
index 2fbd0ee..dd97369 100644
--- a/expect-lava/crash_roxlattables_unhandled_exception_at_el3.exp
+++ b/expect-lava/crash_roxlattables_unhandled_exception_at_el3.exp
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2021, Arm Limited. All rights reserved.
+# Copyright (c) 2021-2022, Arm Limited. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-3-Clause
 #
@@ -83,8 +83,6 @@
 expect_string+=('i;cntkctl_el1')
 expect_string+=('i;sp_el0')
 expect_string+=('i;isr_el1')
-expect_string+=('i;dacr32_el2')
-expect_string+=('i;ifsr32_el2')
 expect_string+=('i;icc_hppir0_el1')
 expect_string+=('i;icc_hppir1_el1')
 expect_string+=('i;icc_ctlr_el3')
diff --git a/expect-lava/crash_test.exp b/expect-lava/crash_test.exp
index f967195..5305978 100644
--- a/expect-lava/crash_test.exp
+++ b/expect-lava/crash_test.exp
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2021 Arm Limited. All rights reserved.
+# Copyright (c) 2021-2022 Arm Limited. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-3-Clause
 #
@@ -7,10 +7,7 @@
 #
 
 expect_string+=('i;Unhandled External Abort received')
-expect_string+=('i;BACKTRACE: START: plat_ea_handler')
-expect_string+=('i;BACKTRACE: END: plat_ea_handler')
-expect_string+=('i;PANIC in EL3')
-expect_string+=('i;x30')
+expect_string+=('i;Unhandled Exception from EL2')
 expect_string+=('i;x0')
 expect_string+=('i;x1')
 expect_string+=('i;x2')
@@ -41,6 +38,7 @@
 expect_string+=('i;x27')
 expect_string+=('i;x28')
 expect_string+=('i;x29')
+expect_string+=('i;x30')
 expect_string+=('i;scr_el3')
 expect_string+=('i;sctlr_el3')
 expect_string+=('i;cptr_el3')
diff --git a/expect-lava/unhandled_exception_at_el3.exp b/expect-lava/unhandled_exception_at_el3.exp
index 1ac84c0..8e896c0 100644
--- a/expect-lava/unhandled_exception_at_el3.exp
+++ b/expect-lava/unhandled_exception_at_el3.exp
@@ -6,84 +6,82 @@
 # Expect script for Trusted Firmware Test Framework
 #
 
-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')
+expect_string+=("i;Unhandled Exception in EL3.")
+expect_string+=("i;x30")
+expect_string+=("i;x0")
+expect_string+=("i;x1")
+expect_string+=("i;x2")
+expect_string+=("i;x3")
+expect_string+=("i;x4")
+expect_string+=("i;x5")
+expect_string+=("i;x6")
+expect_string+=("i;x7")
+expect_string+=("i;x8")
+expect_string+=("i;x9")
+expect_string+=("i;x10")
+expect_string+=("i;x11")
+expect_string+=("i;x12")
+expect_string+=("i;x13")
+expect_string+=("i;x14")
+expect_string+=("i;x15")
+expect_string+=("i;x16")
+expect_string+=("i;x17")
+expect_string+=("i;x18")
+expect_string+=("i;x19")
+expect_string+=("i;x20")
+expect_string+=("i;x21")
+expect_string+=("i;x22")
+expect_string+=("i;x23")
+expect_string+=("i;x24")
+expect_string+=("i;x25")
+expect_string+=("i;x26")
+expect_string+=("i;x27")
+expect_string+=("i;x28")
+expect_string+=("i;x29")
+expect_string+=("i;scr_el3")
+expect_string+=("i;sctlr_el3")
+expect_string+=("i;cptr_el3")
+expect_string+=("i;tcr_el3")
+expect_string+=("i;daif")
+expect_string+=("i;mair_el3")
+expect_string+=("i;spsr_el3")
+expect_string+=("i;elr_el3")
+expect_string+=("i;ttbr0_el3")
+expect_string+=("i;esr_el3")
+expect_string+=("i;far_el3")
+expect_string+=("i;spsr_el1")
+expect_string+=("i;elr_el1")
+expect_string+=("i;spsr_abt")
+expect_string+=("i;spsr_und")
+expect_string+=("i;spsr_irq")
+expect_string+=("i;spsr_fiq")
+expect_string+=("i;sctlr_el1")
+expect_string+=("i;actlr_el1")
+expect_string+=("i;cpacr_el1")
+expect_string+=("i;csselr_el1")
+expect_string+=("i;sp_el1")
+expect_string+=("i;esr_el1")
+expect_string+=("i;ttbr0_el1")
+expect_string+=("i;ttbr1_el1")
+expect_string+=("i;mair_el1")
+expect_string+=("i;amair_el1")
+expect_string+=("i;tcr_el1")
+expect_string+=("i;tpidr_el1")
+expect_string+=("i;tpidr_el0")
+expect_string+=("i;tpidrro_el0")
+expect_string+=("i;par_el1")
+expect_string+=("i;mpidr_el1")
+expect_string+=("i;afsr0_el1")
+expect_string+=("i;afsr1_el1")
+expect_string+=("i;contextidr_el1")
+expect_string+=("i;vbar_el1")
+expect_string+=("i;cntp_ctl_el0")
+expect_string+=("i;cntp_cval_el0")
+expect_string+=("i;cntv_ctl_el0")
+expect_string+=("i;cntv_cval_el0")
+expect_string+=("i;cntkctl_el1")
+expect_string+=("i;sp_el0")
+expect_string+=("i;isr_el1")
+expect_string+=("i;icc_hppir0_el1")
+expect_string+=("i;icc_hppir1_el1")
+expect_string+=("i;icc_ctlr_el3")
diff --git a/expect/crash_rng_trap_unhandled_exception_at_el3.exp b/expect/crash_rng_trap_unhandled_exception_at_el3.exp
index 9efd7b5..eff27f8 100644
--- a/expect/crash_rng_trap_unhandled_exception_at_el3.exp
+++ b/expect/crash_rng_trap_unhandled_exception_at_el3.exp
@@ -84,8 +84,6 @@
 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/expect/crash_roxlattables_unhandled_exception_at_el3.exp b/expect/crash_roxlattables_unhandled_exception_at_el3.exp
index 7c87b21..5c7c61f 100644
--- a/expect/crash_roxlattables_unhandled_exception_at_el3.exp
+++ b/expect/crash_roxlattables_unhandled_exception_at_el3.exp
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2020, Arm Limited. All rights reserved.
+# Copyright (c) 2020-2022, Arm Limited. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-3-Clause
 #
@@ -85,8 +85,6 @@
 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/expect/crash_test.exp b/expect/crash_test.exp
index 1152abc..a8c31be 100644
--- a/expect/crash_test.exp
+++ b/expect/crash_test.exp
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2019-2020 Arm Limited. All rights reserved.
+# Copyright (c) 2019-2022 Arm Limited. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-3-Clause
 #
@@ -9,10 +9,7 @@
 source [file join [file dirname [info script]] handle-arguments.inc]
 
 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 "Unhandled Exception from EL2"
 expect_string "x0"
 expect_string "x1"
 expect_string "x2"
@@ -43,6 +40,7 @@
 expect_string "x27"
 expect_string "x28"
 expect_string "x29"
+expect_string "x30"
 expect_string "scr_el3"
 expect_string "sctlr_el3"
 expect_string "cptr_el3"
diff --git a/expect/unhandled_exception_at_el3.exp b/expect/unhandled_exception_at_el3.exp
index cef8fca..9cad002 100644
--- a/expect/unhandled_exception_at_el3.exp
+++ b/expect/unhandled_exception_at_el3.exp
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2021, Arm Limited. All rights reserved.
+# Copyright (c) 2021-2022, Arm Limited. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-3-Clause
 #
@@ -84,8 +84,6 @@
 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/run_config/fvp-aemv8a.aarch32.roxlattables.spmin_panic b/run_config/fvp-aemv8a.aarch32.roxlattables.spmin_panic
index 73c0567..6b0face 100644
--- a/run_config/fvp-aemv8a.aarch32.roxlattables.spmin_panic
+++ b/run_config/fvp-aemv8a.aarch32.roxlattables.spmin_panic
@@ -19,7 +19,7 @@
 	local model="base-aemv8a"
 
 	uart="0" timeout="60" file="timeout_spmin_roxlattables.exp" track_expect
-	uart="1" timeout="60" file="crash_panic.exp" track_expect
+	uart="1" timeout="60" file="crash_panic.exp" set_primary="1" track_expect
 
 	model="$model" aarch32="1" gen_model_params
 	model="$model" gen_fvp_yaml
diff --git a/run_config/fvp-aemv8a.crash b/run_config/fvp-aemv8a.crash
index 9568454..fa46a57 100644
--- a/run_config/fvp-aemv8a.crash
+++ b/run_config/fvp-aemv8a.crash
@@ -15,7 +15,7 @@
 	local model="base-aemv8a"
 
 	uart="0" timeout="60" file="timeout_test.exp" track_expect
-	uart="1" timeout="60" file="crash_test.exp" track_expect
+	uart="1" timeout="60" file="crash_test.exp" set_primary="1" track_expect
 
 	model="$model" arch_version="8.4" fault_inject="1" gen_model_params
 	model="$model" gen_fvp_yaml
diff --git a/run_config/fvp-aemv8a.rng_trap.bl31_panic b/run_config/fvp-aemv8a.rng_trap.bl31_panic
index 4b2f29c..2e31b34 100644
--- a/run_config/fvp-aemv8a.rng_trap.bl31_panic
+++ b/run_config/fvp-aemv8a.rng_trap.bl31_panic
@@ -9,7 +9,8 @@
 	local model="base-aemv8a"
 
 	uart="0" timeout="60" file="timeout.exp" track_expect
-	uart="1" timeout="60" file="crash_rng_trap_unhandled_exception_at_el3.exp" track_expect
+	uart="1" timeout="60" file="crash_rng_trap_unhandled_exception_at_el3.exp" \
+		set_primary="1" track_expect
 
 	# Due to a bug in the model, the FEAT_RNG_TRAP feature is not available
 	# in models that implement versions lower than 8.8, even though this is
diff --git a/run_config/fvp-aemv8a.roxlattables.bl31_panic b/run_config/fvp-aemv8a.roxlattables.bl31_panic
index 7b66ba3..888015e 100644
--- a/run_config/fvp-aemv8a.roxlattables.bl31_panic
+++ b/run_config/fvp-aemv8a.roxlattables.bl31_panic
@@ -17,7 +17,8 @@
 	local model="base-aemv8a"
 
 	uart="0" timeout="60" file="timeout.exp" track_expect
-	uart="1" timeout="60" file="crash_roxlattables_unhandled_exception_at_el3.exp" track_expect
+	uart="1" timeout="60" file="crash_roxlattables_unhandled_exception_at_el3.exp" \
+		 set_primary="1" track_expect
 
 	model="$model" gen_model_params
 	model="$model" gen_fvp_yaml
diff --git a/run_config/fvp-aemv8a.roxlattables.tspd_panic b/run_config/fvp-aemv8a.roxlattables.tspd_panic
index 5ca3407..6ca26a7 100644
--- a/run_config/fvp-aemv8a.roxlattables.tspd_panic
+++ b/run_config/fvp-aemv8a.roxlattables.tspd_panic
@@ -20,7 +20,7 @@
 	local model="base-aemv8a"
 
 	uart="0" timeout="60" file="timeout.exp" track_expect
-	uart="1" timeout="60" file="crash_panic.exp" track_expect
+	uart="1" timeout="60" file="crash_panic.exp" set_primary="1" track_expect
 	uart="2" timeout="60" file="readonly_el1_xlat_tables.exp" track_expect
 
 	model="$model" gen_model_params
diff --git a/run_config/fvp-aemva.ete_trace_ext.bl31_panic b/run_config/fvp-aemva.ete_trace_ext.bl31_panic
index a8e24c9..c6c3abf 100644
--- a/run_config/fvp-aemva.ete_trace_ext.bl31_panic
+++ b/run_config/fvp-aemva.ete_trace_ext.bl31_panic
@@ -9,7 +9,8 @@
 	local model="base-aemva"
 
 	uart="0" timeout="60" file="timeout_test.exp" track_expect
-	uart="1" timeout="60" file="unhandled_exception_at_el3.exp" track_expect
+	uart="1" timeout="60" file="unhandled_exception_at_el3.exp" \
+		set_primary="1" track_expect
 
 	model="$model" \
 		ete_plugin="1" \
diff --git a/run_config/fvp-aemva.feat_brbe.bl31_panic b/run_config/fvp-aemva.feat_brbe.bl31_panic
index ec35d77..7367aa2 100644
--- a/run_config/fvp-aemva.feat_brbe.bl31_panic
+++ b/run_config/fvp-aemva.feat_brbe.bl31_panic
@@ -9,7 +9,8 @@
 	local model="base-aemva"
 
 	uart="0" timeout="60" file="timeout_test.exp" track_expect
-	uart="1" timeout="60" file="unhandled_exception_at_el3.exp" track_expect
+	uart="1" timeout="60" file="unhandled_exception_at_el3.exp" \
+		set_primary="1" track_expect
 
 	model="$model" \
 		supports_branch_record_buffer_control_regs="1" \