tests: Clean up build tests

Build tests don't need the 'find' nor 'rm -r' as they don't
create directories.

There is no need to delete the 'test.yml' file in
the output tests.

Consistently use NAME as the name argument

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
This commit is contained in:
Rolf Neugebauer 2017-09-17 16:20:19 +01:00
parent 27839280f7
commit 6842f10351
17 changed files with 36 additions and 61 deletions

View File

@ -11,9 +11,7 @@ set -e
NAME=check
clean_up() {
# remove any images
find . -depth -iname "${NAME}*" -exec rm -rf {} \;
rm -f test.yml
rm -f ${NAME}*
}
trap clean_up EXIT

View File

@ -11,9 +11,7 @@ set -e
NAME=check
clean_up() {
# remove any images
find . -depth -iname "${NAME}*" -exec rm -rf {} \;
rm -f test.yml
rm -f ${NAME}*
}
trap clean_up EXIT

View File

@ -11,14 +11,12 @@ set -e
NAME=check
clean_up() {
# remove any images
find . -depth -iname "${NAME}*" -exec rm -rf {} \;
rm -f test.yml
rm -f ${NAME}*
}
trap clean_up EXIT
moby build -format iso-efi -name "${NAME}" ../test.yml
[ -f "${NAME}-efi.iso" ] || exit 1
[ -f "${NAME}"-efi.iso ] || exit 1
exit 0

View File

@ -11,9 +11,7 @@ set -e
NAME=check
clean_up() {
# remove any images
find . -depth -iname "${NAME}*" -exec rm -rf {} \;
rm -f test.yml
rm -f ${NAME}*
}
trap clean_up EXIT

View File

@ -11,9 +11,7 @@ set -e
NAME=check
clean_up() {
# remove any images
find . -depth -iname "${NAME}*" -exec rm -rf {} \;
rm -f test.yml
rm -f ${NAME}*
}
trap clean_up EXIT

View File

@ -11,9 +11,7 @@ set -e
NAME=check
clean_up() {
# remove any images
find . -depth -iname "${NAME}*" -exec rm -rf {} \;
rm -f test.yml
rm -f ${NAME}*
}
trap clean_up EXIT

View File

@ -12,9 +12,7 @@ set -e
NAME=check
clean_up() {
# remove any images
find . -depth -iname "${NAME}*" -exec rm -rf {} \;
rm -f test.yml
rm -f ${NAME}*
}
trap clean_up EXIT

View File

@ -11,9 +11,7 @@ set -e
NAME=check
clean_up() {
# remove any images
find . -depth -iname "${NAME}*" -exec rm -rf {} \;
rm -f test.yml
rm -f ${NAME}*
}
trap clean_up EXIT

View File

@ -8,17 +8,16 @@ set -e
#. "${RT_LIB}"
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
IMAGE_NAME=minimal
NAME=minimal
clean_up() {
# remove any files, containers, images etc
rm -rf ${IMAGE_NAME}*
rm -f ${NAME}*
}
trap clean_up EXIT
# Test code goes here
moby build "${LINUXKIT_EXAMPLES_DIR}/${IMAGE_NAME}.yml"
moby build "${LINUXKIT_EXAMPLES_DIR}/${NAME}.yml"
exit 0

View File

@ -8,17 +8,16 @@ set -e
#. "${RT_LIB}"
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
IMAGE_NAME=docker
NAME=docker
clean_up() {
# remove any files, containers, images etc
rm -rf ${IMAGE_NAME}*
rm -f ${NAME}*
}
trap clean_up EXIT
# Test code goes here
moby build "${LINUXKIT_EXAMPLES_DIR}/${IMAGE_NAME}.yml"
moby build "${LINUXKIT_EXAMPLES_DIR}/${NAME}.yml"
exit 0

View File

