Leonardo Sandoval | 9dfdd1b | 2020-08-06 17:08:11 -0500 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 2 | # |
Leonardo Sandoval | 579c737 | 2020-10-23 15:23:32 -0500 | [diff] [blame] | 3 | # Copyright (c) 2019-2020 Arm Limited. All rights reserved. |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 4 | # |
| 5 | # SPDX-License-Identifier: BSD-3-Clause |
| 6 | # |
| 7 | |
| 8 | # Generate a YAML file in order to dispatch Juno 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/juno_utils.sh" |
| 16 | |
| 17 | get_recovery_image_url() { |
| 18 | local build_job="tf-build" |
| 19 | local bin_mode="${bin_mode:?}" |
| 20 | |
| 21 | if upon "$jenkins_run"; then |
| 22 | echo "$jenkins_url/job/$JOB_NAME/$BUILD_NUMBER/artifact/artefacts/$bin_mode/juno_recovery.zip" |
| 23 | else |
| 24 | echo "file://$workspace/artefacts/$bin_mode/juno_recovery.zip" |
| 25 | fi |
| 26 | } |
| 27 | |
| 28 | bootloader_prompt="${bootloader_prompt:-juno#}" |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 29 | recovery_img_url="${recovery_img_url:-$(get_recovery_image_url)}" |
| 30 | nfs_rootfs="${nfs_rootfs:-$juno_rootfs_url}" |
| 31 | linux_prompt="${linux_prompt:-root@(.*):~#}" |
| 32 | |
Manish Pandey | 7719a38 | 2020-09-07 12:30:18 +0100 | [diff] [blame] | 33 | # Allow running juno tests on specific revision(r0/r1/r2). |
| 34 | juno_revision="${juno_revision:-}" |
| 35 | if [ ! -z "$juno_revision" ]; then |
| 36 | tags="tags:" |
| 37 | juno_revision="- ${juno_revision}" |
| 38 | else |
| 39 | tags="" |
| 40 | fi |
| 41 | |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 42 | cat <<EOF |
| 43 | device_type: juno |
| 44 | job_name: tf-juno |
| 45 | |
| 46 | context: |
| 47 | bootloader_prompt: $bootloader_prompt |
| 48 | |
Manish Pandey | 7719a38 | 2020-09-07 12:30:18 +0100 | [diff] [blame] | 49 | $tags |
| 50 | $juno_revision |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 51 | |
| 52 | timeouts: |
| 53 | # Global timeout value for the whole job. |
| 54 | job: |
| 55 | minutes: 30 |
| 56 | # Unless explicitly overwritten, no single action should take more than |
| 57 | # 10 minutes to complete. |
| 58 | action: |
| 59 | minutes: 10 |
| 60 | |
| 61 | priority: medium |
| 62 | visibility: public |
| 63 | |
| 64 | actions: |
| 65 | |
| 66 | - deploy: |
| 67 | namespace: recovery |
| 68 | to: vemsd |
| 69 | recovery_image: |
| 70 | url: $recovery_img_url |
| 71 | compression: zip |
| 72 | |
| 73 | - deploy: |
| 74 | namespace: target |
| 75 | to: nfs |
| 76 | os: debian |
| 77 | nfsrootfs: |
| 78 | url: $nfs_rootfs |
| 79 | compression: gz |
| 80 | |
| 81 | - boot: |
| 82 | # Drastically increase the timeout for the boot action because of the udev |
| 83 | # issues when using TF build config "juno-all-cpu-reset-ops". |
| 84 | # TODO: Should increase the timeout only for this TF build config, not all! |
| 85 | timeout: |
| 86 | minutes: 15 |
| 87 | namespace: target |
| 88 | connection-namespace: recovery |
| 89 | method: u-boot |
| 90 | commands: norflash |
| 91 | auto-login: |
| 92 | login_prompt: 'login:' |
| 93 | username: root |
| 94 | prompts: |
| 95 | - $linux_prompt |
| 96 | EOF |