From patchwork Fri Sep 15 06:45:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fam Zheng X-Patchwork-Id: 814096 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xtmKj2pvWz9t2Z for ; Fri, 15 Sep 2017 16:52:09 +1000 (AEST) Received: from localhost ([::1]:51620 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dskTv-00014w-Bj for incoming@patchwork.ozlabs.org; Fri, 15 Sep 2017 02:52:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34910) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dskNl-00044a-6a for qemu-devel@nongnu.org; Fri, 15 Sep 2017 02:45:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dskNk-0004k4-3o for qemu-devel@nongnu.org; Fri, 15 Sep 2017 02:45:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60764) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dskNj-0004jb-Qx for qemu-devel@nongnu.org; Fri, 15 Sep 2017 02:45:44 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D3406883C4; Fri, 15 Sep 2017 06:45:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D3406883C4 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=famz@redhat.com Received: from lemon.redhat.com (ovpn-12-95.pek2.redhat.com [10.72.12.95]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9015D675AD; Fri, 15 Sep 2017 06:45:41 +0000 (UTC) From: Fam Zheng To: qemu-devel@nongnu.org Date: Fri, 15 Sep 2017 14:45:15 +0800 Message-Id: <20170915064518.3436-11-famz@redhat.com> In-Reply-To: <20170915064518.3436-1-famz@redhat.com> References: <20170915064518.3436-1-famz@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 15 Sep 2017 06:45:42 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL v3 17/38] Makefile: Add rules to run vm tests X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Fam Zheng Message-Id: <20170913030119.3957-11-famz@redhat.com> --- Makefile | 2 ++ configure | 2 +- tests/vm/Makefile.include | 42 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 tests/vm/Makefile.include diff --git a/Makefile b/Makefile index 337a1f6f9b..946eb2ce35 100644 --- a/Makefile +++ b/Makefile @@ -822,6 +822,7 @@ endif -include $(wildcard *.d tests/*.d) include $(SRC_PATH)/tests/docker/Makefile.include +include $(SRC_PATH)/tests/vm/Makefile.include .PHONY: help help: @@ -845,6 +846,7 @@ help: @echo 'Test targets:' @echo ' check - Run all tests (check-help for details)' @echo ' docker - Help about targets running tests inside Docker containers' + @echo ' vm-test - Help about targets running tests inside VM' @echo '' @echo 'Documentation targets:' @echo ' html info pdf txt' diff --git a/configure b/configure index fd7e3a5e81..3918c47cd8 100755 --- a/configure +++ b/configure @@ -6546,7 +6546,7 @@ if test "$ccache_cpp2" = "yes"; then fi # build tree in object directory in case the source is not in the current directory -DIRS="tests tests/tcg tests/tcg/cris tests/tcg/lm32 tests/libqos tests/qapi-schema tests/tcg/xtensa tests/qemu-iotests" +DIRS="tests tests/tcg tests/tcg/cris tests/tcg/lm32 tests/libqos tests/qapi-schema tests/tcg/xtensa tests/qemu-iotests tests/vm" DIRS="$DIRS docs docs/interop fsdev" DIRS="$DIRS pc-bios/optionrom pc-bios/spapr-rtas pc-bios/s390-ccw" DIRS="$DIRS roms/seabios roms/vgabios" diff --git a/tests/vm/Makefile.include b/tests/vm/Makefile.include new file mode 100644 index 0000000000..5daa2a3b73 --- /dev/null +++ b/tests/vm/Makefile.include @@ -0,0 +1,42 @@ +# Makefile for VM tests + +.PHONY: vm-build-all + +IMAGES := ubuntu.i386 freebsd netbsd openbsd +IMAGE_FILES := $(patsubst %, tests/vm/%.img, $(IMAGES)) + +.PRECIOUS: $(IMAGE_FILES) + +vm-test: + @echo "vm-test: Test QEMU in preconfigured virtual machines" + @echo + @echo " vm-build-ubuntu.i386 - Build QEMU in ubuntu i386 VM" + @echo " vm-build-freebsd - Build QEMU in FreeBSD VM" + @echo " vm-build-netbsd - Build QEMU in NetBSD VM" + @echo " vm-build-openbsd - Build QEMU in OpenBSD VM" + +vm-build-all: $(addprefix vm-build-, $(IMAGES)) + +tests/vm/%.img: $(SRC_PATH)/tests/vm/% \ + $(SRC_PATH)/tests/vm/basevm.py \ + $(SRC_PATH)/tests/vm/Makefile.include + $(call quiet-command, \ + $< \ + $(if $(V)$(DEBUG), --debug) \ + --image "$@" \ + --force \ + --build-image $@, \ + " VM-IMAGE $*") + + +# Build in VM $(IMAGE) +vm-build-%: tests/vm/%.img + $(call quiet-command, \ + $(SRC_PATH)/tests/vm/$* \ + $(if $(V)$(DEBUG), --debug) \ + $(if $(DEBUG), --interactive) \ + $(if $(J),--jobs $(J)) \ + --image "$<" \ + --build-qemu $(SRC_PATH), \ + " VM-BUILD $*") +