blob: 8a7df567242f4bab32b5190c087ac7dad080a90b [file] [log] [blame]
Leonardo Sandoval9dfdd1b2020-08-06 17:08:11 -05001#!/usr/bin/env bash
Fathi Boudra422bf772019-12-02 11:10:16 +02002#
Madhukar Pappireddyb08c8f02021-12-08 11:46:11 -06003# Copyright (c) 2019-2022 Arm Limited. All rights reserved.
Fathi Boudra422bf772019-12-02 11:10:16 +02004#
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
13ci_root="$(readlink -f "$(dirname "$0")/..")"
14source "$ci_root/utils.sh"
15source "$ci_root/juno_utils.sh"
16
17get_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
Madhukar Pappireddyb08c8f02021-12-08 11:46:11 -060028bootloader_prompt="${bootloader_prompt:-VExpress64#}"
Fathi Boudra422bf772019-12-02 11:10:16 +020029recovery_img_url="${recovery_img_url:-$(get_recovery_image_url)}"
30nfs_rootfs="${nfs_rootfs:-$juno_rootfs_url}"
31linux_prompt="${linux_prompt:-root@(.*):~#}"
32
Manish Pandey7719a382020-09-07 12:30:18 +010033# Allow running juno tests on specific revision(r0/r1/r2).
34juno_revision="${juno_revision:-}"
35if [ ! -z "$juno_revision" ]; then
36 tags="tags:"
37 juno_revision="- ${juno_revision}"
38else
39 tags=""
40fi
41
Fathi Boudra422bf772019-12-02 11:10:16 +020042cat <<EOF
43device_type: juno
44job_name: tf-juno
45
46context:
47 bootloader_prompt: $bootloader_prompt
48
Manish Pandey7719a382020-09-07 12:30:18 +010049$tags
50$juno_revision
Fathi Boudra422bf772019-12-02 11:10:16 +020051
52timeouts:
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
61priority: medium
62visibility: public
63
64actions:
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
96EOF