mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-22 18:41:37 +00:00
Initial test hooks
Beginning of a proper test suite, using qemu. Test just runs docker for now, will add further integration tests. Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
parent
b3cfed22f4
commit
44d68b268a
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
test.log
|
6
Dockerfile.test
Normal file
6
Dockerfile.test
Normal file
@ -0,0 +1,6 @@
|
||||
FROM justincormack/alpine-qemu
|
||||
|
||||
COPY alpine/initrd.img.gz .
|
||||
COPY alpine/kernel/vmlinuz64 .
|
||||
|
||||
ENTRYPOINT [ "qemu-system-x86_64", "-serial", "stdio", "-kernel", "vmlinuz64", "-initrd", "initrd.img.gz", "-m", "1024", "-append", "earlyprintk=serial console=ttyS0 noapic mobytest=true", "-vnc", "none" ]
|
6
Makefile
6
Makefile
@ -22,10 +22,14 @@ qemu-arm: Dockerfile.qemu.armhf arm
|
||||
docker build -f Dockerfile.qemu.armhf -t mobyarmqemu:build .
|
||||
docker run -it --rm mobyarmqemu:build
|
||||
|
||||
test: Dockerfile.test all
|
||||
docker build -f Dockerfile.test -t mobytest:build .
|
||||
docker run -it --rm mobytest:build | tee test.log | grep 'Moby test suite PASSED'
|
||||
|
||||
.PHONY: clean
|
||||
|
||||
clean:
|
||||
$(MAKE) -C alpine clean
|
||||
$(MAKE) -C xhyve clean
|
||||
docker images -q mobyqemu:build | xargs docker rmi -f || true
|
||||
docker images -q justincormack/remora | xargs docker rmi -f || true
|
||||
docker images -q mobytest:build | xargs docker rmi -f || true
|
||||
|
@ -74,6 +74,8 @@ COPY packages/bootflag/bootflag /usr/bin
|
||||
COPY packages/gummiboot/gummiboot.tar.gz /usr/share/src/
|
||||
COPY packages/oom/etc /etc
|
||||
COPY packages/9pmount-vsock/9pmount-vsock /sbin
|
||||
COPY packages/test/etc /etc
|
||||
COPY packages/test/mobytest /usr/bin
|
||||
|
||||
RUN \
|
||||
rc-update add swap boot && \
|
||||
@ -109,6 +111,7 @@ RUN \
|
||||
rc-update add hv_kvp_daemon default && \
|
||||
rc-update add hv_vss_daemon default && \
|
||||
rc-update add oom default && \
|
||||
rc-update add test default && \
|
||||
true
|
||||
|
||||
# we do not need to restart syslog, as probably not running
|
||||
|
25
alpine/packages/test/etc/init.d/test
Executable file
25
alpine/packages/test/etc/init.d/test
Executable file
@ -0,0 +1,25 @@
|
||||
#!/sbin/openrc-run
|
||||
|
||||
depend()
|
||||
{
|
||||
need docker
|
||||
}
|
||||
|
||||
start()
|
||||
{
|
||||
cat /proc/cmdline | grep -q 'mobytest' || exit 0
|
||||
|
||||
ebegin "Running tests"
|
||||
|
||||
if mobytest
|
||||
then
|
||||
printf "Moby test suite PASSED\n"
|
||||
else
|
||||
printf "Moby test suite FAILED\n"
|
||||
fi
|
||||
|
||||
eend "Tests completed"
|
||||
|
||||
# now terminate with extreme prejudice
|
||||
poweroff -f
|
||||
}
|
5
alpine/packages/test/mobytest
Executable file
5
alpine/packages/test/mobytest
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
docker ps
|
Loading…
Reference in New Issue
Block a user