mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-22 10:31:35 +00:00
tests: Add a linux.build group to test 'moby build'
- Add a tests which generates all supported outputs - move the examples build tests to the new group Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
This commit is contained in:
parent
cb2b74cfc9
commit
9eb710411a
35
test/cases/000_build/000_outputs/test.sh
Normal file
35
test/cases/000_build/000_outputs/test.sh
Normal file
@ -0,0 +1,35 @@
|
||||
#!/bin/sh
|
||||
# SUMMARY: Check that all supported output formats are generated
|
||||
# LABELS:
|
||||
# AUTHOR: Rolf Neugebauer <rolf.neugebauer@docker.com>
|
||||
|
||||
set -e
|
||||
|
||||
# Source libraries. Uncomment if needed/defined
|
||||
#. "${RT_LIB}"
|
||||
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
|
||||
|
||||
NAME=check
|
||||
|
||||
clean_up() {
|
||||
# remove any images
|
||||
find . -iname "${NAME}*" -exec rm {} \;
|
||||
}
|
||||
|
||||
trap clean_up EXIT
|
||||
|
||||
moby build -name "${NAME}" test.yml
|
||||
|
||||
[ -f "${NAME}.tar" ] || exit 1
|
||||
[ -f "${NAME}-kernel" ] || exit 1
|
||||
[ -f "${NAME}-initrd.img" ] || exit 1
|
||||
[ -f "${NAME}-cmdline" ] || exit 1
|
||||
[ -f "${NAME}.iso" ] || exit 1
|
||||
[ -f "${NAME}-efi.iso" ] || exit 1
|
||||
[ -f "${NAME}.img.gz" ] || exit 1
|
||||
[ -f "${NAME}.qcow2" ] || exit 1
|
||||
# VHD currently requires a lot of memory, disable for now
|
||||
# [ -f "${NAME}.vhd" ] || exit 1
|
||||
[ -f "${NAME}.vmdk" ] || exit 1
|
||||
|
||||
exit 0
|
33
test/cases/000_build/000_outputs/test.yml
Normal file
33
test/cases/000_build/000_outputs/test.yml
Normal file
@ -0,0 +1,33 @@
|
||||
kernel:
|
||||
image: "linuxkit/kernel:4.9.x"
|
||||
cmdline: "console=ttyS0 console=tty0 page_poison=1"
|
||||
init:
|
||||
- linuxkit/init:b3740303f3d1e5689a84c87b7dfb48fd2a40a192
|
||||
- linuxkit/runc:47b1c38d63468c0f3078f8b1b055d07965a1895d
|
||||
- linuxkit/containerd:cf2614f5a96c569a0bd4bd54e054a65ba17d167f
|
||||
onboot:
|
||||
- name: dhcpcd
|
||||
image: "linuxkit/dhcpcd:2def74ab3f9233b4c09ebb196ba47c27c08b0ed8"
|
||||
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"]
|
||||
trust:
|
||||
image:
|
||||
- linuxkit/kernel
|
||||
outputs:
|
||||
- format: tar
|
||||
- format: kernel+initrd
|
||||
- format: iso-bios
|
||||
- format: iso-efi
|
||||
- format: img-gz
|
||||
- format: gcp-img
|
||||
- format: qcow2
|
||||
# Disable VHD for now. It requires a lot of memory, which our CI instance currently doesn't have
|
||||
# - format: vhd
|
||||
- format: vmdk
|
31
test/cases/000_build/100_examples/group.sh
Normal file
31
test/cases/000_build/100_examples/group.sh
Normal file
@ -0,0 +1,31 @@
|
||||
#!/bin/sh
|
||||
# SUMMARY: Check that the examples YAML files work
|
||||
# LABELS:
|
||||
|
||||
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
|
||||
|
31
test/cases/000_build/group.sh
Normal file
31
test/cases/000_build/group.sh
Normal file
@ -0,0 +1,31 @@
|
||||
#!/bin/sh
|
||||
# SUMMARY: LinuxKit tests for 'moby build'
|
||||
# LABELS:
|
||||
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user