blob: 879a404ef5cbc661e8cd0b9e299758dd31209e79 [file] [log] [blame]
Leonardo Sandoval9dfdd1b2020-08-06 17:08:11 -05001#!/usr/bin/env bash
Zelalem1af7a7b2020-08-04 17:34:32 -05002#
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 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
15ci_root="$(readlink -f "$(dirname "$0")/..")"
16source "$ci_root/utils.sh"
17source "$ci_root/juno_utils.sh"
18
19get_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
30bootloader_prompt="${bootloader_prompt:-juno#}"
Zelalem1af7a7b2020-08-04 17:34:32 -050031recovery_img_url="${recovery_img_url:-$(get_recovery_image_url)}"
32nfs_rootfs="${nfs_rootfs:-$juno_rootfs_url}"
33linux_prompt="${linux_prompt:-root@(.*):~#}"
34os="${os:-debian}"
35
Manish Pandey7719a382020-09-07 12:30:18 +010036# Allow running juno tests on specific revision(r0/r1/r2).
37juno_revision="${juno_revision:-}"
38if [ ! -z "$juno_revision" ]; then
39 tags="tags:"
40 juno_revision="- ${juno_revision}"
41else
42 tags=""
43fi
44
Zelalem1af7a7b2020-08-04 17:34:32 -050045cat <<EOF
46device_type: juno
47job_name: tf-juno
48
49context:
50 bootloader_prompt: $bootloader_prompt
51
Manish Pandey7719a382020-09-07 12:30:18 +010052$tags
53$juno_revision
Zelalem1af7a7b2020-08-04 17:34:32 -050054
55timeouts:
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
64priority: medium
65visibility: public
66
67actions:
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
133EOF