mirror of
https://github.com/linuxkit/linuxkit.git
synced 2026-01-14 02:35:10 +00:00
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user