Arthur She | ebbcfaf | 2023-05-08 06:55:23 -0700 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | # |
| 3 | # Copyright (c) 2023 Arm Limited. All rights reserved. |
| 4 | # |
| 5 | # SPDX-License-Identifier: BSD-3-Clause |
| 6 | # |
| 7 | |
| 8 | # Generate a YAML file in order to dispatch STM32MP1 runs on LAVA. Note that this |
| 9 | # script would produce a meaningful output when run via. Jenkins |
| 10 | # |
| 11 | # $bin_mode must be set. This script outputs to STDOUT |
| 12 | |
| 13 | ci_root="$(readlink -f "$(dirname "$0")/..")" |
| 14 | source "$ci_root/utils.sh" |
| 15 | source "$ci_root/stm32mp1_utils.sh" |
| 16 | payload_type=${payload_type:?} |
| 17 | build_mode=$(echo $bin_mode | tr '[:lower:]' '[:upper:]') |
| 18 | layout_file="FlashLayout_sdcard-stm32mp15x-eval.tsv" |
| 19 | |
| 20 | # There will be two types of tests, SP_min BL2 and OP-TEE |
| 21 | # We do SP_min BL2 first |
| 22 | case "$payload_type" in |
| 23 | sp_min_bl2) |
| 24 | job_name="SP_min BL2" |
| 25 | rep_bin_file="tf-a-stm32mp157c-ev1.stm32" |
| 26 | ;; |
| 27 | esac |
| 28 | |
| 29 | if upon "$jenkins_run"; then |
| 30 | file_url="$jenkins_url/job/$JOB_NAME/$BUILD_NUMBER/artifact/artefacts/$bin_mode" |
| 31 | else |
| 32 | file_url="file://$workspace/artefacts/$bin_mode" |
| 33 | fi |
| 34 | |
| 35 | rep_bin_url="$file_url/$rep_bin_file" |
| 36 | flash_layout_url="$file_url/$layout_file" |
| 37 | |
| 38 | expand_template "$(dirname "$0")/lava-templates/stm32mp1-boot-test.yaml" |