|
@ -3,7 +3,7 @@ |
|
|
set -e |
|
|
set -e |
|
|
|
|
|
|
|
|
usage() { |
|
|
usage() { |
|
|
echo "$0 <--all | --only DEVICE_TYPE | --prebuilt-image DEVICE_TYPE IMAGE_NAME>" |
|
|
echo "$0 [--config EXTRA_CONFIG_FILE] <--all | --only DEVICE_TYPE | --prebuilt-image DEVICE_TYPE IMAGE_NAME>" |
|
|
exit 1 |
|
|
exit 1 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -26,7 +26,7 @@ BBB_DEBIAN_EMMC_IMAGE_URL="https://rcn-ee.com/rootfs/bb.org/testing/2021-09-01/b |
|
|
## Auto-update |
|
|
## Auto-update |
|
|
RASPBIAN_IMAGE_URL="http://downloads.raspberrypi.org/raspbian_lite/images/raspbian_lite-2020-02-14/2020-02-13-raspbian-buster-lite.zip" |
|
|
RASPBIAN_IMAGE_URL="http://downloads.raspberrypi.org/raspbian_lite/images/raspbian_lite-2020-02-14/2020-02-13-raspbian-buster-lite.zip" |
|
|
|
|
|
|
|
|
UBUNTU_IMAGE_URL="https://downloads.mender.io/mender-convert/images/Ubuntu-Bionic-x86-64.img.gz" |
|
|
UBUNTU_IMAGE_URL="https://downloads.mender.io/mender-convert/images/Ubuntu-Focal-x86-64.img.gz" |
|
|
|
|
|
|
|
|
## Auto-update |
|
|
## Auto-update |
|
|
UBUNTU_SERVER_RPI_IMAGE_URL="http://cdimage.ubuntu.com/ubuntu/releases/20.04/release/ubuntu-20.04.3-preinstalled-server-armhf+raspi.img.xz" |
|
|
UBUNTU_SERVER_RPI_IMAGE_URL="http://cdimage.ubuntu.com/ubuntu/releases/20.04/release/ubuntu-20.04.3-preinstalled-server-armhf+raspi.img.xz" |
|
@ -44,54 +44,83 @@ get_pytest_files |
|
|
|
|
|
|
|
|
prepare_ssh_keys |
|
|
prepare_ssh_keys |
|
|
|
|
|
|
|
|
if ! [ "$1" == "--all" -o "$1" == "--only" -a -n "$2" -o "$1" == "--prebuilt-image" -a -n "$3" ]; then |
|
|
usage_if_empty() { |
|
|
usage |
|
|
if [ -z "$1" ]; then |
|
|
fi |
|
|
usage |
|
|
|
|
|
fi |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
PREBUILT_IMAGE= |
|
|
|
|
|
TEST_PLATFORM= |
|
|
|
|
|
TEST_ALL=0 |
|
|
|
|
|
EXTRA_CONFIG= |
|
|
|
|
|
while [ -n "$1" ]; do |
|
|
|
|
|
case "$1" in |
|
|
|
|
|
--prebuilt-image) |
|
|
|
|
|
usage_if_empty "$3" |
|
|
|
|
|
PREBUILT_IMAGE="$2 $3" |
|
|
|
|
|
;; |
|
|
|
|
|
--all) |
|
|
|
|
|
TEST_ALL=1 |
|
|
|
|
|
;; |
|
|
|
|
|
--only) |
|
|
|
|
|
usage_if_empty "$2" |
|
|
|
|
|
TEST_PLATFORM="$2" |
|
|
|
|
|
shift |
|
|
|
|
|
;; |
|
|
|
|
|
--config) |
|
|
|
|
|
usage_if_empty "$2" |
|
|
|
|
|
EXTRA_CONFIG="$EXTRA_CONFIG --config $2" |
|
|
|
|
|
shift |
|
|
|
|
|
;; |
|
|
|
|
|
esac |
|
|
|
|
|
shift |
|
|
|
|
|
done |
|
|
|
|
|
|
|
|
test_result=0 |
|
|
test_result=0 |
|
|
|
|
|
|
|
|
if [ "$1" == "--prebuilt-image" ]; then |
|
|
if [ -n "$PREBUILT_IMAGE" ]; then |
|
|
run_tests "$2" "$3" \ |
|
|
run_tests $PREBUILT_IMAGE \ |
|
|
"-k" "'not test_update'" \ |
|
|
"-k" "'not test_update'" \ |
|
|
|| test_result=$? |
|
|
|| test_result=$? |
|
|
exit $test_result |
|
|
exit $test_result |
|
|
|
|
|
|
|
|
else |
|
|
else |
|
|
if [ "$1" == "--all" -o "$1" == "--only" -a "$2" == "qemux86_64" ]; then |
|
|
if [ "$TEST_ALL" == "1" -o "$TEST_PLATFORM" == "qemux86_64" ]; then |
|
|
wget --progress=dot:giga -N ${UBUNTU_IMAGE_URL} -P input/ |
|
|
wget --progress=dot:giga -N ${UBUNTU_IMAGE_URL} -P input/ |
|
|
convert_and_test "qemux86_64" \ |
|
|
convert_and_test "qemux86_64" \ |
|
|
"release-1" \ |
|
|
"release-1" \ |
|
|
"input/Ubuntu-Bionic-x86-64.img.gz" \ |
|
|
"input/Ubuntu-Focal-x86-64.img.gz" \ |
|
|
"--overlay tests/ssh-public-key-overlay" \ |
|
|
"--overlay tests/ssh-public-key-overlay" \ |
|
|
"--config configs/qemux86-64_config" \ |
|
|
"--config configs/qemux86-64_config $EXTRA_CONFIG" \ |
|
|
|| test_result=$? |
|
|
|| test_result=$? |
|
|
|
|
|
|
|
|
echo >&2 "----------------------------------------" |
|
|
echo >&2 "----------------------------------------" |
|
|
echo >&2 "Running the uncompressed test" |
|
|
echo >&2 "Running the uncompressed test" |
|
|
echo >&2 "----------------------------------------" |
|
|
echo >&2 "----------------------------------------" |
|
|
rm -rf deploy |
|
|
rm -rf deploy |
|
|
gunzip --force "input/Ubuntu-Bionic-x86-64.img.gz" |
|
|
gunzip --force "input/Ubuntu-Focal-x86-64.img.gz" |
|
|
run_convert "release-2" \ |
|
|
run_convert "release-2" \ |
|
|
"input/Ubuntu-Bionic-x86-64.img" \ |
|
|
"input/Ubuntu-Focal-x86-64.img" \ |
|
|
"--config configs/qemux86-64_config" || test_result=$? |
|
|
"--config configs/qemux86-64_config $EXTRA_CONFIG" || test_result=$? |
|
|
ret=0 |
|
|
ret=0 |
|
|
test -f deploy/Ubuntu-Bionic-x86-64-qemux86_64-mender.img || ret=$? |
|
|
test -f deploy/Ubuntu-Focal-x86-64-qemux86_64-mender.img || ret=$? |
|
|
assert "${ret}" "0" "Expected uncompressed file deploy/Ubuntu-Bionic-x86-64-qemux86_64-mender.img" |
|
|
assert "${ret}" "0" "Expected uncompressed file deploy/Ubuntu-Focal-x86-64-qemux86_64-mender.img" |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
if [ "$1" == "--all" -o "$1" == "--only" -a "$2" == "raspberrypi3" ]; then |
|
|
if [ "$TEST_ALL" == "1" -o "$TEST_PLATFORM" == "raspberrypi3" ]; then |
|
|
wget --progress=dot:giga -N ${RASPBIAN_IMAGE_URL} -P input/ |
|
|
wget --progress=dot:giga -N ${RASPBIAN_IMAGE_URL} -P input/ |
|
|
RASPBIAN_IMAGE="${RASPBIAN_IMAGE_URL##*/}" |
|
|
RASPBIAN_IMAGE="${RASPBIAN_IMAGE_URL##*/}" |
|
|
convert_and_test "raspberrypi3" \ |
|
|
convert_and_test "raspberrypi3" \ |
|
|
"release-1" \ |
|
|
"release-1" \ |
|
|
"input/${RASPBIAN_IMAGE}" \ |
|
|
"input/${RASPBIAN_IMAGE}" \ |
|
|
"--config configs/raspberrypi3_config" \ |
|
|
"--config configs/raspberrypi3_config $EXTRA_CONFIG" \ |
|
|
-- \ |
|
|
-- \ |
|
|
"-k" "'not test_update'" \ |
|
|
"-k" "'not test_update'" \ |
|
|
|| test_result=$? |
|
|
|| test_result=$? |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
if [ "$1" == "--all" -o "$1" == "--only" -a "$2" == "beaglebone" ]; then |
|
|
if [ "$TEST_ALL" == "1" -o "$TEST_PLATFORM" == "beaglebone" ]; then |
|
|
wget --progress=dot:giga -N ${BBB_DEBIAN_SDCARD_IMAGE_URL} -P input/ |
|
|
wget --progress=dot:giga -N ${BBB_DEBIAN_SDCARD_IMAGE_URL} -P input/ |
|
|
BBB_DEBIAN_SDCARD_IMAGE_COMPRESSED="${BBB_DEBIAN_SDCARD_IMAGE_URL##*/}" |
|
|
BBB_DEBIAN_SDCARD_IMAGE_COMPRESSED="${BBB_DEBIAN_SDCARD_IMAGE_URL##*/}" |
|
|
BBB_DEBIAN_SDCARD_IMAGE_UNCOMPRESSED="${BBB_DEBIAN_SDCARD_IMAGE_COMPRESSED%.xz}" |
|
|
BBB_DEBIAN_SDCARD_IMAGE_UNCOMPRESSED="${BBB_DEBIAN_SDCARD_IMAGE_COMPRESSED%.xz}" |
|
@ -100,7 +129,7 @@ else |
|
|
convert_and_test "beaglebone-sdcard" \ |
|
|
convert_and_test "beaglebone-sdcard" \ |
|
|
"release-1" \ |
|
|
"release-1" \ |
|
|
"input/${BBB_DEBIAN_SDCARD_IMAGE_UNCOMPRESSED}" \ |
|
|
"input/${BBB_DEBIAN_SDCARD_IMAGE_UNCOMPRESSED}" \ |
|
|
"--config configs/beaglebone_black_debian_sdcard_config" \ |
|
|
"--config configs/beaglebone_black_debian_sdcard_config $EXTRA_CONFIG" \ |
|
|
-- \ |
|
|
-- \ |
|
|
"-k" "'not test_update'" \ |
|
|
"-k" "'not test_update'" \ |
|
|
|| test_result=$? |
|
|
|| test_result=$? |
|
@ -113,19 +142,19 @@ else |
|
|
convert_and_test "beaglebone-emmc" \ |
|
|
convert_and_test "beaglebone-emmc" \ |
|
|
"release-1" \ |
|
|
"release-1" \ |
|
|
"input/${BBB_DEBIAN_EMMC_IMAGE_UNCOMPRESSED}" \ |
|
|
"input/${BBB_DEBIAN_EMMC_IMAGE_UNCOMPRESSED}" \ |
|
|
"--config configs/beaglebone_black_debian_emmc_config" \ |
|
|
"--config configs/beaglebone_black_debian_emmc_config $EXTRA_CONFIG" \ |
|
|
-- \ |
|
|
-- \ |
|
|
"-k" "'not test_update'" \ |
|
|
"-k" "'not test_update'" \ |
|
|
|| test_result=$? |
|
|
|| test_result=$? |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
if [ "$1" == "--all" -o "$1" == "--only" -a "$2" == "ubuntu" ]; then |
|
|
if [ "$TEST_ALL" == "1" -o "$TEST_PLATFORM" == "ubuntu" ]; then |
|
|
wget --progress=dot:giga -N ${UBUNTU_SERVER_RPI_IMAGE_URL} -P input/ |
|
|
wget --progress=dot:giga -N ${UBUNTU_SERVER_RPI_IMAGE_URL} -P input/ |
|
|
UBUNTU_SERVER_RPI_IMAGE_COMPRESSED="${UBUNTU_SERVER_RPI_IMAGE_URL##*/}" |
|
|
UBUNTU_SERVER_RPI_IMAGE_COMPRESSED="${UBUNTU_SERVER_RPI_IMAGE_URL##*/}" |
|
|
convert_and_test "raspberrypi3" \ |
|
|
convert_and_test "raspberrypi3" \ |
|
|
"release-1" \ |
|
|
"release-1" \ |
|
|
"input/${UBUNTU_SERVER_RPI_IMAGE_COMPRESSED}" \ |
|
|
"input/${UBUNTU_SERVER_RPI_IMAGE_COMPRESSED}" \ |
|
|
"--config configs/raspberrypi3_config" \ |
|
|
"--config configs/raspberrypi3_config $EXTRA_CONFIG" \ |
|
|
-- \ |
|
|
-- \ |
|
|
"-k" "'not test_update'" \ |
|
|
"-k" "'not test_update'" \ |
|
|
|| test_result=$? |
|
|
|| test_result=$? |
|
|