refactor: refactor simple YAML macros

This change replaces instances of the LAVA-like YAML template variable
syntax where the template variable is actually simple replacement for an
existing Bash variable.

Signed-off-by: Chris Kay <chris.kay@arm.com>
Change-Id: I93147ee1c1a07a096f65760223fbfa1ec2f791d9
diff --git a/fvp_utils.sh b/fvp_utils.sh
index d004b1c..384ad85 100644
--- a/fvp_utils.sh
+++ b/fvp_utils.sh
@@ -395,22 +395,8 @@
     # 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}"
-        [model]="{MODEL}"
-        [model_bin]="{BOOT_IMAGE_BIN}"
-        [model_dir]="{BOOT_IMAGE_DIR}"
-        [prompt1]="{PROMPT1}"
-        [prompt2]="{PROMPT2}"
-        [version_string]="{BOOT_VERSION_STRING}"
-    )
+
     artefacts_macros=(
         [backup_fip]="{BACKUP_FIP}"
         [bl1]="{BL1}"
@@ -508,16 +494,6 @@
     sed -i -e 's/{/{{/g' "${lava_model_params}"
     sed -i -e 's/}/}}/g' "${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"
-    done
-
     # replace artefact macros with real values
     for m in "${!artefacts_macros[@]}"; do
         sed -i -e "s|${artefacts_macros[$m]}|${!m}|" "$yaml_file"
diff --git a/script/lava-templates/fvp-linux.yaml b/script/lava-templates/fvp-linux.yaml
index 711499e..b492117 100644
--- a/script/lava-templates/fvp-linux.yaml
+++ b/script/lava-templates/fvp-linux.yaml
@@ -1,6 +1,6 @@
 metadata:
-  test_config: {TEST_CONFIG}
-  fvp_model: {MODEL}
+  test_config: ${test_config}
+  fvp_model: ${model}
   build_url: ${BUILD_URL}
 
 $(if [ -n "${gerrit_url}" ]; then
@@ -10,7 +10,7 @@
 fi)
 
 device_type: fvp
-job_name: fvp-linux-{TEST_CONFIG}
+job_name: fvp-linux-${test_config}
 
 timeouts:
   connection:
@@ -56,12 +56,12 @@
 
 - boot:
     method: fvp
-    license_variable: ARMLMD_LICENSE_FILE={ARMLMD_LICENSE_FILE}
+    license_variable: ARMLMD_LICENSE_FILE=${armlmd_license_file}
     docker:
-      name: {BOOT_DOCKER_NAME}
+      name: ${docker_name}
       local: true
-    image: {BOOT_IMAGE_DIR}/{BOOT_IMAGE_BIN}
-    version_string: {BOOT_VERSION_STRING}
+    image: ${model_dir}/${model_bin}
+    version_string: ${version_string}
     console_string: 'terminal_0: Listening for serial connection on port (?P<PORT>\d+)'
     feedbacks:
       - '(?P<NAME>terminal_1): Listening for serial connection on port (?P<PORT>\d+)'
diff --git a/script/lava-templates/fvp-tftf.yaml b/script/lava-templates/fvp-tftf.yaml
index 9a337a3..26a4d9f 100644
--- a/script/lava-templates/fvp-tftf.yaml
+++ b/script/lava-templates/fvp-tftf.yaml
@@ -1,6 +1,6 @@
 metadata:
-  test_config: {TEST_CONFIG}
-  fvp_model: {MODEL}
+  test_config: ${test_config}
+  fvp_model: ${model}
   build_url: ${BUILD_URL}
 
 $(if [ -n "${gerrit_url}" ]; then
@@ -10,7 +10,7 @@
 fi)
 
 device_type: fvp
-job_name: {TEST_CONFIG}
+job_name: ${test_config}
 
 timeouts:
   job:
@@ -69,12 +69,12 @@
 
 - boot:
     method: fvp
-    license_variable: ARMLMD_LICENSE_FILE={ARMLMD_LICENSE_FILE}
+    license_variable: ARMLMD_LICENSE_FILE=${armlmd_license_file}
     docker:
-      name: {BOOT_DOCKER_NAME}
+      name: ${docker_name}
       local: true
-    image: {BOOT_IMAGE_DIR}/{BOOT_IMAGE_BIN}
-    version_string: {BOOT_VERSION_STRING}
+    image: ${model_dir}/${model_bin}
+    version_string: ${version_string}
     console_string: 'terminal_0: Listening for serial connection on port (?P<PORT>\d+)'
     feedbacks:
       - '(?P<NAME>terminal_1): Listening for serial connection on port (?P<PORT>\d+)'