feat: allow UART expectations written in LAVA job YAML format
This change introduces the ability to use the LAVA job YAML format
directly instead of the existing Bash Expect-like scripts, which saves
us from having to invent a new syntax to deal with anything that is
currently unsupported (like timeouts).
Change-Id: I6df4663c847daadbee40b8205df2c9a0f657c8c9
Signed-off-by: Chris Kay <chris.kay@arm.com>
diff --git a/fvp_utils.sh b/fvp_utils.sh
index 2621156..8ee9a7f 100644
--- a/fvp_utils.sh
+++ b/fvp_utils.sh
@@ -560,9 +560,21 @@
fi
# Get all expect strings
- expect_file=$ci_root/expect-lava/${expect_file}
- source $expect_file
+ expect_dir="${ci_root}/expect-lava"
+ expect_file="${expect_dir}/${expect_file}"
+ # Allow the expectations to be provided directly in LAVA's job YAML
+ # format, rather than converting it from a pseudo-Expect Bash script in
+ # the block below.
+ if [ -f "${expect_file/.exp/.yaml}" ]; then
+ pushd "${expect_dir}"
+ expand_template "${expect_file/.exp/.yaml}"
+ popd
+
+ continue
+ else
+ source "${expect_file}"
+ fi
if [ ${#expect_string[@]} -gt 0 ]; then