tests: Run config tests on all kernels we support

- Add a test for the kernel config for each supported kernel
- simplify YAML files: no need for ca certificates nor DHCP
- Explicitly state that the kernel module tests are for
  the 4.9 kernel.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
This commit is contained in:
Rolf Neugebauer 2017-05-19 11:50:01 +01:00
parent e1920b4f22
commit e62e94a240
14 changed files with 117 additions and 12 deletions

View File

@ -0,0 +1,16 @@
kernel:
image: "linuxkit/kernel:4.4.x"
cmdline: "console=ttyS0"
init:
- linuxkit/init:cbd7ae748f0a082516501a3e914fa0c924ee941e
- linuxkit/runc:24dfe632ed3ff53a026ee3fac046fd544434e2d6
- linuxkit/containerd:f1130450206d4f64f0ddc13d15bb68435aa1ff61
onboot:
- name: check-kernel-config
image: "linuxkit/test-kernel-config:ecff41279ccbc408079a3996a956432651c6eb9c"
readonly: true
- name: poweroff
image: "linuxkit/poweroff:a8f1e4ad8d459f1fdaad9e4b007512cb3b504ae8"
command: ["/bin/sh", "/poweroff.sh", "3"]
outputs:
- format: kernel+initrd

View File

@ -5,19 +5,7 @@ init:
- linuxkit/init:cbd7ae748f0a082516501a3e914fa0c924ee941e
- linuxkit/runc:24dfe632ed3ff53a026ee3fac046fd544434e2d6
- linuxkit/containerd:f1130450206d4f64f0ddc13d15bb68435aa1ff61
- linuxkit/ca-certificates:4e9a83e890e6477dcd25029fc4f1ced61d0642f4
onboot:
- name: dhcpcd
image: "linuxkit/dhcpcd:cb96c09a33c166eca6530f166f0f79927c3e83b0"
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

View File

@ -0,0 +1,23 @@
#!/bin/sh
# SUMMARY: Sanity check on the kernel config file
# LABELS:
# REPEAT:
# AUTHOR: Dave Tucker <dt@docker.com>
set -e
# Source libraries. Uncomment if needed/defined
#. "${RT_LIB}"
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
clean_up() {
find . -iname "test-kernel-config*" -not -iname "*.yml" -exec rm -rf {} \;
}
trap clean_up EXIT
# Test code goes here
moby build test-kernel-config
RESULT="$(linuxkit run qemu test-kernel-config)"
echo "${RESULT}" | grep -q "suite PASSED"
exit 0

View File

@ -0,0 +1,16 @@
kernel:
image: "linuxkit/kernel:4.10.x"
cmdline: "console=ttyS0"
init:
- linuxkit/init:cbd7ae748f0a082516501a3e914fa0c924ee941e
- linuxkit/runc:24dfe632ed3ff53a026ee3fac046fd544434e2d6
- linuxkit/containerd:f1130450206d4f64f0ddc13d15bb68435aa1ff61
onboot:
- name: check-kernel-config
image: "linuxkit/test-kernel-config:ecff41279ccbc408079a3996a956432651c6eb9c"
readonly: true
- name: poweroff
image: "linuxkit/poweroff:a8f1e4ad8d459f1fdaad9e4b007512cb3b504ae8"
command: ["/bin/sh", "/poweroff.sh", "3"]
outputs:
- format: kernel+initrd

View File

@ -0,0 +1,23 @@
#!/bin/sh
# SUMMARY: Sanity check on the kernel config file
# LABELS:
# REPEAT:
# AUTHOR: Dave Tucker <dt@docker.com>
set -e
# Source libraries. Uncomment if needed/defined
#. "${RT_LIB}"
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
clean_up() {
find . -iname "test-kernel-config*" -not -iname "*.yml" -exec rm -rf {} \;
}
trap clean_up EXIT
# Test code goes here
moby build test-kernel-config
RESULT="$(linuxkit run qemu test-kernel-config)"
echo "${RESULT}" | grep -q "suite PASSED"
exit 0

View File

@ -0,0 +1,16 @@
kernel:
image: "linuxkit/kernel:4.11.x"
cmdline: "console=ttyS0"
init:
- linuxkit/init:cbd7ae748f0a082516501a3e914fa0c924ee941e
- linuxkit/runc:24dfe632ed3ff53a026ee3fac046fd544434e2d6
- linuxkit/containerd:f1130450206d4f64f0ddc13d15bb68435aa1ff61
onboot:
- name: check-kernel-config
image: "linuxkit/test-kernel-config:ecff41279ccbc408079a3996a956432651c6eb9c"
readonly: true
- name: poweroff
image: "linuxkit/poweroff:a8f1e4ad8d459f1fdaad9e4b007512cb3b504ae8"
command: ["/bin/sh", "/poweroff.sh", "3"]
outputs:
- format: kernel+initrd

View File

@ -0,0 +1,23 @@
#!/bin/sh
# SUMMARY: Sanity check on the kernel config file
# LABELS:
# REPEAT:
# AUTHOR: Dave Tucker <dt@docker.com>
set -e
# Source libraries. Uncomment if needed/defined
#. "${RT_LIB}"
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
clean_up() {
find . -iname "test-kernel-config*" -not -iname "*.yml" -exec rm -rf {} \;
}
trap clean_up EXIT
# Test code goes here
moby build test-kernel-config
RESULT="$(linuxkit run qemu test-kernel-config)"
echo "${RESULT}" | grep -q "suite PASSED"
exit 0