tests: Consolidate platform tests

There is no need to split the build from run as we have separate build tests

Also shuffle the order around a little. Double digit numbers are for local hypervisor
tests and tripple digit tests are for cloud.

Removed GCP test as they weren't run.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
This commit is contained in:
Rolf Neugebauer 2017-05-15 16:53:55 +01:00
parent 9eb710411a
commit ddb4221c1f
22 changed files with 97 additions and 370 deletions

View File

@ -1,28 +0,0 @@
#!/bin/sh
# SUMMARY: Test building an image for qemu
# LABELS: build
# AUTHOR: Dave Tucker <dt@docker.com>
set -e
# Source libraries. Uncomment if needed/defined
#. "${RT_LIB}"
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
IMAGE_NAME=test-qemu-build
clean_up() {
# remove any files, containers, images etc
find . -iname "${IMAGE_NAME}*" -not -iname "*.yml" -exec rm {} \;
}
trap clean_up EXIT
# Test code goes here
moby build -name "${IMAGE_NAME}" test.yml
[ -f "${IMAGE_NAME}-kernel" ] || exit 1
[ -f "${IMAGE_NAME}-initrd.img" ] || exit 1
[ -f "${IMAGE_NAME}-cmdline" ]|| exit 1
find . -iname "${IMAGE_NAME}-*" -exec cp {} "${LINUXKIT_TMPDIR}/{}" \;
exit 0

View File

@ -0,0 +1,27 @@
#!/bin/sh
# SUMMARY: Check that the kernel+initrd image boots in qemu
# LABELS:
# AUTHOR: Dave Tucker <dt@docker.com>
# AUTHOR: Rolf Neugebauer <rolf.neugebauer@docker.com>
set -e
# Source libraries. Uncomment if needed/defined
#. "${RT_LIB}"
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
NAME=qemu-kernel
clean_up() {
# remove any files, containers, images etc
rm -rf "${NAME}*" || true
}
trap clean_up EXIT
moby build -name "${NAME}" test.yml
[ -f "${NAME}-kernel" ] || exit 1
[ -f "${NAME}-initrd.img" ] || exit 1
[ -f "${NAME}-cmdline" ]|| exit 1
linuxkit run qemu "${NAME}" | grep -q "Welcome to LinuxKit"
exit 0

View File

@ -6,17 +6,6 @@ init:
- linuxkit/runc:b0fb122e10dbb7e4e45115177a61a3f8d68c19a9
- linuxkit/containerd:60e2486a74c665ba4df57e561729aec20758daed
onboot:
- name: dhcpcd
image: "linuxkit/dhcpcd:8837289b78ecd80f59524883085424e115dd0b3a"
binds:
- /var:/var
- /tmp/etc:/etc
capabilities:
- CAP_NET_ADMIN
- CAP_NET_BIND_SERVICE
- CAP_NET_RAW
net: host
command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]
- name: poweroff
image: "linuxkit/poweroff:961412b8ef5c5285de0d40ec076701d955eaa084"
pid: host

View File

@ -1,24 +0,0 @@
#!/bin/sh
# SUMMARY: Test running an image with qemu
# LABELS:
# AUTHOR: Dave Tucker <dt@docker.com>
set -e
# Source libraries. Uncomment if needed/defined
#. "${RT_LIB}"
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
IMAGE_NAME=test-qemu-build
clean_up() {
# remove any files, containers, images etc
rm -rf "${LINUXKIT_TMPDIR:?}/${IMAGE_NAME:?}*" || true
}
trap clean_up EXIT
# Test code goes here
[ -f "${LINUXKIT_TMPDIR}/${IMAGE_NAME}-kernel" ] || exit 1
linuxkit run qemu "${LINUXKIT_TMPDIR}/${IMAGE_NAME}" | grep -q "Welcome to LinuxKit"
exit 0

View File

@ -1,26 +0,0 @@
#!/bin/sh
# SUMMARY: Test building an ISO image for qemu
# LABELS: build
# AUTHOR: Dave Tucker <dt@docker.com>
set -e
# Source libraries. Uncomment if needed/defined
#. "${RT_LIB}"
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
IMAGE_NAME=test-qemu-build
clean_up() {
# remove any files, containers, images etc
find . -iname "${IMAGE_NAME}*" -not -iname "*.yml" -exec rm {} \;
}
trap clean_up EXIT
# Test code goes here
moby build -name "${IMAGE_NAME}" test.yml
[ -f "${IMAGE_NAME}.iso" ] || exit 1
cp "${IMAGE_NAME}.iso" "${LINUXKIT_TMPDIR}/"
exit 0

