blob: 20dab75241c3396313c80223f8681deb44053d59 [file] [log] [blame]
Leonardo Sandoval9dfdd1b2020-08-06 17:08:11 -05001#!/usr/bin/env bash
Zelalem1af7a7b2020-08-04 17:34:32 -05002#
Leonardo Sandoval579c7372020-10-23 15:23:32 -05003# Copyright (c) 2019-2020 Arm Limited. All rights reserved.
Zelalem1af7a7b2020-08-04 17:34:32 -05004#
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)}"
Leonardo Sandovalbe690bd2020-10-12 17:59:39 -050032nfs_rootfs="${juno_rootfs_url:-$nfs_rootfs}"
Zelalem1af7a7b2020-08-04 17:34:32 -050033linux_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
Chris Kay3d807882022-08-31 16:00:02 +010045expand_template "$(dirname "$0")/lava-templates/juno-linux-reboot.yaml"