blob: 1611001f91b9e0956b4150fb4ed9f013443bc4bd [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
27juno_revision="${juno_revision:-juno-r0}"
28recovery_img_url="${recovery_img_url:-$(get_recovery_image_url)}"
29
30cat <<EOF
31device_type: juno
32job_name: tf-juno
33
34tags:
35- $juno_revision
36
37timeouts:
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
48priority: medium
49visibility: public
50
51actions:
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.
Zelalem219df412020-05-17 19:21:20 -050078 pattern: "(?s)> Executing '(?P<test_case_id>.+?(?='))'(.*) TEST COMPLETE\\\s+(?P<result>(Skipped|Passed|Failed|Crashed))"
Fathi Boudra422bf772019-12-02 11:10:16 +020079
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
86EOF