Split linuxkit.build.outputs into distinct tests

This test was building all the supported output formats and so was taking
orders of magnitude longer than every other test. It was also obscuring which
output formats were slow and/or broken.

The vhd test remains skipped.

Signed-off-by: Ian Campbell <ijc@docker.com>
This commit is contained in:
Ian Campbell 2017-07-13 13:42:24 +01:00
parent 3891a179e5
commit 89e7627576
9 changed files with 195 additions and 33 deletions

View File

@ -0,0 +1,26 @@
#!/bin/sh
# SUMMARY: Check that kernel+initrd output format is generated
# LABELS:
set -e
# Source libraries. Uncomment if needed/defined
#. "${RT_LIB}"
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
NAME=check
clean_up() {
# remove any images
find . -depth -iname "${NAME}*" -exec rm -rf {} \;
rm -f test.yml
}
trap clean_up EXIT
moby build -output kernel+initrd -name "${NAME}" ../test.yml
[ -f "${NAME}-kernel" ] || exit 1
[ -f "${NAME}-initrd.img" ] || exit 1
[ -f "${NAME}-cmdline" ] || exit 1
exit 0

View File

@ -0,0 +1,24 @@
#!/bin/sh
# SUMMARY: Check that iso-bios output format is generated
# LABELS:
set -e
# Source libraries. Uncomment if needed/defined
#. "${RT_LIB}"
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
NAME=check
clean_up() {
# remove any images
find . -depth -iname "${NAME}*" -exec rm -rf {} \;
rm -f test.yml
}
trap clean_up EXIT
moby build -output iso-bios -name "${NAME}" ../test.yml
[ -f "${NAME}.iso" ] || exit 1
exit 0

View File

@ -0,0 +1,24 @@
#!/bin/sh
# SUMMARY: Check that iso-efi output format is generated
# LABELS:
set -e
# Source libraries. Uncomment if needed/defined
#. "${RT_LIB}"
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
NAME=check
clean_up() {
# remove any images
find . -depth -iname "${NAME}*" -exec rm -rf {} \;
rm -f test.yml
}
trap clean_up EXIT
moby build -output iso-efi -name "${NAME}" ../test.yml
[ -f "${NAME}-efi.iso" ] || exit 1
exit 0

View File

@ -0,0 +1,24 @@
#!/bin/sh
# SUMMARY: Check that gcp output format is generated
# LABELS:
set -e
# Source libraries. Uncomment if needed/defined
#. "${RT_LIB}"
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
NAME=check
clean_up() {
# remove any images
find . -depth -iname "${NAME}*" -exec rm -rf {} \;
rm -f test.yml
}
trap clean_up EXIT
moby build -output gcp -name "${NAME}" ../test.yml
[ -f "${NAME}.img.tar.gz" ] || exit 1
exit 0

View File

@ -0,0 +1,24 @@
#!/bin/sh
# SUMMARY: Check that raw output format is generated
# LABELS:
set -e
# Source libraries. Uncomment if needed/defined
#. "${RT_LIB}"
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
NAME=check
clean_up() {
# remove any images
find . -depth -iname "${NAME}*" -exec rm -rf {} \;
rm -f test.yml
}
trap clean_up EXIT
moby build -output raw -name "${NAME}" ../test.yml
[ -f "${NAME}.raw" ] || exit 1
exit 0

View File

@ -0,0 +1,24 @@
#!/bin/sh
# SUMMARY: Check that qcow2 output format is generated
# LABELS:
set -e
# Source libraries. Uncomment if needed/defined
#. "${RT_LIB}"
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
NAME=check
clean_up() {
# remove any images
find . -depth -iname "${NAME}*" -exec rm -rf {} \;
rm -f test.yml
}
trap clean_up EXIT
moby build -output qcow2 -name "${NAME}" ../test.yml
[ -f "${NAME}.qcow2" ] || exit 1
exit 0

View File

@ -0,0 +1,25 @@
#!/bin/sh
# SUMMARY: Check that vhd format is generated
# LABELS: skip
# VHD currently requires a lot of memory, disable for now
set -e
# Source libraries. Uncomment if needed/defined
#. "${RT_LIB}"
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
NAME=check
clean_up() {
# remove any images
find . -depth -iname "${NAME}*" -exec rm -rf {} \;
rm -f test.yml
}
trap clean_up EXIT
moby build -output vhd -name "${NAME}" ../test.yml
[ -f "${NAME}.vhd" ] || exit 1
exit 0

View File

@ -0,0 +1,24 @@
#!/bin/sh
# SUMMARY: Check that vmdk output format is generated
# LABELS:
set -e
# Source libraries. Uncomment if needed/defined
#. "${RT_LIB}"
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
NAME=check
clean_up() {
# remove any images
find . -depth -iname "${NAME}*" -exec rm -rf {} \;
rm -f test.yml
}
trap clean_up EXIT
moby build -output vmdk -name "${NAME}" ../test.yml
[ -f "${NAME}.vmdk" ] || exit 1
exit 0

View File

@ -1,33 +0,0 @@
#!/bin/sh
# SUMMARY: Check that all supported output formats are generated
# LABELS:
set -e
# Source libraries. Uncomment if needed/defined
#. "${RT_LIB}"
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
NAME=check
clean_up() {
# remove any images
find . -depth -iname "${NAME}*" -exec rm -rf {} \;
}
trap clean_up EXIT
moby build -output kernel+initrd,iso-bios,iso-efi,gcp,raw,qcow2,vmdk -name "${NAME}" test.yml
[ -f "${NAME}-kernel" ] || exit 1
[ -f "${NAME}-initrd.img" ] || exit 1
[ -f "${NAME}-cmdline" ] || exit 1
[ -f "${NAME}.iso" ] || exit 1
[ -f "${NAME}-efi.iso" ] || exit 1
[ -f "${NAME}.img.tar.gz" ] || exit 1
[ -f "${NAME}.raw" ] || exit 1
[ -f "${NAME}.qcow2" ] || exit 1
# VHD currently requires a lot of memory, disable for now
# [ -f "${NAME}.vhd" ] || exit 1
[ -f "${NAME}.vmdk" ] || exit 1
exit 0