blob: f1c1a5997e498ff7b7a275dba13aafb280228bdc [file] [log] [blame]
Leonardo Sandoval9dfdd1b2020-08-06 17:08:11 -05001#!/usr/bin/env bash
Fathi Boudra422bf772019-12-02 11:10:16 +02002#
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
13ci_root="$(readlink -f "$(dirname "$0")/..")"
14source "$ci_root/utils.sh"
15
16get_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
Fathi Boudra422bf772019-12-02 11:10:16 +020027recovery_img_url="${recovery_img_url:-$(get_recovery_image_url)}"
28
Manish Pandey7719a382020-09-07 12:30:18 +010029# Allow running juno tests on specific revision(r0/r1/r2).
30juno_revision="${juno_revision:-}"
31if [ ! -z "$juno_revision" ]; then
32 tags="tags:"
33 juno_revision="- ${juno_revision}"
34else
35 tags=""
36fi
37
Fathi Boudra422bf772019-12-02 11:10:16 +020038cat <<EOF
39device_type: juno
40job_name: tf-juno
41
Manish Pandey7719a382020-09-07 12:30:18 +010042$tags
43$juno_revision
Fathi Boudra422bf772019-12-02 11:10:16 +020044
45timeouts:
46 # Global timeout value for the whole job.
47 job:
48 minutes: 45
49 actions:
50 lava-test-monitor:
51 seconds: 120
52 connections:
53 lava-test-monitor:
54 seconds: 120
55
56priority: medium
57visibility: public
58
59actions:
60
61- deploy:
62 timeout:
63 minutes: 10
64 to: vemsd
65 recovery_image:
66 url: $recovery_img_url
67 compression: zip
68
69- boot:
70 method: minimal
71
72- test:
73 # Timeout for all the TFTF tests to complete.
74 timeout:
75 minutes: 30
76
77 monitors:
78 - name: TFTF
79 # LAVA looks for a testsuite start string...
80 start: 'Booting trusted firmware test framework'
81 # ...and a testsuite end string.
82 end: 'Exiting tests.'
83
84 # For each test case, LAVA looks for a string which includes the testcase
85 # name and result.
Zelalem219df412020-05-17 19:21:20 -050086 pattern: "(?s)> Executing '(?P<test_case_id>.+?(?='))'(.*) TEST COMPLETE\\\s+(?P<result>(Skipped|Passed|Failed|Crashed))"
Fathi Boudra422bf772019-12-02 11:10:16 +020087
88 # Teach to LAVA how to interpret the TFTF Tests results.
89 fixupdict:
90 Passed: pass
91 Failed: fail
92 Crashed: fail
93 Skipped: skip
94EOF