forked from u-root/webboot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
integration.sh
executable file
·37 lines (31 loc) · 990 Bytes
/
integration.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
#
# Intended for CI but can be run standalone.
#
# Runs an integration test using the distro name passed as the first argument.
# The list of accepted distros is in "integration/basic_test.go".
#
# Example usage:
# cd /path/to/webboot/repo
# sudo apt-get update
# ./firsttime.sh
# ./integration.sh TinyCore
# Exit immediately if a command fails
set -e
if [[ $# -eq 0 ]] ; then
echo "integration.sh: No argument supplied. Please specify a distro as the first argument." 1>&2
exit 1
fi
(
cd integration
# Download if bzImage not present
wget --no-clobber https://github.com/u-root/webboot-distro/raw/master/CIkernels/5.6.14/bzImage
# Print full path
ls -dl "$PWD"/bzImage
# Tests distro specified by first argument
WEBBOOT_DISTRO="$1" \
UROOT_QEMU="qemu-system-x86_64" \
UROOT_KERNEL="$PWD/bzImage" \
UROOT_INITRAMFS="/tmp/initramfs.linux_amd64.cpio" \
go test -v -timeout 60m # Matches behavior of `vmtest.QEMUTest` in basic_test.go
)