tests: Unify test YAML files to test.yml

While at it also unify the clean-up code and other bits in test.sh

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
This commit is contained in:
Rolf Neugebauer
2017-09-17 15:20:48 +01:00
parent 6842f10351
commit 4541e8511a
23 changed files with 50 additions and 33 deletions

View File

@@ -9,14 +9,16 @@ set -e
#. "${RT_LIB}"
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
NAME=kconfig
clean_up() {
find . -depth -iname "test-kernel-config*" -not -iname "*.yml" -exec rm -rf {} \;
rm -rf ${NAME}-*
}
trap clean_up EXIT
# Test code goes here
moby build -format kernel+initrd test-kernel-config.yml
RESULT="$(linuxkit run test-kernel-config)"
moby build -format kernel+initrd -name "${NAME}" test.yml
RESULT="$(linuxkit run ${NAME})"
echo "${RESULT}" | grep -q "suite PASSED"
exit 0

View File

@@ -9,14 +9,16 @@ set -e
#. "${RT_LIB}"
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
NAME=kconfig
clean_up() {
find . -depth -iname "test-kernel-config*" -not -iname "*.yml" -exec rm -rf {} \;
rm -rf ${NAME}-*
}
trap clean_up EXIT
# Test code goes here
moby build -format kernel+initrd test-kernel-config.yml
RESULT="$(linuxkit run test-kernel-config)"
moby build -format kernel+initrd -name "${NAME}" test.yml
RESULT="$(linuxkit run ${NAME})"
echo "${RESULT}" | grep -q "suite PASSED"
exit 0

View File

@@ -9,14 +9,16 @@ set -e
#. "${RT_LIB}"
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
NAME=kconfig
clean_up() {
find . -depth -iname "test-kernel-config*" -not -iname "*.yml" -exec rm -rf {} \;
rm -rf ${NAME}-*
}
trap clean_up EXIT
# Test code goes here
moby build -format kernel+initrd test-kernel-config.yml
RESULT="$(linuxkit run test-kernel-config)"
moby build -format kernel+initrd -name "${NAME}" test.yml
RESULT="$(linuxkit run ${NAME})"
echo "${RESULT}" | grep -q "suite PASSED"
exit 0

View File

@@ -9,11 +9,12 @@ set -e
#. "${RT_LIB}"
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
IMAGE_NAME="kmod-test"
NAME=kmod
IMAGE_NAME=kmod-test
clean_up() {
docker rmi ${IMAGE_NAME} || true
find . -depth -iname "kmod*" -not -iname "*.yml" -exec rm -rf {} \;
rm -rf ${NAME}-*
}
trap clean_up EXIT
@@ -23,8 +24,8 @@ docker pull linuxkit/kernel:4.9.50
docker build -t ${IMAGE_NAME} .
# Build and run a LinuxKit image with kernel module (and test script)
moby build -format kernel+initrd kmod.yml
RESULT="$(linuxkit run kmod)"
moby build -format kernel+initrd -name "${NAME}" test.yml
RESULT="$(linuxkit run ${NAME})"
echo "${RESULT}" | grep -q "Hello LinuxKit"
exit 0