Leonardo Sandoval | 9dfdd1b | 2020-08-06 17:08:11 -0500 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Zelalem | 1af7a7b | 2020-08-04 17:34:32 -0500 | [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. |
Zelalem | 1af7a7b | 2020-08-04 17:34:32 -0500 | [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. |
| 9 | # This file will boot Linux, reboot Linux, and then wait for the shell prompt |
| 10 | # to declare the test as a pass after the successful reboot. Note that this |
| 11 | # script would produce a meaningful output when run via. Jenkins |
| 12 | # |
| 13 | # $bin_mode must be set. This script outputs to STDOUT |
| 14 | |
| 15 | ci_root="$(readlink -f "$(dirname "$0")/..")" |
| 16 | source "$ci_root/utils.sh" |
| 17 | source "$ci_root/juno_utils.sh" |
| 18 | |
| 19 | get_recovery_image_url() { |
| 20 | local build_job="tf-build" |
| 21 | local bin_mode="${bin_mode:?}" |
| 22 | |
| 23 | if upon "$jenkins_run"; then |
| 24 | echo "$jenkins_url/job/$JOB_NAME/$BUILD_NUMBER/artifact/artefacts/$bin_mode/juno_recovery.zip" |
| 25 | else |
| 26 | echo "file://$workspace/artefacts/$bin_mode/juno_recovery.zip" |
| 27 | fi |
| 28 | } |
| 29 | |
| 30 | bootloader_prompt="${bootloader_prompt:-juno#}" |
Zelalem | 1af7a7b | 2020-08-04 17:34:32 -0500 | [diff] [blame] | 31 | recovery_img_url="${recovery_img_url:-$(get_recovery_image_url)}" |
| 32 | nfs_rootfs="${nfs_rootfs:-$juno_rootfs_url}" |
| 33 | linux_prompt="${linux_prompt:-root@(.*):~#}" |
| 34 | os="${os:-debian}" |
| 35 | |
Manish Pandey | 7719a38 | 2020-09-07 12:30:18 +0100 | [diff] [blame] | 36 | # Allow running juno tests on specific revision(r0/r1/r2). |
| 37 | juno_revision="${juno_revision:-}" |
| 38 | if [ ! -z "$juno_revision" ]; then |
| 39 | tags="tags:" |
| 40 | juno_revision="- ${juno_revision}" |
| 41 | else |
| 42 | tags="" |
| 43 | fi |
| 44 | |
Zelalem | 1af7a7b | 2020-08-04 17:34:32 -0500 | [diff] [blame] | 45 | cat <<EOF |
| 46 | device_type: juno |
| 47 | job_name: tf-juno |
| 48 | |
| 49 | context: |
| 50 | bootloader_prompt: $bootloader_prompt |
| 51 | |
Manish Pandey | 7719a38 | 2020-09-07 12:30:18 +0100 | [diff] [blame] | 52 | $tags |
| 53 | $juno_revision |
Zelalem | 1af7a7b | 2020-08-04 17:34:32 -0500 | [diff] [blame] | 54 | |
| 55 | timeouts: |
| 56 | # Global timeout value for the whole job. |
| 57 | job: |
| 58 | minutes: 30 |
| 59 | # Unless explicitly overridden, no single action should take more than |
| 60 | # 10 minutes to complete. |
| 61 | action: |
| 62 | minutes: 10 |
| 63 | |
| 64 | priority: medium |
| 65 | visibility: public |
| 66 | |
| 67 | actions: |
| 68 | |
| 69 | - deploy: |
| 70 | namespace: recovery |
| 71 | to: vemsd |
| 72 | recovery_image: |
| 73 | url: $recovery_img_url |
| 74 | compression: zip |
| 75 | |
| 76 | - deploy: |
| 77 | namespace: target |
| 78 | to: nfs |
| 79 | os: $os |
| 80 | nfsrootfs: |
| 81 | url: $nfs_rootfs |
| 82 | compression: gz |
| 83 | |
| 84 | - boot: |
| 85 | # Drastically increase the timeout for the boot action because of the udev |
| 86 | # issues when using TF build config "juno-all-cpu-reset-ops". |
| 87 | # TODO: Should increase the timeout only for this TF build config, not all! |
| 88 | timeout: |
| 89 | minutes: 15 |
| 90 | namespace: target |
| 91 | connection-namespace: recovery |
| 92 | method: u-boot |
| 93 | commands: norflash |
| 94 | auto-login: |
| 95 | login_prompt: 'login:' |
| 96 | username: root |
| 97 | prompts: |
| 98 | - $linux_prompt |
| 99 | |
| 100 | - test: |
| 101 | namespace: target |
| 102 | timeout: |
| 103 | minutes: 10 |
| 104 | definitions: |
| 105 | - repository: |
| 106 | metadata: |
| 107 | format: Lava-Test Test Definition 1.0 |
| 108 | name: container-test-run |
| 109 | description: '"Prepare system..."' |
| 110 | os: |
| 111 | - $os |
| 112 | scope: |
| 113 | - functional |
| 114 | run: |
| 115 | steps: |
| 116 | - echo "Rebooting..." |
| 117 | from: inline |
| 118 | name: target-configure |
| 119 | path: inline/target-configure.yaml |
| 120 | |
| 121 | - boot: |
| 122 | timeout: |
| 123 | minutes: 15 |
| 124 | namespace: target |
| 125 | connection-namespace: recovery |
| 126 | method: u-boot |
| 127 | commands: norflash |
| 128 | auto-login: |
| 129 | login_prompt: 'login:' |
| 130 | username: root |
| 131 | prompts: |
| 132 | - $linux_prompt |
| 133 | EOF |