View File

@ -0,0 +1,24 @@
#!/bin/sh
# SUMMARY: Check that legacy BIOS ISO boots in qemu
# LABELS:
# AUTHOR: Dave Tucker <dt@docker.com>
# AUTHOR: Rolf Neugebauer <rolf.neugebauer@docker.com>
set -e
# Source libraries. Uncomment if needed/defined
#. "${RT_LIB}"
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
NAME=qemu-iso
clean_up() {
rm -rf "${NAME}*" || true
}
trap clean_up EXIT
moby build -name "${NAME}" test.yml
[ -f "${NAME}.iso" ] || exit 1
linuxkit run qemu -iso "${NAME}" | grep -q "Welcome to LinuxKit"
exit 0

View File

@ -6,17 +6,6 @@ init:
- linuxkit/runc:b0fb122e10dbb7e4e45115177a61a3f8d68c19a9
- linuxkit/containerd:60e2486a74c665ba4df57e561729aec20758daed
onboot:
- name: dhcpcd
image: "linuxkit/dhcpcd:8837289b78ecd80f59524883085424e115dd0b3a"
binds:
- /var:/var
- /tmp/etc:/etc
capabilities:
- CAP_NET_ADMIN
- CAP_NET_BIND_SERVICE
- CAP_NET_RAW
net: host
command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]
- name: poweroff
image: "linuxkit/poweroff:961412b8ef5c5285de0d40ec076701d955eaa084"
pid: host

View File

@ -1,24 +0,0 @@
#!/bin/sh
# SUMMARY: Test running an ISO image with qemu
# LABELS:
# AUTHOR: Dave Tucker <dt@docker.com>
set -e
# Source libraries. Uncomment if needed/defined
#. "${RT_LIB}"
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
IMAGE_NAME=test-qemu-build
clean_up() {
# remove any files, containers, images etc
rm -rf "${LINUXKIT_TMPDIR:?}/${IMAGE_NAME:?}*" || true
}
trap clean_up EXIT
# Test code goes here
[ -f "${LINUXKIT_TMPDIR}/${IMAGE_NAME}.iso" ] || exit 1
linuxkit run qemu -iso "${LINUXKIT_TMPDIR}/${IMAGE_NAME}" | grep -q "Welcome to LinuxKit"
exit 0

View File

@ -1,25 +0,0 @@
#!/bin/sh
# SUMMARY: Test building a UEFI image for qemu
# LABELS: build
# AUTHOR: Dave Tucker <dt@docker.com>
set -e
# Source libraries. Uncomment if needed/defined
#. "${RT_LIB}"
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
IMAGE_NAME=test-qemu-build
clean_up() {
# remove any files, containers, images etc
find . -iname "${IMAGE_NAME}*" -not -iname "*.yml" -exec rm {} \;
}
trap clean_up EXIT
# Test code goes here
moby build -name "${IMAGE_NAME}" test.yml
[ -f "${IMAGE_NAME}-efi.iso" ] || exit 1
cp "${IMAGE_NAME}-efi.iso" "${LINUXKIT_TMPDIR}/"
exit 0

View File

@ -1,7 +1,8 @@
#!/bin/sh
# SUMMARY: Test running a UEFI image with qemu
# SUMMARY: Check that legacy BIOS ISO boots in qemu
# LABELS:
# AUTHOR: Dave Tucker <dt@docker.com>
# AUTHOR: Rolf Neugebauer <rolf.neugebauer@docker.com>
set -e
@ -9,11 +10,11 @@ set -e
#. "${RT_LIB}"
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
IMAGE_NAME=test-qemu-build
NAME=qemu-efi
clean_up() {
# remove any files, containers, images etc
rm -rf "${LINUXKIT_TMPDIR:?}/${IMAGE_NAME:?}*" || true
rm -rf "${NAME}*" || true
}
trap clean_up EXIT
@ -24,8 +25,7 @@ if command -v qemu; then
fi
fi
# Test code goes here
[ -f "${LINUXKIT_TMPDIR}/${IMAGE_NAME}-efi.iso" ] || exit 1
linuxkit run qemu -uefi "${LINUXKIT_TMPDIR}/${IMAGE_NAME}" | grep -q "Welcome to LinuxKit"
moby build -name "${NAME}" test.yml
[ -f "${NAME}-efi.iso" ] || exit 1
linuxkit run qemu -uefi "${NAME}" | grep -q "Welcome to LinuxKit"
exit 0

