tfa-next: test STF on CI on fvp
Test secure world support as the default option.
The current build system is limited on what it can actually
build, so change the build configuration to build STF with
the current setup. Please see:
https://github.com/RustedFirmware-A/rusted-firmware-a/issues/59
for more information.
Change-Id: If812dcbe2e33883b43a46e6b1b2c760ed4be841d
Signed-off-by: Tomás González <tomasagustin.gonzalezorlando@arm.com>
diff --git a/expect-lava/tfa-next-rme.exp b/expect-lava/tfa-next-rme.exp
new file mode 100644
index 0000000..2314a7e
--- /dev/null
+++ b/expect-lava/tfa-next-rme.exp
@@ -0,0 +1,15 @@
+#
+# Copyright (c) 2025 Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Expect script for Rusted Firmware
+#
+
+source $ci_root/expect-lava/trusted-firmware.inc
+
+expect_string+=('i;Rust BL31 starting')
+
+expect_string+=('i;Booting Secure World')
+
+# TODO: expect "Booting Realm World" when we add some realm world payload to run
diff --git a/expect-lava/tfa-next.exp b/expect-lava/tfa-next.exp
index bb878fa..f1a62c6 100644
--- a/expect-lava/tfa-next.exp
+++ b/expect-lava/tfa-next.exp
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2024 Arm Limited. All rights reserved.
+# Copyright (c) 2024-2025 Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
@@ -8,6 +8,6 @@
source $ci_root/expect-lava/trusted-firmware.inc
-expect_string+=('i;Rust BL31 starting')
-
-expect_string+=('i;Booting Secure World')
+# if the "N/M tests passed in (normal|secure) world" pattern is matched,
+# we succeed if N = M and fail if N != M
+expect_string+=('m;Rust BL31 starting;([0-9]+)/\1 tests passed in secure world;Booting Secure World@Booting Normal World@([0-9]+)/\1 tests passed in normal world')
diff --git a/expect/tfa-next-rme.exp b/expect/tfa-next-rme.exp
new file mode 100644
index 0000000..efce509
--- /dev/null
+++ b/expect/tfa-next-rme.exp
@@ -0,0 +1,17 @@
+#
+# Copyright (c) 2025 Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Expect script for Rusted Firmware
+#
+
+source [file join [file dirname [info script]] handle-arguments.inc]
+
+source [file join [file dirname [info script]] trusted-firmware.inc]
+
+expect_string "Rust BL31 starting"
+expect_string "Booting Secure World"
+# TODO: expect "Booting Realm World" when we add some realm world payload to run
+
+exit_uart 0
diff --git a/expect/tfa-next.exp b/expect/tfa-next.exp
index 043d253..31aee50 100644
--- a/expect/tfa-next.exp
+++ b/expect/tfa-next.exp
@@ -1,16 +1,39 @@
#
-# Copyright (c) 2024 Arm Limited. All rights reserved.
+# Copyright (c) 2024-2025 Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
# Expect script for Rusted Firmware
#
+source [file join [file dirname [info script]] utils.inc]
+
source [file join [file dirname [info script]] handle-arguments.inc]
source [file join [file dirname [info script]] trusted-firmware.inc]
expect_string "Rust BL31 starting"
expect_string "Booting Secure World"
+expect_string "Booting Normal World"
-exit_uart 0
+set failed 1
+
+expect {
+ -re {([0-9]+)/([0-9]+) tests passed in normal world} {
+ set passed_normal $expect_out(1,string)
+ set total_normal $expect_out(2,string)
+ set failed [expr { $passed_normal != $total_normal }]
+ }
+}
+
+expect {
+ -re {([0-9]+)/([0-9]+) tests passed in secure world} {
+ if { $failed == 0 } {
+ set passed_secure $expect_out(1,string)
+ set total_secure $expect_out(2,string)
+ set failed [expr { $passed_secure != $total_secure }]
+ }
+ }
+}
+
+exit_uart [expr { $failed ? -1 : 0 }]
diff --git a/run_config/fvp-next b/run_config/fvp-next
index 9d282c4..05bf41a 100644
--- a/run_config/fvp-next
+++ b/run_config/fvp-next
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
#
-# Copyright (c) 2024, Arm Limited. All rights reserved.
+# Copyright (c) 2024-2025, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
diff --git a/run_config/fvp-next.rme b/run_config/fvp-next.rme
index 518d7f9..e1d61ab 100644
--- a/run_config/fvp-next.rme
+++ b/run_config/fvp-next.rme
@@ -15,7 +15,7 @@
# scripts to work properly and not hang up waiting for BL1->BL31.
uart="0" set_expect_variable "skip_early_boot_msgs" "1"
- uart="0" file="tfa-next.exp" track_expect
+ uart="0" file="tfa-next-rme.exp" track_expect
# Track the rest of the UARTs to aid in debugging.
uart="1" file="hold_uart.exp" track_expect
uart="2" file="hold_uart.exp" track_expect
diff --git a/tf_config/fvp-next b/tf_config/fvp-next
index adebef5..db2cec1 100644
--- a/tf_config/fvp-next
+++ b/tf_config/fvp-next
@@ -1,3 +1,3 @@
PLAT=fvp
RUST=1
-TFA_FLAGS="FVP_TRUSTED_SRAM_SIZE=512 NEED_BL31=no"
+TFA_FLAGS="FVP_TRUSTED_SRAM_SIZE=512 SPD=spmd SPMD_SPM_AT_SEL2=0 NEED_BL31=no"