Kristian Amlie
5 years ago
committed by
GitHub
9 changed files with 323 additions and 112 deletions
@ -0,0 +1,14 @@ |
|||
# Real life SD cards typically have less than they advertise. First off, they |
|||
# often use a base of 1000 instead of 1024, and even then they are often smaller |
|||
# than advertised. The number below is based on a conservative target of 3.9GB |
|||
# (that's mathematical GB, base 1000), converted to MiB, rounding down. |
|||
MENDER_STORAGE_TOTAL_SIZE_MB=3719 |
|||
|
|||
# Use all there is, which gets us almost, but not quite, to 500MiB free space |
|||
# (about 480MiB at the time of writing). |
|||
IMAGE_ROOTFS_SIZE=-1 |
|||
IMAGE_ROOTFS_EXTRA_SPACE=0 |
|||
IMAGE_OVERHEAD_FACTOR=1.0 |
|||
|
|||
# Best compression there is! |
|||
MENDER_COMPRESS_DISK_IMAGE=lzma |
@ -0,0 +1,106 @@ |
|||
#!/bin/bash |
|||
|
|||
set -e |
|||
|
|||
usage() { |
|||
echo "$0 <--all | --prebuilt-image DEVICE_TYPE IMAGE_NAME>" |
|||
exit 1 |
|||
} |
|||
|
|||
root_dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )/../../" && pwd ) |
|||
if [ "${root_dir}" != "${PWD}" ]; then |
|||
echo "You must execute $(basename $0) from the root directory: ${root_dir}" |
|||
exit 1 |
|||
fi |
|||
|
|||
WORKSPACE=./tests |
|||
|
|||
BBB_DEBIAN_IMAGE="bone-debian-9.5-iot-armhf-2018-10-07-4gb.img" |
|||
BBB_DEBIAN_IMAGE_URL="http://debian.beagleboard.org/images/${BBB_DEBIAN_IMAGE}.xz" |
|||
|
|||
RASPBIAN_IMAGE="2019-09-26-raspbian-buster-lite" |
|||
RASPBIAN_IMAGE_URL="http://downloads.raspberrypi.org/raspbian_lite/images/raspbian_lite-2019-09-30/2019-09-26-raspbian-buster-lite.zip" |
|||
|
|||
TINKER_IMAGE="20170417-tinker-board-linaro-stretch-alip-v1.8" |
|||
TINKER_IMAGE_URL="http://dlcdnet.asus.com/pub/ASUS/mb/Linux/Tinker_Board_2GB/${TINKER_IMAGE}.zip" |
|||
|
|||
UBUNTU_IMAGE="Ubuntu-Bionic-x86-64.img" |
|||
UBUNTU_IMAGE_URL="https://d1b0l86ne08fsf.cloudfront.net/mender-convert/images/${UBUNTU_IMAGE}.gz" |
|||
|
|||
UBUNTU_SERVER_RPI_IMAGE="ubuntu-18.04.3-preinstalled-server-armhf+raspi3.img" |
|||
UBUNTU_SERVER_RPI_IMAGE_URL="http://cdimage.ubuntu.com/ubuntu/releases/bionic/release/${UBUNTU_SERVER_RPI_IMAGE}.xz" |
|||
|
|||
# Keep common function declarations in separate utils script |
|||
UTILS_PATH=${0/$(basename $0)/test-utils.sh} |
|||
source $UTILS_PATH |
|||
|
|||
# Some distros do not have /sbin in path for "normal users" |
|||
export PATH="${PATH}:/sbin" |
|||
|
|||
if [ ! -d ${WORKSPACE}/mender-image-tests ]; then |
|||
git clone https://github.com/mendersoftware/mender-image-tests ${WORKSPACE}/mender-image-tests |
|||
else |
|||
cd ${WORKSPACE}/mender-image-tests |
|||
git pull |
|||
cd - |
|||
fi |
|||
|
|||
mkdir -p ${WORKSPACE} |
|||
|
|||
get_pytest_files |
|||
|
|||
test_result=0 |
|||
|
|||
case "$1" in |
|||
--prebuilt-image) |
|||
if [ -z "$3" ]; then |
|||
echo "Both DEVICE_TYPE and IMAGE_NAME must be specified" |
|||
exit 1 |
|||
fi |
|||
test_result=0 |
|||
run_tests "$2" "$3" || test_result=$? |
|||
exit $test_result |
|||
;; |
|||
|
|||
--all) |
|||
convert_and_test "qemux86_64" \ |
|||
"release-1" \ |
|||
"${UBUNTU_IMAGE_URL}" \ |
|||
"${UBUNTU_IMAGE}" \ |
|||
"${UBUNTU_IMAGE}.gz" \ |
|||
"configs/qemux86-64_config" || test_result=$? |
|||
|
|||
convert_and_test "raspberrypi" \ |
|||
"release-1" \ |
|||
"${RASPBIAN_IMAGE_URL}" \ |
|||
"${RASPBIAN_IMAGE}.img" \ |
|||
"${RASPBIAN_IMAGE}.zip" \ |
|||
"configs/raspberrypi3_config" || test_result=$? |
|||
|
|||
# MEN-2809: Disabled due broken download link |
|||
#convert_and_test "linaro-alip" \ |
|||
# "release-1" \ |
|||
# "${TINKER_IMAGE_URL}" \ |
|||
# "${TINKER_IMAGE}.img" \ |
|||
# "${TINKER_IMAGE}.zip" || test_result=$? |
|||
|
|||
convert_and_test "beaglebone" \ |
|||
"release-1" \ |
|||
"${BBB_DEBIAN_IMAGE_URL}" \ |
|||
"${BBB_DEBIAN_IMAGE}" \ |
|||
"${BBB_DEBIAN_IMAGE}.xz" || test_result=$? |
|||
|
|||
convert_and_test "ubuntu" \ |
|||
"release-1" \ |
|||
"${UBUNTU_SERVER_RPI_IMAGE_URL}" \ |
|||
"${UBUNTU_SERVER_RPI_IMAGE}" \ |
|||
"${UBUNTU_SERVER_RPI_IMAGE}.xz" \ |
|||
"configs/raspberrypi3_config" || test_result=$? |
|||
|
|||
exit $test_result |
|||
;; |
|||
|
|||
*) |
|||
usage |
|||
;; |
|||
esac |
Loading…
Reference in new issue