makefile: Use moby run qemu

This deprectes scripts/qemu.sh as moby run qemu can now safely be run in
CI, where we currently used the qemu container

Signed-off-by: Dave Tucker <dt@docker.com>
This commit is contained in:
Dave Tucker 2017-04-20 13:40:28 +01:00 committed by Dave Tucker
parent 48daeda07e
commit 11fcf087ca
2 changed files with 2 additions and 49 deletions

View File

@ -42,7 +42,7 @@ test-bzImage: test-initrd.img
# interactive versions need to use volume mounts
.PHONY: test-qemu-efi
test-qemu-efi: test-efi.iso
./scripts/qemu.sh $^ 2>&1 | tee test-efi.log
script -q /dev/null $(MOBY) run $^ | tee test-efi.log
$(call check_test_log, test-efi.log)
bin:
@ -68,7 +68,7 @@ test-gcp: $(MOBY) test.img.tar.gz
.PHONY: test
test: test-initrd.img test-bzImage test-cmdline
tar cf - $^ | ./scripts/qemu.sh 2>&1 | tee test.log
script -q /dev/null $(MOBY) run test | tee test.log
$(call check_test_log, test.log)
test-ltp.img.tar.gz: $(MOBY) test/ltp/test-ltp.yml

View File

@ -1,47 +0,0 @@
#!/bin/sh
QEMU_IMAGE=linuxkit/qemu:4563d58e97958f4941fbef9e74cabc08bd402144@sha256:b2db0b13ba1cbb6b48218f088fe0a4d860e1db2c4c6381b5416536f48a612230
# if not interactive
if [ ! -t 0 -a -z "$1" ]
then
# non interactive, tarball input
docker run -i --rm "$QEMU_IMAGE"
exit $?
fi
FILE=$1
FILE2=$2
CMDLINE=$3
[ -z "$FILE" ] && FILE="$PWD/moby"
BASE=$(basename "$FILE")
DIR=$(dirname "$FILE")
if [ ! -f "$FILE" -a -f $DIR/$BASE-initrd.img -a -f $DIR/$BASE-bzImage ]
then
FILE=$DIR/$BASE-initrd.img
FILE2=$DIR/$BASE-bzImage
fi
echo "$FILE" | grep -q '^/' || FILE="$PWD/$FILE"
if [ ! -z "$FILE2" ]
then
echo "$FILE2" | grep -q '^/' || FILE2="$PWD/$FILE2"
fi
if [ ! -z "$CMDLINE" ]
then
echo "$CMDLINE" | grep -q '^/' || CMDLINE="$PWD/$CMDLINE"
fi
if [ -c "/dev/kvm" ] ; then
DEVKVM="--device=/dev/kvm"
fi
BASE=$(basename "$FILE")
MOUNTS="-v $FILE:/tmp/$BASE"
BASE2=$(basename "$FILE2")
BASE3=$(basename "$CMDLINE")
[ ! -z "$FILE2" ] && MOUNTS="$MOUNTS -v $FILE2:/tmp/$BASE2"
[ ! -z "$CMDLINE" ] && MOUNTS="$MOUNTS -v $CMDLINE:/tmp/$BASE3"
docker run -it --rm $MOUNTS $DEVKVM "$QEMU_IMAGE"