tests: Run the package tests on HyperKit when running on OSX

With the updated HyperKit go bindings we can redirect the VM output
and check for test results. Use this for all kernel tests as this
speeds up running the tests on OSX.

Also use 'set -x' instead of 'set -v' for consistency and don't fail
when the clean up code fails.

The mkimage package test currently doesn't work on HyperKit as it
requires support for multiple disks to be added.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
This commit is contained in:
Rolf Neugebauer 2017-06-07 16:18:43 +01:00
parent d449ef6901
commit 4195ff8553
4 changed files with 8 additions and 12 deletions

View File

@ -4,20 +4,19 @@
# REPEAT:
set -e
set -v
# Source libraries. Uncomment if needed/defined
#. "${RT_LIB}"
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
clean_up() {
find . -iname "test-binfmt*" -not -iname "*.yml" -exec rm -rf {} \;
find . -iname "test-binfmt*" -not -iname "*.yml" -exec rm -rf {} \; || true
}
trap clean_up EXIT
# Test code goes here
moby build -output kernel+initrd test-binfmt.yml
RESULT="$(linuxkit run qemu -kernel test-binfmt)"
RESULT="$(linuxkit run test-binfmt)"
echo "${RESULT}"
echo "${RESULT}" | grep -q "suite PASSED"

View File

@ -4,20 +4,19 @@
# REPEAT:
set -e
set -v
# Source libraries. Uncomment if needed/defined
#. "${RT_LIB}"
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
clean_up() {
find . -iname "test-ca-certificates*" -not -iname "*.yml" -exec rm -rf {} \;
find . -iname "test-ca-certificates*" -not -iname "*.yml" -exec rm -rf {} \; || true
}
trap clean_up EXIT
# Test code goes here
moby build -output kernel+initrd test-ca-certificates.yml
RESULT="$(linuxkit run qemu -kernel test-ca-certificates)"
RESULT="$(linuxkit run test-ca-certificates)"
echo "${RESULT}"
echo "${RESULT}" | grep -q "suite PASSED"

View File

@ -4,20 +4,19 @@
# REPEAT:
set -e
set -v
# Source libraries. Uncomment if needed/defined
#. "${RT_LIB}"
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
clean_up() {
find . -iname "test-dhcpcd*" -not -iname "*.yml" -exec rm -rf {} \;
find . -iname "test-dhcpcd*" -not -iname "*.yml" -exec rm -rf {} \; || true
}
trap clean_up EXIT
# Test code goes here
moby build -output kernel+initrd test-dhcpcd.yml
RESULT="$(linuxkit run qemu -kernel test-dhcpcd)"
RESULT="$(linuxkit run test-dhcpcd)"
echo "${RESULT}"
echo "${RESULT}" | grep -q "suite PASSED"

View File

@ -4,20 +4,19 @@
# REPEAT:
set -e
set -v
# Source libraries. Uncomment if needed/defined
#. "${RT_LIB}"
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
clean_up() {
find . -iname "test-sysctl*" -not -iname "*.yml" -exec rm -rf {} \;
find . -iname "test-sysctl*" -not -iname "*.yml" -exec rm -rf {} \; || true
}
trap clean_up EXIT
# Test code goes here
moby build -output kernel+initrd test-sysctl.yml
RESULT="$(linuxkit run qemu -kernel test-sysctl)"
RESULT="$(linuxkit run test-sysctl)"
echo "${RESULT}"
echo "${RESULT}" | grep -q "suite PASSED"