Merge pull request #1128 from justincormack/bin

Use bin dir and clean up hyperkit test
This commit is contained in:
Justin Cormack 2017-02-01 16:24:34 +00:00 committed by GitHub
commit ec8c047835
3 changed files with 13 additions and 12 deletions

2
.gitignore vendored
View File

@ -1,6 +1,6 @@
test.log test.log
/bin
*.swp *.swp
/hyperkit.bin
*.img *.img
*.tag *.tag
*.iso *.iso

View File

@ -31,27 +31,28 @@ qemu-iso: alpine/mobylinux-bios.iso
qemu-gce: alpine/gce.img.tar.gz qemu-gce: alpine/gce.img.tar.gz
docker run -it --rm -v $(CURDIR)/alpine/gce.img.tar.gz:/tmp/gce.img.tar.gz $(QEMU_IMAGE) docker run -it --rm -v $(CURDIR)/alpine/gce.img.tar.gz:/tmp/gce.img.tar.gz $(QEMU_IMAGE)
hyperkit.bin: bin:
mkdir $@ mkdir -p $@
hyperkit.bin/com.docker.hyperkit: hyperkit.bin bin/com.docker.hyperkit: bin
curl -fsSL https://circleci.com/api/v1/project/docker/hyperkit/latest/artifacts/0//Users/distiller/hyperkit/build/com.docker.hyperkit > $@ curl -fsSL https://circleci.com/api/v1/project/docker/hyperkit/latest/artifacts/0//Users/distiller/hyperkit/build/com.docker.hyperkit > $@
chmod a+x $@ chmod a+x $@
hyperkit.bin/com.docker.slirp: bin/com.docker.slirp: bin
curl -fsSL https://circleci.com/api/v1/project/docker/vpnkit/latest/artifacts/0//Users/distiller/vpnkit/com.docker.slirp.tgz \ curl -fsSL https://circleci.com/api/v1/project/docker/vpnkit/latest/artifacts/0//Users/distiller/vpnkit/com.docker.slirp.tgz \
| tar xz --strip=2 -C hyperkit.bin Contents/MacOS/com.docker.slirp | tar xz --strip=2 -C $(dir $@) Contents/MacOS/com.docker.slirp
touch $@
hyperkit: hyperkit.sh hyperkit.bin/com.docker.hyperkit hyperkit.bin/com.docker.slirp alpine/initrd.img alpine/kernel/x86_64/vmlinuz64 hyperkit: hyperkit.sh bin/com.docker.hyperkit bin/com.docker.slirp alpine/initrd.img alpine/kernel/x86_64/vmlinuz64
./hyperkit.sh ./hyperkit.sh
define check_test_log define check_test_log
@cat $1 |grep -q 'Moby test suite PASSED' @cat $1 |grep -q 'Moby test suite PASSED'
endef endef
hyperkit-test: hyperkit.sh hyperkit.bin/com.docker.hyperkit hyperkit.bin/com.docker.slirp alpine/initrd-test.img alpine/kernel/x86_64/vmlinuz64 hyperkit-test: hyperkit.sh bin/com.docker.hyperkit bin/com.docker.slirp alpine/initrd-test.img alpine/kernel/x86_64/vmlinuz64
rm -f disk.img rm -f disk.img
INITRD=alpine/initrd-test.img ./hyperkit.sh 2>&1 | tee test.log INITRD=alpine/initrd-test.img script -q /dev/null ./hyperkit.sh | tee test.log
$(call check_test_log, test.log) $(call check_test_log, test.log)
test: alpine/initrd-test.img alpine/kernel/x86_64/vmlinuz64 test: alpine/initrd-test.img alpine/kernel/x86_64/vmlinuz64
@ -125,4 +126,4 @@ ci-pr:
clean: clean:
$(MAKE) -C alpine clean $(MAKE) -C alpine clean
rm -rf hyperkit.bin disk.img test.log rm -rf bin disk.img test.log

View File

@ -17,7 +17,7 @@ PCI_DEV="-s 0:0,hostbridge -s 31,lpc"
RND="-s 5,virtio-rnd" RND="-s 5,virtio-rnd"
LPC_DEV="-l com1,stdio" LPC_DEV="-l com1,stdio"
hyperkit.bin/com.docker.slirp --ethernet $SLIRP_SOCK &>/dev/null & bin/com.docker.slirp --ethernet $SLIRP_SOCK &>/dev/null &
trap "kill $!; rm $SLIRP_SOCK" EXIT trap "kill $!; rm $SLIRP_SOCK" EXIT
hyperkit.bin/com.docker.hyperkit -A $MEM $SMP $PCI_DEV $LPC_DEV $NET $IMG_HDD $RND -u -f kexec,$KERNEL,$INITRD,"$CMDLINE" bin/com.docker.hyperkit -A $MEM $SMP $PCI_DEV $LPC_DEV $NET $IMG_HDD $RND -u -f kexec,$KERNEL,$INITRD,"$CMDLINE"