fvp_utils: include the test configuration info as LAVA metadata
Usually LAVA jobs are found starting from Jenkins jobs, i.e. L1 ->
gateway -> builder, then the latter triggering/storing the LAVA job
log. However Jenkins' build-discarter policy removes Jenkins
jobs (jobs are no longer available at original URLs) at some point,
leaving the LAVA job the only available CI job from the original
pipeline.
This patch introduces test configuration as metadata, which is the
information that uniquely identifies how the artefacts are compiled
and tested by LAVA, allowing it to easily (re)trigger jobs from Jenkins.
Signed-off-by: Leonardo Sandoval <leonardo.sandoval@linaro.org>
Change-Id: If545ca0848267f9f45dad684b49b45bccfdc620d
diff --git a/fvp_utils.sh b/fvp_utils.sh
index 1a789d6..0fa0484 100644
--- a/fvp_utils.sh
+++ b/fvp_utils.sh
@@ -366,11 +366,17 @@
prompt2='root@genericarmv8:~#'
version_string="\"Fast Models"' [^\\n]+'"\""
+ test_config="${TEST_CONFIG}"
+
# arrays that relates variables and template macros
# NOTE: any addition on these arrays, requires an addition in the
# fvp templates
+ declare -A metadata_macros
declare -A yaml_macros
declare -A artefacts_macros
+ metadata_macros=(
+ [test_config]="{TEST_CONFIG}"
+ )
yaml_macros=(
[armlmd_license_file]="{ARMLMD_LICENSE_FILE}"
[docker_name]="{BOOT_DOCKER_NAME}"
@@ -528,6 +534,11 @@
cp "${yaml_template_file}" "${yaml_file}"
cp "$archive/model_params" "$lava_model_params"
+ # replace metadata macros with real values
+ for m in "${!metadata_macros[@]}"; do
+ sed -i -e "s|${metadata_macros[$m]}|${!m}|" "$yaml_file"
+ done
+
# replace yaml macros with real values
for m in "${!yaml_macros[@]}"; do
sed -i -e "s|${yaml_macros[$m]}|${!m}|" "$yaml_file"