From patchwork Mon Jun 24 13:43:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1121281 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=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="kanAamLU"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45XW125ZgTz9s3l for ; Mon, 24 Jun 2019 23:51:34 +1000 (AEST) Received: from localhost ([::1]:51331 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPNc-0002UJ-Rx for incoming@patchwork.ozlabs.org; Mon, 24 Jun 2019 09:51:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41479) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPGG-0006fm-Cs for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:43:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfPGE-0007d2-E5 for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:43:56 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]:54118) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hfPGC-0007J7-Gu for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:43:53 -0400 Received: by mail-wm1-x32f.google.com with SMTP id x15so12848967wmj.3 for ; Mon, 24 Jun 2019 06:43:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kG7TibQlzrXHGeVA/kaiY4pLQv/EwI9FVJyG9q9KK+o=; b=kanAamLUH/KjSYgigeWC3w9zqYxCkDdbhY35YtMRFvB0f5IBXMFZUL2lHxoZMMazOl WboT7gNPfYZ1b5hti25DJpDeo+yaUUHycyALVTzge2nlcpLtlZKbPaNH41fIM8kAPD32 kqhDll7XDffw+UsqOWzCBGQDcCyCgi2RBtU6B+PVRjqTkJfFEXIkcoTMw48yOkyRMssM K20bzQjiF8dDouI43hs4NierTMU317YxQ7jwtIMNO5pm9gSLsJwEOBxd4/YoQLWBHwVM S3GBshIAexk5DEShMhpe1TG7W2cflKBqCzdsriORPyFWBYYn5A/bBsviP0+dwz8Z4ghQ JduA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kG7TibQlzrXHGeVA/kaiY4pLQv/EwI9FVJyG9q9KK+o=; b=QJLiQaDMVyvDBU3WArIjvQC4ZCaVP2IOWzyo+MiQSxkPwoN6n6TTesDP3qr1rptqfx q2G2t2/ON9G44SKJLAHe1nTAk+NZ/of2FmlCL+QGlsSQmz+Y4ZQgbhzrM+8sPoNokffd TcvVFXhkp6DKUaElcYcNiH7MzLmyckSaHv74QDCIfJ5ipG+nz3Nxei6RZj7urwJgu9PQ BWpSBhwy5b3xMp9VYBzRmcFnd5uT2AexhJR07KCxmn5gzKWw88Xix3K3lvMUxMdoOd5V CBuT+SYtQ56gRhKT/u7GimAo7c1CzAzeWNzTANd7V8U3XtikRywrVMlMKhcZQsme0opW aohQ== X-Gm-Message-State: APjAAAVy0N6/IqOLSJrbB/AjE2+p2Km5WFgh0YQvphq/Cy9BWzIU7pIy 7NGmWAqEnAdRPTHS7L/z1b++xfRffvM= X-Google-Smtp-Source: APXvYqxixADqBuwEvB/UrG4M8ETE6+HRu8Ml2IYiOnaMvWW4B3zKzLmeu9lqWjo29l7mmv40uplkPQ== X-Received: by 2002:a1c:e356:: with SMTP id a83mr16695414wmh.38.1561383818949; Mon, 24 Jun 2019 06:43:38 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id l16sm10803321wrw.42.2019.06.24.06.43.37 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 24 Jun 2019 06:43:37 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 8F2A61FF8C; Mon, 24 Jun 2019 14:43:37 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Mon, 24 Jun 2019 14:43:19 +0100 Message-Id: <20190624134337.10532-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190624134337.10532-1-alex.bennee@linaro.org> References: <20190624134337.10532-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32f Subject: [Qemu-devel] [PULL 01/19] tests/vm: avoid extra compressed image copy X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Cleber Rosa Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Cleber Rosa The image copy is only really needed because xz doesn't know to properly decompress a file not named properly. Instead of decompressing to stdout, and having to rely on a shell, let's just create a link instead of copying the file. Signed-off-by: Cleber Rosa Tested-by: Philippe Mathieu-Daudé Message-Id: <20190613130718.3763-2-crosa@redhat.com> Signed-off-by: Alex Bennée diff --git a/tests/vm/centos b/tests/vm/centos index 7417b50af4..b00b46a8dc 100755 --- a/tests/vm/centos +++ b/tests/vm/centos @@ -66,8 +66,8 @@ class CentosVM(basevm.BaseVM): cimg = self._download_with_cache("https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud-1802.qcow2.xz") img_tmp = img + ".tmp" sys.stderr.write("Extracting the image...\n") - subprocess.check_call(["cp", "-f", cimg, img_tmp + ".xz"]) - subprocess.check_call(["xz", "-dvf", img_tmp + ".xz"]) + subprocess.check_call(["ln", "-f", cimg, img_tmp + ".xz"]) + subprocess.check_call(["xz", "--keep", "-dvf", img_tmp + ".xz"]) subprocess.check_call(["qemu-img", "resize", img_tmp, "50G"]) self.boot(img_tmp, extra_args = ["-cdrom", self._gen_cloud_init_iso()]) self.wait_ssh() diff --git a/tests/vm/freebsd b/tests/vm/freebsd index b0066017a6..5575c23a6f 100755 --- a/tests/vm/freebsd +++ b/tests/vm/freebsd @@ -34,8 +34,8 @@ class FreeBSDVM(basevm.BaseVM): img_tmp_xz = img + ".tmp.xz" img_tmp = img + ".tmp" sys.stderr.write("Extracting the image...\n") - subprocess.check_call(["cp", "-f", cimg, img_tmp_xz]) - subprocess.check_call(["xz", "-dvf", img_tmp_xz]) + subprocess.check_call(["ln", "-f", cimg, img_tmp_xz]) + subprocess.check_call(["xz", "--keep", "-dvf", img_tmp_xz]) if os.path.exists(img): os.remove(img) os.rename(img_tmp, img) diff --git a/tests/vm/netbsd b/tests/vm/netbsd index 4c6624ea5e..d0508f4465 100755 --- a/tests/vm/netbsd +++ b/tests/vm/netbsd @@ -34,8 +34,8 @@ class NetBSDVM(basevm.BaseVM): img_tmp_xz = img + ".tmp.xz" img_tmp = img + ".tmp" sys.stderr.write("Extracting the image...\n") - subprocess.check_call(["cp", "-f", cimg, img_tmp_xz]) - subprocess.check_call(["xz", "-dvf", img_tmp_xz]) + subprocess.check_call(["ln", "-f", cimg, img_tmp_xz]) + subprocess.check_call(["xz", "--keep", "-dvf", img_tmp_xz]) if os.path.exists(img): os.remove(img) os.rename(img_tmp, img) diff --git a/tests/vm/openbsd b/tests/vm/openbsd index 2105c01a26..87ec982489 100755 --- a/tests/vm/openbsd +++ b/tests/vm/openbsd @@ -36,8 +36,8 @@ class OpenBSDVM(basevm.BaseVM): img_tmp_xz = img + ".tmp.xz" img_tmp = img + ".tmp" sys.stderr.write("Extracting the image...\n") - subprocess.check_call(["cp", "-f", cimg, img_tmp_xz]) - subprocess.check_call(["xz", "-dvf", img_tmp_xz]) + subprocess.check_call(["ln", "-f", cimg, img_tmp_xz]) + subprocess.check_call(["xz", "--keep", "-dvf", img_tmp_xz]) if os.path.exists(img): os.remove(img) os.rename(img_tmp, img) From patchwork Mon Jun 24 13:43:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1121345 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=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="t9I3fhZd"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45XWNN1304z9s3l for ; Tue, 25 Jun 2019 00:08:20 +1000 (AEST) Received: from localhost ([::1]:51474 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPdp-00044z-RP for incoming@patchwork.ozlabs.org; Mon, 24 Jun 2019 10:08:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41612) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPGK-0006jS-3d for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:44:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfPGG-0007h3-VV for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:43:59 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]:51554) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hfPGG-0007JP-KV for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:43:56 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 207so12881921wma.1 for ; Mon, 24 Jun 2019 06:43:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IGs3kzw+BI2fE8Ae88LzkdFhpv0ghN5hux8Z4DaX/+I=; b=t9I3fhZd8bxzsfpVLvbf+GRhcegKRKVkyCFmIEOQfttF9JdlBaOFguPFWWeFXxhwnN uZ0UtWOrq9N14fQSnSPMacMm+pptgGjmoVbnVOKPDM9N6uOupAjbphAGArrNnhq7ftAV 62j7Ph06MzvKX0gv1UKy9j3JeuBGuQffvXiqqw/k3TQu3faAMxsWvh138BEhzaHsmc0/ tiAgRLJA3IStTt17SEAGYDoiV/B0gb9RNPkwW+jfItKbx1agwGv8NPcGedNFrO1q6Mj8 QodjTwZeexqH+2YLhwinIz8xO8fPTlJ15zkRHJjYpukyjl8u271RVDmlBHSFA0/fADHc /PCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IGs3kzw+BI2fE8Ae88LzkdFhpv0ghN5hux8Z4DaX/+I=; b=P8P352zW5nU7k0g3mN0hZuWpSeaCcwUW/URLzyZmyELtvnU03EU7Z9nS2+WLYefVv6 dGNTTy7lX5B1+g3OWue1fzdOMgk3IqFkTZjTJ//LdOuHFwYFaYnDkU5Hg9HxUkp6Nmgo uMLQfKDfrUHqPGg5rKvwso+IMF0CJ33U8MqTnc5c3SoqGroHzEc/bFrJhkFVyKo6LGS9 vXCEsb1YKSak1seAdChhzLowl4+4BqqjUqLVZFtCHt/XuuDZ/k3f0CJ+shdPQl5PJHbH PC6t7Cw26THHTs1vo9J740PTm48LC3Hc5HgmLfoEg16W4+l8nEXCgY5YlCstq4UifNim 4ifw== X-Gm-Message-State: APjAAAU1NQOhQSUIcl44c4BvzcCNp3qibxETxFlU+9vvAJWsvjfPPSO4 +kQVoAHNYkit79XqW2rxl9MFhw== X-Google-Smtp-Source: APXvYqw5BO3qXdUfNiTzbnKk7PDdW8d7X2UURPk1v8RVMbg84aWmvddu2p5A3XzefBHUGPLz1C2W6A== X-Received: by 2002:a05:600c:204c:: with SMTP id p12mr16171881wmg.121.1561383819494; Mon, 24 Jun 2019 06:43:39 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id h1sm10498779wrt.20.2019.06.24.06.43.38 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 24 Jun 2019 06:43:38 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id AA1EF1FF8F; Mon, 24 Jun 2019 14:43:37 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Mon, 24 Jun 2019 14:43:20 +0100 Message-Id: <20190624134337.10532-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190624134337.10532-1-alex.bennee@linaro.org> References: <20190624134337.10532-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32a Subject: [Qemu-devel] [PULL 02/19] tests/vm: avoid image presence check and removal X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Cleber Rosa Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Cleber Rosa Python's os.rename() will silently replace an existing file, so there's no need for the extra check and removal. Reference: https://docs.python.org/3/library/os.html#os.rename Signed-off-by: Cleber Rosa Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Message-Id: <20190613130718.3763-3-crosa@redhat.com> Signed-off-by: Alex Bennée diff --git a/tests/vm/centos b/tests/vm/centos index b00b46a8dc..53976f1c4c 100755 --- a/tests/vm/centos +++ b/tests/vm/centos @@ -77,8 +77,6 @@ class CentosVM(basevm.BaseVM): self.ssh_root_check("systemctl enable docker") self.ssh_root("poweroff") self.wait() - if os.path.exists(img): - os.remove(img) os.rename(img_tmp, img) return 0 diff --git a/tests/vm/freebsd b/tests/vm/freebsd index 5575c23a6f..091be1a065 100755 --- a/tests/vm/freebsd +++ b/tests/vm/freebsd @@ -36,8 +36,6 @@ class FreeBSDVM(basevm.BaseVM): sys.stderr.write("Extracting the image...\n") subprocess.check_call(["ln", "-f", cimg, img_tmp_xz]) subprocess.check_call(["xz", "--keep", "-dvf", img_tmp_xz]) - if os.path.exists(img): - os.remove(img) os.rename(img_tmp, img) if __name__ == "__main__": diff --git a/tests/vm/netbsd b/tests/vm/netbsd index d0508f4465..ee9eaeab50 100755 --- a/tests/vm/netbsd +++ b/tests/vm/netbsd @@ -36,8 +36,6 @@ class NetBSDVM(basevm.BaseVM): sys.stderr.write("Extracting the image...\n") subprocess.check_call(["ln", "-f", cimg, img_tmp_xz]) subprocess.check_call(["xz", "--keep", "-dvf", img_tmp_xz]) - if os.path.exists(img): - os.remove(img) os.rename(img_tmp, img) if __name__ == "__main__": diff --git a/tests/vm/openbsd b/tests/vm/openbsd index 87ec982489..28c7d25e29 100755 --- a/tests/vm/openbsd +++ b/tests/vm/openbsd @@ -38,8 +38,6 @@ class OpenBSDVM(basevm.BaseVM): sys.stderr.write("Extracting the image...\n") subprocess.check_call(["ln", "-f", cimg, img_tmp_xz]) subprocess.check_call(["xz", "--keep", "-dvf", img_tmp_xz]) - if os.path.exists(img): - os.remove(img) os.rename(img_tmp, img) if __name__ == "__main__": diff --git a/tests/vm/ubuntu.i386 b/tests/vm/ubuntu.i386 index a22d137e76..12867b193f 100755 --- a/tests/vm/ubuntu.i386 +++ b/tests/vm/ubuntu.i386 @@ -80,8 +80,6 @@ class UbuntuX86VM(basevm.BaseVM): self.ssh_root_check("apt-get install -y libfdt-dev flex bison") self.ssh_root("poweroff") self.wait() - if os.path.exists(img): - os.remove(img) os.rename(img_tmp, img) return 0 From patchwork Mon Jun 24 13:43:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1121321 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=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="KqgCuy9d"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45XW4n28nvz9s9y for ; Mon, 24 Jun 2019 23:54:48 +1000 (AEST) Received: from localhost ([::1]:51354 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPQk-0006Iv-Kw for incoming@patchwork.ozlabs.org; Mon, 24 Jun 2019 09:54:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41478) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPGG-0006fk-Ci for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:43:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfPGE-0007dO-Hf for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:43:56 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:40884) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hfPGD-0007MF-5z for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:43:54 -0400 Received: by mail-wr1-x433.google.com with SMTP id p11so13968664wre.7 for ; Mon, 24 Jun 2019 06:43:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xtIRwzundNicszHIR+Xc5ItZ9WkO8ULjpABGU4hH988=; b=KqgCuy9dPwLZhtEumpwHuY0ekl0UMQfJ8xPf2t/6KOJqLtBZfrA5FOlV1KJq0c1WMO jLzy6koClz0+DQlyOy0L/tAVy74tN7JDEbY6HV99VPZ01R5Z2tKcA5T/xz1q1u2Mb9Oq gcx9c2DMj72roCBKZQZOQvEvebLYfTADFuphEyiGHpQ6yob2K6wc+oCgx4/WxJ8EBE3x W7H+3BGRLVIGzDpUXGx6llmqrsKSKqTanWgiF1Gwif3R/Rn7p9a+aqMLQbkezqSwJxEo cXnjZq3sChMNzj2YwG8uzQGOITYwRQGF5qHyWFAbLvKb9j2t+/7u63jpIu7dX1R4X8HS Yh0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xtIRwzundNicszHIR+Xc5ItZ9WkO8ULjpABGU4hH988=; b=lNj7LB/EzBLawQdbJBKkezVOd320eGgJBY8UxPZ93HM0nUCViiXj45B1ooh4qgO1bZ LuD9OXpdSIJmYrJQQgd8V0ZukxvY9/Fgtx1OSAmo4jVzCvXV+RfL3iaMcs0c5KyA1TiV nK3mv9i5Qxnj8foZhAvR5VYFdoGHnrscnme8R8K+ZpRy1XNDbuquHywGb1Sjhx4nfmv3 xz56tZk0hjCaM9ApnxWhri33oDm4E4uW8hWOBE5YdNjjooR3G3dfuDyVViEvUO+e4g8N Jvn2ek1tUJ8vV5GamQ9oG86BtLuDKpqADQgBCCKCJ9gY0yBxONLaSQ/m56YpifbP6Qfh eyGw== X-Gm-Message-State: APjAAAV11cwHrFYSjbBB55msWtvqMKWuy6K47JwONFofYkR3F6uwXFtd cHvNX/a7ak+CWPiuCXXqh/rl6g== X-Google-Smtp-Source: APXvYqyeAkZE74pKnqCICtUk3qdhnBAAwYal5kKyb7jyJAToRm/c9mncO1JqyM/q9FGQc48U0hEBlg== X-Received: by 2002:a5d:6190:: with SMTP id j16mr16866483wru.49.1561383821278; Mon, 24 Jun 2019 06:43:41 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id 32sm22683122wra.35.2019.06.24.06.43.38 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 24 Jun 2019 06:43:38 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id C12351FF90; Mon, 24 Jun 2019 14:43:37 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Mon, 24 Jun 2019 14:43:21 +0100 Message-Id: <20190624134337.10532-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190624134337.10532-1-alex.bennee@linaro.org> References: <20190624134337.10532-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::433 Subject: [Qemu-devel] [PULL 03/19] tests/vm: pin ubuntu.i386 image X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Cleber Rosa Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Cleber Rosa It's a good practice to always have the same components used in tests. According to: https://cloud-images.ubuntu.com/releases/16.04/ New images are released from time to time, and the "release/" directory points to the latest release. Let's pin to the latest available version, and while at it, set a hash for verification. Signed-off-by: Cleber Rosa Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Message-Id: <20190613130718.3763-4-crosa@redhat.com> Signed-off-by: Alex Bennée diff --git a/tests/vm/ubuntu.i386 b/tests/vm/ubuntu.i386 index 12867b193f..7017e6d388 100755 --- a/tests/vm/ubuntu.i386 +++ b/tests/vm/ubuntu.i386 @@ -61,7 +61,9 @@ class UbuntuX86VM(basevm.BaseVM): return os.path.join(cidir, "cloud-init.iso") def build_image(self, img): - cimg = self._download_with_cache("https://cloud-images.ubuntu.com/releases/16.04/release/ubuntu-16.04-server-cloudimg-i386-disk1.img") + cimg = self._download_with_cache( + "https://cloud-images.ubuntu.com/releases/16.04/release-20190605/ubuntu-16.04-server-cloudimg-i386-disk1.img", + sha256sum="e30091144c73483822b7c27193e9d47346dd1064229da577c3fedcf943f7cfcc") img_tmp = img + ".tmp" subprocess.check_call(["cp", "-f", cimg, img_tmp]) subprocess.check_call(["qemu-img", "resize", img_tmp, "50G"]) From patchwork Mon Jun 24 13:43:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1121276 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=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="DrcGtnpF"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45XVsF08FBz9s3l for ; Mon, 24 Jun 2019 23:44:49 +1000 (AEST) Received: from localhost ([::1]:51300 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPH5-0006ja-3X for incoming@patchwork.ozlabs.org; Mon, 24 Jun 2019 09:44:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41477) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPGG-0006fj-Cf for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:43:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfPGE-0007dJ-Gx for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:43:56 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:36052) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hfPGD-0007Lj-5s for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:43:54 -0400 Received: by mail-wr1-x433.google.com with SMTP id n4so12787225wrs.3 for ; Mon, 24 Jun 2019 06:43:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=g1Gikb/q4aJ790nsrLBBZxeFgZO8Vqq/Oo0RByk4pDk=; b=DrcGtnpFi3Ydl8TJ6ET8W4Atli+YgU6sjopl3d7io59NTYvCQ7Zp8EhjwkN5qRrmtJ C7s350UC4Fd/X5DzncZ+fg9ox45RyUQLr3VTc6JAFKZepSKFaqfDXO3iJk6Sv+ktSP9A JsaEwsu3f5lWmnkkHOhtxoYyC77lVlgfUOwSmI8VbGOJrKnEwZNY/7QvO8o0HBvUkWHK gbwm8xzv1W7rmNJEBE4guiDGEeC9aqt3rQ/dnG7yvfQOJs32RlgnuEFEfCQZ+eLcLKcM OvnZtI3z2zsl7fbp72jwEihnQTwjfw7XsNANB7NuUL15h/2fsgrt8aawdsU+aKWgJ5rP IAUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=g1Gikb/q4aJ790nsrLBBZxeFgZO8Vqq/Oo0RByk4pDk=; b=gC65MsQ9Ow1ctoFhqciViW04dvFu4YkM9BAEk4qcuZsm/QEHh//FN+IdSsaVk3/4Xh /OqWEdzQ4zFksHR4rqlggVrKDgRn00KTJyLknw0XyPBE6PwsaK4luZ8a7SGRlk8tXc3y WxknLiCdMM6u54VWWjFxQS37AeNsbRNcYYiX957jb3RoUNSROX8xQeZcoFPiW9uT+Ywf uFk68ozy0MGBMO+J5X+FpPGNn88jvd5vEucRDk4h9RreXa1f98ldR7mmuA5xVfs5ewro 48tHwHGLrSHiECnGXzDakvti5hko9x7HXBKsDqofB8/GTtCbRl5vEZk6WOwAhOU91rZw pJ7g== X-Gm-Message-State: APjAAAWgNy7zhWhlM9tkYsO7hT+vYCSvU/vyBOVgzL2xhL/nyMBxEtPL G7uEQ+GYYH47Wqf7XW8J4oImlw== X-Google-Smtp-Source: APXvYqwcwsFNu5Nf5LHFzO5QTBW31YpnNRNSUnN+crPgC/6y760jgaykRecTvjIvPghb7KY+W9dXQg== X-Received: by 2002:a5d:4fc1:: with SMTP id h1mr24334734wrw.83.1561383820838; Mon, 24 Jun 2019 06:43:40 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id t6sm11005487wmb.29.2019.06.24.06.43.38 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 24 Jun 2019 06:43:38 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D53BC1FF91; Mon, 24 Jun 2019 14:43:37 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Mon, 24 Jun 2019 14:43:22 +0100 Message-Id: <20190624134337.10532-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190624134337.10532-1-alex.bennee@linaro.org> References: <20190624134337.10532-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::433 Subject: [Qemu-devel] [PULL 04/19] tests/vm: add source repos on ubuntu.i386 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Cleber Rosa Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Cleber Rosa Possibly because of different behavior on the newly update cloud-image, trying to run 'apt-get build-dep' results in: E: You must put some 'source' URIs in your sources.list This enables all source repos (even though some are not needed) for simplicity sake. Signed-off-by: Cleber Rosa Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Message-Id: <20190613130718.3763-5-crosa@redhat.com> Signed-off-by: Alex Bennée diff --git a/tests/vm/ubuntu.i386 b/tests/vm/ubuntu.i386 index 7017e6d388..3ea459ee20 100755 --- a/tests/vm/ubuntu.i386 +++ b/tests/vm/ubuntu.i386 @@ -77,6 +77,7 @@ class UbuntuX86VM(basevm.BaseVM): time.sleep(5) self.wait_ssh() # The previous update sometimes doesn't survive a reboot, so do it again + self.ssh_root_check("sed -ie s/^#\ deb-src/deb-src/g /etc/apt/sources.list") self.ssh_root_check("apt-get update") self.ssh_root_check("apt-get build-dep -y qemu") self.ssh_root_check("apt-get install -y libfdt-dev flex bison") From patchwork Mon Jun 24 13:43:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1121280 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=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="obrIbgPG"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45XW112vFsz9sDX for ; Mon, 24 Jun 2019 23:51:33 +1000 (AEST) Received: from localhost ([::1]:51325 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPNZ-0002HF-Cf for incoming@patchwork.ozlabs.org; Mon, 24 Jun 2019 09:51:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41558) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPGI-0006iv-CW for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:43:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfPGG-0007g5-Mc for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:43:58 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]:40189) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hfPGG-0007OS-AM for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:43:56 -0400 Received: by mail-wm1-x32f.google.com with SMTP id v19so13430096wmj.5 for ; Mon, 24 Jun 2019 06:43:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UmlC5jhm/yiDMB/28jG9Y1RW/s/4aA4e4sfjTnMWwG4=; b=obrIbgPGbOjoOwra80SsV3ITSoWb/Un6kxVUrlBzcsbEp8kslAZ1/mT13TKTgnQSK5 GL5O8V+yMwd4CBBYfCPnV7kL0T59sMy3DEvw2rmos89naaRqb84V6LZgZ7F7wCnZXmUb r5nn0JNSs7y2YpQbG6NaYSNBa/w/O6fUSYMC8Tg8TyeTYr8+m4USdw2TlranpSivwREd sglLj1Zmwz28F9MTWTWaN2SSbqQxPA3iKKii1PUdcYPDWKqIZjiSzwOe7pRuLBWEGzkj H3QLR7pVEdSu7JJF+nr8Y3dI+GO18ycd8Sox0ihzv1+DuvZ15+ywpnC+Fz78Nbq446s2 Ak0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UmlC5jhm/yiDMB/28jG9Y1RW/s/4aA4e4sfjTnMWwG4=; b=sLbADiSdoVK0j6jIqnNbBkjbBt+fxVyvwGvr1dqCHloHt+RcBAcU7jxaLnSZOAfnjb zyGLWtHSFT2VnjgNJCN2ILwJA7O8b6IU8aIYxwl6RRsr45Vgu7+DqjyXxFUOlToQZHYH DRIStUByMq2lI8sbjEe/p14QOPLmihTXpNx/NSTk6ms6MjReYNbF/lc3ISqBI3OaRAbG DEgQSPnZrCLcE19mIO19ec82qnb0c37MQ/hMXveMun9gZCkVhhpIVOOllwAaR/PTx0jL IWr3qyeEnHLkNRZLzrfav7h7wXJnFI2M1KaBkg6tZeRBxRwGYJ/46y2bXN8KoUv8/326 R6zA== X-Gm-Message-State: APjAAAVCUrzUu2NesLG+ZVHm8f/BXM3sdhgK/sVyrRev4SYo/OAPcR0A SPPVXYBmQ21kN2j5JF9yUAcrhw== X-Google-Smtp-Source: APXvYqxfXFCree/i0XFd2AIns4ij+K9pYRujG9dNl35kRHA1Ucb4x0pimJFgRgwjiaasPyV+Mob0SQ== X-Received: by 2002:a1c:dc45:: with SMTP id t66mr16621984wmg.63.1561383822979; Mon, 24 Jun 2019 06:43:42 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id y133sm23398521wmg.5.2019.06.24.06.43.39 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 24 Jun 2019 06:43:41 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id EACB61FF92; Mon, 24 Jun 2019 14:43:37 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Mon, 24 Jun 2019 14:43:23 +0100 Message-Id: <20190624134337.10532-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190624134337.10532-1-alex.bennee@linaro.org> References: <20190624134337.10532-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32f Subject: [Qemu-devel] [PULL 05/19] tests/vm: send proxy environment variables over ssh X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Gerd Hoffmann , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Gerd Hoffmann Packages are fetched via proxy that way, if configured on the host. That might be required to pass firewalls, and it allows to route package downloads through a caching proxy server. Needs AcceptEnv setup in sshd_config on the guest side to work. Signed-off-by: Gerd Hoffmann Reviewed-by: Philippe Mathieu-Daudé Tested-by: Thomas Huth Tested-by: Philippe Mathieu-Daudé Message-Id: <20190617043858.8290-2-kraxel@redhat.com> Signed-off-by: Alex Bennée diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index 4847549592..5e30bac661 100755 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -38,6 +38,13 @@ class BaseVM(object): GUEST_PASS = "qemupass" ROOT_PASS = "qemupass" + envvars = [ + "https_proxy", + "http_proxy", + "ftp_proxy", + "no_proxy", + ] + # The script to run in the guest that builds QEMU BUILD_SCRIPT = "" # The guest name, to be overridden by subclasses @@ -106,6 +113,8 @@ class BaseVM(object): "-o", "UserKnownHostsFile=" + os.devnull, "-o", "ConnectTimeout=1", "-p", self.ssh_port, "-i", self._ssh_key_file] + for var in self.envvars: + ssh_cmd += ['-o', "SendEnv=%s" % var ] if interactive: ssh_cmd += ['-t'] assert not isinstance(cmd, str) From patchwork Mon Jun 24 13:43:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1121277 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=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="WqnUV4HN"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45XVsF4YzGz9s6w for ; Mon, 24 Jun 2019 23:44:49 +1000 (AEST) Received: from localhost ([::1]:51302 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPH5-0006tx-Mg for incoming@patchwork.ozlabs.org; Mon, 24 Jun 2019 09:44:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41523) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPGH-0006hj-IN for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:43:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfPGG-0007fL-Az for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:43:57 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:38376) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hfPGE-0007Oi-DS for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:43:54 -0400 Received: by mail-wr1-x436.google.com with SMTP id d18so13994189wrs.5 for ; Mon, 24 Jun 2019 06:43:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=c6RTlncvKEOxdPzqDtthTA6vXD5pXgd87E8kJP9158o=; b=WqnUV4HNKo4DS2e2EQXp0afedkA08ZF6h1AXyr+FJCgdB36To9Bc1Cbtdu6jRCDaWx OHSPEW8ZRl3fW5F++mopm5ynQelzWU/Lv7NzRjIMEA1Oc85pqOI0mzWnElu0gOuPrnO9 TkhQBX3npI5PBer5YBHSrpvkmbFFd3cYGUR4WZr1GNUw4bwAcdC4AGjNHyyzdHfrGe+U 0Yrj/PONaqedOFmw+6N/Wp37kWu557MdBIywL9SktRrrlQFqOnEvul7d6uWEYOVQtRh+ 8jtybw25h63b5QKm3go8wKxSoEBJ5+U4yLX4hwBjnerYQjA+tNqQWl0zdgD1+SQfmrbf oHMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=c6RTlncvKEOxdPzqDtthTA6vXD5pXgd87E8kJP9158o=; b=MoSqBv5iOlA3v5zvsCQ8xSgXQLYRv+brx2DXnBK1d9F5oOvT+RnlJxwarMQ4ppK53O F4fqMEXUcYFCIIfZ4ZcfGa5VNUm8r3Q1P50nKK43KfVDdvGhBdavypOirPEKU5ojrtyT xAPlGIscJ7B29sA5dTs+zapTOvqYsS+z3r+2JOvPH8OtEufHFLZXWoutkvvdSuM6vhaJ v37Rpxjsol/hkVolditdshcQPOtKf4Tsk4/HakXFRuD1Ce1l5gmLKRnlwRqsgE4c7eKC jA+AYCCHs2B54Asn9hNyDplK2S81zZA/c8t6KwyXGlplcozNBXsVG2FiEXsl3sClEkVF /+aA== X-Gm-Message-State: APjAAAU0wx4Q1DhVANrZRQcw3IcG1uX5nL6v6eQsaBdbW3SKqnT8f+YG wn079cdJY2nKWNCtqHznpSBTnw== X-Google-Smtp-Source: APXvYqycduhhLupneyF6DwiALAvNx9yrAK7UN37lIFMifF0/3TT0yyCzcjNEZG5krUdfMm3Om4kTXQ== X-Received: by 2002:adf:fecd:: with SMTP id q13mr18321554wrs.97.1561383823469; Mon, 24 Jun 2019 06:43:43 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id s7sm11584wmc.2.2019.06.24.06.43.39 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 24 Jun 2019 06:43:41 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 1ECFD1FF96; Mon, 24 Jun 2019 14:43:38 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Mon, 24 Jun 2019 14:43:25 +0100 Message-Id: <20190624134337.10532-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190624134337.10532-1-alex.bennee@linaro.org> References: <20190624134337.10532-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::436 Subject: [Qemu-devel] [PULL 07/19] tests/vm: run test builds on snapshot X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Thomas Huth , Ed Maste , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Gerd Hoffmann , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Gerd Hoffmann The build script doesn't shutdown the guest VMs properly, which results in filesystem corruption and guest boot failures sooner or later. Use the --snapshot to run builds on a snapshot, That way killing the VM doesn't corrupt the base image. Signed-off-by: Gerd Hoffmann Tested-by: Thomas Huth Acked-by: Ed Maste Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Message-Id: <20190617043858.8290-4-kraxel@redhat.com> [AJB: added tags] Signed-off-by: Alex Bennée diff --git a/tests/vm/Makefile.include b/tests/vm/Makefile.include index c59411bee0..276b870216 100644 --- a/tests/vm/Makefile.include +++ b/tests/vm/Makefile.include @@ -57,6 +57,7 @@ vm-build-%: $(IMAGES_DIR)/%.img $(if $(V),--verbose) \ --image "$<" \ $(if $(BUILD_TARGET),--build-target $(BUILD_TARGET)) \ + --snapshot \ --build-qemu $(SRC_PATH) -- \ $(if $(TARGET_LIST),--target-list=$(TARGET_LIST)) \ $(if $(EXTRA_CONFIGURE_OPTS),$(EXTRA_CONFIGURE_OPTS)), \ From patchwork Mon Jun 24 13:43:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1121316 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=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="q3YH62h/"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45XW3q24rtz9sNk for ; Mon, 24 Jun 2019 23:53:58 +1000 (AEST) Received: from localhost ([::1]:51346 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPPw-000698-Rx for incoming@patchwork.ozlabs.org; Mon, 24 Jun 2019 09:53:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41562) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPGI-0006iy-DS for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:44:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfPGG-0007gJ-Qa for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:43:58 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:34481) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hfPGG-0007Ph-Fu for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:43:56 -0400 Received: by mail-wm1-x32e.google.com with SMTP id w9so6397wmd.1 for ; Mon, 24 Jun 2019 06:43:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BBiBWMHXigNW/eAwUhEz7VujTp1CJQa4AIKszYpazcU=; b=q3YH62h/w752HZ54J+NrTZ9fRDFtw3iQAin8CdHAUxsdOgzE69NHyLlP+zCR7gdcda +qgaWN+F+7GTcfF5poyCrDegHuBA5rCG1PXpR42WFZs6OCalj2opQ7w74RwYYYi2l/gO LugnhhdYhtcTP+3MN7pC3S2OIN1EhfcKplGgo6GPgaFszyzsPSs0gJhwIXlXIjStPa0p 9/0KRKiH76+0NwqaIh3TwNp9y+OjbGpfwa9Hmr/FgYhd6O1lD4yx37o0AdqHJ/k/C6Me zuYQrpuZAISOrxsLUxW5qC/Yic53Jz3b8OwD1h5lGpl8PZkvQxcCkOLuxfreG9Lr/A0h yqiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BBiBWMHXigNW/eAwUhEz7VujTp1CJQa4AIKszYpazcU=; b=i7+naUuYnlWYWVREtgemlgFHLJX472mekRnCoxCuZowVuIRTRbPjFh6WlAF132FS3C didUQtdHN5PRcphVnLzE4XmgHeOq10Ypbg9p8JPOQqYgRI0kjvpJhgZoc+chkOH1+TYH 5PP5uvT5aMyF61LmvKkfxdM19n5qY9g6+aCH+nqoRE7JFzhCYfg/XdXfFRk1Caw/epXa DlDoXiLPhf4HtPPf2EQ+MBf87mR5PdpI4OOmiSfwn7CRYju5TzE8D8iM08Sp74QgYH7C baL6ts/Zxe2yXB9KEKLx7R4mvfK1fFDbGT1gTVzoJiipvBzKuPQzXAh8XJpvG0KBzaXI +bEg== X-Gm-Message-State: APjAAAXn/BksNfNFZZ42HYWBj4PB37OXh/bfruKzdaP29ZJBuKekn66J BWbruXKxIqQmc95Bqnui/TxsHEHof44= X-Google-Smtp-Source: APXvYqw3jnUlfsghzs2t4x6YXTroZsL0RvSO0Z4luQ65XHQs5n31X0jp4p998GRNeyoPs4Lb0Um4sQ== X-Received: by 2002:a1c:4b1a:: with SMTP id y26mr16112566wma.105.1561383824395; Mon, 24 Jun 2019 06:43:44 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id w67sm11468568wma.24.2019.06.24.06.43.39 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 24 Jun 2019 06:43:41 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 328A21FF98; Mon, 24 Jun 2019 14:43:38 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Mon, 24 Jun 2019 14:43:26 +0100 Message-Id: <20190624134337.10532-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190624134337.10532-1-alex.bennee@linaro.org> References: <20190624134337.10532-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32e Subject: [Qemu-devel] [PULL 08/19] tests/vm: proper guest shutdown X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Gerd Hoffmann , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Gerd Hoffmann When not running in snapshot mode ask the guest to poweroff and wait for this to finish instead of simply quitting qemu, so the guest can flush pending updates to disk. Signed-off-by: Gerd Hoffmann Tested-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Message-Id: <20190617043858.8290-5-kraxel@redhat.com> Signed-off-by: Alex Bennée diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index 395eefaec9..f27178f3c7 100755 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -51,6 +51,8 @@ class BaseVM(object): name = "#base" # The guest architecture, to be overridden by subclasses arch = "#arch" + # command to halt the guest, can be overridden by subclasses + poweroff = "poweroff" def __init__(self, debug=False, vcpus=None): self._guest = None self._tmpdir = os.path.realpath(tempfile.mkdtemp(prefix="vm-test-", @@ -202,6 +204,10 @@ class BaseVM(object): def wait(self): self._guest.wait() + def graceful_shutdown(self): + self.ssh_root(self.poweroff) + self._guest.wait() + def qmp(self, *args, **kwargs): return self._guest.qmp(*args, **kwargs) @@ -278,11 +284,13 @@ def main(vmcls): traceback.print_exc() return 2 - if args.interactive: - if vm.ssh(*cmd) == 0: - return 0 + exitcode = 0 + if vm.ssh(*cmd) != 0: + exitcode = 3 + if exitcode != 0 and args.interactive: vm.ssh() - return 3 - else: - if vm.ssh(*cmd) != 0: - return 3 + + if not args.snapshot: + vm.graceful_shutdown() + + return exitcode From patchwork Mon Jun 24 13:43:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1121283 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=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="qVD+5bjH"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45XW1528hWz9sDX for ; Mon, 24 Jun 2019 23:51:37 +1000 (AEST) Received: from localhost ([::1]:51334 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPNf-0002dM-B3 for incoming@patchwork.ozlabs.org; Mon, 24 Jun 2019 09:51:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41560) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPGI-0006ix-DF for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:44:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfPGG-0007fw-IV for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:43:58 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]:37791) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hfPGG-0007SE-A7 for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:43:56 -0400 Received: by mail-wm1-x32b.google.com with SMTP id f17so13455886wme.2 for ; Mon, 24 Jun 2019 06:43:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uYenwXAi2dqO9YgcCSxpMSuNa4TOsTlySRQpX2U2e0k=; b=qVD+5bjHqYP++60WwQB0iVxga0/Cbar8oQmqdGFSasEK2fAJQaqZXYJ0wQLnA+qsU9 OGkK38ebu45b41wth+GZ19XuhPsHbDnPLOYewoK5+GRJiKVasutA1XFmuDePAep7Sj/Y qz/flomZJzwaskMS/NG/90YPWlMerFx6ExCLP8zy2guCany4BxOFzajJKsCj7lg5OG4+ vymE6PeH8TNT15FioIsElauc3Dry3SQaoHHQr/fhP/Whv5CTzMExt1KFJgOrsnRR3wxN XrITkw/MruWSMFVgMYS8tUAnr6VI0Abqsz4fsZziBBrQBaa9PU7OQ0ad/pJHA+i+zkvK Kexg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uYenwXAi2dqO9YgcCSxpMSuNa4TOsTlySRQpX2U2e0k=; b=M0Vs7A8A8qWWT2arTI2d4dyXKrmilAHcSDhyMYVTcxHzNh2+X3ClK0Tg5I6j8Wer3t 6kzMMFxaK5vBqEOOcKvFJMLvXTEJH3s31e5U0mW5ymula8WmFM343WoveA++8crvLCG8 dHHJJXIPTRdUnJzCDkDAkLF/rPogxU0w3nUXhNYEHGNOX7zL/9JTLHn/cguUjM0vdUC9 juLrNjiKiOkIB5gi/+2Oxbi0d9oWLvJwP8AgYdLVmfRiFtdW/7/xsZZtWXauolkNs7s7 Cy52taKFVsgd+0+NIxr1+hcTIcVspyL9yT3GZI5Yr/FnYuPMk8s+n54fi9vJ+fSAc26l yOUQ== X-Gm-Message-State: APjAAAWq5AptxkUX96a8yYHtTAqyLuNJ/vlol2kJqbGLyvZbB+37FDrd LyDK6NoW2YPwWfaKYPr3hqPIcQ== X-Google-Smtp-Source: APXvYqyJvB/pI828TAXUOTRwQn0Re8ef8I7f91ukgVtCsykM9dplFUrODyZeQmJBnrA/Y6pWYtAgsA== X-Received: by 2002:a1c:720e:: with SMTP id n14mr16224973wmc.53.1561383826209; Mon, 24 Jun 2019 06:43:46 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id y17sm18277427wrg.18.2019.06.24.06.43.39 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 24 Jun 2019 06:43:42 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 460331FF99; Mon, 24 Jun 2019 14:43:38 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Mon, 24 Jun 2019 14:43:27 +0100 Message-Id: <20190624134337.10532-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190624134337.10532-1-alex.bennee@linaro.org> References: <20190624134337.10532-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32b Subject: [Qemu-devel] [PULL 09/19] tests/vm: add vm-boot-{ssh, serial}- targets X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Gerd Hoffmann , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Gerd Hoffmann For testing/troubleshooting convenience. make vm-boot-serial- Boot guest, with the serial console on stdio. make vm-boot-ssh- Boot guest, login via ssh. Signed-off-by: Gerd Hoffmann Tested-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Message-Id: <20190617043858.8290-6-kraxel@redhat.com> [AJB: added tags] Signed-off-by: Alex Bennée diff --git a/tests/vm/Makefile.include b/tests/vm/Makefile.include index 276b870216..a61c236b8e 100644 --- a/tests/vm/Makefile.include +++ b/tests/vm/Makefile.include @@ -20,6 +20,10 @@ vm-test: @echo " vm-build-all - Build QEMU in all VMs" @echo " vm-clean-all - Clean up VM images" @echo + @echo "For trouble-shooting:" + @echo " vm-boot-serial- - Boot guest, serial console on stdio" + @echo " vm-boot-ssh- - Boot guest and login via ssh" + @echo @echo "Special variables:" @echo " BUILD_TARGET=foo - Override the build target" @echo " TARGET_LIST=a,b,c - Override target list in builds" @@ -63,3 +67,18 @@ vm-build-%: $(IMAGES_DIR)/%.img $(if $(EXTRA_CONFIGURE_OPTS),$(EXTRA_CONFIGURE_OPTS)), \ " VM-BUILD $*") +vm-boot-serial-%: $(IMAGES_DIR)/%.img + qemu-system-x86_64 -enable-kvm -m 4G -smp 2 -nographic \ + -drive if=none,id=vblk,cache=writeback,file="$<" \ + -netdev user,id=vnet \ + -device virtio-blk-pci,drive=vblk \ + -device virtio-net-pci,netdev=vnet \ + || true + +vm-boot-ssh-%: $(IMAGES_DIR)/%.img + $(call quiet-command, \ + $(SRC_PATH)/tests/vm/$* \ + --image "$<" \ + --interactive \ + false, \ + " VM-BOOT-SSH $*") || true From patchwork Mon Jun 24 13:43:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1121332 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=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="ReagwXuv"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45XW812kBmz9s3l for ; Mon, 24 Jun 2019 23:57:37 +1000 (AEST) Received: from localhost ([::1]:51374 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPTO-0001LB-SP for incoming@patchwork.ozlabs.org; Mon, 24 Jun 2019 09:57:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41611) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPGK-0006jR-3V for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:44:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfPGG-0007gp-V5 for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:43:59 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:34057) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hfPGG-0007U0-JO for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:43:56 -0400 Received: by mail-wr1-x435.google.com with SMTP id k11so14008959wrl.1 for ; Mon, 24 Jun 2019 06:43:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4V5durOY/x3+0X/wiER2jyd9YT6J94WuCw52pgi+pLM=; b=ReagwXuvID5elncENxLBDxvRAHCo0mRVCrZnmEp4kOovVhKQC+Iy7pZLnZ+IglOFx1 Wf+n9vdsWFSN6BA5B3/E7dtYBZRKhH6UYNLHX6g1qJe97L73ZePkLokXw1TvqHctuz88 25RPhUwzd23HZ/WNgoU23VLj/mXaXAkVHCjknYXm3GIak1unzN+FTdpey8YH6AR7T1PC vulhYtw07B9qzFMGi05ho6PRF9TR62N86wLvAO0tzPVEyVeB3t1yp2o+gsj86X9QPyBx vr7RctfDYx1MbWs/weicqjB8GF6WXIlAcd5ioni2kNV7HW9V/ZBN+01RXDjhDjJnqCEx 51NA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4V5durOY/x3+0X/wiER2jyd9YT6J94WuCw52pgi+pLM=; b=tgNZIt29fZqBHjjQ41tVLAUwfX+F3tA7i0Or1ep6WXVu0RNncVORWluDJziJQtjsGd 6TTeoiRbdBujan3rHGxl7beMxfGWd+G1WjGWgl/P3UXHi06pQ40bQlHqGvwRG1NMhD2p FkBEDpoci0j1ROddHJB/xk3SdQ3KRO1Mf8UTnF2xIK2g03Bdyd/5Ng4MaWwOOaRZv+Hh 8yobaKh20+ZaAqrDHYfGXe7Gm+Pzsi0K+5ZV8uLDK2jUkRQZOJ9QFLdVmG4prkRMrnnD NhDKKymh/nFEmPLmMi64shp4csIEIz2jyyiJwDmQGGI2qExzMQhKVSF4vBLzQc6nnHYj Lndw== X-Gm-Message-State: APjAAAUGS5Yi4GgPz6U1SkXcnxcryKV3bT85QAI7kyeVN3ErUzLjD2v2 MsJqngGbPdLZzPh6J17XmOHIiQ== X-Google-Smtp-Source: APXvYqy2EejcZFiq2QQkwcvc+OQDCaJynL1YeBo8wIeaErW1i/u9FMwp89EUbGDgUoZpk2xguBoTgg== X-Received: by 2002:adf:fc85:: with SMTP id g5mr23355987wrr.324.1561383827800; Mon, 24 Jun 2019 06:43:47 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id t63sm11034068wmt.6.2019.06.24.06.43.39 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 24 Jun 2019 06:43:42 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 5A9671FF9A; Mon, 24 Jun 2019 14:43:38 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Mon, 24 Jun 2019 14:43:28 +0100 Message-Id: <20190624134337.10532-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190624134337.10532-1-alex.bennee@linaro.org> References: <20190624134337.10532-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::435 Subject: [Qemu-devel] [PULL 10/19] tests/vm: serial console support helpers X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Gerd Hoffmann , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Gerd Hoffmann Add a bunch of helpers to talk to the guest using the serial console. Also drop the hard-coded -serial parameter for the vm so QEMUMachine.set_console() actually works. Signed-off-by: Gerd Hoffmann Tested-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Message-Id: <20190617043858.8290-7-kraxel@redhat.com> [AJB: added tags] Signed-off-by: Alex Bennée diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index f27178f3c7..592a344773 100755 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -2,10 +2,11 @@ # # VM testing base class # -# Copyright 2017 Red Hat Inc. +# Copyright 2017-2019 Red Hat Inc. # # Authors: # Fam Zheng +# Gerd Hoffmann # # This code is licensed under the GPL version 2 or later. See # the COPYING file in the top-level directory. @@ -13,7 +14,9 @@ from __future__ import print_function import os +import re import sys +import socket import logging import time import datetime @@ -79,8 +82,7 @@ class BaseVM(object): "-cpu", "max", "-netdev", "user,id=vnet,hostfwd=:127.0.0.1:0-:22", "-device", "virtio-net-pci,netdev=vnet", - "-vnc", "127.0.0.1:0,to=20", - "-serial", "file:%s" % os.path.join(self._tmpdir, "serial.out")] + "-vnc", "127.0.0.1:0,to=20"] if vcpus and vcpus > 1: self._args += ["-smp", "%d" % vcpus] if kvm_available(self.arch): @@ -162,6 +164,8 @@ class BaseVM(object): logging.debug("QEMU args: %s", " ".join(args)) qemu_bin = os.environ.get("QEMU", "qemu-system-" + self.arch) guest = QEMUMachine(binary=qemu_bin, args=args) + guest.set_machine('pc') + guest.set_console() try: guest.launch() except: @@ -184,6 +188,82 @@ class BaseVM(object): raise Exception("Cannot find ssh port from 'info usernet':\n%s" % \ usernet_info) + def console_init(self, timeout = 120): + vm = self._guest + vm.console_socket.settimeout(timeout) + + def console_log(self, text): + for line in re.split("[\r\n]", text): + # filter out terminal escape sequences + line = re.sub("\x1b\[[0-9;?]*[a-zA-Z]", "", line) + line = re.sub("\x1b\([0-9;?]*[a-zA-Z]", "", line) + # replace unprintable chars + line = re.sub("\x1b", "", line) + line = re.sub("[\x00-\x1f]", ".", line) + line = re.sub("[\x80-\xff]", ".", line) + if line == "": + continue + # log console line + sys.stderr.write("con recv: %s\n" % line) + + def console_wait(self, expect): + vm = self._guest + output = "" + while True: + try: + chars = vm.console_socket.recv(1) + except socket.timeout: + sys.stderr.write("console: *** read timeout ***\n") + sys.stderr.write("console: waiting for: '%s'\n" % expect) + sys.stderr.write("console: line buffer:\n") + sys.stderr.write("\n") + self.console_log(output.rstrip()) + sys.stderr.write("\n") + raise + output += chars.decode("latin1") + if expect in output: + break + if "\r" in output or "\n" in output: + lines = re.split("[\r\n]", output) + output = lines.pop() + if self.debug: + self.console_log("\n".join(lines)) + if self.debug: + self.console_log(output) + + def console_send(self, command): + vm = self._guest + if self.debug: + logline = re.sub("\n", "", command) + logline = re.sub("[\x00-\x1f]", ".", logline) + sys.stderr.write("con send: %s\n" % logline) + for char in list(command): + vm.console_socket.send(char.encode("utf-8")) + time.sleep(0.01) + + def console_wait_send(self, wait, command): + self.console_wait(wait) + self.console_send(command) + + def console_ssh_init(self, prompt, user, pw): + sshkey_cmd = "echo '%s' > .ssh/authorized_keys\n" % SSH_PUB_KEY.rstrip() + self.console_wait_send("login:", "%s\n" % user) + self.console_wait_send("Password:", "%s\n" % pw) + self.console_wait_send(prompt, "mkdir .ssh\n") + self.console_wait_send(prompt, sshkey_cmd) + self.console_wait_send(prompt, "chmod 755 .ssh\n") + self.console_wait_send(prompt, "chmod 644 .ssh/authorized_keys\n") + + def console_sshd_config(self, prompt): + self.console_wait(prompt) + self.console_send("echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config\n") + for var in self.envvars: + self.console_wait(prompt) + self.console_send("echo 'AcceptEnv %s' >> /etc/ssh/sshd_config\n" % var) + + def print_step(self, text): + sys.stderr.write("### %s ...\n" % text) + def wait_ssh(self, seconds=300): starttime = datetime.datetime.now() endtime = starttime + datetime.timedelta(seconds=seconds) From patchwork Mon Jun 24 13:43:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1121282 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=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="YPViegu/"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45XW143HVsz9sBr for ; Mon, 24 Jun 2019 23:51:36 +1000 (AEST) Received: from localhost ([::1]:51332 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPNe-0002bl-CW for incoming@patchwork.ozlabs.org; Mon, 24 Jun 2019 09:51:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41585) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPGJ-0006jB-4N for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:44:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfPGG-0007fY-CG for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:43:58 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:55061) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hfPGE-0007T2-EH for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:43:55 -0400 Received: by mail-wm1-x32c.google.com with SMTP id g135so12844284wme.4 for ; Mon, 24 Jun 2019 06:43:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/RSieZJAcswfuzrWAl67uAJKjsybJgY5oC9aZNMPdU0=; b=YPViegu/fLJeDmKBD8VgBppTY8qR1rNFe5QFgb9d19kNTOXc8dHHEwEmT/HdDZ/jTs ey7tWL//ccAfbXDhBKow22Qshewnf1lhuDYhfNF5u0yLB9Z5IXzSCJlt8uyOhjdWuWJr DYhpJ+SQbmm//n2yDib9OBeGGLuChTCZDlpDgpfz0mn8RLB9Psz5qbvjmhDraYRXH0Py zgSkKM+MdaOy+JOwIl/M2FQeA8aVFA9oS3hawsXEgNY8t6M6I00QwUs5N6JDBBa92dv4 I6tuLdH/mHjuXNZqGzGMAGAqVoXsC+k6Mp1zsPj88C6fZp0VP3GOPWh5urrXcGXBpJON zIKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/RSieZJAcswfuzrWAl67uAJKjsybJgY5oC9aZNMPdU0=; b=a+CXcNt8almTKbJ5Km74CO77oFB1uXqLO8beOrWTHeJqZGANwpx++wINxmQ4nAlD95 ChJKCHMOuUOAdw61loo1K7/X2yEwK8xB1MazB6GKKr4lY4WEpM/TjyM3HhSA1eYWgFsM 9SNqP82a0dNGl4lri3Z9NWLNtMPh/tlNdgpTmOALne7y2fTmqifLj8D4ASk4HB29FKsg hF5nUAo5W3KspThySsvqDw/e6pYuvJyD/bH1tGMV0XGyC2oLqj+Od51kmQsPztqJOTn1 iDK8hMaV2QUW9dErxTq3TdQWTKHfjCqAqu01I424lRCo9aeOB172kFK5NnzUgNHB2f76 1vPA== X-Gm-Message-State: APjAAAU3HhR5iFXXBit2WPwR6eJJNDO1f65o5ytIHmccMrx8pGFT8692 KgtPKIPFuIj7IZVdqdm8HewN+uHyNrM= X-Google-Smtp-Source: APXvYqxsME7vNDJG92KAs4JyLp5W80jBHSB5ntwXSWWunvduaUlx7ZAcXgsti2+SvDl1UUoXRMHY7w== X-Received: by 2002:a7b:cc04:: with SMTP id f4mr7267902wmh.125.1561383826654; Mon, 24 Jun 2019 06:43:46 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id y12sm8423706wrr.3.2019.06.24.06.43.41 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 24 Jun 2019 06:43:42 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 7028C1FF9B; Mon, 24 Jun 2019 14:43:38 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Mon, 24 Jun 2019 14:43:29 +0100 Message-Id: <20190624134337.10532-12-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190624134337.10532-1-alex.bennee@linaro.org> References: <20190624134337.10532-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32c Subject: [Qemu-devel] [PULL 11/19] tests/vm: openbsd autoinstall, using serial console X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Gerd Hoffmann , =?utf-8?q?Alex_Benn=C3=A9e?= , Brad Smith Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Gerd Hoffmann Instead of fetching the prebuilt image from patchew download the install iso and prepare the image locally. Install to disk, using the serial console. Create qemu user, configure ssh login. Install packages needed for qemu builds. Signed-off-by: Gerd Hoffmann Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Message-Id: <20190617043858.8290-8-kraxel@redhat.com> [AJB: added tags] Signed-off-by: Alex Bennée diff --git a/tests/vm/openbsd b/tests/vm/openbsd index 28c7d25e29..b92c39f89a 100755 --- a/tests/vm/openbsd +++ b/tests/vm/openbsd @@ -2,10 +2,11 @@ # # OpenBSD VM image # -# Copyright 2017 Red Hat Inc. +# Copyright 2017-2019 Red Hat Inc. # # Authors: # Fam Zheng +# Gerd Hoffmann # # This code is licensed under the GPL version 2 or later. See # the COPYING file in the top-level directory. @@ -13,32 +14,166 @@ import os import sys +import socket import subprocess import basevm class OpenBSDVM(basevm.BaseVM): name = "openbsd" arch = "x86_64" + + link = "https://cdn.openbsd.org/pub/OpenBSD/6.5/amd64/install65.iso" + csum = "38d1f8cadd502f1c27bf05c5abde6cc505dd28f3f34f8a941048ff9a54f9f608" + size = "20G" + pkgs = [ + # tools + "git", + "pkgconf", + "bzip2", "xz", + + # gnu tools + "bash", + "gmake", + "gsed", + "bison", + + # libs: usb + "libusb1", + + # libs: crypto + "gnutls", + + # libs: images + "jpeg", + "png", + + # libs: ui + "sdl2", + "gtk+3", + "libxkbcommon", + ] + BUILD_SCRIPT = """ set -e; - rm -rf /var/tmp/qemu-test.* - cd $(mktemp -d /var/tmp/qemu-test.XXXXXX); + rm -rf /home/qemu/qemu-test.* + cd $(mktemp -d /home/qemu/qemu-test.XXXXXX); + mkdir src build; cd src; tar -xf /dev/rsd1c; - ./configure --cc=x86_64-unknown-openbsd6.1-gcc-4.9.4 --python=python2.7 {configure_opts}; - gmake --output-sync -j{jobs} {verbose}; - # XXX: "gmake check" seems to always hang or fail - #gmake --output-sync -j{jobs} check {verbose}; + cd ../build + ../src/configure --cc=cc --python=python3 {configure_opts}; + gmake --output-sync -j{jobs} {target} {verbose}; """ + poweroff = "halt -p" def build_image(self, img): - cimg = self._download_with_cache("http://download.patchew.org/openbsd-6.1-amd64.img.xz", - sha256sum='8c6cedc483e602cfee5e04f0406c64eb99138495e8ca580bc0293bcf0640c1bf') - img_tmp_xz = img + ".tmp.xz" + self.print_step("Downloading install iso") + cimg = self._download_with_cache(self.link, sha256sum=self.csum) img_tmp = img + ".tmp" - sys.stderr.write("Extracting the image...\n") - subprocess.check_call(["ln", "-f", cimg, img_tmp_xz]) - subprocess.check_call(["xz", "--keep", "-dvf", img_tmp_xz]) + iso = img + ".install.iso" + + self.print_step("Preparing iso and disk image") + subprocess.check_call(["cp", "-f", cimg, iso]) + subprocess.check_call(["qemu-img", "create", "-f", "qcow2", + img_tmp, self.size]) + + self.print_step("Booting installer") + self.boot(img_tmp, extra_args = [ + "-bios", "pc-bios/bios-256k.bin", + "-machine", "graphics=off", + "-cdrom", iso + ]) + self.console_init() + self.console_wait_send("boot>", "set tty com0\n") + self.console_wait_send("boot>", "\n") + + # pre-install configuration + self.console_wait_send("(I)nstall", "i\n") + self.console_wait_send("Terminal type", "xterm\n") + self.console_wait_send("System hostname", "openbsd\n") + self.console_wait_send("Which network interface", "vio0\n") + self.console_wait_send("IPv4 address", "dhcp\n") + self.console_wait_send("IPv6 address", "none\n") + self.console_wait_send("Which network interface", "done\n") + self.console_wait_send("DNS domain name", "localnet\n") + self.console_wait("Password for root account") + self.console_send("%s\n" % self.ROOT_PASS) + self.console_wait("Password for root account") + self.console_send("%s\n" % self.ROOT_PASS) + self.console_wait_send("Start sshd(8)", "yes\n") + self.console_wait_send("X Window System", "\n") + self.console_wait_send("xenodm", "\n") + self.console_wait_send("console to com0", "\n") + self.console_wait_send("Which speed", "\n") + + self.console_wait("Setup a user") + self.console_send("%s\n" % self.GUEST_USER) + self.console_wait("Full name") + self.console_send("%s\n" % self.GUEST_USER) + self.console_wait("Password") + self.console_send("%s\n" % self.GUEST_PASS) + self.console_wait("Password") + self.console_send("%s\n" % self.GUEST_PASS) + + self.console_wait_send("Allow root ssh login", "yes\n") + self.console_wait_send("timezone", "UTC\n") + self.console_wait_send("root disk", "\n") + self.console_wait_send("(W)hole disk", "\n") + self.console_wait_send("(A)uto layout", "\n") + self.console_wait_send("Location of sets", "cd0\n") + self.console_wait_send("Pathname to the sets", "\n") + self.console_wait_send("Set name(s)", "\n") + self.console_wait_send("without verification", "yes\n") + + self.print_step("Installation started now, this will take a while") + self.console_wait_send("Location of sets", "done\n") + + self.console_wait("successfully completed") + self.print_step("Installation finished, rebooting") + self.console_wait_send("(R)eboot", "reboot\n") + + # setup qemu user + prompt = "$" + self.console_ssh_init(prompt, self.GUEST_USER, self.GUEST_PASS) + self.console_wait_send(prompt, "exit\n") + + # setup root user + prompt = "openbsd#" + self.console_ssh_init(prompt, "root", self.ROOT_PASS) + self.console_sshd_config(prompt) + + # setup virtio-blk #1 (tarfile) + self.console_wait(prompt) + self.console_send("echo 'chmod 666 /dev/rsd1c' >> /etc/rc.local\n") + + # enable w+x for /home + self.console_wait(prompt) + self.console_send("sed -i -e '/home/s/rw,/rw,wxallowed,/' /etc/fstab\n") + + # tweak datasize limit + self.console_wait(prompt) + self.console_send("sed -i -e 's/\\(datasize[^=]*\\)=[^:]*/\\1=infinity/' /etc/login.conf\n") + + # use http (be proxy cache friendly) + self.console_wait(prompt) + self.console_send("sed -i -e 's/https/http/' /etc/installurl\n") + + self.print_step("Configuration finished, rebooting") + self.console_wait_send(prompt, "reboot\n") + self.console_wait("login:") + self.wait_ssh() + + self.print_step("Installing packages") + self.ssh_root_check("pkg_add %s\n" % " ".join(self.pkgs)) + + # shutdown + self.ssh_root(self.poweroff) + self.wait() + + if os.path.exists(img): + os.remove(img) os.rename(img_tmp, img) + os.remove(iso) + self.print_step("All done") if __name__ == "__main__": sys.exit(basevm.main(OpenBSDVM)) From patchwork Mon Jun 24 13:43:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1121340 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=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="n7L6nSdY"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45XWBm4q5cz9sBr for ; Mon, 24 Jun 2019 23:59:59 +1000 (AEST) Received: from localhost ([::1]:51406 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPVl-0004Sr-O5 for incoming@patchwork.ozlabs.org; Mon, 24 Jun 2019 09:59:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41590) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPGJ-0006jE-9z for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:44:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfPGG-0007fQ-BS for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:43:58 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]:37795) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hfPGE-0007Te-Dp for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:43:54 -0400 Received: by mail-wm1-x32f.google.com with SMTP id f17so13455974wme.2 for ; Mon, 24 Jun 2019 06:43:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uy+t0RIuw/tzOoTJEZrmneCaAg6fEiVS+nMeJyBAP3k=; b=n7L6nSdYpkNsaNLeVCkJZbgX2kxUGZi3y+GUNDnBySKiSFheCTg+XbRgvVzDqnIAc3 xI4O4HWe431FqGD4fHwECSF97kcbg3dY6wjk7+pyHD0ZJuGDkfE3OBpdXsisPNQC6vj+ a4LoJfQPm3K2sHzAY097CBiVHlO5n3LT4iigUWsPaN212/slZ8tNG2SUHjFoMx8wPyej MZfoGeoM4ljaehTJhARrCyCmqTZIpRdYkn1rLIv+heONEGFlsQWg1F2TluDHEIdnL/NU ZtoUv2N71Kz46Ou+ei3zlLV6f8f6snZzXMI12HejHwHCIryP2IXT6GeYYrjsFN7+CMEi a0Ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uy+t0RIuw/tzOoTJEZrmneCaAg6fEiVS+nMeJyBAP3k=; b=UcONvuvZ9abDTlKHI2iw/B+UZVjDittD9rQd7+/jFi925Y/docotuwG+TaYSqwsx86 kpYvCCBxdo7C/M1YjgnSQVzscIUBtIjgLIpX0+lJerY0nq2Fhu3xaZYV5dj6J9fuh4c9 d51nBDElCg9eRjBh1aXiTHR6x3ld3zvDtSRx1vCQoEb0OdMCy6e86ZRNG2ETumQ5SxL+ 61uvTyMpIVY9G0gcug8ESertKuPwvCwo5SWZNpzqablczlza8gQ9MXkkioVGNszoEOAv gSLn9v9IjoSrxiopaUpb4U/LtK6X5thUes7InmsEul3BGZDuztFi8X6hw6F8lQkbR2LR vP6g== X-Gm-Message-State: APjAAAVB9ZGpRx2cnedzuocty7MlAnU5dMB1fxLv42I49Y2RUaAOCa5B uR/9j0CrZLcXtO+7rqpJp9+DCw== X-Google-Smtp-Source: APXvYqxRC8zMw1upwti8Y8vWt9odXsZJ0E/rFYA1NdjXTv2JTYTiulwWoGW8heA1rhxOdgBIVKVmAQ== X-Received: by 2002:a1c:c255:: with SMTP id s82mr16863185wmf.6.1561383827350; Mon, 24 Jun 2019 06:43:47 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id v15sm9612712wrt.25.2019.06.24.06.43.41 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 24 Jun 2019 06:43:42 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 86B4E1FF87; Mon, 24 Jun 2019 14:43:38 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Mon, 24 Jun 2019 14:43:30 +0100 Message-Id: <20190624134337.10532-13-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190624134337.10532-1-alex.bennee@linaro.org> References: <20190624134337.10532-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32f Subject: [Qemu-devel] [PULL 12/19] tests/vm: freebsd autoinstall, using serial console X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Gerd Hoffmann , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Gerd Hoffmann Instead of fetching the prebuilt image from patchew download the install iso and prepare the image locally. Install to disk, using the serial console. Create qemu user, configure ssh login. Install packages needed for qemu builds. Note that freebsd package downloads are delivered as non-cachable content, so I had to configure squid with "ignore-no-store ignore-private ignore-reload" for pkgmir.geo.freebsd.org to make the caching actually work. Signed-off-by: Gerd Hoffmann Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Tested-by: Thomas Huth Message-Id: <20190617043858.8290-9-kraxel@redhat.com> Signed-off-by: Alex Bennée diff --git a/tests/vm/freebsd b/tests/vm/freebsd index 091be1a065..2a19461a90 100755 --- a/tests/vm/freebsd +++ b/tests/vm/freebsd @@ -2,41 +2,203 @@ # # FreeBSD VM image # -# Copyright 2017 Red Hat Inc. +# Copyright 2017-2019 Red Hat Inc. # # Authors: # Fam Zheng +# Gerd Hoffmann # # This code is licensed under the GPL version 2 or later. See # the COPYING file in the top-level directory. # import os +import re import sys +import time +import socket import subprocess import basevm class FreeBSDVM(basevm.BaseVM): name = "freebsd" arch = "x86_64" + + link = "https://download.freebsd.org/ftp/releases/ISO-IMAGES/12.0/FreeBSD-12.0-RELEASE-amd64-disc1.iso.xz" + csum = "1d40015bea89d05b8bd13e2ed80c40b522a9ec1abd8e7c8b80954fb485fb99db" + size = "20G" + pkgs = [ + # build tools + "git", + "pkgconf", + "bzip2", + + # gnu tools + "bash", + "gmake", + "gsed", + "flex", "bison", + + # libs: crypto + "gnutls", + + # libs: images + "jpeg-turbo", + "png", + + # libs: ui + "sdl2", + "gtk3", + "libxkbcommon", + + # libs: opengl + "libepoxy", + "mesa-libs", + ] + BUILD_SCRIPT = """ set -e; - rm -rf /var/tmp/qemu-test.* - cd $(mktemp -d /var/tmp/qemu-test.XXXXXX); + rm -rf /home/qemu/qemu-test.* + cd $(mktemp -d /home/qemu/qemu-test.XXXXXX); + mkdir src build; cd src; tar -xf /dev/vtbd1; - ./configure {configure_opts}; + cd ../build + ../src/configure --python=python3.6 {configure_opts}; gmake --output-sync -j{jobs} {target} {verbose}; """ + def console_boot_serial(self): + self.console_wait_send("Autoboot", "3") + self.console_wait_send("OK", "set console=comconsole\n") + self.console_wait_send("OK", "boot\n") + def build_image(self, img): - cimg = self._download_with_cache("http://download.patchew.org/freebsd-11.1-amd64.img.xz", - sha256sum='adcb771549b37bc63826c501f05121a206ed3d9f55f49145908f7e1432d65891') - img_tmp_xz = img + ".tmp.xz" + self.print_step("Downloading install iso") + cimg = self._download_with_cache(self.link, sha256sum=self.csum) img_tmp = img + ".tmp" - sys.stderr.write("Extracting the image...\n") - subprocess.check_call(["ln", "-f", cimg, img_tmp_xz]) - subprocess.check_call(["xz", "--keep", "-dvf", img_tmp_xz]) + iso = img + ".install.iso" + iso_xz = iso + ".xz" + + self.print_step("Preparing iso and disk image") + subprocess.check_call(["cp", "-f", cimg, iso_xz]) + subprocess.check_call(["xz", "-dvf", iso_xz]) + subprocess.check_call(["qemu-img", "create", "-f", "qcow2", + img_tmp, self.size]) + + self.print_step("Booting installer") + self.boot(img_tmp, extra_args = [ + "-bios", "pc-bios/bios-256k.bin", + "-machine", "graphics=off", + "-cdrom", iso + ]) + self.console_init() + self.console_boot_serial() + self.console_wait_send("Console type", "xterm\n") + + # pre-install configuration + self.console_wait_send("Welcome", "\n") + self.console_wait_send("Keymap Selection", "\n") + self.console_wait_send("Set Hostname", "freebsd\n") + self.console_wait_send("Distribution Select", "\n") + self.console_wait_send("Partitioning", "\n") + self.console_wait_send("Partition", "\n") + self.console_wait_send("Scheme", "\n") + self.console_wait_send("Editor", "f") + self.console_wait_send("Confirmation", "c") + + self.print_step("Installation started now, this will take a while") + + # post-install configuration + self.console_wait("New Password:") + self.console_send("%s\n" % self.ROOT_PASS) + self.console_wait("Retype New Password:") + self.console_send("%s\n" % self.ROOT_PASS) + + self.console_wait_send("Network Configuration", "\n") + self.console_wait_send("IPv4", "y") + self.console_wait_send("DHCP", "y") + self.console_wait_send("IPv6", "n") + self.console_wait_send("Resolver", "\n") + + self.console_wait_send("Time Zone Selector", "a\n") + self.console_wait_send("Confirmation", "y") + self.console_wait_send("Time & Date", "\n") + self.console_wait_send("Time & Date", "\n") + + self.console_wait_send("System Configuration", "\n") + self.console_wait_send("System Hardening", "\n") + + # qemu user + self.console_wait_send("Add User Accounts", "y") + self.console_wait("Username") + self.console_send("%s\n" % self.GUEST_USER) + self.console_wait("Full name") + self.console_send("%s\n" % self.GUEST_USER) + self.console_wait_send("Uid", "\n") + self.console_wait_send("Login group", "\n") + self.console_wait_send("Login group", "\n") + self.console_wait_send("Login class", "\n") + self.console_wait_send("Shell", "\n") + self.console_wait_send("Home directory", "\n") + self.console_wait_send("Home directory perm", "\n") + self.console_wait_send("Use password", "\n") + self.console_wait_send("Use an empty password", "\n") + self.console_wait_send("Use a random password", "\n") + self.console_wait("Enter password:") + self.console_send("%s\n" % self.GUEST_PASS) + self.console_wait("Enter password again:") + self.console_send("%s\n" % self.GUEST_PASS) + self.console_wait_send("Lock out", "\n") + self.console_wait_send("OK", "yes\n") + self.console_wait_send("Add another user", "no\n") + + self.console_wait_send("Final Configuration", "\n") + self.console_wait_send("Manual Configuration", "\n") + self.console_wait_send("Complete", "\n") + + self.print_step("Installation finished, rebooting") + self.console_boot_serial() + + # setup qemu user + prompt = "$" + self.console_ssh_init(prompt, self.GUEST_USER, self.GUEST_PASS) + self.console_wait_send(prompt, "exit\n") + + # setup root user + prompt = "root@freebsd:~ #" + self.console_ssh_init(prompt, "root", self.ROOT_PASS) + self.console_sshd_config(prompt) + + # setup serial console + self.console_wait(prompt) + self.console_send("echo 'console=comconsole' >> /boot/loader.conf\n") + + # setup boot delay + self.console_wait(prompt) + self.console_send("echo 'autoboot_delay=1' >> /boot/loader.conf\n") + + # setup virtio-blk #1 (tarfile) + self.console_wait(prompt) + self.console_send("echo 'chmod 666 /dev/vtbd1' >> /etc/rc.local\n") + + self.print_step("Configuration finished, rebooting") + self.console_wait_send(prompt, "reboot\n") + self.console_wait("login:") + self.wait_ssh() + + self.print_step("Installing packages") + self.ssh_root_check("pkg install -y %s\n" % " ".join(self.pkgs)) + + # shutdown + self.ssh_root(self.poweroff) + self.console_wait("Uptime:") + self.wait() + + if os.path.exists(img): + os.remove(img) os.rename(img_tmp, img) + os.remove(iso) + self.print_step("All done") if __name__ == "__main__": sys.exit(basevm.main(FreeBSDVM)) From patchwork Mon Jun 24 13:43:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1121325 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=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="GLbmOs4O"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45XW5B50Zkz9sBr for ; Mon, 24 Jun 2019 23:55:10 +1000 (AEST) Received: from localhost ([::1]:51362 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPR6-0007A8-OB for incoming@patchwork.ozlabs.org; Mon, 24 Jun 2019 09:55:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43885) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPP4-00060g-R0 for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:53:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfPP2-0001Cp-M1 for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:53:02 -0400 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:35410) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hfPP0-0001AT-Ti for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:53:00 -0400 Received: by mail-wm1-x343.google.com with SMTP id c6so13519312wml.0 for ; Mon, 24 Jun 2019 06:52:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eLuX9jytNKsr8SIbflzRQAre1ZIZKEWnNTFuqfXsFEI=; b=GLbmOs4Ofki+XfvjIEvhwkMqTz4rWWYADV04u637Kva7MzXF5qMBmEdMSykxViq2cN s5JQim3m1NaSAzXoRdj8gB7AT5r2s1y5T9qdKn3os8blDUTqwXBemNC4OEOb6E7uGenV lfWxqly0w+qndc0pn2rysRZtN054Zj6p049Ka1AxPd3+xwXoPLM+JnZeBK/LDjbc/r+8 NyjefxOr6gdql0H4JA6lyPchnwVA98mmYOQgOZ/+EDuRB0WVAzpZedFrrar0NI1um2vV KK5Xf67+7cXLqbm14bqQzrpMd1009PvwzZyoXSLjJkVtxchDeCT26yuRghrc2Y6TaSC3 UUCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eLuX9jytNKsr8SIbflzRQAre1ZIZKEWnNTFuqfXsFEI=; b=KX048RueFBfz65FvridPQKeO9hzEPAcswWRfYdd81nQKAx9Pg6SB9iZlIcvwfnLgmK IxC473m0RxT+F5cN5o8DzJFYPBjDk3nYH7Rx85cukRqaATBQiM66pB16IrjhMfVMmi0E XCByAT0zZNbxt6gb5ynS22ju3ifPfJTg4/zHsMqzmXC/nFepT/nr5wB5ijpGkmjPbsDp 3x6iOcwr3iCA1ZrzFGPDejYZ+zAACn8OUJbxPn37OwvpIVgfnhKv344sw7InJ1231jbW QR94hePEO3HFZflit8RxUiFbOlhv5zsQuqeEqJ8ZLGzPRj1IFI98svV9mvfqgm3mEQ0b FCmQ== X-Gm-Message-State: APjAAAXrOgRb+GxdiPj4AuyQA9hd3lEAwkAeTeI4n9p+SCMANpjwAqBt 7s9dVyZ8eZl5W9efY51VFI/CXg== X-Google-Smtp-Source: APXvYqytsG3InSjhn+VNtmC7YuUtaNEWP+TDm5Bq2tRaQdNqW9TIatCgTCO6xMt4skveAVfnr+hOJA== X-Received: by 2002:a1c:63d7:: with SMTP id x206mr16344738wmb.19.1561384377405; Mon, 24 Jun 2019 06:52:57 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id l8sm25130438wrg.40.2019.06.24.06.52.56 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 24 Jun 2019 06:52:56 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 9A5971FF9C; Mon, 24 Jun 2019 14:43:38 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Mon, 24 Jun 2019 14:43:31 +0100 Message-Id: <20190624134337.10532-14-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190624134337.10532-1-alex.bennee@linaro.org> References: <20190624134337.10532-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::343 Subject: [Qemu-devel] [PULL 13/19] tests/vm: netbsd autoinstall, using serial console X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Kamil Rytarowski , Gerd Hoffmann , Kamil Rytarowski , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Gerd Hoffmann Instead of fetching the prebuilt image from patchew download the install iso and prepare the image locally. Install to disk, using the serial console. Create qemu user, configure ssh login. Install packages needed for qemu builds. Signed-off-by: Gerd Hoffmann Reviewed-by: Kamil Rytarowski Tested-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Message-Id: <20190617043858.8290-10-kraxel@redhat.com> [AJB: added tags] Signed-off-by: Alex Bennée diff --git a/tests/vm/netbsd b/tests/vm/netbsd index ee9eaeab50..be59a2c1da 100755 --- a/tests/vm/netbsd +++ b/tests/vm/netbsd @@ -2,10 +2,11 @@ # # NetBSD VM image # -# Copyright 2017 Red Hat Inc. +# Copyright 2017-2019 Red Hat Inc. # # Authors: # Fam Zheng +# Gerd Hoffmann # # This code is licensed under the GPL version 2 or later. See # the COPYING file in the top-level directory. @@ -13,30 +14,198 @@ import os import sys +import time import subprocess import basevm class NetBSDVM(basevm.BaseVM): name = "netbsd" arch = "x86_64" + + link = "https://cdn.netbsd.org/pub/NetBSD/NetBSD-8.0/images/NetBSD-8.0-amd64.iso" + size = "20G" + pkgs = [ + # tools + "git-base", + "pkgconf", + "xz", + "python37", + + # gnu tools + "bash", + "gmake", + "gsed", + "flex", "bison", + + # libs: crypto + "gnutls", + + # libs: images + "jpeg", + "png", + + # libs: ui + "SDL2", + "gtk3+", + "libxkbcommon", + ] + BUILD_SCRIPT = """ set -e; - rm -rf /var/tmp/qemu-test.* - cd $(mktemp -d /var/tmp/qemu-test.XXXXXX); + rm -rf /home/qemu/qemu-test.* + cd $(mktemp -d /home/qemu/qemu-test.XXXXXX); + mkdir src build; cd src; tar -xf /dev/rld1a; - ./configure --python=python2.7 {configure_opts}; + cd ../build + ../src/configure --python=python3.7 --disable-opengl {configure_opts}; gmake --output-sync -j{jobs} {target} {verbose}; """ + poweroff = "/sbin/poweroff" def build_image(self, img): - cimg = self._download_with_cache("http://download.patchew.org/netbsd-7.1-amd64.img.xz", - sha256sum='b633d565b0eac3d02015cd0c81440bd8a7a8df8512615ac1ee05d318be015732') - img_tmp_xz = img + ".tmp.xz" + cimg = self._download_with_cache(self.link) img_tmp = img + ".tmp" - sys.stderr.write("Extracting the image...\n") - subprocess.check_call(["ln", "-f", cimg, img_tmp_xz]) - subprocess.check_call(["xz", "--keep", "-dvf", img_tmp_xz]) + iso = img + ".install.iso" + + self.print_step("Preparing iso and disk image") + subprocess.check_call(["cp", "-f", cimg, iso]) + subprocess.check_call(["qemu-img", "create", "-f", "qcow2", + img_tmp, self.size]) + + self.print_step("Booting installer") + self.boot(img_tmp, extra_args = [ + "-bios", "pc-bios/bios-256k.bin", + "-machine", "graphics=off", + "-cdrom", iso + ]) + self.console_init() + self.console_wait("Primary Bootstrap") + + # serial console boot menu output doesn't work for some + # reason, so we have to fly blind ... + for char in list("5consdev com0\n"): + time.sleep(0.2) + self.console_send(char) + self.console_wait("") + self.console_wait_send("> ", "boot\n") + + self.console_wait_send("Terminal type", "xterm\n") + self.console_wait_send("a: Installation messages", "a\n") + self.console_wait_send("b: US-English", "b\n") + self.console_wait_send("a: Install NetBSD", "a\n") + self.console_wait("Shall we continue?") + self.console_wait_send("b: Yes", "b\n") + + self.console_wait_send("a: ld0", "a\n") + self.console_wait_send("a: This is the correct", "a\n") + self.console_wait_send("b: Use the entire disk", "b\n") + self.console_wait("NetBSD bootcode") + self.console_wait_send("a: Yes", "a\n") + self.console_wait_send("b: Use existing part", "b\n") + self.console_wait_send("x: Partition sizes ok", "x\n") + self.console_wait_send("for your NetBSD disk", "\n") + self.console_wait("Shall we continue?") + self.console_wait_send("b: Yes", "b\n") + + self.console_wait_send("b: Use serial port com0", "b\n") + self.console_wait_send("f: Set serial baud rate", "f\n") + self.console_wait_send("a: 9600", "a\n") + self.console_wait_send("x: Exit", "x\n") + + self.console_wait_send("a: Full installation", "a\n") + self.console_wait_send("a: CD-ROM", "a\n") + + self.print_step("Installation started now, this will take a while") + self.console_wait_send("Hit enter to continue", "\n") + + self.console_wait_send("d: Change root password", "d\n") + self.console_wait_send("a: Yes", "a\n") + self.console_wait("New password:") + self.console_send("%s\n" % self.ROOT_PASS) + self.console_wait("New password:") + self.console_send("%s\n" % self.ROOT_PASS) + self.console_wait("Retype new password:") + self.console_send("%s\n" % self.ROOT_PASS) + + self.console_wait_send("o: Add a user", "o\n") + self.console_wait("username") + self.console_send("%s\n" % self.GUEST_USER) + self.console_wait("to group wheel") + self.console_wait_send("a: Yes", "a\n") + self.console_wait_send("a: /bin/sh", "a\n") + self.console_wait("New password:") + self.console_send("%s\n" % self.GUEST_PASS) + self.console_wait("New password:") + self.console_send("%s\n" % self.GUEST_PASS) + self.console_wait("Retype new password:") + self.console_send("%s\n" % self.GUEST_PASS) + + self.console_wait_send("a: Configure network", "a\n") + self.console_wait_send("a: vioif0", "a\n") + self.console_wait_send("Network media type", "\n") + self.console_wait("autoconfiguration") + self.console_wait_send("a: Yes", "a\n") + self.console_wait_send("DNS domain", "localnet\n") + self.console_wait("Are they OK?") + self.console_wait_send("a: Yes", "a\n") + self.console_wait("installed in /etc") + self.console_wait_send("a: Yes", "a\n") + + self.console_wait_send("e: Enable install", "e\n") + proxy = os.environ.get("http_proxy") + if not proxy is None: + self.console_wait_send("f: Proxy", "f\n") + self.console_wait("Proxy") + self.console_send("%s\n" % proxy) + self.console_wait_send("x: Install pkgin", "x\n") + self.console_init(1200) + self.console_wait_send("Hit enter to continue", "\n") + self.console_init() + + self.console_wait_send("g: Enable sshd", "g\n") + self.console_wait_send("x: Finished conf", "x\n") + self.console_wait_send("Hit enter to continue", "\n") + + self.print_step("Installation finished, rebooting") + self.console_wait_send("d: Reboot the computer", "d\n") + + # setup qemu user + prompt = "localhost$" + self.console_ssh_init(prompt, self.GUEST_USER, self.GUEST_PASS) + self.console_wait_send(prompt, "exit\n") + + # setup root user + prompt = "localhost#" + self.console_ssh_init(prompt, "root", self.ROOT_PASS) + self.console_sshd_config(prompt) + + # setup virtio-blk #1 (tarfile) + self.console_wait(prompt) + self.console_send("echo 'chmod 666 /dev/rld1a' >> /etc/rc.local\n") + + # turn off mprotect (conflicts with tcg) + self.console_wait(prompt) + self.console_send("echo security.pax.mprotect.enabled=0 >> /etc/sysctl.conf\n") + + self.print_step("Configuration finished, rebooting") + self.console_wait_send(prompt, "reboot\n") + self.console_wait("login:") + self.wait_ssh() + + self.print_step("Installing packages") + self.ssh_root_check("pkgin update\n") + self.ssh_root_check("pkgin -y install %s\n" % " ".join(self.pkgs)) + + # shutdown + self.ssh_root(self.poweroff) + self.console_wait("entering state S5") + self.wait() + + if os.path.exists(img): + os.remove(img) os.rename(img_tmp, img) + os.remove(iso) + self.print_step("All done") if __name__ == "__main__": sys.exit(basevm.main(NetBSDVM)) From patchwork Mon Jun 24 13:43:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1121347 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=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="EIZeQAqt"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45XWRw2qXTz9sPH for ; Tue, 25 Jun 2019 00:11:24 +1000 (AEST) Received: from localhost ([::1]:51516 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPgo-0000yO-BG for incoming@patchwork.ozlabs.org; Mon, 24 Jun 2019 10:11:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41641) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPGO-0006jj-9n for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:44:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfPGG-0007gm-Ul for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:44:00 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:33368) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hfPGG-0007Vf-HK for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:43:56 -0400 Received: by mail-wr1-x42d.google.com with SMTP id n9so14039576wru.0 for ; Mon, 24 Jun 2019 06:43:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UpVvHEnh/SP5d5n5fhpbeMvaoSDIsow/FrkdXyrTnwk=; b=EIZeQAqt7tBcSB5dclnivOuFWbO0Zile5mqNF5EaaDKiHXWNhg9xxNHv8UA9RwKFvH RGeEirFYgLk3LwIAk+Q4VJ3OSHzZtR/ONhVT22t+vuhc+SeL0RlukYpgUD0tjfwpjMpf L3iVKFniS6OqhLlBcuGY3NYJgnJecsh1IsERneg3gXNVEM/kzFDMOPy30tC75eOjw9wa fcpzIfjadFJWeGwVifuIZtFjE28sP+QAEHMhudy8pwCpcXggDnVVMQ2xr9wZVbGMZalP DYuXPIekWWh6+u4GLxnIys+bAlJV3iAYp8hKEmxRo57xWxB3enViwNe1YU1cJtlop+Lk wizg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UpVvHEnh/SP5d5n5fhpbeMvaoSDIsow/FrkdXyrTnwk=; b=haviPSnh8yG+38O2DdjTobrD96GCi+QO+1Dg1iznANGtK1n46Ht5Cw1P5azB4/b9OS TvKk4QkeMrRHo8MWdBSkcikQk5qRHHVI4acNsz7FfGHjGkkCCm0ix5VziiGqscYfwZNZ kJXSvG0W6zvIh/Px+CAryklanpX4ViNA2vVPJG9E6GqxBmBc2BruoNskfWlS1w+tzzp6 lJkHNCaBblPKguKSEojoGO/J+duNNxZBql+lgi1f0J/deZUP2DBh+2He/tv2fEdO7d0Z f3XbK78eOIxmqMohoMp8h8qKxVX22r9BK6KXUEZODlrj12sdUmpQnTpF3/iSE5TzAM2S taJw== X-Gm-Message-State: APjAAAV7P6/f+yL4o67VsoOloe5i8nsvEzvq9ylRt1QDEYKXnqfyZvl+ afaQiVPgHhvwd8p3IF9B57y5yg== X-Google-Smtp-Source: APXvYqymsCt9JE3Z27IUF5o+2JmrFfT1flFJVYxJUlAFvALc1Iw6q///AmATWEZroJ6AJ+YrbSaD2Q== X-Received: by 2002:adf:9bd3:: with SMTP id e19mr32204476wrc.38.1561383828671; Mon, 24 Jun 2019 06:43:48 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id d1sm10270324wru.41.2019.06.24.06.43.41 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 24 Jun 2019 06:43:44 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id B1E221FF9D; Mon, 24 Jun 2019 14:43:38 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Mon, 24 Jun 2019 14:43:32 +0100 Message-Id: <20190624134337.10532-15-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190624134337.10532-1-alex.bennee@linaro.org> References: <20190624134337.10532-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42d Subject: [Qemu-devel] [PULL 14/19] tests/vm: fedora autoinstall, using serial console X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Gerd Hoffmann , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Gerd Hoffmann Download the install iso and prepare the image locally. Install to disk, using the serial console. Create qemu user, configure ssh login. Install packages needed for qemu builds. Yes, we have docker images for fedora. But for trouble-shooting it might be helpful to have a vm too. When vm builds fail you can use it to figure whenever the vm setup or the guest os is the problem. Signed-off-by: Gerd Hoffmann Tested-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Message-Id: <20190617043858.8290-11-kraxel@redhat.com> Signed-off-by: Alex Bennée diff --git a/tests/vm/Makefile.include b/tests/vm/Makefile.include index a61c236b8e..809b80e2e5 100644 --- a/tests/vm/Makefile.include +++ b/tests/vm/Makefile.include @@ -2,7 +2,7 @@ .PHONY: vm-build-all vm-clean-all -IMAGES := ubuntu.i386 freebsd netbsd openbsd centos +IMAGES := ubuntu.i386 freebsd netbsd openbsd centos fedora IMAGES_DIR := $(HOME)/.cache/qemu-vm/images IMAGE_FILES := $(patsubst %, $(IMAGES_DIR)/%.img, $(IMAGES)) @@ -16,6 +16,7 @@ vm-test: @echo " vm-build-netbsd - Build QEMU in NetBSD VM" @echo " vm-build-openbsd - Build QEMU in OpenBSD VM" @echo " vm-build-centos - Build QEMU in CentOS VM, with Docker" + @echo " vm-build-fedora - Build QEMU in Fedora VM" @echo "" @echo " vm-build-all - Build QEMU in all VMs" @echo " vm-clean-all - Clean up VM images" diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index 592a344773..3d717da498 100755 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -206,7 +206,7 @@ class BaseVM(object): # log console line sys.stderr.write("con recv: %s\n" % line) - def console_wait(self, expect): + def console_wait(self, expect, expectalt = None): vm = self._guest output = "" while True: @@ -215,6 +215,8 @@ class BaseVM(object): except socket.timeout: sys.stderr.write("console: *** read timeout ***\n") sys.stderr.write("console: waiting for: '%s'\n" % expect) + if not expectalt is None: + sys.stderr.write("console: waiting for: '%s' (alt)\n" % expectalt) sys.stderr.write("console: line buffer:\n") sys.stderr.write("\n") self.console_log(output.rstrip()) @@ -223,6 +225,8 @@ class BaseVM(object): output += chars.decode("latin1") if expect in output: break + if not expectalt is None and expectalt in output: + break if "\r" in output or "\n" in output: lines = re.split("[\r\n]", output) output = lines.pop() @@ -230,6 +234,9 @@ class BaseVM(object): self.console_log("\n".join(lines)) if self.debug: self.console_log(output) + if not expectalt is None and expectalt in output: + return False + return True def console_send(self, command): vm = self._guest diff --git a/tests/vm/fedora b/tests/vm/fedora new file mode 100755 index 0000000000..e8fa5bf0d2 --- /dev/null +++ b/tests/vm/fedora @@ -0,0 +1,189 @@ +#!/usr/bin/env python +# +# Fedora VM image +# +# Copyright 2019 Red Hat Inc. +# +# Authors: +# Gerd Hoffmann +# +# This code is licensed under the GPL version 2 or later. See +# the COPYING file in the top-level directory. +# + +import os +import re +import sys +import time +import socket +import subprocess +import basevm + +class FedoraVM(basevm.BaseVM): + name = "fedora" + arch = "x86_64" + + base = "http://dl.fedoraproject.org/pub/fedora/linux/releases/30/" + link = base + "Server/x86_64/iso/Fedora-Server-netinst-x86_64-30-1.2.iso" + repo = base + "Server/x86_64/os/" + full = base + "Everything/x86_64/os/" + csum = "5e4eac4566d8c572bfb3bcf54b7d6c82006ec3c6c882a2c9235c6d3494d7b100" + size = "20G" + pkgs = [ + # tools + 'git-core', + 'flex', 'bison', + 'gcc', 'binutils', 'make', + + # perl + 'perl-Test-Harness', + + # libs: usb + '"pkgconfig(libusb-1.0)"', + '"pkgconfig(libusbredirparser-0.5)"', + + # libs: crypto + '"pkgconfig(gnutls)"', + + # libs: ui + '"pkgconfig(sdl2)"', + '"pkgconfig(gtk+-3.0)"', + '"pkgconfig(ncursesw)"', + + # libs: audio + '"pkgconfig(libpulse)"', + '"pkgconfig(alsa)"', + ] + + BUILD_SCRIPT = """ + set -e; + rm -rf /home/qemu/qemu-test.* + cd $(mktemp -d /home/qemu/qemu-test.XXXXXX); + mkdir src build; cd src; + tar -xf /dev/vdb; + cd ../build + ../src/configure --python=python3 {configure_opts}; + gmake --output-sync -j{jobs} {target} {verbose}; + """ + + def build_image(self, img): + self.print_step("Downloading install iso") + cimg = self._download_with_cache(self.link, sha256sum=self.csum) + img_tmp = img + ".tmp" + iso = img + ".install.iso" + + self.print_step("Preparing iso and disk image") + subprocess.check_call(["cp", "-f", cimg, iso]) + subprocess.check_call(["qemu-img", "create", "-f", "qcow2", + img_tmp, self.size]) + + self.print_step("Booting installer") + self.boot(img_tmp, extra_args = [ + "-bios", "pc-bios/bios-256k.bin", + "-machine", "graphics=off", + "-cdrom", iso + ]) + self.console_init(300) + self.console_wait("installation process.") + time.sleep(0.3) + self.console_send("\t") + time.sleep(0.3) + self.console_send(" console=ttyS0") + proxy = os.environ.get("http_proxy") + if not proxy is None: + self.console_send(" proxy=%s" % proxy) + self.console_send(" inst.proxy=%s" % proxy) + self.console_send(" inst.repo=%s" % self.repo) + self.console_send("\n") + + self.console_wait_send("2) Use text mode", "2\n") + + self.console_wait_send("5) [!] Installation Dest", "5\n") + self.console_wait_send("1) [x]", "c\n") + self.console_wait_send("2) [ ] Use All Space", "2\n") + self.console_wait_send("2) [x] Use All Space", "c\n") + self.console_wait_send("1) [ ] Standard Part", "1\n") + self.console_wait_send("1) [x] Standard Part", "c\n") + + self.console_wait_send("7) [!] Root password", "7\n") + self.console_wait("Password:") + self.console_send("%s\n" % self.ROOT_PASS) + self.console_wait("Password (confirm):") + self.console_send("%s\n" % self.ROOT_PASS) + + self.console_wait_send("8) [ ] User creation", "8\n") + self.console_wait_send("1) [ ] Create user", "1\n") + self.console_wait_send("3) User name", "3\n") + self.console_wait_send("ENTER:", "%s\n" % self.GUEST_USER) + self.console_wait_send("4) [ ] Use password", "4\n") + self.console_wait_send("5) Password", "5\n") + self.console_wait("Password:") + self.console_send("%s\n" % self.GUEST_PASS) + self.console_wait("Password (confirm):") + self.console_send("%s\n" % self.GUEST_PASS) + self.console_wait_send("7) Groups", "c\n") + + while True: + good = self.console_wait("3) [x] Installation", + "3) [!] Installation") + self.console_send("r\n") + if good: + break + time.sleep(10) + + while True: + good = self.console_wait("4) [x] Software", + "4) [!] Software") + self.console_send("r\n") + if good: + break + time.sleep(10) + self.console_send("r\n" % self.GUEST_PASS) + + self.console_wait_send("'b' to begin install", "b\n") + + self.print_step("Installation started now, this will take a while") + + self.console_wait_send("Installation complete", "\n") + self.print_step("Installation finished, rebooting") + + # setup qemu user + prompt = " ~]$" + self.console_ssh_init(prompt, self.GUEST_USER, self.GUEST_PASS) + self.console_wait_send(prompt, "exit\n") + + # setup root user + prompt = " ~]#" + self.console_ssh_init(prompt, "root", self.ROOT_PASS) + self.console_sshd_config(prompt) + + # setup virtio-blk #1 (tarfile) + self.console_wait(prompt) + self.console_send("echo 'KERNEL==\"vdb\" MODE=\"666\"' >> %s\n" % + "/etc/udev/rules.d/99-qemu.rules") + + self.print_step("Configuration finished, rebooting") + self.console_wait_send(prompt, "reboot\n") + self.console_wait("login:") + self.wait_ssh() + + self.print_step("Installing packages") + self.ssh_root_check("rm -vf /etc/yum.repos.d/fedora*.repo\n") + self.ssh_root_check("echo '[fedora]' >> /etc/yum.repos.d/qemu.repo\n") + self.ssh_root_check("echo 'baseurl=%s' >> /etc/yum.repos.d/qemu.repo\n" % self.full) + self.ssh_root_check("echo 'gpgcheck=0' >> /etc/yum.repos.d/qemu.repo\n") + self.ssh_root_check("dnf install -y %s\n" % " ".join(self.pkgs)) + + # shutdown + self.ssh_root(self.poweroff) + self.console_wait("sleep state S5") + self.wait() + + if os.path.exists(img): + os.remove(img) + os.rename(img_tmp, img) + os.remove(iso) + self.print_step("All done") + +if __name__ == "__main__": + sys.exit(basevm.main(FedoraVM)) From patchwork Mon Jun 24 13:43:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1121322 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=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="Lbx1R/JX"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45XW4q4vdpz9sBr for ; Mon, 24 Jun 2019 23:54:51 +1000 (AEST) Received: from localhost ([::1]:51360 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPQn-0006NT-Fe for incoming@patchwork.ozlabs.org; Mon, 24 Jun 2019 09:54:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43887) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPP4-00060h-R5 for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:53:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfPP2-0001D9-Pq for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:53:02 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:38466) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hfPP2-0001BS-Ip for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:53:00 -0400 Received: by mail-wr1-x42f.google.com with SMTP id d18so14029032wrs.5 for ; Mon, 24 Jun 2019 06:52:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JwqqKvF7VNQMlcY7yI6rqE4GBREhj+ZNU7fBJq4Qxvs=; b=Lbx1R/JXUSM1xqCRYKx1MCR01V06vnc/y53HX9FR1Kn2iAx5U6+oCAAO5orQLAkWrw 0oVysE0RE2gNIr+EhwmRfSc7c3LQfjxDk1RfReNxUChd+cax1vVD1b67Es2D4EXQ8rDG DoIZ9uRaKMrmDJk2zm0V4q19XXkhgyZwv2TBf4QCoN5AbUPFHa3idjAoiZN3Kpr9+JBq c1xYObhnH0v9KBlF6q7favZGRrHh/8XETfnsME6LJtlCSsIptmR/05Pq4ODSRIIbsIBw pS0Dh0PXbY95tuX/18+wTGcXNJ6xyL7eJcA0d02Y0SL5bEN+Uk/lpJitUyI3h2Bydoqa MsGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JwqqKvF7VNQMlcY7yI6rqE4GBREhj+ZNU7fBJq4Qxvs=; b=No4dbSqYjmj8XNWPE5Ko11LLn8qSn+TtgtSwY04vxxDT6dRkVLE5nThbJE9CG68YZP fZvZCjJ33UROzxNMDyWGQTrJWsNolr5JcKYUOVlDP+UfPgWp9CYSUWdf71rk90g54dV4 zfFVC4bOTrfxYrVEB4miL/CLSrp5+tTREv48YbnKqfKHJtGOJLhGJK7MoHk5V4lcqb46 f06kygQmYv8B+n1cRpyCYRojGI25s9tO+M3oa6WglsvAM9xQWgro1NP5H2kVywBbGxY0 pLaPyxj2yP6AbT9O9pHXyUyHjhaXTauxom8v5NSOCcmm8EV6ClqdJZrkMEAbdEbodVIZ ujsw== X-Gm-Message-State: APjAAAVACL6ONHM3jYl4vwcbhezUpUfaPU3H8SPMkjVoIoEuu+KnyKJm uHcd2w/bH28rfJA4yAWaNL9WnA== X-Google-Smtp-Source: APXvYqyLvl4eBO2vUrtCaSCJlL3SI4O4Nvx5c6arZJZ2kANRGi40Xui2980HzIcM+LitfNDCU9M/2A== X-Received: by 2002:a5d:540e:: with SMTP id g14mr36912099wrv.346.1561384378583; Mon, 24 Jun 2019 06:52:58 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id g131sm8401807wmf.37.2019.06.24.06.52.56 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 24 Jun 2019 06:52:56 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id C5CFD1FF9E; Mon, 24 Jun 2019 14:43:38 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Mon, 24 Jun 2019 14:43:33 +0100 Message-Id: <20190624134337.10532-16-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190624134337.10532-1-alex.bennee@linaro.org> References: <20190624134337.10532-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42f Subject: [Qemu-devel] [PULL 15/19] tests/vm: ubuntu.i386: apt proxy setup X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Gerd Hoffmann Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Gerd Hoffmann Configure apt proxy so package downloads can be cached and can pass firewalls. Signed-off-by: Gerd Hoffmann Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20190617043858.8290-12-kraxel@redhat.com> Signed-off-by: Alex Bennée diff --git a/tests/vm/ubuntu.i386 b/tests/vm/ubuntu.i386 index 3ea459ee20..38f740eabf 100755 --- a/tests/vm/ubuntu.i386 +++ b/tests/vm/ubuntu.i386 @@ -51,6 +51,10 @@ class UbuntuX86VM(basevm.BaseVM): " ssh-authorized-keys:\n", " - %s\n" % basevm.SSH_PUB_KEY, "locale: en_US.UTF-8\n"]) + proxy = os.environ.get("http_proxy") + if not proxy is None: + udata.writelines(["apt:\n", + " proxy: %s" % proxy]) udata.close() subprocess.check_call(["genisoimage", "-output", "cloud-init.iso", "-volid", "cidata", "-joliet", "-rock", From patchwork Mon Jun 24 13:43:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1121346 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=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="PBe2eunJ"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45XWPH2kzvz9s3l for ; Tue, 25 Jun 2019 00:09:07 +1000 (AEST) Received: from localhost ([::1]:51486 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPeb-00066n-EC for incoming@patchwork.ozlabs.org; Mon, 24 Jun 2019 10:09:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43884) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPP4-00060e-Qw for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:53:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfPP2-0001Cv-OV for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:53:02 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:44304) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hfPP2-0001Ae-HD for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:53:00 -0400 Received: by mail-wr1-x42f.google.com with SMTP id r16so13983376wrl.11 for ; Mon, 24 Jun 2019 06:52:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AuGWXO++XORyc/3VqRL/LyTlB90VYc261lGuzU8sLu8=; b=PBe2eunJi1FJ7i0Y3uk6JPnhhjoft5fr/USyTKYtpBJ7arsQ2vUwRr233li5+QaefU lIp7RUsyUwkas8qwVixCbZJ/D7SkxihTOWGx24q5EU+2q4Iis+ts6YB6NpuL6CvWyNdr hF7iSzXLaDlC3+GpLPzyYYEffBFq/M9JzL6FMWMXDOMcWIK2h5NJkRKWC32+m1+w5p/E oyvf/uk0JX2lo2AiWvSNignxdfRiyP9oxOhtsQ4zN5LoxvXvdtTEGGa6KM9KeKiNI4bk V68+fl13zcXgbRoG2LPTaIgo/0kXPEuNITLkpswCKX8zj2KQWDy/WpXA9JmUYcYGTzaN Gb8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AuGWXO++XORyc/3VqRL/LyTlB90VYc261lGuzU8sLu8=; b=QNVNfV0KxfLeDAdaYK3WD+7o7xEeUUBENzzyWOVJmTNuHqrOK4wxVtqAF/qMXQx1er gM2qfttfKIwPBicVwLUwOSQyTX2DqgljFqVZOd3duy6GFeWUhUITLsV4BT2MuUkAZm7e sP88XGNG5ApsBwd/oROAGRpDb/ZRT9YkTImfTu6Nuc4LwjecWGBnNPa+cJQ0TFPhyPCk nCgMt7hPOmtJ2mvNIxcAzSzIj2ziVip5cznn1NWk2uFI5wMzyElqAk69QIS0CJBrThhQ fx8d6N6kml7LuBen7+kP8Xq9FRsTLg98quRqDPbCbDOS5WoJxv6zgixNk6p1W7wrDppq PIPQ== X-Gm-Message-State: APjAAAV11cIrltQkHmEYG/aSVaYtwKKsXzph1Z+VxEoXWfu4AMS1UnCn TUKbdpdwTPsneZUs8lkl+djurg== X-Google-Smtp-Source: APXvYqytidLDUCp91smjbqj4P76G8ebSTLjXBUpO2cMC/5wzjf8Cd9hYI1UESEUZueaewBK6IhFtZA== X-Received: by 2002:adf:f7c8:: with SMTP id a8mr43492077wrq.246.1561384377841; Mon, 24 Jun 2019 06:52:57 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id h84sm10583658wmf.43.2019.06.24.06.52.56 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 24 Jun 2019 06:52:56 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D95C31FF9F; Mon, 24 Jun 2019 14:43:38 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Mon, 24 Jun 2019 14:43:34 +0100 Message-Id: <20190624134337.10532-17-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190624134337.10532-1-alex.bennee@linaro.org> References: <20190624134337.10532-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42f Subject: [Qemu-devel] [PULL 16/19] .travis.yml: default the --disable-system build to --static X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" It's fairly common to build qemu-user binaries with --static linking so the binary can be copied around without libraries. Enable --static in the default qemu-user build to cover this. There are other qemu-user builds that use dynamic linking so they should catch any problems there. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé diff --git a/.travis.yml b/.travis.yml index aeb9b211cd..9750dc905c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -80,7 +80,7 @@ script: matrix: include: - env: - - CONFIG="--disable-system" + - CONFIG="--disable-system --static" # we split the system builds as it takes a while to build them all From patchwork Mon Jun 24 13:43:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1121344 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=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="ZJaBFGNn"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45XWHM4T5Cz9s3l for ; Tue, 25 Jun 2019 00:03:59 +1000 (AEST) Received: from localhost ([::1]:51434 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPZd-0007wl-MI for incoming@patchwork.ozlabs.org; Mon, 24 Jun 2019 10:03:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41606) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPGJ-0006jQ-Ti for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:44:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfPGG-0007gw-VC for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:43:59 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]:50525) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hfPGG-0007WK-L5 for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:43:56 -0400 Received: by mail-wm1-x32b.google.com with SMTP id c66so12881340wmf.0 for ; Mon, 24 Jun 2019 06:43:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KxVNBoteG2ZKNWG79/wL8DSFUaTRSU+Jwkvg0mrRqy0=; b=ZJaBFGNnbPwK7O1wxovlElcbI5VeMEZq8hWNjdV3ZYNCu5j3cc9x0BnL7bsNi7b6gq Vfe+aWAbLYKSVPhO6sRGn9u+6RtJu4CJgXg6x5HLspWmKtKhqtOaDKyf/CNOepxGlmOl EssENbXG5zEDXffoz1NEkl2/aFgn4K1fOfcxtzkivlwf8VZx4cufjTqosYKbd/z4rPO+ jWC7owKfFpPW8avzRyk2V1wnBr0KLRSaQDuCDSoYL+e8rDe9UpLqaiemYfOQTnv3nrLh YKINfixWGmPclt6YGf8BhdVjfhaot4F8hMoGTMIvVwEwLcTzqaV7VxctzuaX7LeCMKFM 8/6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KxVNBoteG2ZKNWG79/wL8DSFUaTRSU+Jwkvg0mrRqy0=; b=srOuXYvmVE/A8z0YnVJ/j2VDShYYDPRfIXZS0v4CVk+ELKQQj+Api6F+F5jjKjYYRV bcWE1e4aGwB/7C0OJlsuIxXIkH0+jrqJVwGH6k3vhRmia3bR1029mj59z2QDiw7+5mJa JVlj7WbxJ8VSv5L6HDk93H6wPa0O2oa+KjtLirS5Il/p8r2D6Jcrrjpdyay53EomxyAb H91FPuE46tkw3Cwq/xj7IQRWI4QGaomhrhIQwsXqcYFkR48bVFQG8IdVwBd1Ok4YCBlb Px1owdXXz6qH9kw3upIP8FJvMSprwDVWvfgjin8cS+uOYbrfanivjtfKMoxtyyjY7W3t qKGQ== X-Gm-Message-State: APjAAAUJQiDb5pklotL0aJx8nd2dBHikQDPuMRLZvjNjRovpaN5MDGdE zFHDMozCG0q9pgOrNXVjONLfC0zSEfA= X-Google-Smtp-Source: APXvYqz8Qew/loJl4dWPd/44D9wwJDwh8G6KATvE9MuOWO329Px1Rq+QcdpDHagkKYD1YExKyJZ8Fw== X-Received: by 2002:a7b:c148:: with SMTP id z8mr10195590wmi.142.1561383829425; Mon, 24 Jun 2019 06:43:49 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id a7sm11151625wrs.94.2019.06.24.06.43.42 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 24 Jun 2019 06:43:48 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id ECD8A1FFA3; Mon, 24 Jun 2019 14:43:38 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Mon, 24 Jun 2019 14:43:35 +0100 Message-Id: <20190624134337.10532-18-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190624134337.10532-1-alex.bennee@linaro.org> References: <20190624134337.10532-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32b Subject: [Qemu-devel] [PULL 17/19] .travis.yml: force a brew update for MacOS builds X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" It looks like the Travis image package databases are out of date causing the build to error with: Error: Your Homebrew is outdated. Please run `brew update`. Error: Kernel.exit Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé diff --git a/.travis.yml b/.travis.yml index 9750dc905c..a891ce2485 100644 --- a/.travis.yml +++ b/.travis.yml @@ -43,6 +43,7 @@ addons: - glib - pixman - gnu-sed + update: true # The channel name "irc.oftc.net#qemu" is encrypted against qemu/qemu From patchwork Mon Jun 24 13:43:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1121339 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=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="rB/3XN8x"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45XWBm4jNcz9s9y for ; Mon, 24 Jun 2019 23:59:56 +1000 (AEST) Received: from localhost ([::1]:51404 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPVh-0004Lk-Oq for incoming@patchwork.ozlabs.org; Mon, 24 Jun 2019 09:59:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41589) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPGJ-0006jD-9s for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:44:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfPGG-0007gE-PC for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:43:58 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:50526) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hfPGG-0007XQ-BX for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:43:56 -0400 Received: by mail-wm1-x32c.google.com with SMTP id c66so12881370wmf.0 for ; Mon, 24 Jun 2019 06:43:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Q/rV4H+M74u+dhawBtWuITzFuv6kQ3ZswIz8UU+IjNo=; b=rB/3XN8xaJn+TXtKR1EHfDwWUioqbmCwAUR0RL/KXdhBbMVOlVpHNdSlvqLDXn0YZV 67or258xLFQCKwIqIOvKunmwvdfFvo3hxooMIIO7DNjNKbSm5x1x0Z/1DMfUO/eLcA/j QYfu2bJdKufBfgj/+2/IHZEu0lvk9qqh48T2faX/vjG9yu/qeUV2HVFkj/3XTxCFtSta jKdz6MZpnNXIgkO/sA8kenxkZiFebzRKaLHQlXvY66xOOETldTNoD9juafhtZ7cbvlGk 0kxVLkanNCEL7VhKgMZ18wUlerQOWsXFeQ3VpF1Upr2YJYQZ1bGKPf3TKPkFpu10qode rMrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Q/rV4H+M74u+dhawBtWuITzFuv6kQ3ZswIz8UU+IjNo=; b=GEC641m3dgN0jlOdlijPFZimjK2ApFdef0PGsbPo1GsgULs00qzbv7zcPv+V7fCr+b lO4PoT8iO63IFEcy1iGQhZGucl8GqSu7gXKojN772Sl3JlgGxYhl5OtxvAnD6aK3Vp9R RCiWaI3EdQOrgC/HXsxjzCFDp6VBUD8eBix3M6VXidiNS4lcCT/SPzv9h8M9qETCqcxB wyTAtPtMJvR/J46lFft2rgMht667hQbsXBTbdG/mV+8DgJOGGwqZ5Wyd+RgjGlJ+kpYu lG8VWkobdFlcFwHiCmEzTX2gYdqnrfB3nqNxCTNRWv6w31Wr7HB9VQnn9fPMimO0ng3n ucdQ== X-Gm-Message-State: APjAAAXUqk4BPcTmPYmIrZW4CfdzEkbcsVWhxT4avuxr8PZrLlH8Xl0J 7N7vhIrPP8ZCEHnLEkTW/fUkvQ== X-Google-Smtp-Source: APXvYqxnuPpZWp9uwZ8TmRB9HCO4GS9BbWc7m64+nZc1wVERVsBWUam2gl6cRG1MlugvJblcSKrT3Q== X-Received: by 2002:a05:600c:2549:: with SMTP id e9mr16443672wma.46.1561383830031; Mon, 24 Jun 2019 06:43:50 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id e7sm8165642wmd.0.2019.06.24.06.43.42 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 24 Jun 2019 06:43:48 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 108131FF8C; Mon, 24 Jun 2019 14:43:39 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Mon, 24 Jun 2019 14:43:36 +0100 Message-Id: <20190624134337.10532-19-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190624134337.10532-1-alex.bennee@linaro.org> References: <20190624134337.10532-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32c Subject: [Qemu-devel] [PULL 18/19] Makefile: Rename the 'vm-test' target as 'vm-help' X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Stefano Garzarella Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé We already have 'make check-help', use the 'make vm-help' form to display helps about VM testing. Keep the old target to not bother old customs. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Stefano Garzarella Message-Id: <20190531064341.29730-1-philmd@redhat.com> Signed-off-by: Alex Bennée diff --git a/Makefile b/Makefile index cfb18f1525..bdeb259dfa 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ SRC_PATH=. UNCHECKED_GOALS := %clean TAGS cscope ctags dist \ html info pdf txt \ help check-help print-% \ - docker docker-% vm-test vm-build-% + docker docker-% vm-help vm-test vm-build-% print-%: @echo '$*=$($*)' @@ -1148,7 +1148,7 @@ endif @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 ' vm-help - Help about targets running tests inside VM' @echo '' @echo 'Documentation targets:' @echo ' html info pdf txt' diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst index da2d0fc964..68aba3926e 100644 --- a/docs/devel/testing.rst +++ b/docs/devel/testing.rst @@ -399,12 +399,12 @@ VM testing This test suite contains scripts that bootstrap various guest images that have necessary packages to build QEMU. The basic usage is documented in ``Makefile`` -help which is displayed with ``make vm-test``. +help which is displayed with ``make vm-help``. Quickstart ---------- -Run ``make vm-test`` to list available make targets. Invoke a specific make +Run ``make vm-help`` to list available make targets. Invoke a specific make command to run build test in an image. For example, ``make vm-build-freebsd`` will build the source tree in the FreeBSD image. The command can be executed from either the source tree or the build dir; if the former, ``./configure`` is diff --git a/tests/vm/Makefile.include b/tests/vm/Makefile.include index 809b80e2e5..3560716092 100644 --- a/tests/vm/Makefile.include +++ b/tests/vm/Makefile.include @@ -8,8 +8,9 @@ IMAGE_FILES := $(patsubst %, $(IMAGES_DIR)/%.img, $(IMAGES)) .PRECIOUS: $(IMAGE_FILES) -vm-test: - @echo "vm-test: Test QEMU in preconfigured virtual machines" +# 'vm-help' target was historically named 'vm-test' +vm-help vm-test: + @echo "vm-help: 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" From patchwork Mon Jun 24 13:43:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1121333 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=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="F4t46+YJ"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45XW823x3mz9s6w for ; Mon, 24 Jun 2019 23:57:38 +1000 (AEST) Received: from localhost ([::1]:51380 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPTU-0001Vq-KC for incoming@patchwork.ozlabs.org; Mon, 24 Jun 2019 09:57:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41595) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPGJ-0006jF-EU for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:44:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfPGG-0007ga-Sw for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:43:58 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]:37790) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hfPGG-0007Z0-JM for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:43:56 -0400 Received: by mail-wm1-x329.google.com with SMTP id f17so13456169wme.2 for ; Mon, 24 Jun 2019 06:43:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=sgFHUBki7irv0ZpoKsilsQQcYReZg1Ztcy4s6VB+Mlo=; b=F4t46+YJFn9aDyEA2g2iYs48FjwPQs9jrzySLiJj4eJSOMfBkPgIRZcHd4TRC/l4un wj5mHt3OQe+b3rjnmp7pQ/9nf4C2EQklCyD1l9qmEvr5cUGXZAcXELW+wshJcO4HNWZB /tN/zWD5hJpjbZaaG1WX1/9c7RMZeNXqiYg8V7u8J6PmsFI8D/lo2uJD/nihzvpYLcPo JgbY1eULIwzYwSjrfFF5KWzHGsk+Ydvry1cQBNpcmVk/ic/fCv4DdlcepXITjDCufUU5 8dY90pmjW3Uab5/coteRczgAWfmQtnpjEoI/lPqsMd/1O8tonx/+/D5DMt2WyUinaIVL Ecxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=sgFHUBki7irv0ZpoKsilsQQcYReZg1Ztcy4s6VB+Mlo=; b=UnsTV9/kgwEDMAb7a9MbmVt0HNYR3hBErPSTyvdwvS1xpWh4J5mgg1diOoPAW+7Zit jm73y21N1Nf+WUNtvAWuTuI7YHRv7VvKHlPkdeO0SBwXEmSTXScvYF8Vg23xR1TZdkPx h/FKHQ9pe0M7WR6w+WRVFPHMNf0RYXawPiujwGnX+d/XoDIChs5q41tm7iE5Hn4lpw2c 9fNlgZ7/JMde5Y8Ll2TjBi9jLErZ9NieAU3Ql2SPxypriNHShlNT378BAdxtdmaL8Tm/ 4NjpLfxszZDljyR9s1HYlteH8YX4rrFtsyJ/Vx4eIWRRiFMkJuotsuzknTzri1STTR9v +Amw== X-Gm-Message-State: APjAAAW7t5rYhL/OzaqGppMqZPDjBcQ8eCCxfyjNEPT+k/A4zcLjz3xo F82Q+r2VN/hbJfGx5zVlRfsIpA== X-Google-Smtp-Source: APXvYqy2xCNc2j5W5ggwl8XgFQ2YqwEMyEx4PbJ6/kw3OimNvKs2+KR2iTebb7G9wipdFMNnrXwjZg== X-Received: by 2002:a05:600c:2549:: with SMTP id e9mr16443711wma.46.1561383830792; Mon, 24 Jun 2019 06:43:50 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id r2sm16154485wma.26.2019.06.24.06.43.42 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 24 Jun 2019 06:43:48 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 252001FFA5; Mon, 24 Jun 2019 14:43:39 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Mon, 24 Jun 2019 14:43:37 +0100 Message-Id: <20190624134337.10532-20-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190624134337.10532-1-alex.bennee@linaro.org> References: <20190624134337.10532-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::329 Subject: [Qemu-devel] [PULL 19/19] target/i386: fix feature check in hyperv-stub.c X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , qemu-devel@nongnu.org, Roman Kagan , Paolo Bonzini , Vitaly Kuznetsov , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Commit 2d384d7c8 broken the build when built with: configure --without-default-devices --disable-user The reason was the conversion of cpu->hyperv_synic to cpu->hyperv_synic_kvm_only although the rest of the patch introduces a feature checking mechanism. So I've fixed the KVM_EXIT_HYPERV_SYNIC in hyperv-stub to do the same feature check as in the real hyperv.c Signed-off-by: Alex Bennée Reviewed-by: Vitaly Kuznetsov Acked-by: Paolo Bonzini Cc: Roman Kagan diff --git a/target/i386/hyperv-stub.c b/target/i386/hyperv-stub.c index fe548cbae2..0028527e79 100644 --- a/target/i386/hyperv-stub.c +++ b/target/i386/hyperv-stub.c @@ -15,7 +15,7 @@ int kvm_hv_handle_exit(X86CPU *cpu, struct kvm_hyperv_exit *exit) { switch (exit->type) { case KVM_EXIT_HYPERV_SYNIC: - if (!cpu->hyperv_synic) { + if (!hyperv_feat_enabled(cpu, HYPERV_FEAT_SYNIC)) { return -1; }