View File

@ -6,17 +6,6 @@ init:
- linuxkit/runc:b0fb122e10dbb7e4e45115177a61a3f8d68c19a9
- linuxkit/containerd:60e2486a74c665ba4df57e561729aec20758daed
onboot:
- name: dhcpcd
image: "linuxkit/dhcpcd:8837289b78ecd80f59524883085424e115dd0b3a"
binds:
- /var:/var
- /tmp/etc:/etc
capabilities:
- CAP_NET_ADMIN
- CAP_NET_BIND_SERVICE
- CAP_NET_RAW
net: host
command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]
- name: poweroff
image: "linuxkit/poweroff:961412b8ef5c5285de0d40ec076701d955eaa084"
pid: host

View File

@ -1,27 +0,0 @@
#!/bin/sh
# SUMMARY: Test building an image for GCP
# LABELS: build
# AUTHOR: Dave Tucker <dt@docker.com>
set -e
# Source libraries. Uncomment if needed/defined
#. "${RT_LIB}"
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
IMAGE_NAME=gcp
clean_up() {
# remove any files, containers, images etc
rm -rf ${IMAGE_NAME}*
}
trap clean_up EXIT
# Test code goes here
moby build -name "${IMAGE_NAME}" test.yml
[ -f "${IMAGE_NAME}.img.tar.gz" ] || exit 1
# As build and run on different machines, copy to the artifacts directory
cp -f "${IMAGE_NAME}.img.tar.gz" "${LINUXKIT_ARTIFACTS_DIR}/test.img.tar.gz"
exit 0

View File

@ -1,34 +0,0 @@
# FIXME: This should use the minimal example
# We continue to use the kernel-config-test as CI is currently expecting to see a success message
kernel:
image: "linuxkit/kernel:4.9.x"
cmdline: "console=ttyS0"
init:
- linuxkit/init:deea956a9ab07bf262083e93a86930bdc610cc2f
- linuxkit/runc:2649198589ef0020d99f613adaeda45ce0093a38
- linuxkit/containerd:cf2614f5a96c569a0bd4bd54e054a65ba17d167f
- linuxkit/ca-certificates:3344cdca1bc59fdfa17bd7f0fcbf491b9dbaa288
onboot:
- name: dhcpcd
image: "linuxkit/dhcpcd:2def74ab3f9233b4c09ebb196ba47c27c08b0ed8"
binds:
- /var:/var
- /tmp:/etc
capabilities:
- CAP_NET_ADMIN
- CAP_NET_BIND_SERVICE
- CAP_NET_RAW
net: host
command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]
- name: check-kernel-config
image: "linuxkit/test-kernel-config:ecff41279ccbc408079a3996a956432651c6eb9c"
readonly: true
- name: poweroff
image: "linuxkit/poweroff:961412b8ef5c5285de0d40ec076701d955eaa084"
pid: host
command: ["/bin/sh", "/poweroff.sh", "3"]
capabilities:
- CAP_SYS_BOOT
readonly: true
outputs:
- format: gcp-img

View File

@ -1,24 +0,0 @@
#!/bin/sh
# SUMMARY: Test running an image with qemu
# LABELS: gcp
# AUTHOR: Dave Tucker <dt@docker.com>
set -e
# Source libraries. Uncomment if needed/defined
#. "${RT_LIB}"
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
IMAGE_NAME=test
clean_up() {
# remove any files, containers, images etc
echo "Nothing to cleanup..."
}
trap clean_up EXIT
# Test code goes here
[ -f "${LINUXKIT_ARTIFACTS_DIR}/${IMAGE_NAME}.img.tar.gz" ] || exit 1
linuxkit run gcp "${LINUXKIT_ARTIFACTS_DIR}/${IMAGE_NAME}" | grep -q "Welcome to LinuxKit"
exit 0

View File

@ -1,27 +0,0 @@
#!/bin/sh
# SUMMARY: Test building an image for packet.net
# LABELS: build
# AUTHOR: Dave Tucker <dt@docker.com>
set -e
# Source libraries. Uncomment if needed/defined
#. "${RT_LIB}"
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
IMAGE_NAME=packet
clean_up() {
# remove any files, containers, images etc
rm -rf ${IMAGE_NAME}*
}
trap clean_up EXIT
# Test code goes here
moby build --name "${IMAGE_NAME}" test.yml
[ -f "${IMAGE_NAME}-kernel" ] || exit 1
# As build and run on different machines, copy to the artifacts directory
find . -iname "${IMAGE_NAME}-*" -exec cp {} "${LINUXKIT_ARTFACTS_DIR}/{}" \;
exit 0

