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: 167578 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp4257885ilk; Mon, 24 Jun 2019 06:51:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqys29a/Y95hVcTGQCzkloefhzuJ1oHA5NJW2sGqHqkDtWCiKNY5cJUdhrwjatbxaSTB4AQN X-Received: by 2002:a17:906:3953:: with SMTP id g19mr13334559eje.242.1561384280678; Mon, 24 Jun 2019 06:51:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561384280; cv=none; d=google.com; s=arc-20160816; b=ZkpLzNizpyEDibz4WxBiJBVDFXfagEn0S/plVGipaJ5PcV5IlDBYAD6a225pTHCIKW rbrKvt/CiiL5Vu54V9W0oXSz5vDxOxMtj+zEGddhGXrd4WQfMpH2n/Db0n7oD7e4LAhi 4WtIwhCQNDMm6AVo4ZiqyOCHg8EEhonV71Qtrm13x8SQHB7/75fXHuEwUcEBWZKzDNWk AT02rUbD1BXAUARCrJml+6TAm4GOEEsWkJcOJwR4OigbjirUxXqr0OSF8e3Wx85XVX6g llguIQL+f2+d5DqSdzBOyUDb3Ee8Ttcxh/xS4e78hqW7rsyZsdaVyMQboCc4OTjIFlkx uR+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=kG7TibQlzrXHGeVA/kaiY4pLQv/EwI9FVJyG9q9KK+o=; b=LTNUFAtQIvGDHXrJNFWnj1X6Kwv5XbplFIdfaPlAbnxyMxCdFVyH0XA70ycdiv8O6u Ft3UCoeiIQBisCyi8G9jyC6HAq6osVf853ibAcsJT238CTJ80yduauCiC5NvTuQdGMb2 fpvgq6t2Ir32M46RgiVzCY1wXdJrlh1QzDkazcpzHscfWQCNaWlWCSh+soWZX0BEgqfe Td5r+l+yXBPb6Adv5z3YRQwHlsgAbXOVz64kQg8KAN/pgE9zQc4UMaWecOCl0+enQNBn gKQApGNTzZ+vG2w0mtZmXHbzm0lbCj/bhWTPRC88VuQeF+uBw8LhhwU8UQHcqRSmgUQv r9lA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=kanAamLU; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id q13si6641915ejr.163.2019.06.24.06.51.20 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Jun 2019 06:51:20 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=kanAamLU; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:51331 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPNP-0002UJ-Kk for patch@linaro.org; Mon, 24 Jun 2019 09:51:19 -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-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+patch=linaro.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 -- 2.20.1 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: 167592 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp4281557ilk; Mon, 24 Jun 2019 07:10:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqw9qwS75EOohGdgsYHtdVfoirjsc1zONuY/vjDbhfIrbrBc8ur/elmb/MjZQoHZNGdBgafP X-Received: by 2002:a50:d791:: with SMTP id w17mr69315420edi.223.1561385442785; Mon, 24 Jun 2019 07:10:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561385442; cv=none; d=google.com; s=arc-20160816; b=tnLYKBUq487tLqtttnicgZlXWDuPCICHJfR5Hgqz/XY5GGGEsnOKubqsoLzXuTNLm9 RTW1UOI4j9YbTbqqjxxeX09/5uoWztiVybR2fsZcFGiA4uVvw/cMlJ5YEYqVKuSewv+Z /YUy0JvzYK0r56CQZ4FPaqa+NSvCssrMLgKqo5M8xB7IcBFSWb2TQAohqij+O/umQXt7 mbMgfMaiT1IYVO22UtXuchlxk/RpctzFdSrDTM+WzkbHof2AuKYP3wqYmI1XvKoBdTsX RsEWxeXrvDV7kJuvJ/c1FMeKp3bINvOv5MSko+bo6kzDbIAcy1WEJTedLFf8SPMfvXzB bGfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=IGs3kzw+BI2fE8Ae88LzkdFhpv0ghN5hux8Z4DaX/+I=; b=UJM+bja/v/XDqp6L6SXPGxGSMG2hb8r22UPtY1J1qdRGy8SjdyMIsMaGLLDVf8O3/t 4mQHDBfeB/i2Ec+Z6SHYEt7ynHDb3EkX9MJTkVDR3bPe/2g0QfAr9rUPzdy+BBr3OXFS 1TLQFmnx0IOJ5JLVi9ahsQ5XmcJ3PCeMnEFilNZh8kRyFBYoDdzIrZuSxJfrlChQ9Wo/ juK9c48ZXUvF7Vf44l73RwRReziEfSLR+FzkRTIJujDpN5M9OiYGSlUSWC1JJLkqPuLS IfBp78FidAU4uSWOPeNDiaPaTZXP75O5etEDQnfC3nPp4mCMCppsCOlXkWVHJr2Dddxe /jOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=t9I3fhZd; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id z5si6759232ejb.106.2019.06.24.07.10.42 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Jun 2019 07:10:42 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=t9I3fhZd; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:51512 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPg9-0000je-4W for patch@linaro.org; Mon, 24 Jun 2019 10:10:41 -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-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+patch=linaro.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 -- 2.20.1 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: 167582 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp4260158ilk; Mon, 24 Jun 2019 06:53:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqxlOdoNRyVNSfWZQFbns39icBdoLRYSZgi/yHRuIWB60f2yGX91Ql2Zh0T7CGC/E4ZrzenT X-Received: by 2002:a50:e612:: with SMTP id y18mr162471862edm.143.1561384427326; Mon, 24 Jun 2019 06:53:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561384427; cv=none; d=google.com; s=arc-20160816; b=FodR2g6A/pi5bkOcJppve910WIqaodLG7aABekZrKww45n2lt8nDZJRtXrXEPvEQEA xio80OxrmwPFvqj2/6IhgVx0Tf5oLBZSj08UoBYBi2YK9owx+qv8YoIKseEyDTc7Ktwr r1oR36gjfHHnbUQrko6LnHZI8CQeRZX0MORjxourNtnpyKBX+oFsrJwM9lgzswDioxBM iEZPsgCpTljwcWb9Yh/FZu1++a5OLPY3KYcdWXesJ9y207J1SUtsWNQFc9Gjfb7BG4+b I3Gk5PTTBrR9U4e+xScSRdVyHd5ejcLSNFI0MetayCUlZnpQOqo/DC3UPIuNU5QWGkJb Kipg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=xtIRwzundNicszHIR+Xc5ItZ9WkO8ULjpABGU4hH988=; b=ZHnkYX3/3wR9abQX7q6CKuHKZVymvj8NjkCif7uzmoRoriM3kZguDPdDaXeF1nU/8Q 2d4jx767rAeq6ahQzDx9bYs7Gpw5lQg38HRkSy0vg3/oiv2lzY5wp3QCGOuzT470s2oJ OghOzjCG4nRl7FTQb3AS1o5kl9WQ3MoQWk4BXlClppMKILwMuCDXu/g4aUdosq63DC0k EE5MCoAWrpVOOLqztwdm0VUHnXZ+GeDssDSswYXkBcMnUE5Bb47oSC7QQ4Sin+WGlcBM UTsryx45bWV/QYo3pN4JgG5nelkR9ZW8HOEiu6FJ+Y3BHN3+WmvYD5ewqLa7iCn9zGLg XPqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=KqgCuy9d; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id e24si9118272ede.59.2019.06.24.06.53.47 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Jun 2019 06:53:47 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=KqgCuy9d; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:51354 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPPm-0006Iv-AX for patch@linaro.org; Mon, 24 Jun 2019 09:53: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-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+patch=linaro.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 -- 2.20.1 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: 167575 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp4256805ilk; Mon, 24 Jun 2019 06:50:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqxIDUE0xJC9uBzsvUJ8lLVLtaJs3Wg/PhRmeYx8Edv6/CvZw1UJN1adGMeSMtvblhnZUr+T X-Received: by 2002:aa7:ccd6:: with SMTP id y22mr98055976edt.274.1561384218008; Mon, 24 Jun 2019 06:50:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561384218; cv=none; d=google.com; s=arc-20160816; b=u7AqBBKW1bATXSMCeTP+E+pLqgcL7tYQNVIcsukaFZIaBIaxgvw1T8RJPjfJShoMUc iCEn9qZclo8aZVMhI+VqlQ4yAEno/evnoRa7mTXvHpwuac14z6ytXQbsJ9u2KHe1ulN5 3y2PXtPxjcQkYRGESSWtDNqPH7STGBWW4v33VPIq/eHDqj/cTiwfUp2T+tBhjArg3NGh 8OmuRqqzHyOlSeyQNqOPsLpm8rZ61IA5VgADmu8hmXFUwlCbska0vYvGg5YUn9ClcnpR RShdnbAyf8lphegHhxAAKM9bHJjA4p0c7WXJxFHyr/JA45nEpOx/n4ptg0FvliZ/hh4q SQcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=g1Gikb/q4aJ790nsrLBBZxeFgZO8Vqq/Oo0RByk4pDk=; b=L9J0LEGLxkGuQsa/zMdDMmsIjw5KIPQc2Hyq24HphfdJtEx4EpdR7oSWbK0mgxHyTA Rm7hcAF7GqhEUhwUUgUZFlx0zTKW3hlgXkIW1S1PtBWe3YrTFs+eAtnWsiCBBYFLB4Iu aZC7l6forn4i1CflpuaX6B82xB51LQfY/qM6x9j42ZmCTeMkRLIIWRdXhm4HtrF32EfS GkEQXyXipu7eww8JDLI+XKzlm4nKU/qqtr47IiYW3uzXres0JFfYEJvnrq7YJoDWUhB/ ce25qEm6YkIRX/9O6Eppb7QJ6iuMWIH4YY2gk3lUP1+8f3smM9f089+lg/1DME/0zCqx Nx3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=DrcGtnpF; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b22si7180887ejk.371.2019.06.24.06.50.17 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Jun 2019 06:50:17 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=DrcGtnpF; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:51326 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPMO-0002KC-Vg for patch@linaro.org; Mon, 24 Jun 2019 09:50:16 -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-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+patch=linaro.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 -- 2.20.1 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: 167577 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp4257838ilk; Mon, 24 Jun 2019 06:51:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqydDCXTjCA8gU7T5bvPSqJUc6Y4AeudG5Jsp/pxEX1hnhPj0cRmkYcEEf/OWfeaqqZejOMA X-Received: by 2002:a17:906:4bcb:: with SMTP id x11mr5060076ejv.1.1561384277419; Mon, 24 Jun 2019 06:51:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561384277; cv=none; d=google.com; s=arc-20160816; b=w3Vw8dhQdATcBifbGZoUv/j86VJtrd2cqRlTt23beBRKGx9Gv9lDHqu7egogxiUSZj zy7zh1r+T4JRglchgU8qrP5vyPSx1uAWN+WyT8riJ2a+M6ROt02HR5pqqFtLLUepCz5C bcmS60m/uD0OP5jO19Q/C7TrubdYpms2m2YsMUAPIrvoawocIyAqmsQnmEzI3h5ZF0p1 ClzrgHQIU8h0MQQ/y3RvCzDSDYWOglDVzOAqGGPKT6nB54CUqKvZG1ZrkWhqbub1tUCn jpdTMsDWSPR4SPY35wYeJtnmGtjiaZSFp33FQTYvLUMzxvmCzcgUAooRPu/wxh0JUX0Y VPag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=UmlC5jhm/yiDMB/28jG9Y1RW/s/4aA4e4sfjTnMWwG4=; b=si9IXc6SslquVhSQEDpHR8juaFoPrMDgXfPhgp+F3Y+KFLAmw0XyQclt+cXBOajOhO C0xrwAT8ptj+7OHoR/PC1swKSIAh/Bjryns5uqg/x8tiFKyzih3kJyeWF3mC/DGIrN2d q6bCdYOVbg2Jp+c15aLbMHVbwBaQwC9ro8jT/vN8g18JUfEjJhe8fim+z1ADSe995t/t 9t+9FKV/14Z/zVjWcHw9VyGeaDlT1Zz8VQ8oW/xJFC9gmPVMdqDIjlHTnPk0svqWzKb9 h5hQj1sS5bFZJSusNm8ezVmaOfUVLGCvxAc4PCpdMT6ziqCnq++0NDumwBkgn2JS78vE EfFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=obrIbgPG; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id t16si9326309eda.244.2019.06.24.06.51.17 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Jun 2019 06:51:17 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=obrIbgPG; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:51325 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPNM-0002HF-BX for patch@linaro.org; Mon, 24 Jun 2019 09:51:16 -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-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+patch=linaro.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 -- 2.20.1 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:24 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: 167574 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp4250682ilk; Mon, 24 Jun 2019 06:44:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqyJyhYcl2/ZuPDP8CxHz4qn1CYER3MPVzJS8blexfMIPIVQFRZI1S+omgB4h/2+DYouwKgK X-Received: by 2002:a50:ba28:: with SMTP id g37mr143088226edc.109.1561383869653; Mon, 24 Jun 2019 06:44:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561383869; cv=none; d=google.com; s=arc-20160816; b=OD31dRoUFGHggP19JDqrBAErfQzdNcJpjzhKXxwGqfaihqqntpo1xsmw/4GGyssoL+ meVayMIlrZyHPwUdOMBoILAo7hATSkUtoSA8OXA1jvBnV1ic1p1jN4M20MHrrg9cMUoU mpgtu2Y2TdBgj7tG2PFzErut7XYCx8PItJn2cPSNBt273j3H/wBB1dw8MCJuqU1aQT23 iR45+IcUpDTPRtoiHrQSDaZSku2hhQKAfcSvna2FAYDscYGtdTnCa3z4h3S3agRiM6fD vB7ScLBRJ5nhaFd+555p3NmGYnEyNo+Zf7wrLKXoM7UtTXqlGDnITr7mL9YkRAvDwwiJ KcEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=INLzBrnOdVpVaX735jR9Ql7IOiOc8rJWuc+qFiZ4wMM=; b=UPghOxs1LUAq40qgboIu8aqR3Y/VfSS3RM2l/myeKgKWGzladCtTF7XvMABT/5o+si nPAnw25TtTdce+ijVN8Ab8ZnNSgTW0vSWxHyms1iUVZqB6jL8cQNOdxDcR5XeoxSSGKj lttxsiWFWIiPmV1t7yu+AKitekJa4iJussRjzhnwvSRF/mCHSarMiDB7//AWhIxjIQgZ 8o+2ySWqgVAkdB15vI36STp4AF+3pSDRqSn4RYmhvt8idGxTFAJOhgWtkEeif+uPbBy8 d3qqqTmKORsAfHha99bAY3RQJjE1FHG0DMooUG7f6+HHM+kwORrozFAXTlk1aXlKU2ct tOXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=w+gFRtDH; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id q16si6696218ejm.323.2019.06.24.06.44.29 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Jun 2019 06:44:29 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=w+gFRtDH; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:51298 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPGm-0006gI-K0 for patch@linaro.org; Mon, 24 Jun 2019 09:44:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41434) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPGC-0006ac-Ij for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:43:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfPGA-0007XZ-JK for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:43:52 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]:38427) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hfPG6-0007NP-OB for qemu-devel@nongnu.org; Mon, 24 Jun 2019 09:43:48 -0400 Received: by mail-wm1-x332.google.com with SMTP id s15so13429318wmj.3 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=INLzBrnOdVpVaX735jR9Ql7IOiOc8rJWuc+qFiZ4wMM=; b=w+gFRtDHcBs4MeHAgFdm7/Q0W6J8DVe7h0IihpVSwDry2bm0ZDph9Mwr/57vjLqinJ 79gqC8ZVTWXl/y+N6bPt29fwP8uEfU8jVeaaPqxQCA5oCxsRFRfCFFieZZ4Yqv7jZp4B tj8mA3BrjR9dVY7S6vssL3CxTzL8Gjc5pOvvmwkb0rgXjLw86+CT0GH/qg1RE102xp+m HIMoPlQmtgWJK2uiVu5Yhser7X4b8/yiWDeoOoeyA3H00vqg7U0fS6kBFeXFHCIE017d +G5xqP9HvjBJFyCUuUbnn1QhzwtorKfz3++GhRv1gImjRqwccC6m6QQSwhdid9zIEYyL hCTw== 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=INLzBrnOdVpVaX735jR9Ql7IOiOc8rJWuc+qFiZ4wMM=; b=TV0T3Mm7VI0Uweg2Z6ygZh033BPy2roBE3NsdrvdF28Ea09Cfe9sePfwvY1iHBSFdo x/5YNysu0TFN7E5gzefXNt4AllGhgbxMgOhoAOR+VKu9W2Cxmu25TdYmmlFYv8hSFCWN SgWHzmtsFB/BuJzaHAdmARsoNjnLfjSmv1grvLTrGtonHTMZ3bUNttZXW1wzLyOvnwTC ZeOrQHosfqTiLKzfIYsn+VN9U1/omox+m/kbhM3sMxCd4Wpsprys08KruiN0HeIMehUd xCFebbtODBBwGs4FNP1JNNOp0BdFyCr7NLvTHMKuYMMdeJoMgN3nm63jYdfc0Upcg2Dc 38yA== X-Gm-Message-State: APjAAAW0byZCrcPDzBskyE03VJXZyQx3Cdn6xClCrWTXenNilliCqnhe q69jkPt2BN/lzoQF7dZIUb4wXw== X-Received: by 2002:a1c:b146:: with SMTP id a67mr15829427wmf.124.1561383822192; Mon, 24 Jun 2019 06:43:42 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id p3sm8196123wrd.47.2019.06.24.06.43.38 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 24 Jun 2019 06:43:39 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 0A2AE1FF93; 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:24 +0100 Message-Id: <20190624134337.10532-7-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::332 Subject: [Qemu-devel] [PULL 06/19] tests/vm: use ssh with pty unconditionally 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Gerd Hoffmann Allways ask ssh to run with a pseudo terminal. Not having a terminal causes problems now and then. Signed-off-by: Gerd Hoffmann Tested-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Message-Id: <20190617043858.8290-3-kraxel@redhat.com> Signed-off-by: Alex Bennée -- 2.20.1 diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index 5e30bac661..395eefaec9 100755 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -107,16 +107,14 @@ class BaseVM(object): os.rename(fname + ".download", fname) return fname - def _ssh_do(self, user, cmd, check, interactive=False): - ssh_cmd = ["ssh", "-q", + def _ssh_do(self, user, cmd, check): + ssh_cmd = ["ssh", "-q", "-t", "-o", "StrictHostKeyChecking=no", "-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) ssh_cmd += ["%s@127.0.0.1" % user] + list(cmd) logging.debug("ssh_cmd: %s", " ".join(ssh_cmd)) @@ -128,9 +126,6 @@ class BaseVM(object): def ssh(self, *cmd): return self._ssh_do(self.GUEST_USER, cmd, False) - def ssh_interactive(self, *cmd): - return self._ssh_do(self.GUEST_USER, cmd, False, True) - def ssh_root(self, *cmd): return self._ssh_do("root", cmd, False) @@ -284,9 +279,9 @@ def main(vmcls): return 2 if args.interactive: - if vm.ssh_interactive(*cmd) == 0: + if vm.ssh(*cmd) == 0: return 0 - vm.ssh_interactive() + vm.ssh() return 3 else: if vm.ssh(*cmd) != 0: 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: 167576 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp4256811ilk; Mon, 24 Jun 2019 06:50:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqwsGA252zbihvKTrJeUKqgoyP+BNxJl0q+fRxvqh1sbMQ79G9Bt2zmKCuitk1wTI7BOEkRW X-Received: by 2002:a50:b1bd:: with SMTP id m58mr60628400edd.185.1561384218872; Mon, 24 Jun 2019 06:50:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561384218; cv=none; d=google.com; s=arc-20160816; b=oSXvu6GPIFGHDSfcZpFqNvAWpKhQMtTYKbxdZx0fq32xPlQCDzc/pKD0P/EB/r6xEc E/JQAk1q7kuSkoXvSjT/EZgGqj6DF/iGzMZugzFtkLmdsfGyLaPq6ueZ9Afe/vOkACp7 w/tLV864K4k7Xjkj29B3BZAuUVY5Z/YdJZnui/pMLbpFEaN6aV08YMiYgxewjYXC3ZaN KjREYFPBL15LNvmH22XOdTey7ZbBO/tf+7yPoo1Of8q/XEqQoHin5GnkMKJi6Z+snA6Z U0oM77fVVnerP5Tfz8XPhTXRNNYKslWE9UXRW3Xpuqmn9aELNWaF9+PCupYLGaExF/m4 VFVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=c6RTlncvKEOxdPzqDtthTA6vXD5pXgd87E8kJP9158o=; b=t3794ww5cR4+kkXPvlT68gM2wBGT6fxWUMvko5S2HIMnA3wswbPjP8QRyWXlsiBa/g 7l0qNzMxfea1RFKEyqgjHyfYh/+Qm1w36r8qr7pqjkWmQWCS/BRl7EpfJSEN0OwV2GF5 IVQ9qQ7MzlbJGFmUTs5sqUyLIoeSJigr4mUNQu5RPldhNjlSJOplWdOllLZYW4Eb/afj VEoIPgDkJ7UWkmdLUo6+N3AaNAWdTz3TWq8tJcoiItqSQTNNWLabxKxyIaU8KhLm+NpL hxAgIbMIun/MuLhABWd/4aCfgUUtbhgQGBSTltcbQl2QNLCnhyUxUEe3SHiVnq6eV3sF wNNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=WqnUV4HN; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b21si9127705edw.264.2019.06.24.06.50.18 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Jun 2019 06:50:18 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=WqnUV4HN; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:51328 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPMP-0002Me-Ra for patch@linaro.org; Mon, 24 Jun 2019 09:50:17 -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-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+patch=linaro.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 -- 2.20.1 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: 167584 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp4262945ilk; Mon, 24 Jun 2019 06:56:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqx3y7BtU/NEblVUUydZm444sKWTMIpRzgnf6kWf11hsBEx+TpNEiBPUox3sJYEW7rMaMPWA X-Received: by 2002:a50:a56b:: with SMTP id z40mr113256451edb.99.1561384583879; Mon, 24 Jun 2019 06:56:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561384583; cv=none; d=google.com; s=arc-20160816; b=a2mpTmYP4l9WAPDV7ihZHUCCoDPPKpkkQu9TZ1OZ0X5x1v6QQDBwECjA6qlGfBYlmS riQtUHWASHoFuRpfTwJJbFFtf9yH3n/ATnERJ48vO9Qc+JRzFLc7KkeJieLGEuD/li+3 scOIm6XRTkBxJ/1FUIZLx7DIYRZhGjM6jh3TAeK8/uK8FrzwiTCxKqRLwh8rRmLf/4pB RKtTJ6QY/8Ay8R5FL9zO8z47Vuu9ef/+8QHc/0E3+BYuEUrhixvPFW9aJ7E3iX3zqiT3 AV+pvNgskMti4SUF4zlkaJuPqaFbhsWQTWgucjHZdVi03JlI2UwmHc35LY6D7SI/usEe oLHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=BBiBWMHXigNW/eAwUhEz7VujTp1CJQa4AIKszYpazcU=; b=sUyb7PFYVqh00Qwr4cmlYutlIvfGqHBurRO+Nzw+/993aNLZwDLzTj+7Oj/Y8k8pBa KuezpHcE0U/JdnT6nyO6vQxl7z+AqHxrm3FhBMye1G03FCKdedJdkX7u2JkEDTL3iv4P fM9MSMWOa2pT32vZmpiYS3J8af1IVxHs7W++rneco+ilBPSEeyXBrCWzaYIaHcZbJyjw L/kthGLlXdqW+P+kDC8r2IYCtgtqJ+FZ3zZyWfB9hCjGVX+87OtCQvsOV5arBQCUsohN t3kADf2l/IlXnYIjk+hcPgpYvBhyOcEIH5Q+6FEBeBLi4WD6eeucebCG/eoJupwXyK+F SnnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="q3YH62h/"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id l29si9580801edd.330.2019.06.24.06.56.23 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Jun 2019 06:56:23 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="q3YH62h/"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:51372 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPSI-0001Bh-Tg for patch@linaro.org; Mon, 24 Jun 2019 09:56:22 -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-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+patch=linaro.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 -- 2.20.1 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: 167579 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp4257917ilk; Mon, 24 Jun 2019 06:51:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqzxNR48aHqcRho4Tr20HWl7frlZy99i19mfUBJF9Kq3zUDuJ4HVZWLjz0QD0hc/8T/VzalG X-Received: by 2002:a50:89a6:: with SMTP id g35mr112272547edg.145.1561384282721; Mon, 24 Jun 2019 06:51:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561384282; cv=none; d=google.com; s=arc-20160816; b=sKbR7ewwbM8k6DZLle74AKdRGXq2PAkBQ4hAynq0FRFXkFdR9ZPlP0UcagYJ2tEY90 iCT9D0h+7hI0rKSxzsbbNa04zgibOSY1n6gEhL54ZHViFNLP7EX3JcuMgtjpzZ2TANuR ZZjLvvlVqRTn1Abj8ytZ1vFjQ1esGLaqCZUig6qA2ljWufaY4wB4SDzndO7o6NoyRMRa AS9HnKgAEOOn3bSBG9Cm1fV1cB3xZbNdcLEOrFgp15TkrjMhBn7K88iXeRhNtp5ye4Dn V+M3xziwsGwFBmKLRA5w0MUhZAUqn2ha4QRBg7Fnw8hHXmmjfxsS6ZYFA/PmtMqOJbIP pDLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=uYenwXAi2dqO9YgcCSxpMSuNa4TOsTlySRQpX2U2e0k=; b=gZ36fW8rgIWhfLjsaSJBNHx2HY+dwL2xYXJZbHg5YvBnwxckwQ5YBszXP7ce3L+VwT YSyN3fDqnPv2NTdLOu7A50nkY57LL/4R8fYF1mDvX0b/z8PN9PLidX1bPPlDmv2HBtcQ RdapZXB2GyxSEv9punX7DjZBbGIhoejUGUMQVCgmk9ABI1ryQdqrfhFwv05vU4smYrAp YUSxikencEg0ZJXyQ9QKaiAcZcuBfFJz3vwMt1uDQTPXFtkFt73k3jHV2MAifQjicHwh jNc+HROhFSyltzluAwdDobP96CslqjBy9oU75zQq1Vh7IX8fchNIK/gdZCzWQJo0GEpl MfCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=qVD+5bjH; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id j9si6864390ejv.235.2019.06.24.06.51.22 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Jun 2019 06:51:22 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=qVD+5bjH; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:51334 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPNR-0002dM-O1 for patch@linaro.org; Mon, 24 Jun 2019 09:51:21 -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-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+patch=linaro.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 -- 2.20.1 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: 167586 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp4263258ilk; Mon, 24 Jun 2019 06:56:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqzTXLT2jp1Z5cBQk0W0MwfddZ1NGlnBqBgNOT44VGZZmgv2E4lkXRFIDJbFCAJ1wvOAvT0E X-Received: by 2002:a50:b0e3:: with SMTP id j90mr45648261edd.26.1561384603571; Mon, 24 Jun 2019 06:56:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561384603; cv=none; d=google.com; s=arc-20160816; b=mInpkuK+5w6L8XsJmCrYKYLCY5/IOpd36QdGVIK9FOLwkr/EzGmC7iJSS4mG8az+w4 s4IL2knnloema+e3zWxwjMsXrpW4oI999i1iWRFY47s7+pBIZzB5qEasExSeXC6Gc3qt TNJ8mB/hj0AuWaE8zisYvoJid4YsFi0DjHqGMOpddiLTRmvaSWuML2i9WpVkkkMdXLPr vevrgcF6NUcCVuBILAebxFMp3G9vC4Pk8NPjH5d5CZlYI5b8F8NYDEnw4d5VYEmlTolD p0o4fmIsIDKMWE6VU2u6FRW8TVQppNSJ1jm5VpF+0nx0Qy5l/IDNIA3qiB5wsRj9Cddn AZlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=4V5durOY/x3+0X/wiER2jyd9YT6J94WuCw52pgi+pLM=; b=adoigsXMEQvWrDdVeY0/22Iiz4Pg6PHjNJWPynLIxZEtEZKhRqm3gi5UypYJdE+oXO s1uC5zgDK/kknCOxI59w3Gx6VWdfFG4+3swth+xdrwV1gx3cL58kcq4MgoLWpA5bbH3u 04nIC+ClyVxstzLwPXdpn5p6zeu/+MUXAabQhDkIQAWMP6Z+In2wgcg3HKI7I734+DYf ZC+4vQO2L8D+JRBLwSOVZBurygjLK3iF6ldmoBX+w3ZS3LsG66zlMI0qbGIQx1pys4rW uM7XnE7yES0r35h4EZkO3ISbA7HIRNLklooeKINYSS0cfIsioUYelHQ6aUMv8yzlPHlA AeFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ReagwXuv; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id g41si9686316edc.339.2019.06.24.06.56.43 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Jun 2019 06:56:43 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ReagwXuv; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:51374 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPSc-0001LB-JX for patch@linaro.org; Mon, 24 Jun 2019 09:56:42 -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-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+patch=linaro.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 -- 2.20.1 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: 167580 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp4259720ilk; Mon, 24 Jun 2019 06:53:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqylJ/LMtgiZpGJ3j46aN9kM+2skgeAXKK7knL3X+XzHshEcHfl48Co7LQVK8y3Z+RW8D8Lm X-Received: by 2002:a50:90fa:: with SMTP id d55mr116465671eda.210.1561384399232; Mon, 24 Jun 2019 06:53:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561384399; cv=none; d=google.com; s=arc-20160816; b=ZhFemDadspnUzEhAt4qEiTxU3UZeYPP0e6iUO1ddX8bwScsBtR/VHnidDHwP8CS3hh tjcEQJFRuDe7e9/4Bp2mMCeor7ZKwMh5baqezqEzLEQhhtCc/0ZuIoMz7ka6jlJPTd4F +vu1wz0tHbPpIjoUlxC262Ki4WhcviqFd3Yaw3lsXQ2dEod9cdNYpyvpR1pG6J/Z2Ne5 6P+brxrC/lHtDLoWoB5361sucgfNGOrXVVveHc7Cuo290mhT9yQaAM0WjrbgGSQ5SxVW vYzrXy9ldfKOpGvHJ8z38rJgdvzbONtdALhtJPyTFiE593JAmHg95+W5bHifA5CZHFNA 9l0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=/RSieZJAcswfuzrWAl67uAJKjsybJgY5oC9aZNMPdU0=; b=xg6cOq8fyku8Kw2H1HD2OexhVmc6YCaFmWP1cCDnG7e/8UHD7ioFhyuMdPNP0pR7Xm VQ3owPM08SUQKGIZxG6VYCvfcR96JvXOYaTe4cpRW0w7Fd0RgdEIrI9FDf4ctn0Egthw gx26vyYDxB8tKMn8bJjarbLKB+7GInIUmV5bR/pDE0wzOKRxJHm8ujfPj8J5QGho8Tbk i59vf+eixs+4lT51TP74xl4kb8VH77pCtFTQxasB9wQcjit8nifLLfdZYrASeklnSOlY yr+8nxDhZueWSEi16KiRHznz6JWStPm01hn+uY8Cx9fnuy47uyvFR8BVyz8R+FthDsZD jOfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="YPViegu/"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id op8si6661921ejb.193.2019.06.24.06.53.19 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Jun 2019 06:53:19 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="YPViegu/"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:51350 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPPK-0006D7-7W for patch@linaro.org; Mon, 24 Jun 2019 09:53:18 -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-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+patch=linaro.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 -- 2.20.1 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: 167590 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp4266361ilk; Mon, 24 Jun 2019 06:59:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqz1N3DB3xkf0Lf5UvBYCciDHHlJBWFd5i1dScDOYZjZkazorNMpgC0eTf55cDiIX4uldiVL X-Received: by 2002:a50:b566:: with SMTP id z35mr132097873edd.129.1561384785983; Mon, 24 Jun 2019 06:59:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561384785; cv=none; d=google.com; s=arc-20160816; b=RJEErwUUXBDuKODMc+sH5ZoIHiHSsk2gy6KUZYib6hk6ITjT+sqp0tJpiL3GJNxA+w 0pJKuEv4Uwyx1GITlLc2WTcS7BloISDMy1+/FPl/nmFkoxVngYTqBZ6vft0FzGRtgZHp AJPg/DfLSZQDv9hHvqMhhLdDrOjY2Aqu3Y4lUfqy1ncngS0QINdsF/Xmtf8PEAYCpKDx jr6yStSJjUHEnJlxPWDCFN5KmxVjAjaDhrwBA3AKNE/CJh8ZOd/qAOaZl8ywPJNMSc0t RHWt5/qdiJwWy+DVVd4bqX7MecsYliuOaMZY2yLQ+c+l+GEhRjlJUACfe6+vP37KBbkO g5pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=uy+t0RIuw/tzOoTJEZrmneCaAg6fEiVS+nMeJyBAP3k=; b=xU7URiL9Xc00MqU0AL/Cary89XnHu8xwUrwCa3dukemoqWIlFScDxwotbq6wAOTHC+ 0P8WL+aVL7g2O7z5yqx6uG3ey2wotmDIqSFMelh4VNNN/0rW+4xvEy/uyK5PMxlDZluC wd/cMPlIbCpzEnpRMw6ZC800u66niFwr+H4ZHCjoWd5IwLRJsGqmeXd3WOJ3aMjvS06b u2YZ0LVO9W5uM1PyHg0kO2IZdvvrvw8tEItX3G8JI1iLoKJmeqbW13p7NA58iV4/cysB oaIB0rrXlV2VeivHcuefQQEhN++qhhzrBwDWh7L7EHLxrUMfN5TGX/cCJjkO4tSmuQPT WGVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=n7L6nSdY; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id z44si10609032edb.16.2019.06.24.06.59.45 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Jun 2019 06:59:45 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=n7L6nSdY; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:51406 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPVY-0004Sr-W9 for patch@linaro.org; Mon, 24 Jun 2019 09:59:45 -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-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+patch=linaro.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 -- 2.20.1 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: 167588 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp4263992ilk; Mon, 24 Jun 2019 06:57:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqz65Viyuxfj4Sk9MWLXGtSCCjW5Qwr9R826WQNXKYTGWfbAmBNN5GtL/EAXyYZbstX7Jy6O X-Received: by 2002:a17:906:4694:: with SMTP id a20mr117097244ejr.67.1561384643919; Mon, 24 Jun 2019 06:57:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561384643; cv=none; d=google.com; s=arc-20160816; b=0Eh+sVbUe/3zUUH6mqGDA2m7uxBzPqx7SMACLiTPedMPAJpoMDY9yc6wNyoxcuwpVO r+l6wF2psnQoFxuJbo9nPQkuvlnKFokuK3AGn1Nn3E1vlDEcaV92VjBPOfi+qUMObk3+ 9RGw4Inn1dJ54PtU3C7SkW6XluBnPx2tnKBZXBa3s9uGnMS5fsNCKp/KAvZ7HNgGniE1 +rVi+mQT+cfLEV+9Qw9sG5BzhM0stVcUzugNuIWjFTVIiT5ZYLbSytRAeMw7MEOlppUO 2Y6OHmBnB4ex1Y0Bpzjcb8Lo0iZI5MidhLJ3n/72aFtktdPNhCfFJeUN15JJGWmj+j8a oyCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=eLuX9jytNKsr8SIbflzRQAre1ZIZKEWnNTFuqfXsFEI=; b=LmjdgUTEIXoN1PcZ1lFJQRanCSrCNiJjsUbp9PqQcMJKTA9P7eJKOOlxNP/iTSYPQu 6SPOt4p+HOy3X+Tlk86mLmggPlDACNfVModBXGyZ18XdgEht4wFYFQZfGslgHVbzj0QX URDpyQqjT0m3vjDjB7UHj8EZHCyHrGgq3wx9rKFMAyawL34EhbcMqriwCxXHwmRHqw0k Z7Lteu0GCx2ATIuyGm/hLrhcbWJBlh2Wv3+s0pZqj3e+FP9LnZ8z7P9aMWqb3kix5kI7 +U/oPbPH/6X9X+QDAbWwT/s1Sxi8aCiFFIxSBQoD6xUWmkQ9ZlH0f+IrmnTe5yTIB9R8 yPLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=GLbmOs4O; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id i24si3803643ejh.42.2019.06.24.06.57.23 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Jun 2019 06:57:23 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=GLbmOs4O; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:51384 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPTG-00027G-Rx for patch@linaro.org; Mon, 24 Jun 2019 09:57:22 -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-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+patch=linaro.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 -- 2.20.1 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: 167593 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp4282143ilk; Mon, 24 Jun 2019 07:11:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqx0g+U2gLLAlmTfekWwwqwx1m/wj0sVt/rb2X/FvnphL5DTkY/3kj08wf4FDVgEb//k9IQ6 X-Received: by 2002:a50:91e5:: with SMTP id h34mr116020720eda.72.1561385469952; Mon, 24 Jun 2019 07:11:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561385469; cv=none; d=google.com; s=arc-20160816; b=xeNOADHblWwNSzvrlwgMeho1Qc8OPKugnv6gUVQGbRmSFozNiNhao5EXhavddl748I jxhBgevGRBvoQx3ZH6f7dekbQ8aOA374bey7+vvSjDizunzTqg0H6hBjGC67bA9pvPZk ETqxQSX1dVPQ8g7dnvyopcyMUkhjolZdtfSqdU6RDrf9y5wXn/BEtGUI4mXZQkNRBZ5D UOV8Izub3fMLv8R5pNFo5y+9QFxAzMRoOLEI4QdSbsI1B1Sh9OQub605bLgDhYPwe09K BvyivWPRJqLbKTV7RL0bOF1vWUpo/iJhbUfBCd/8xUyz5nWELewYfEf+hDUFHwqJwmR2 9WWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=UpVvHEnh/SP5d5n5fhpbeMvaoSDIsow/FrkdXyrTnwk=; b=WDR4Nr8ZiKLU3xqVUHf0ht3LfWfeM6UHy+/mLvde0YuKhEFBmVVnuG0z/kT8D0etyb TkhwUK3p8QB5L2xpI3Q7wv16rc0jY/Ju6piGvDhNVHBVthdUPhWwnhiSFZvyT8FMJ7bK jDSlR2Q3wZVcth47I/+yetdxCMchleaWsXpbESI1LqlXWsFRqFPw+Le/DYqH96plU2z3 HJ2hPQkSDUTYLy0wuLacesWqr5KFuGB/gr4dl20/yXutGj/8PB043lS1ILKYzLYDlp5f cSSnhV1k1ZkWJrd5bXO726PZzMzE/+1tsAvKLYWGn9rk/tsP3EQmIoc/v5Y0EJuBz+dG z5gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=EIZeQAqt; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 90si9645705edq.146.2019.06.24.07.11.09 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Jun 2019 07:11:09 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=EIZeQAqt; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:51516 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPga-0000yO-TH for patch@linaro.org; Mon, 24 Jun 2019 10:11:08 -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-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+patch=linaro.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 -- 2.20.1 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: 167585 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp4263022ilk; Mon, 24 Jun 2019 06:56:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqy8+mV+A6TiOh5HdnA7Qo1tlCMoQphQy+R2i8H2JkQU8l8ArdvjaVrYCsYLZfr3CAneQv+q X-Received: by 2002:a50:ba28:: with SMTP id g37mr143152606edc.109.1561384589534; Mon, 24 Jun 2019 06:56:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561384589; cv=none; d=google.com; s=arc-20160816; b=U580lZwN0Ws9QBV+/5HFxYovVI8+F7OLBGbawm1J/8WgybKAapYIffqslfGu43zTOn vufxb7FgjJW0quVTJod59xp9yRe+/tX2Dlq3whXHm4x2owTODEHYHGYmLuttIA/nWuN6 SDLyn3OZwmrWIKm1x1vdgvglTkAH5Zg4Jm7T17dvXPcJRlzgyh+X7bfHZ7E8mIkw5hYN 44RBt1LIDb32EwUMgEl3rfg1hGybfn6I1cIMeC18QhEO9TkLLU9J2IC2kGF8dWWcH6eP KQnyRyNRvqfnrBy+f8K1fGXlsE5Jv7/4aN+R4mVvNrqZaldf7ZyzfN6jRmS2y9OpBVD0 a5Aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=JwqqKvF7VNQMlcY7yI6rqE4GBREhj+ZNU7fBJq4Qxvs=; b=PFEzJcgSJDvl+4f0S5O0bNQFpO3Un4IEoaD90igoVdaRRHtswphavD4RZ41xvy2ert FxS5w6H4ZC1PLrMFyh1lePi1So9F2JSs/TcvLb6K9miwF0yI0tEcMuhZXX+Zg179B9DI TPDZsWfA73e/ajXPQjNz0Eop3LT+lEnWxwwEzb0fE7d5PxZAktkLIfNja8gZJ5ZvNFjX 8+8qYCBHM0SS/XnYwxHVbD1KAcxMkkUYCex5YWRzp4UEf4ryxTs9l4koYPN5yL/eB1Pl I+OwNbgohQCXD0idurI9dyT1PtBteGPJMoGoZHDHHZoUOSnTisGdRcnjuJUw8Lzdcwcm jXoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="Lbx1R/JX"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id z19si7226222ejm.26.2019.06.24.06.56.29 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Jun 2019 06:56:29 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="Lbx1R/JX"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:51378 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPSO-0001Pc-Fw for patch@linaro.org; Mon, 24 Jun 2019 09:56:28 -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-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+patch=linaro.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 -- 2.20.1 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: 167594 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp4282421ilk; Mon, 24 Jun 2019 07:11:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqxrk56E2DGGwyPJMxwBRuyAz9jTBrensPKsvA9PAPR4R1E5/7R4YeQ196iWC1LizytCo15p X-Received: by 2002:a50:87d0:: with SMTP id 16mr111851076edz.133.1561385482086; Mon, 24 Jun 2019 07:11:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561385482; cv=none; d=google.com; s=arc-20160816; b=bWlXl0YPVelEllIXAFypE2+AY9IWZ/PbzgE65O1G1loQCxDh5XuisZ2MZ8Zyqt9/Rp 3I009WaE4dB9CRqKe0jy9ZRmr89Ry4yjxD3OV5uMzS7yHASdZHNiWrm2Pvf1NxcfbxSi 0FmJXvpnZVQn8gJyQ63aIqafMoCDl7Y9XjqiBd6Pg5QuRchBD/3WdnFvOTvZT49hDeLT vYWnVtRyd9pAMVwr36S2PzeH2bITIgteGqfKxRhx32mKf41KARvv/4rZgEKqprP/eJut cVwxpqBhbp2jXgTKQI03iEcg3AiFKaYBcIH0CH+N+3IrtCmCaRqAsQuNtVrWDGYx09by DgVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=AuGWXO++XORyc/3VqRL/LyTlB90VYc261lGuzU8sLu8=; b=aXQGhig5zblGdTIuAW2U9n0RYY+rfmn3kQymP3+DLRYpgXrPc5wfpVtzIMPIbmQJBb UFFUNaCVgWUeWl6W4eUFcrqy21brav0WgvvSOsEtLiIkMAZ44dMrerHkr14WJuu0yuhN +Es8Wb9ATL2kbueHN66fISs33HbtmRLADJZoveiHj787M6hBrFfvqH2PLqatiVT886oP EIRcBQdchgWP1+4+/aeVImmsFaNZAfu+ieGicV+28Y9HMeCeEoEkBLeSZW8dJx7usxhx TMVtTnaEpzB7TwUKApWnLwWtXk1VvW2j+NC+FzHauaFTuqZjursFt3hmvMtV2wgg8lw8 GxNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=PBe2eunJ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d6si8682841edz.104.2019.06.24.07.11.21 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Jun 2019 07:11:22 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=PBe2eunJ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:51522 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPgn-0001Qb-4S for patch@linaro.org; Mon, 24 Jun 2019 10:11:21 -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-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+patch=linaro.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é -- 2.20.1 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: 167591 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp4277548ilk; Mon, 24 Jun 2019 07:07:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqyDxgpJSu8ImP9ev+WJtywy19dr1JxOJ6wExWkDEzVQZiUGDmHGtSJK85g52tw1UhdBq2EQ X-Received: by 2002:a50:ad2c:: with SMTP id y41mr141567107edc.300.1561385263101; Mon, 24 Jun 2019 07:07:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561385263; cv=none; d=google.com; s=arc-20160816; b=sxvVvMYMz/jt602y04YE2mmxd2Wd3XOM26czMdjSIKv8x+RFirBNMjHS3jHHuLf20w QDor6m/tshETqmeMv40juIViQxCUMxvldhflgFkx67MCmrlV17PL0h3ax20jgi/rlzOZ RZ1TqAYGfFxiVOUoC2lcC/K+rm2eRZTZEJFcQw6SBjvJC5jDVdEe+Wby6jWhx8/P4rgw AR8Pm/tOFPABKgMvwZQJjY6YBQ7TUGEI9BkuKGmDp8mZMvgGZZ29UXvn86R8PyCA+GEI 91smoQg4LAnQQF+vaC0IT/vyC23ke94KiMGCoGqLMezvPBMDNQ4BWxnO6li/2aSeInTa lOpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=KxVNBoteG2ZKNWG79/wL8DSFUaTRSU+Jwkvg0mrRqy0=; b=GHqqmvq4qlEzpSE9rFcqcfQyRK1+cKPz7ZgFytMVUOHycrlGzh+3YZ9j75IdoEtnoE QY63PVaakyIAfVSbQWIDpgSdApBa85lRNWP5YkStQH4vFZFZf3CZw+/s1qCu3UEl7Rwq cCwp8SwXKZ5hOWlAqpnwKeFTQfKhAAMVxLtrZKBbwmSZFeG6TUBSwggCgqIPVxhSVQ/W xiC7k+NEXe1Gkn2OSUsO686jFkmiChNYfZylddt0vqupvquHJodOZcx/jPCojGRd05Z3 m6z1DDzRF5FL7dzu+yplT2zEU4TD9C63MDsb5clghIXi/OHbpA5Au0NrpmUQVG9uds07 0MmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ZJaBFGNn; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id e54si9800018eda.324.2019.06.24.07.07.42 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Jun 2019 07:07:43 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ZJaBFGNn; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:51472 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPdG-0003kn-26 for patch@linaro.org; Mon, 24 Jun 2019 10:07:42 -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-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+patch=linaro.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é -- 2.20.1 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: 167589 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp4266185ilk; Mon, 24 Jun 2019 06:59:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqzZUrdDfbDnXP2hAIyHUlJYTmkE7RQ3yQgyh9usg0He196URoLHCvjWrOckeAR6o7py6JQS X-Received: by 2002:a50:f599:: with SMTP id u25mr133662664edm.195.1561384772349; Mon, 24 Jun 2019 06:59:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561384772; cv=none; d=google.com; s=arc-20160816; b=a2FnS5IkPwH2IzKCo1LNrmegvPBottHo/K/m1boF5l6/MvbLV8ZG6mhx9uqwLMpM10 iWmHPfkKEFMqH1fjeQOS1EfZSx5NFP7nXIRgFGUbjnUiipebauxQipJT6/H8Q+uf9eGM VuLjvo6oR6N9Ka7xZw8PLZwGmlPL/9nbceAE0J1G+PRlTm74E/Yh3HtP4LFxawLZD3/D OwxZF0noCaQ6nocXQJr/qSXutF2lNcbYuJaNX77TLy/oSJDV9sGI1XMu1clWwHcfq51y 1cbmpxq4DsPFxzV8hq3FMdgTHmragHDUv6wdRa5rY2+txC4nCPUlcSumfgIK3pagggm2 Wh+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=Q/rV4H+M74u+dhawBtWuITzFuv6kQ3ZswIz8UU+IjNo=; b=yFGGR8OjLm5spnf2VAJlo2zTMcntzpr36ZT/lZMVDlC0P0knkCL7nrLcG/Ndkw89rM CsOttlUUJ1KhJe/SlmYv5JpbvUecBkeFYGZng1swP4MH+8Ewp8SZgvAQ/UJp1NlLrdQk MHojo0ySQhYqd4h1N4FGplyc1IHIZebqN3dbHKcE9heVc3HW5YXTtVBstG8KCzDI/YTd 9C7OmbhEOpEjaT2trBljL412T6jqYFmiovByqHlkxoMv5qxPh5PGfLVOK3TkThbANAed aQPEN1BBv12dDSo2Y5CZVJ4KFHonDl1OYPM/kYECT+a6mYpnhnZGgLjW0pXTrfmcV3iN c9bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="rB/3XN8x"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id s51si9786496edb.243.2019.06.24.06.59.32 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Jun 2019 06:59:32 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="rB/3XN8x"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:51404 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPVL-0004Lk-9O for patch@linaro.org; Mon, 24 Jun 2019 09:59:31 -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-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+patch=linaro.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 -- 2.20.1 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: 167587 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp4263501ilk; Mon, 24 Jun 2019 06:56:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqwSfpEdr/+YO93YvpeqkrbhL7MTEAPVwLSReEBgUQUwJs/KZfY/TMe8YimO5Mh83+sJX+IG X-Received: by 2002:a05:6402:1456:: with SMTP id d22mr37080773edx.57.1561384617017; Mon, 24 Jun 2019 06:56:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561384617; cv=none; d=google.com; s=arc-20160816; b=kqL8PHBZE4NC5kChqmU26FMtk/NWANYRsOiYKw4pc2rYGlwZr+xa+O3MF9nAeFIbrZ Ya8UmdDw88vULh4CbIQqGrjz61a2fS0fysk/a9bGhBO3OnzPPpQ8mQKQBFv13f2RbLoP 9xFfIjRX31F7bFMglEYDYVuXLFT90+SqcOhMgcmnCAjxTINo8DvrfPWnxJ0DEbHDtrTF P40Dw9s813380iMq8+EhUiADhNW4JIU8RcZdck+aDjDaayEvGZHD0KIkJutg4k/VwzIR fS7jZMK5NU72tqkDsDhkUTrnQx3c8W3H+KR3dRiv9QnWcraoncXSXeNqUo765TcCh2qk UyIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=sgFHUBki7irv0ZpoKsilsQQcYReZg1Ztcy4s6VB+Mlo=; b=r+Ls0zQFeHkrScFhCHGI/30D0sQvyVigA448UQqMFhal7+kGjsJY7FNCuo+UYl9uQ+ krFUYu1zJwMcA0e7Yue+IfG7osvyHlQJ7uNzSs5BDlmRuc1Q4VtiiVHizYoQ0GTP66tN fJ9gsRDiCeabe7lDlGUtty2035SbTihfPc64j5OT3KY1B2h9u0j9ErY09kT7ejTA/RmF ZUxhX+9pj1KMlkTvqY3uIp49gw+BUFtrfUdSQZOxDOzcsFE8ahqoRx/aabFiHd/h7MMr ovkQrTDdb9I1JKdafKQAwuj7FyjLRoYCI96uJH051E0FL0wGu8Q/HO0EBw4uLC7WQVlm ZuGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=F4t46+YJ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 46si10363380eds.445.2019.06.24.06.56.56 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Jun 2019 06:56:56 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=F4t46+YJ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:51380 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPSp-0001Vq-Vm for patch@linaro.org; Mon, 24 Jun 2019 09:56:56 -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-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+patch=linaro.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 -- 2.20.1 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; }