@ -8,17 +8,16 @@ set -e
#. "${RT_LIB}"
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
IMAGE_NAME=sshd
NAME=sshd
clean_up() {
# remove any files, containers, images etc
rm -rf ${IMAGE_NAME}*
rm -f ${NAME}*
}
trap clean_up EXIT
# Test code goes here
moby build "${LINUXKIT_EXAMPLES_DIR}/${IMAGE_NAME}.yml"
moby build "${LINUXKIT_EXAMPLES_DIR}/${NAME}.yml"
exit 0

View File

@ -8,17 +8,16 @@ set -e
#. "${RT_LIB}"
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
IMAGE_NAME=redis-os
NAME=redis-os
clean_up() {
# remove any files, containers, images etc
rm -rf ${IMAGE_NAME}*
rm -f ${NAME}*
}
trap clean_up EXIT
# Test code goes here
moby build "${LINUXKIT_EXAMPLES_DIR}/${IMAGE_NAME}.yml"
moby build "${LINUXKIT_EXAMPLES_DIR}/${NAME}.yml"
exit 0

View File

@ -8,17 +8,16 @@ set -e
#. "${RT_LIB}"
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
IMAGE_NAME=swap
NAME=swap
clean_up() {
# remove any files, containers, images etc
rm -rf ${IMAGE_NAME}*
rm -f ${NAME}*
}
trap clean_up EXIT
# Test code goes here
moby build "${LINUXKIT_EXAMPLES_DIR}/${IMAGE_NAME}.yml"
moby build "${LINUXKIT_EXAMPLES_DIR}/${NAME}.yml"
exit 0

View File

@ -8,17 +8,16 @@ set -e
#. "${RT_LIB}"
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
IMAGE_NAME=node_exporter
NAME=node_exporter
clean_up() {
# remove any files, containers, images etc
rm -rf ${IMAGE_NAME}*
rm -f ${NAME}*
}
trap clean_up EXIT
# Test code goes here
moby build "${LINUXKIT_EXAMPLES_DIR}/${IMAGE_NAME}.yml"
moby build "${LINUXKIT_EXAMPLES_DIR}/${NAME}.yml"
exit 0

View File

@ -8,16 +8,15 @@ set -e
#. "${RT_LIB}"
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
IMAGE_NAME=tpm
NAME=tpm
clean_up() {
# remove any files, containers, images etc
rm -rf ${IMAGE_NAME}*
rm -f ${NAME}*
}
trap clean_up EXIT
# Test code goes here
moby build "${LINUXKIT_EXAMPLES_DIR}/${IMAGE_NAME}.yml"
moby build "${LINUXKIT_EXAMPLES_DIR}/${NAME}.yml"
exit 0

View File

@ -8,16 +8,15 @@ set -e
#. "${RT_LIB}"
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
IMAGE_NAME=wireguard
NAME=wireguard
clean_up() {
# remove any files, containers, images etc
rm -rf ${IMAGE_NAME}*
rm -f ${NAME}*
}
trap clean_up EXIT
# Test code goes here
moby build "${LINUXKIT_EXAMPLES_DIR}/${IMAGE_NAME}.yml"
moby build "${LINUXKIT_EXAMPLES_DIR}/${NAME}.yml"
exit 0

View File

@ -8,17 +8,16 @@ set -e
#. "${RT_LIB}"
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
IMAGE_NAME=docker-for-mac
NAME=docker-for-mac
clean_up() {
# remove any files, containers, images etc
rm -rf ${IMAGE_NAME}*
rm -f ${NAME}*
}
trap clean_up EXIT
# Test code goes here
moby build -name "${IMAGE_NAME}" "${LINUXKIT_BLUEPRINTS_DIR}/${IMAGE_NAME}/base.yml" "${LINUXKIT_BLUEPRINTS_DIR}/${IMAGE_NAME}/docker-ce.yml"
moby build -name "${NAME}" "${LINUXKIT_BLUEPRINTS_DIR}/${NAME}/base.yml" "${LINUXKIT_BLUEPRINTS_DIR}/${NAME}/docker-ce.yml"
exit 0