View File

@ -1,31 +0,0 @@
kernel:
image: "linuxkit/kernel:4.9.x"
cmdline: "console=ttyS0 console=tty0 page_poison=1"
init:
- linuxkit/init:f71c3b30ac1ba4ef16c160c89610fa4976f9752f
- linuxkit/runc:b0fb122e10dbb7e4e45115177a61a3f8d68c19a9
- linuxkit/containerd:60e2486a74c665ba4df57e561729aec20758daed
onboot:
- name: dhcpcd
image: "linuxkit/dhcpcd:8837289b78ecd80f59524883085424e115dd0b3a"
binds:
- /var:/var
- /tmp/etc:/etc
capabilities:
- CAP_NET_ADMIN
- CAP_NET_BIND_SERVICE
- CAP_NET_RAW
net: host
command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]
- name: poweroff
image: "linuxkit/poweroff:961412b8ef5c5285de0d40ec076701d955eaa084"
pid: host
command: ["/bin/sh", "/poweroff.sh", "10"]
capabilities:
- CAP_SYS_BOOT
readonly: true
trust:
image:
- linuxkit/kernel
outputs:
- format: kernel+initrd

View File

@ -0,0 +1,37 @@
#!/bin/sh
# SUMMARY: LinuxKit VMware tests
# LABELS: darwin
# For the top level group.sh also specify a 'NAME:' comment
# Source libraries. Uncomment if needed/defined
#. "${RT_LIB}"
#. "${RT_PROJECT_ROOT}/_lib/lib.sh"
group_init() {
# Group initialisation code goes here
return 0
}
group_deinit() {
# Group de-initialisation code goes here
return 0
}
CMD=$1
case $CMD in
init)
group_init
res=$?
;;
deinit)
group_deinit
res=$?
;;
*)
res=1
;;
esac
exit $res

View File

@ -1,27 +0,0 @@
#!/bin/sh
# SUMMARY: Test building an image for VMware
# LABELS: build
# AUTHOR: Dave Tucker <dt@docker.com>
set -e
# Source libraries. Uncomment if needed/defined
#. "${RT_LIB}"
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
IMAGE_NAME=vmware
clean_up() {
# remove any files, containers, images etc
rm -rf ${IMAGE_NAME}*
}
trap clean_up EXIT
# Test code goes here
moby build --name "${IMAGE_NAME}" test.yml
[ -f "${IMAGE_NAME}.vmdk" ] || exit 1
# As build and run on different machines, copy to the artifacts directory
cp "${IMAGE_NAME}.vmdk" "${LINUXKIT_ARTIFACTS_DIR}/"
exit 0

View File

@ -1,31 +0,0 @@
kernel:
image: "linuxkit/kernel:4.9.x"
cmdline: "console=ttyS0 console=tty0 page_poison=1"
init:
- linuxkit/init:f71c3b30ac1ba4ef16c160c89610fa4976f9752f
- linuxkit/runc:b0fb122e10dbb7e4e45115177a61a3f8d68c19a9
- linuxkit/containerd:60e2486a74c665ba4df57e561729aec20758daed
onboot:
- name: dhcpcd
image: "linuxkit/dhcpcd:8837289b78ecd80f59524883085424e115dd0b3a"
binds:
- /var:/var
- /tmp/etc:/etc
capabilities:
- CAP_NET_ADMIN
- CAP_NET_BIND_SERVICE
- CAP_NET_RAW
net: host
command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]
- name: poweroff
image: "linuxkit/poweroff:961412b8ef5c5285de0d40ec076701d955eaa084"
pid: host
command: ["/bin/sh", "/poweroff.sh", "10"]
capabilities:
- CAP_SYS_BOOT
readonly: true
trust:
image:
- linuxkit/kernel
outputs:
- format: vmdk

View File

@ -1,5 +1,5 @@
#!/bin/sh
# SUMMARY: LinuxKit configuration tests
# SUMMARY: LinuxKit packet.net tests
# LABELS:
# For the top level group.sh also specify a 'NAME:' comment

View File

@ -1,5 +1,5 @@
#!/bin/sh
# SUMMARY: LinuxKit configuration tests
# SUMMARY: LinuxKit Google Cloud tests
# LABELS:
# For the top level group.sh also specify a 'NAME:' comment