Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame^] | 1 | #!/bin/bash |
| 2 | # |
| 3 | # Copyright (c) 2019, Arm Limited. All rights reserved. |
| 4 | # |
| 5 | # SPDX-License-Identifier: BSD-3-Clause |
| 6 | # |
| 7 | |
| 8 | # Generate a YAML file in order to dispatch Juno TFTF runs on LAVA. Note that |
| 9 | # this 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 | |
| 16 | get_recovery_image_url() { |
| 17 | local build_job="tf-build" |
| 18 | local bin_mode="${bin_mode:?}" |
| 19 | |
| 20 | if upon "$jenkins_run"; then |
| 21 | echo "$jenkins_url/job/$JOB_NAME/$BUILD_NUMBER/artifact/artefacts/$bin_mode/juno_recovery.zip" |
| 22 | else |
| 23 | echo "file://$workspace/artefacts/$bin_mode/juno_recovery.zip" |
| 24 | fi |
| 25 | } |
| 26 | |
| 27 | juno_revision="${juno_revision:-juno-r0}" |
| 28 | recovery_img_url="${recovery_img_url:-$(get_recovery_image_url)}" |
| 29 | |
| 30 | cat <<EOF |
| 31 | device_type: juno |
| 32 | job_name: tf-juno |
| 33 | |
| 34 | tags: |
| 35 | - $juno_revision |
| 36 | |
| 37 | timeouts: |
| 38 | # Global timeout value for the whole job. |
| 39 | job: |
| 40 | minutes: 45 |
| 41 | actions: |
| 42 | lava-test-monitor: |
| 43 | seconds: 120 |
| 44 | connections: |
| 45 | lava-test-monitor: |
| 46 | seconds: 120 |
| 47 | |
| 48 | priority: medium |
| 49 | visibility: public |
| 50 | |
| 51 | actions: |
| 52 | |
| 53 | - deploy: |
| 54 | timeout: |
| 55 | minutes: 10 |
| 56 | to: vemsd |
| 57 | recovery_image: |
| 58 | url: $recovery_img_url |
| 59 | compression: zip |
| 60 | |
| 61 | - boot: |
| 62 | method: minimal |
| 63 | |
| 64 | - test: |
| 65 | # Timeout for all the TFTF tests to complete. |
| 66 | timeout: |
| 67 | minutes: 30 |
| 68 | |
| 69 | monitors: |
| 70 | - name: TFTF |
| 71 | # LAVA looks for a testsuite start string... |
| 72 | start: 'Booting trusted firmware test framework' |
| 73 | # ...and a testsuite end string. |
| 74 | end: 'Exiting tests.' |
| 75 | |
| 76 | # For each test case, LAVA looks for a string which includes the testcase |
| 77 | # name and result. |
| 78 | pattern: "(?s)> Executing '(?P<test_case_id>.+)'(.*) TEST COMPLETE\\\s+(?P<result>(Skipped|Passed|Failed|Crashed))" |
| 79 | |
| 80 | # Teach to LAVA how to interpret the TFTF Tests results. |
| 81 | fixupdict: |
| 82 | Passed: pass |
| 83 | Failed: fail |
| 84 | Crashed: fail |
| 85 | Skipped: skip |
| 86 | EOF |