From patchwork Wed Jun 19 19:40:05 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: 167253 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp1125184ilk; Wed, 19 Jun 2019 12:40:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqwVdn+AnpaGTOortQ4eUJd72iewEHSTX0jPqe6buQAtXTSMP93A9PkEC1ppKVFEKGZ6cvwe X-Received: by 2002:a17:906:25c9:: with SMTP id n9mr84942654ejb.51.1560973256234; Wed, 19 Jun 2019 12:40:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560973256; cv=none; d=google.com; s=arc-20160816; b=TvzhMQJQH7gc0vKfn45indGjN1Dg7y00yvjg2729qSeP7ufAe1MQiuSiTVpwDn02gv 4FzkWlJt+dEorzwGQYc4NaaRVHVwaNg6d1tIL2yYgxuE4OGGzjxVFm4LHbjl/g558AF0 8Z33KlkYn/QZS7Z3O4WG6J18TM8ukSk0i5ISW4aV/3aYDuT5TP7RwCeuTIzQSdcdIyjV QGFaR424hDykzv32ZRZNMj4JiCUsyS7v3gVTSIug3RoZ4eWYr3nRpnjkAHYb8ops1HB9 WmU2K8uj1oAXG/Cxd7tN+9uAyj5RJOPgAdRKjQHJAz6sRCmMHHpprJGlpeH6MZO7uepz 8e1A== 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=ahgJcoAG7RlG7q4icivLXPe7IKp6EgtWsDrDvy33nsw=; b=Rna1rvizfW+ojgtdu0aP5LsOYQd5jytRXc9utsdSjTUZVDJkYmeFcAJAFBUSh/nJBW 0SnR2FJ67kiZhVQJ8QEJM6ndNutJBn1MyQazhSI8feprC8ZEZwN13lt/KhE1Hnw8U4AU Vb6uEy90q4Z69jJSKHaxfdz3rgnINl0L/YjY+J+fFN4rtJWN5Xat0vADZjFx8s0sZN7I aDsxCGEvILRMS59AeHEH7uap+DQoz6F+LsERhStF+O5trfNtXzLLahqPvLeMEuCNzIQa /aURJg41dM7gaZP7wme0Avcmb0SyYfEyAkVHEmoq32OZbUa3eqM3JO+s9XjUPsGOEnIo 1zwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=pudx98c+; 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 f25si14531004ede.206.2019.06.19.12.40.56 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Jun 2019 12:40: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=pudx98c+; 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]:41414 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdgRz-00067w-5f for patch@linaro.org; Wed, 19 Jun 2019 15:40:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53862) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdgRV-0005zF-MO for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:40:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hdgRU-0008Rs-Ec for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:40:25 -0400 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:53689) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hdgRU-0008R3-7R for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:40:24 -0400 Received: by mail-wm1-x341.google.com with SMTP id x15so676346wmj.3 for ; Wed, 19 Jun 2019 12:40:24 -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=ahgJcoAG7RlG7q4icivLXPe7IKp6EgtWsDrDvy33nsw=; b=pudx98c+j8ZzDliq4YExa9ZVynTLKf/yqrj/3IvRabsx6+gwOY4wcobzJ2LOPOPOhz NWD6QguqQ9xKrYKgIqt7nwc02Qpot4/Plj+gmJHdgpaLAnReM2T2UVL/kh3AU0T3jWtu AugUyumRiBAA7JQ9IKaqBvC6AbN1N2LYIpOqCRpjZs7quG7fNaB9ZT76jgNCDt/ZH00i nn//+5Q5hKlZfU/XfWf6p4pN95BXuXQ73z8DBZF9op20avcfZxGJIFcbgur0GudZkdJe j0B1EJlbB0VN8aRzW+qe2W1IB6AORRKgO+s75e7hKbXxykAkijOLKMhLC4FDpJSsxZ1b WQGA== 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=ahgJcoAG7RlG7q4icivLXPe7IKp6EgtWsDrDvy33nsw=; b=OFsbvChHIMD5eusd0t+ZO9TUi62Oy2y+NDD4FCTwNsCPUVWcfTf4o0Wtdiwfr5/Z1n P1P+C6KgEHRMkfNfM9qDPIBD+hMRnmw0U6mEd8b30US4AgQJuY4/DWc20KXuLbmWR/Af 1KIM2drf7t3WF9+XS+Frs7uaKhfAzL+NEG3aNqSAEBnZ+3woExEcwcFagqTsjKqDeBCd lgJJRAdXpuUBRVb/2EpUpdzP+iyIi8LojLeEc/vPC+xcLCceRM4+T4soB1cpyDbvjuuc 30ui1CDSnRKPqr241nLFH1PVL06av4tg4Owesl7C2pP8haVQXVLguGqHY+lMmjPuM1Bg ZoIA== X-Gm-Message-State: APjAAAUxVczliCu5wqiCGMMuSmBZL1QMoSnPKRnF38aFlbP9MtS2MizA PDuZ5UCBwaGrkPn5xrmTMu02gA== X-Received: by 2002:a1c:720e:: with SMTP id n14mr9641760wmc.53.1560973222964; Wed, 19 Jun 2019 12:40:22 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id f12sm27114958wrg.5.2019.06.19.12.40.21 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 19 Jun 2019 12:40:21 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 8BB3E1FF8C; Wed, 19 Jun 2019 20:40:21 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Wed, 19 Jun 2019 20:40:05 +0100 Message-Id: <20190619194021.8240-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190619194021.8240-1-alex.bennee@linaro.org> References: <20190619194021.8240-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::341 Subject: [Qemu-devel] [PATCH v1 01/17] 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?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , 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 Message-Id: <20190613130718.3763-2-crosa@redhat.com> Signed-off-by: Alex Bennée --- tests/vm/centos | 4 ++-- tests/vm/freebsd | 4 ++-- tests/vm/netbsd | 4 ++-- tests/vm/openbsd | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) -- 2.20.1 Tested-by: Philippe Mathieu-Daudé 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 Wed Jun 19 19:40:06 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: 167256 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp1134004ilk; Wed, 19 Jun 2019 12:51:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqwcxrNtvuvq6R+/gV99MI01TC1Vlt7r6Q3KMDtxmPa6xwrxCawFPxr7mU2QZkBe8f0rpqEx X-Received: by 2002:a17:906:5242:: with SMTP id y2mr32708126ejm.163.1560973902158; Wed, 19 Jun 2019 12:51:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560973902; cv=none; d=google.com; s=arc-20160816; b=vsRJ93qdLNY98cfnM6yW3ZTDlj4+f6DOHhIbUXHpsY9jupgQAfww/MTWXlz2f98FyI zMmFIJPW7aMOcaKnPW/N/LtwLohOveLaun77gm1OQdFvASuu5WpfT9K4jDs+LgICWK8A zTQYAvkd9cvzcwDdqquCU2st9LcfCCQ6L4I2vHNzmbDYSSWwgXlQigV4MPsccJfuKDrh 3l/2SgS54UMNTNVvyXsrhczkwNVWE9PGiEva0d3Hl3ajdVLe4Fl217ObRmtCS4Wx8Llz 62npX92QMQO3t60KUJ1+LDgz7Kte26F6k6jTVYFo8TelhIH+9wR1jzsn3NG+rWTUP5vY hVQQ== 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=QOjApRFyonn/7Cn6p2ojwBNi3DBnLp0ky5fDJ7UyreM=; b=Iu15q8csRDf+RvXm50t0BzroDWy9BWnxiuQxWQ/e1DLyCKJVfuDJrTxFalnt5YVXHP d9KavTihsyGc5Smw64D2hpl80iqsj0bYZ3U+zctbasKk0Ls3+Fa1nxycrSWj/ACBrf/t S0YgUFb+1A9C9v0Fx6e05WpSti2968pWWqdL/PZoHdAoOR479LWUlIXxj6aViTlgexsM iuMY0dZo6MxyUONDcLRXiXbFWQBRNU7dMhHmrpANhzt/dhT19NlrsCZKXR1ndIkIlDQ/ 53nnmp60fvsfJF3iNNnZNcMK3AWasNdZhfXdExzrR6Iegm9Zw3u91mDD5gX4mCPCy25y fPQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=CMVuiKku; 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 x54si3069405edd.148.2019.06.19.12.51.41 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Jun 2019 12:51: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=CMVuiKku; 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]:41460 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdgcN-0005qJ-I3 for patch@linaro.org; Wed, 19 Jun 2019 15:51:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53875) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdgRW-00061J-AW for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:40:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hdgRV-0008SI-2p for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:40:26 -0400 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:54856) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hdgRU-0008Rk-So for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:40:25 -0400 Received: by mail-wm1-x341.google.com with SMTP id g135so669846wme.4 for ; Wed, 19 Jun 2019 12:40:24 -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=QOjApRFyonn/7Cn6p2ojwBNi3DBnLp0ky5fDJ7UyreM=; b=CMVuiKkugnseipDzZesGcJkDxkHE4uiVbnBppHdgkmQB7s1Tsyy2+ABEjUjJc6tr4S ZY8TRLzR9QEvYIXXaWswWNzu2ldQzKDEIPuCKRA9argsWyHKwqSfw5tnhmc+JLihcZix zqZyW6VnxB1TTZKinUzaJ2RCp/mCFXdaY6kWweoUbXxSGesAhGFrBuV41tuRYTNhMGK0 xOFMvyIIsW9xXIQAXL7NBF16eTFKy38q2qHrAl3MIf1z3x+ERM7WQ82OjJjGspdS53Ac iLOuaiqMa9LOGK6EFcyB52UgifTlUmBUjAh5Qzwr3drjw6cLlcWmXPoqvt0+qZ9G8aQv ekQw== 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=QOjApRFyonn/7Cn6p2ojwBNi3DBnLp0ky5fDJ7UyreM=; b=leTR3v5Y3bSkApGiO4Cq+NJwnDvB7a8NHWTMeEhc2LgCN9CnOmZkXnUnnXN0d8k8E6 Ij9j4JSCVx6FUY/qFondhr+rkL2YQOVFb2yOazWKyUQm3z0+cSSsM123g7uIPW6+TImX y94YqoyFe6arI86exIqQINjlubZmIycrzCM2KpLOfXtpE8p4SYCgXfL5Aeb32k/vqZic lJsx4n8zz3YfigyvN/U8ZNnLkXTgnmiretllLv85X29iziDEaLyTqsgV9BtFMa1rEFk/ uZOBBJkISSItS6it1AKteaxdEe9aDXKmZn7/Rmanezf995I5z4YHEUg146zAB33LZT9K 5gbA== X-Gm-Message-State: APjAAAUdVeC21q/KqtmJpA7/8bjAT4cAWNDmEGHdAhyPxwUGLwd4LH1h oYKxVvyM9rC9DBnNqu3vxdVQiA== X-Received: by 2002:a1c:6a06:: with SMTP id f6mr9493478wmc.159.1560973223794; Wed, 19 Jun 2019 12:40:23 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id c65sm1375701wma.44.2019.06.19.12.40.21 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 19 Jun 2019 12:40:22 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A53231FF8F; Wed, 19 Jun 2019 20:40:21 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Wed, 19 Jun 2019 20:40:06 +0100 Message-Id: <20190619194021.8240-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190619194021.8240-1-alex.bennee@linaro.org> References: <20190619194021.8240-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::341 Subject: [Qemu-devel] [PATCH v1 02/17] 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?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , 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 Message-Id: <20190613130718.3763-3-crosa@redhat.com> Signed-off-by: Alex Bennée --- tests/vm/centos | 2 -- tests/vm/freebsd | 2 -- tests/vm/netbsd | 2 -- tests/vm/openbsd | 2 -- tests/vm/ubuntu.i386 | 2 -- 5 files changed, 10 deletions(-) -- 2.20.1 Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé 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 Wed Jun 19 19:40:07 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: 167260 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp1136759ilk; Wed, 19 Jun 2019 12:54:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqxJEPiubkOGaW726G9NUzJJkNlUmxUYahakwWyhSk0GoIgGCwUi9wtFT6O7utu3ayBMQSaI X-Received: by 2002:aa7:d30b:: with SMTP id p11mr95139908edq.23.1560974091445; Wed, 19 Jun 2019 12:54:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560974091; cv=none; d=google.com; s=arc-20160816; b=oIdrPEw1aAQthyhXbEcevtHa351zsBnc3rx/Rn6WiSlTYBjI2tA8S2gxPElnpnndFZ Vf9Zyz9VmvsWMWz8X+5Aaz5iIjv//hfSDfKcPoXbv/5Xc+81rOCRZk8SMhPNkclgJbvt qLuOqw/o0qAtpHwkO+Mtb1kMO7ErVXuuiky/TvDRvj0vKruH62E4p57nk5dMHnsezN6c YwxvS/zo3VRg4FPu4MiqNbg6TYpttVF06rYL5F6pmaehCOhuxKGSBs34Ub6nSYF1YTIV jSgScNV2z/nXl4DsAmO4A2mJQWuxhem6R7MJ84fL1reYBq96GNesBesG5nqRwPmbDCLu 4tKA== 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=agoXBU9KBwBvYhLupQKySupZDhJoyEvavC+P1ObpTUI=; b=fhco5JhbtbMNGs5ckRpGd95+cEBnZP3Ix/HdRPycc0jUT4TgSRp4NMVfK/wGjsEe/p H6AYywKTNvcJroxswBQQ2Kkq/lLgf0rYNadNDY8HhJYSVN3BB99xdpAHlvDQNbiv3mLI 9GuHvwMmiRgqYW/L8ADPl8bDkSBapL8nbIM9EkoOrfOHm4gGiRHrrHd8J7hejO+RFUEr KDaZygn3E7HdiO4RtEEkF4LDSqQvGfhIaz3d7Ju3j6yjnQmDQHfBs5aBL5Jo9gCIA96X kion386D3T6HHiFgseCj57UOMBC5lKHfYwioDeYGjLvOQheNA9noB0+zkqQar5CGBz1R fyAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=LenmuXzH; 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 z51si15127659edz.300.2019.06.19.12.54.51 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Jun 2019 12:54:51 -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=LenmuXzH; 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]:41488 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdgfS-0001AA-DP for patch@linaro.org; Wed, 19 Jun 2019 15:54:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53896) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdgRX-000643-Ct for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:40:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hdgRW-0008TA-4x for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:40:27 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:37569) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hdgRV-0008SS-Uh for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:40:26 -0400 Received: by mail-wm1-x32e.google.com with SMTP id f17so709071wme.2 for ; Wed, 19 Jun 2019 12:40:25 -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=agoXBU9KBwBvYhLupQKySupZDhJoyEvavC+P1ObpTUI=; b=LenmuXzHbJZYCZiqMPSJt1R8ChPKFru3KZsS+sKjyzc0whAIF7NtQ3dwN1K7zsOICy w1bT48CttJsIQ3R1T6LUolybx5swIE8PX3E6+9JwbQsXgnfHmrU6sVIXvU2y1a1dRHSg PMp3RjeG0arjOQ0UDXfOC9pK7Jr4ZRrs+YHw7Gh0+OLsyHQ7V+5bujLHWA35Yqn2j5Io 3UViTwYtLu+QoKM3OJnsrNPxwbVFaOfaTx0WkWLaxKfW5aEn7jZ7iMBCLrEfZIsfEyib tYsGL61+v6lAae6lRTEyVeV1UxF+U0IS2dXheFWhEfHgjVpfP31EmPk/JqocV9P3qj8q Luog== 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=agoXBU9KBwBvYhLupQKySupZDhJoyEvavC+P1ObpTUI=; b=A4n3vvL3rDavPvKnl4hAf2VfiLDROsTupNKRQtN4sZk7xuxKGbv/y8TyjwCj31uS6x gBclMIdLO25PRcZs9Z4C3WjXdOUJ5WN57AW5AkMFZ05WsyqnSEf/uZcEYcb6gql+5TBl XeVZ4J5Vw7JthARs/9BtrjJXUHL+cpAYEGDLkKqslkBhpbDdM2UATyrQxbqDNO+8LIqT l0V84W4THk/agL1KNi28cRHaUwV5CwqQ/B9zkLfTOqIhijVr459bm17lqRmQ67FbZle1 +PQXnGZ8FCh87/jdPftUvKVVMw8tfMJzZ2Q/WnUiTqtHvRE5t3ixy7V/wNRv81lKlpzv kHTw== X-Gm-Message-State: APjAAAXR9DgYZjCpLy1bhNN374XFOa+UbMm+i8+38qHCLf22kDWZ4eaI UHc3fen5+DiYOzr51wkm9uTw6Q== X-Received: by 2002:a1c:5453:: with SMTP id p19mr8935717wmi.148.1560973224759; Wed, 19 Jun 2019 12:40:24 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id r2sm3356988wma.26.2019.06.19.12.40.22 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 19 Jun 2019 12:40:22 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id B86581FF90; Wed, 19 Jun 2019 20:40:21 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Wed, 19 Jun 2019 20:40:07 +0100 Message-Id: <20190619194021.8240-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190619194021.8240-1-alex.bennee@linaro.org> References: <20190619194021.8240-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] [PATCH v1 03/17] 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?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , 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 Message-Id: <20190613130718.3763-4-crosa@redhat.com> Signed-off-by: Alex Bennée --- tests/vm/ubuntu.i386 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.20.1 Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé 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 Wed Jun 19 19:40:08 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: 167258 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp1134070ilk; Wed, 19 Jun 2019 12:51:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqzRGCsFzz5k3bKgdn177RMo0f3lzbf5mGOJTv10qQFKnapBwc9TKh7jjJ/vTgRNvbXVi9LY X-Received: by 2002:a17:906:e087:: with SMTP id gh7mr58506210ejb.22.1560973906017; Wed, 19 Jun 2019 12:51:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560973906; cv=none; d=google.com; s=arc-20160816; b=VQ5Wwo4/jnfFrp6YTVyihABbeN66PDV/9R5CrKxNlf9J72P2MN485yvoQ7N0N5Tv9I 5ZQINZDKD7imv/4HSkHXbwoYOX1Ng0izqOmxoOGUpbY+lE99/ICypApYFimq7qbHWgTs IO5OQbhFTF/tGzIkosJAGESjUyi3kEWP58NVJhKjhq699H6yrJ5u3WTS41RToyLZQBfg J1kHNHiXe9ja9MZBhCl6cuB/xQ2WJex/bwPuEy/Vv9LZrOP2Pk+wKOJzbT2O087ENAgB PTV43qtt1xMLfZWZHopL5RyzprUpGjRJn4zdO+an+D60ltEX4NEujkBFspzlAz8Hxzax XYpg== 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=6j/tPjZmC3evFe7OoozCDsXFpBZiOXO2+h6m9FK7slk=; b=mwUqKUP3J3BQ63chmTQLf1jSj2d0qCSN43Kin5l4PRAayFBa391n83dIiTmoZ0ek2O zHM4O56mp25g+LYTJG9m6tTBmmwMIPMQL848BkgorjVo0icpDByKvXBuIj9ZzzzeXsKL iaFCEpIFOZr1ypKQMcmuLXNZZSPmWbEtTn+YAZSW4zBiuOy5gp6pdnWvkYXMCXKl+6sb CXj4wn1fPLO3w6WZAO5xVLjb8cCHDHnqHJLYi3fsUsn81LeJpsBZq7IAx4AM31lTQHOr g8PGDvUNKHm8CXdWYqWsA7diW0C+TUlOFLZYtiNg7jN+bd5HOSZ+W2P+zML6lSz7p25+ cjDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=yLSSok3Q; 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 z52si14749073edz.118.2019.06.19.12.51.45 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Jun 2019 12:51:46 -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=yLSSok3Q; 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]:41464 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdgcS-0005uS-TI for patch@linaro.org; Wed, 19 Jun 2019 15:51:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53904) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdgRX-00064r-UI for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:40:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hdgRW-0008Tr-VH for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:40:27 -0400 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:52108) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hdgRW-0008T1-NA for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:40:26 -0400 Received: by mail-wm1-x342.google.com with SMTP id 207so694700wma.1 for ; Wed, 19 Jun 2019 12:40:26 -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=6j/tPjZmC3evFe7OoozCDsXFpBZiOXO2+h6m9FK7slk=; b=yLSSok3Qvl8AOpn0jUmJuUibKEqNNfg7Ajqpfj1TysSe6Iu+h9YRJqi8YKz4N+wOs+ 6FOtT4zzkTT4AeFRGxSVrVmWSkYnsOamIZiSnNMaSJtmQ9qwqgNZHvcMqXJdQYrhiUBg 5EgSEDWP2Ej6kLjmQbCGua8MvowKbv3o+PWNKphem6DwkWhYTggD2mjFXJF7oP2n+PDy Y5/0AOXiAZs5goOCQ5sSUjjsheY8h2IVTVjVv3SCwCkHliM6Ys/nb5PeT5wRDG25lcjw 50V31RSA3stpqKLAxibaX5M0wvowAaqC1gXcPdTXr5e1DyvOJlyQ1lumENot1E96LRWF T4nQ== 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=6j/tPjZmC3evFe7OoozCDsXFpBZiOXO2+h6m9FK7slk=; b=L8zRUOCp6iT3cfse4ofnXT1APoTpSCoFeE6HgEjWMmUesBi122O9ScMEAisfT8YRud UrmO3NzkbpiZ+IVnsKe+YEjWyW2By3BTuAWroPWRzOM2MlJ1y1mOpbntsvCCohUvBlU5 ZrcGZQxcyHcfCWGQD7EUNsaJA8Gx19V6bZ5A6y2lRpPGkt7pRbTX8caxprQpAqmfEq/v 9JyJ+WpYvsp9OH5+BlqNHhcY8ym4o9mIWj2PAtWOjuq/jo1sujUXgeo9Q59Mg3sKxvRx eA2r7OubjzO75t03xVMC2RklGZAwP23wojzZF9Jp1R2wBpxPMeFyySyKsyMf44DS/pqc u/ZA== X-Gm-Message-State: APjAAAU3N/OZQmp0i4l1U5/x8KtATOjhXAZ8vCWhsjPRX+Lux4+kJ6G0 PlKVfouGRCSpyYIBIYNhe0Ckiw== X-Received: by 2002:a1c:7e85:: with SMTP id z127mr9804067wmc.95.1560973225536; Wed, 19 Jun 2019 12:40:25 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id v65sm3571592wme.31.2019.06.19.12.40.22 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 19 Jun 2019 12:40:23 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id CADC71FF91; Wed, 19 Jun 2019 20:40:21 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Wed, 19 Jun 2019 20:40:08 +0100 Message-Id: <20190619194021.8240-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190619194021.8240-1-alex.bennee@linaro.org> References: <20190619194021.8240-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::342 Subject: [Qemu-devel] [PATCH v1 04/17] 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?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , 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 Message-Id: <20190613130718.3763-5-crosa@redhat.com> Signed-off-by: Alex Bennée --- tests/vm/ubuntu.i386 | 1 + 1 file changed, 1 insertion(+) -- 2.20.1 Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé 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 Wed Jun 19 19:40:09 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: 167257 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp1134048ilk; Wed, 19 Jun 2019 12:51:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqw4+vsCAwl8ojX/hO9NqavHVeuDOq3Nn0RollCtjhGq+v0uA+5WEPWLqYmVUhSf2LowhrJc X-Received: by 2002:a17:906:1344:: with SMTP id x4mr48225567ejb.249.1560973904342; Wed, 19 Jun 2019 12:51:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560973904; cv=none; d=google.com; s=arc-20160816; b=j1Dz5K1yVh5UE+0P5wT2lr61/sBhj6Vh3MKcYpRCNlPJB/oPhaDNvS1tupy03w54MJ gUSy3NjXZNoF2lbUJ25J5LdPSiSteSt3ZmeT+zSEq4wjuK7Yvh3OJCbcPuADn+ruhSLd jhBHbRdtax/9uZjeA8XgycKrI4FerZ5M3kasULxKvHrHdvEfwx9VJwpkm28tpMxq+Xux pfFIp6IlCZrjo+7jE7aBj5lh31GkxSoY/pPSV+U0zNqU2+incqJoTbNBKGgN8O7GU7+Y 4rgBbheSmGeKJRYvIU9V6y+fQ8QF5bfTxiqjh7EPCc7o8GHaHkLZOHJgJug8jEUD3Vhb /+LA== 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=qdTjyQaBb0/jp//KyLcDmonBqL8NDTLZR4EMwIjuiJg=; b=iUCRg2lTavj9t8XO6rNkFBJLVhDCCRr+huZ3pQsW5dWJG6sFmtcDJt7YSrUSMCHK+/ 8WhVDV3RZ8Lt71NUf7XCUNlWXEQHS7dqvhTvVIHfH7Q/QrckqGnm5u8byQXxpgfiIW0z PHif9p18Zuq3NNNUJzBgN38npPVEPpVP8dTlYCK6MgihlaoJfJMNXreYn+2q9w6o9AIe 1uBt4k/xU/pWCQMOdy89ACy4L+WRWTL8/FChMywPL3oteOIawL2ql/9WfT6ojCXpebVu NWFj2KV0r6mFHgBzPA8LHl33Nb6pb+ORaPqSoLSPpBMt4FIwOHB77mlI8rR3LWsvSNln ltLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="GOTKH/so"; 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 u22si11509430eja.77.2019.06.19.12.51.44 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Jun 2019 12:51:44 -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="GOTKH/so"; 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]:41462 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdgcR-0005uI-Ba for patch@linaro.org; Wed, 19 Jun 2019 15:51:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53928) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdgRZ-00067x-Kg for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:40:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hdgRY-000062-8G for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:40:29 -0400 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:38779) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hdgRY-0008Vd-1r for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:40:28 -0400 Received: by mail-wr1-x441.google.com with SMTP id d18so493485wrs.5 for ; Wed, 19 Jun 2019 12:40:27 -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=qdTjyQaBb0/jp//KyLcDmonBqL8NDTLZR4EMwIjuiJg=; b=GOTKH/soekvQHQvQQZP5TPI1o9LeBPGGBj4hpcm3CPKG6FJS53AN2siCH0/8AIWmb+ 0HnbD8z7Jf0isQiji37McaIHJtmIRpsC+eYQ0SfdVlhaBBCY3sWWQB8bB5Ius3YCqqMa pinEzJ2r7BlCc9s1mxwrpiW6mC+Xp6cp+7myNa2KDis5aAPWK/Jr4Eq2hSnkYNYFY7H5 QMYkSt7ogRJ8XLtS2MMByFcrvh6ths0kkO5uTaC5oYeYJwH8Q5Z84yT2LG/pVQa8hOCQ e9qypKc8m5sdlCQkTe680JjGtFcnxaX20XvdmXltfiWfvx8nKqB9ymqZsobAXGQsEjIn DFsA== 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=qdTjyQaBb0/jp//KyLcDmonBqL8NDTLZR4EMwIjuiJg=; b=IZBarWLlhwVkTcDNP0QXOtwnf1/8xbF6WEFut7No16d6orUxZ/xVAfhumyPBOdDt2p h5qRiP0vBfU5CYVZtP/x6RzRtTAfL1Y4cwY1k6MEe73COaj6/kJyWKJyJyOZNCiLHokW tchU/HTpp6Cem2+ICXbTT4lp9hpXgVvpHAHTaJV5ctdCNpqGyHpm1WvPPWEPvwubUHNQ T4IQrg0tdEhfWDYEcTqSu7MJILat7lF26z8Sb4pAea9Jecl+xoXAnMIRrGwhRzN+8uLB B3ppYVKpcVDNydU+kO7NYkLAKXoM4czkd684j5ARynOKUmON7kf7OkNlHmddT+gQapTq vlfg== X-Gm-Message-State: APjAAAVSS2cOoqHkTielA8iwZzt1g4FPy4to2xt3jjlN+O6jheuOCVzr CJfrZWAkEJ90fYymRc2DDGS7o+lTBZs= X-Received: by 2002:adf:efc8:: with SMTP id i8mr11569882wrp.220.1560973226941; Wed, 19 Jun 2019 12:40:26 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id i25sm7844878wrc.91.2019.06.19.12.40.22 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 19 Jun 2019 12:40:23 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id DD8FB1FF92; Wed, 19 Jun 2019 20:40:21 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Wed, 19 Jun 2019 20:40:09 +0100 Message-Id: <20190619194021.8240-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190619194021.8240-1-alex.bennee@linaro.org> References: <20190619194021.8240-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::441 Subject: [Qemu-devel] [PATCH v1 05/17] 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 , =?utf-8?q?Alex_Benn=C3=A9e?= , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Gerd Hoffmann 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 Message-Id: <20190617043858.8290-2-kraxel@redhat.com> --- tests/vm/basevm.py | 9 +++++++++ 1 file changed, 9 insertions(+) -- 2.20.1 Tested-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index 4847549592..5e30bac661 100755 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -38,6 +38,13 @@ class BaseVM(object): GUEST_PASS = "qemupass" ROOT_PASS = "qemupass" + envvars = [ + "https_proxy", + "http_proxy", + "ftp_proxy", + "no_proxy", + ] + # The script to run in the guest that builds QEMU BUILD_SCRIPT = "" # The guest name, to be overridden by subclasses @@ -106,6 +113,8 @@ class BaseVM(object): "-o", "UserKnownHostsFile=" + os.devnull, "-o", "ConnectTimeout=1", "-p", self.ssh_port, "-i", self._ssh_key_file] + for var in self.envvars: + ssh_cmd += ['-o', "SendEnv=%s" % var ] if interactive: ssh_cmd += ['-t'] assert not isinstance(cmd, str) From patchwork Wed Jun 19 19:40:10 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: 167254 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp1127181ilk; Wed, 19 Jun 2019 12:43:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqwiUorDXe98tBL2g9nwlb9ViA0bLFqmB0Bw98MS227+TmmF0XTrUFSWmQ88Ze1icms2DmK+ X-Received: by 2002:a50:b14b:: with SMTP id l11mr108339562edd.76.1560973407699; Wed, 19 Jun 2019 12:43:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560973407; cv=none; d=google.com; s=arc-20160816; b=sUFPJ9NzZdJX6t1mIAF7PxBZ7AM78ZeSNCOuSy6AlgMSLNBO7e0+fkWAp/RPMT1pLd Qybc/txbGzLl8E66JRWfc8bP1aXPDo0QWcvhZcS1QmE+BeVjeLe3REs/jOIQnlh0Pm72 /o9286nGcbCuyXvZZ+1HQS5/WIsDKg+/1FF0FBwDljft2LSBDN7bG6cuRIQD3hVhjJWK pfge1OJBkTHpNvy/k9Qn/0Wua/0NQUBK/1e2EpyHChBIMqvznuMcopDbHAlqZ0BJaaj5 KB6g7MWpB6RYuNT3SEBQJWJN+8g0m4B88kbwPU4MIko6Qkzeyq8alMXX7RK+aMG8RwiK r50A== 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=xvCzdluYnrwYcHghSKZ/rlY7/FmiKtd1c7t0G93SmmQ=; b=d27i2LWGw1YSRlbjjet9RX9hnCQDzYzaltDYsjr2DlH0wxHO5iHCY4Ad64mYjI8jc2 zExS9aI6n7IFbFEcppkqt3OtHGsj6lyKWS22UQKwgFebx7GaKTtkQlxRUpo7lb/YD6L4 UfWh8vf9CHH8LBo9eK/jrAJ2n0mQXaWjRIN1c2hxV7u9O1NmnXSRgAAKuOtm8LnJUtHg THEtdwZDE+L+KY5zf6GvvOU25wIAGkyWb3/1MaLy15EWGcLPw7mYTMVaEVjRgrDW0YP6 yow3FcH2FjWmIsDe4ts9zyC1EWIyHa2ZAfzQtwt2Y4cT8nSiPSYwl0hIG43a4n0wD1AU eMjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="os/VqEbQ"; 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 i12si13952222edq.333.2019.06.19.12.43.27 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Jun 2019 12:43:27 -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="os/VqEbQ"; 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]:41428 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdgUQ-0000eu-Kt for patch@linaro.org; Wed, 19 Jun 2019 15:43:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53918) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdgRY-00066e-JC for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:40:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hdgRX-0008Vo-H4 for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:40:28 -0400 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:47059) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hdgRX-0008Te-AN for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:40:27 -0400 Received: by mail-wr1-x441.google.com with SMTP id n4so440261wrw.13 for ; Wed, 19 Jun 2019 12:40:27 -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=xvCzdluYnrwYcHghSKZ/rlY7/FmiKtd1c7t0G93SmmQ=; b=os/VqEbQx1wcOOru7EslrS0uy3sCxZpv4+20JudtT0TuXAeNfVuIhP4G3rpa7GR07y iBDi5ZT+Hkd06yHL9qs5AlDiF4X/zglUIQ6V0xH8HKWdAFaQAL/SLFoJsmuk+F5eLDTl eWMaVgLz9ku1v+3lWuESwEqXaC6lGaqDV8n6OvInmMVu+mByVgDbEwSBNDxk1OT5802y xEnikeNJ/QZIx1U1WfU2HU/IALmwWoyu+XIngM0tYSK6+nBJ13aNSOvpIHmza1QIiV5S F247UCvSwpg+RlhcKCYj0SGmiNpqFDQbZwlti0h+C9jG82Ke2fJB+3mFLWPuWCtVlh0j wLdw== 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=xvCzdluYnrwYcHghSKZ/rlY7/FmiKtd1c7t0G93SmmQ=; b=ctF2/egF0zbJXiTsz55ZhJyLHSQ3bZA1RPMy2F2iiVWgIAK4vaoq8UDLb0AyV6M+ee glYrf8I9Wm5j0ATS2y7zjjBWkzSM5+PRCgzhzVM/JhugKq76GTXrXnMAj+jzJeK5QQyE MgzVUdv9qiz9JvtwUGhGrukdZZbGf54bIHa/KZjwKvR+MJvwRcTjwyKBax6Fs3RsZvrK 25TAWODR5SvIBBl4AjixSZzdsHSP1KZUCMZ83jrEcPEM3L0dzMMXGFZh4Ay3jxBZakhM tfJ031J8ujhSHYnVY9LYyeCwKCfnWiV5WjnMT5HylyKiaE34Rq1GcEnEHAcqPGgHH8uV W0xA== X-Gm-Message-State: APjAAAV2w7j2y+F0RzyaCsgQzYZrQWTQw7nX9QCABjeM6Nm8JgugtRhd NdWZaPDK4BpFOW3iTWkKh+PXAA== X-Received: by 2002:a5d:5510:: with SMTP id b16mr53368161wrv.267.1560973226051; Wed, 19 Jun 2019 12:40:26 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id 72sm15113657wrk.22.2019.06.19.12.40.22 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 19 Jun 2019 12:40:23 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id F01371FF93; Wed, 19 Jun 2019 20:40:21 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Wed, 19 Jun 2019 20:40:10 +0100 Message-Id: <20190619194021.8240-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190619194021.8240-1-alex.bennee@linaro.org> References: <20190619194021.8240-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::441 Subject: [Qemu-devel] [PATCH v1 06/17] 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 , =?utf-8?q?Alex_Benn=C3=A9e?= , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Gerd Hoffmann 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> [AJB: added PMD's r-b/t-b tags] Signed-off-by: Alex Bennée --- tests/vm/basevm.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) -- 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 Wed Jun 19 19:40:11 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: 167263 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp1137604ilk; Wed, 19 Jun 2019 12:55:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqz4rws/NaLvIls/TIQs/FAVvLgYtcwO8VPoi01vQp54SscW0Z8V8S98uppR0Uo7+jrvGdqj X-Received: by 2002:a17:906:52c3:: with SMTP id w3mr9946746ejn.39.1560974146314; Wed, 19 Jun 2019 12:55:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560974146; cv=none; d=google.com; s=arc-20160816; b=LpoZIGg3DONA63u5PvafMUKlK3FmOsx33jLnM49dVNb6Rtp1+UCiGU3XZ0O/7MN2of Z5wkzgiddrwUSSfnQQO01I6WnIM3X3b58BZBk51BNCmN9XEkCdOTKExNWtOmzyS/ueLQ K5wuwlhWF6SCCzpe6iWUHuwSzTyON0Mv062Cf+ggoMlCLtlAqq9PGT7zcNMe5cOYkX+0 qErin9Bb3l/PNFVPUCkFQC7p1d/AK3USzfzwpRuywL5dxmpCmE5QVFscQIvm8tzUBOUK EdKW9APY/Okun6Mg6kaI644IifDVwwS2cg9Oo2dJZWlPWbdrpc/FTDSvmMQVgh7LTwV/ PlfA== 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=+wqq4GBFQwrMJ04FlDJ+2L8IS0oLTrKe+hT5DciI8mk=; b=RoAOmi5ez6XtJpiDvxsyMrWLDMnkOsCDi97mr2zwfqQKWf09aqqDUfQ9nlET7frgZx d7uLnvSj2LTJem6D6fC4rBcFdZ9M7J50EIpY0tXisgWkzhOALQiGyycikY+PnM43gJi+ tNO+dB1UGmnttizSdXd4CJto7mBSPaV2sAObGvZ40Fkiq1wdQHp/Hrof5meHzgWAagFx 3T6XB6o07saERXvGn73c/AImDZRD1WbTV0OM2/+u8HOowYzDFEyO/e8eGk7XQYB+YZpf 81UjpWxsrKfkOL5glcsuDyY9lg3XgYW80BgEKfB0hOrYvZZCBv9kpWhas6tEst1GtX+s QknA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=JBAffJZG; 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 z44si15161036edb.16.2019.06.19.12.55.46 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Jun 2019 12:55:46 -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=JBAffJZG; 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]:41494 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdggL-0001KT-AD for patch@linaro.org; Wed, 19 Jun 2019 15:55:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53944) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdgRc-0006AA-Kh for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:40:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hdgRa-000098-Rl for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:40:32 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:32868) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hdgRZ-00006K-K2 for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:40:30 -0400 Received: by mail-wr1-x42a.google.com with SMTP id n9so528650wru.0 for ; Wed, 19 Jun 2019 12:40:29 -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=+wqq4GBFQwrMJ04FlDJ+2L8IS0oLTrKe+hT5DciI8mk=; b=JBAffJZGJkFH+KR0qxTHczfggE5KA8gE60L7XjGcbcFnlOJp8KCCErxUxkN0CnsdJu 9G+kZHo485AOxm+xFbqAaDS8gwfkSOaMjzCEd80+c/DjSFKp9GF6Lyxezue2EXiOb7IA 072gwJrYsVoFrvNej8gq/r9sfzXak+Mpof/tS0/cxPc4Nx0aWAN/8q1X4HsGZJF7jI2D kAgeAm30jJssYrgU0kVJktIZ6UhXcAQUkSsd8PuJGvOHrjeIdLO98b6WVmDHC1svdhDJ ZZO7jr41HkfdxeO46Qpkfgaec46fk5l9AIRreAzbbLQhTb0vj8IjLxYrfNPVUaukwWgK EPTg== 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=+wqq4GBFQwrMJ04FlDJ+2L8IS0oLTrKe+hT5DciI8mk=; b=k6zbQJZMy3Yt8RON6TRr0JpT1qs6Enau8wiNksm1A/oic20whvaljzapUqaIHXReqF 66Bs8Rk5oE2fDLCInKSyYJVigP6ZDQepmpBkr/lcRsDCmbwc0JZHLF77cMXcsglGFPyk zC/lYnw2rJKrKG6yT2Nt4XClzWQCWqMXhd2NKBw4lDD4lMMQdNToND/WWO9sQQX/B3Nv kMVMIL62kV7tFh1HqsLiu3qdUQvBeDc1Eh3qJ9mroA25oQenIwdOCSFJx/td5+tFnO4f kJddeVJsu+7WsemE9KqVHAsk6i+C/1Z1RWDLpkGieyvdmJcW5DDK28C/93/3zDj2r7Bj es/w== X-Gm-Message-State: APjAAAUiCklwo4WhBHWqjh1qubvzrhMSBbfbrbVhoZAm6n3nH2T31UK5 /0OrR8YFnyPyNUig/xQoRd3cIA== X-Received: by 2002:adf:ce8f:: with SMTP id r15mr76694975wrn.122.1560973227907; Wed, 19 Jun 2019 12:40:27 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id h21sm1393459wmb.47.2019.06.19.12.40.23 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 19 Jun 2019 12:40:26 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 0E50D1FF96; Wed, 19 Jun 2019 20:40:22 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Wed, 19 Jun 2019 20:40:11 +0100 Message-Id: <20190619194021.8240-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190619194021.8240-1-alex.bennee@linaro.org> References: <20190619194021.8240-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::42a Subject: [Qemu-devel] [PATCH v1 07/17] 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?= , 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 --- tests/vm/Makefile.include | 1 + 1 file changed, 1 insertion(+) -- 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 Wed Jun 19 19:40:12 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: 167264 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp1137711ilk; Wed, 19 Jun 2019 12:55:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqy4zE+CPFQBjWdafLoa2jrRhHKKPrXjr9QJHuQjEahbrrHH0Mw8DvprxHRZpNEHYnCx9KOO X-Received: by 2002:a17:906:f0c7:: with SMTP id dk7mr12383904ejb.97.1560974153178; Wed, 19 Jun 2019 12:55:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560974153; cv=none; d=google.com; s=arc-20160816; b=CGOuYB7ElbC12YGMzeSIfV//u5xau1Uzvv+dKeK4Wz6jvkbzbyMDi62TWfkz8RZGPQ wIJJG5CrjfzjXoQKSXdjq8KQ2x+2DhMCg7rkZT2X3lTwvP9NEsAsRrCiVIrxUrqjgPRH 5K/qYSSLNKUTTNQSJr6KEmn1AbYKMbb6/RHiUckPQ6QZn/9TWtEV2+x2Sup08Cy+g1uv I7ziFGIcbBGlQ3taFD1zpSimhCm5thwRR6KGS86BdPsc8iRKCqClHVypYkDD33HWmSCA idpuDFQ4fzx3uoq8t9aCGjeoGvuMFjz9/k38GDHkIl8+zmBMFKL8D3FpqqUoRSxcfKjL lqgg== 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=XPPAW9sETduxZJ0ooFzD4w+7btkzMy95F7Mgcr+ef2Q=; b=Zflw+FGpFdylbtGQv31rHmXBUBYGIiyooZ7DrYaHeoBeQYHP1036yeM8ZpSbDFKVFE XAy2r9LGjBepf0IwNy7i/Qa8XYjRE44W/G6qes6thjMUD1TxHlytSbgFyn0jWbJbWJ89 l83hD+m47qcH9hU1SoMfKJ3xsTkO8DBcnvb9yrXTJPeV7RJ2Faa3VMq6QUThQ1J8kSHk 4Z6tI28N5TnG59HEfj+bo+aIq5S6n/G76AscfzqPpaAEzVgMBAKSMpenUiAOAeYZByJu wK2usfLNz4N5jBTbJ7Wuj+bzcqyC8odna3bnxkI0aDqffQlGpvbIG7ifuwo6R0nz2kHJ qyOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=rxqFVkAI; 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 l16si11312132ejd.17.2019.06.19.12.55.52 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Jun 2019 12:55:53 -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=rxqFVkAI; 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]:41496 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdggS-0001OR-4S for patch@linaro.org; Wed, 19 Jun 2019 15:55:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53971) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdgRe-0006AW-IM for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:40:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hdgRc-0000Al-Io for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:40:34 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:39008) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hdgRa-00007A-Pr for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:40:30 -0400 Received: by mail-wr1-x42e.google.com with SMTP id x4so487840wrt.6 for ; Wed, 19 Jun 2019 12:40:29 -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=XPPAW9sETduxZJ0ooFzD4w+7btkzMy95F7Mgcr+ef2Q=; b=rxqFVkAIueAr1gkdbJPVfgsA4HfIDUpegE4dnUx3mBtXWfbr0IC8WBqkHqj0+0DUfL 3xk+Lp/BZVqSgKAO83vlk1r6L2j1LxOJ9rVoIvNkUkGsWYnukmkYG043FT/8WZAN1xnt gqdxmT8X6XSJrssBodM3SBLPtv7V1w7Vi/HybQaxA+kXV2opOzOhaRY1sirQxEBTO89S WhxvT5WKTuhwIwyFEWdi4nsjTkPPM4miy8uKDeJdibAG8jW1IAMTlOUm3y+e9wr+kg6B RpmqTPnET2VCqx/Uan99kQcqwDoGMN/HRjOPWuFHOsLZOBwCPCNkfSbPKK68V22qde7B k2Rw== 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=XPPAW9sETduxZJ0ooFzD4w+7btkzMy95F7Mgcr+ef2Q=; b=PecIkEs8iO/0gZIte8x554+nhZ9giTU2gGnh8gvZMQ793gzMflCs0j087D7W6h3EBy aieqvcNosqACOmC3G+B5DHYp1ZCtbPOFqMexTGZ0SCAMt881YKJ4bu2sQAAkj4L7F9Wh 3T1krZ8odLJ/ACYQephpBo6WQj8orb2ikRA3/SvTGzOiCpf2AMMUNN/XAr1Lf8suEBpC BSwXbKythm9ul/VEoCvlxR19H+8S5bSa3JslCxEsoqTwIdAoe7SaJgGvuwYOgTLB6LAF rSQxdZWMk6GfVNVYu/Ub28BXRurwjUPun1N5t0ooZAEJYSM00K5rhMya1vyfLsfDS0HM Jdyw== X-Gm-Message-State: APjAAAUPKaMAuiImXAAasdeVqiOtO4of1MFWAZlrQVUp7z6bTc7XkXrf UMSnA0tzI6FNrTMcj6M/JEXCWw== X-Received: by 2002:a5d:618d:: with SMTP id j13mr10421354wru.195.1560973228499; Wed, 19 Jun 2019 12:40:28 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id t14sm14845097wrr.33.2019.06.19.12.40.23 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 19 Jun 2019 12:40:26 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 210121FF98; Wed, 19 Jun 2019 20:40:22 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Wed, 19 Jun 2019 20:40:12 +0100 Message-Id: <20190619194021.8240-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190619194021.8240-1-alex.bennee@linaro.org> References: <20190619194021.8240-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::42e Subject: [Qemu-devel] [PATCH v1 08/17] 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 , =?utf-8?q?Alex_Benn=C3=A9e?= , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Gerd Hoffmann 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> [AJB: added tags] Signed-off-by: Alex Bennée --- tests/vm/basevm.py | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) -- 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 Wed Jun 19 19:40:13 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: 167261 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp1136785ilk; Wed, 19 Jun 2019 12:54:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqx+0ZSCsSBYG1plmSD3PYKV63SBNF+kSOikmd0FbqrqeKhSxg/FZYYGvnAr+THFmHw7cMZR X-Received: by 2002:a05:6402:2cb:: with SMTP id b11mr79478678edx.281.1560974093401; Wed, 19 Jun 2019 12:54:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560974093; cv=none; d=google.com; s=arc-20160816; b=u4AKv1udXvp6KYCB0EG5EZWouDVZvjRpil5797nCnZtvkR8tLRHyxMTeRR0uKQOGC8 WRFfkBRvE1WJeAUeHLCLCBxDy4Q/dFv0cikUKcJDDQP7O+mZ/GGE0xGcWDTUx3MoOqs7 psRojp7mHFc0IWAjpZq/cP63e+8vlU9Cw9I/wbDlEYuQSIW/6Pcr5CIOs1lcIhkQMgjr sZYQ8/2msWK1QIcuwnBvG2wSv13fIVWnz1dF8IXD6k3eiZLhMYShI0WmDpl7mcmmmA3u /AhEimi98uABPHXChHZoVvgRUAprtZOedUfwz62F4KxexZSVthGz/H2F5Y3jxrRH5pmA 6hSg== 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=ARkcebMpISH50aw23FUa04C3Oh1jK41sh6r3OqpObcE=; b=VxoL7W/fMCgyLmNX+9OjrsZNUjBH01aV4ztGbyEsFlEeTWODaQPoch+clZpsKUXXzB qrKeQV4ILCGOAJnEQtwlC4JwX72BQF+hYjNMaTwKajcx1dHPta2GOPAO0aRLDnc3ct4+ FX0ZKob25i53ZD3HC7oMp4KPInQhtD9ZgKnhTq1bAPrn/zMu0v1yhR8U5jXWWfThuvlF n0F3zSOi4ud/9w/8yJfKvs+mC2mVevM2ziQHf3u6dzSyAv3JDL/Tjs2cvbOTLKKifNJS MKUDtpVQQVGA+/uz40qsrhpUaK7wVb5Jy6TURbDSvc7+q+unEUvGAQ4frEp7oVd19VFo uj8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=g3c1KA5K; 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 n3si11522782ejk.56.2019.06.19.12.54.53 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Jun 2019 12:54:53 -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=g3c1KA5K; 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]:41490 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdgfU-0001E6-Bn for patch@linaro.org; Wed, 19 Jun 2019 15:54:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53975) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdgRf-0006AZ-3y for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:40:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hdgRc-0000As-Ji for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:40:34 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:36963) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hdgRa-000086-Qw for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:40:31 -0400 Received: by mail-wr1-x432.google.com with SMTP id v14so497639wrr.4 for ; Wed, 19 Jun 2019 12:40:30 -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=ARkcebMpISH50aw23FUa04C3Oh1jK41sh6r3OqpObcE=; b=g3c1KA5KzxMalCXecUFEgbFY2TZc7+/4CRaeus3y47wJWdOMq+XNCULHOUIj5XXxQG oJ2LIrP3N1rRf2PY8B14w1vF51S3/iF1rec6TvWmPEW43GJ9bTk6C6physJEWswcKVg5 gstdR0ZOuhzGkpgJT+q9+JwTG9Vu4KyBwKwqfjb7plmjk8jbQYo1kwXD+UvXDgV7igNa Xs3IZH5sGojGGDjh8gHxePDAKQbLCHuV9KStb5ErbzeiQXp7QejJikQ/B9fZWbx4WVc5 laTaTmMP/6ofC9LoSybNLm0OE1Er03Rd5uDZgJuOt88bk/n+7ch+ckTBCC7O5RIRKsra nBNw== 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=ARkcebMpISH50aw23FUa04C3Oh1jK41sh6r3OqpObcE=; b=TWfiE75I8j+5WGA9XzF4DHDojdrmMJSxQOUCUfszHukFBdm3j3ZjKpofIv5LWQvEuy j8uXOUsW5EY4rAs98VuSt+R7zSHtxyDzbmlSdS50OO8aH0ZLVGEOJKQAKRleN9b6Dlbk waEvv2L2OaBjQn8BV+3AVKxENCKXM/5FWZqjAltbyWIM6xYB09XHI4ugHbd0KsaRdKZJ OFzcxvsfU8uYWvYS+uM69YZBsSb/MqlOFrUhhcX/BaXafXhjvqYTAQd093cL9MeZkhlY MeAC8oD+8Iev/VE26X1lEiwSFEcrGvnM7wGEn3yM4MCgAnlPzZ8CuZR/qZRTXWqRkjdv Km/Q== X-Gm-Message-State: APjAAAVWAai/n5mJAfTRDPiCI/7IdCAKexBY+5aJXaqSSPL+lb9ZMETr R13K/6bRSfBeF+JS6lZl04XzJw== X-Received: by 2002:adf:b1ca:: with SMTP id r10mr10910899wra.156.1560973229277; Wed, 19 Jun 2019 12:40:29 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id q193sm2271869wme.8.2019.06.19.12.40.24 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 19 Jun 2019 12:40:26 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 335AA1FF99; Wed, 19 Jun 2019 20:40:22 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Wed, 19 Jun 2019 20:40:13 +0100 Message-Id: <20190619194021.8240-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190619194021.8240-1-alex.bennee@linaro.org> References: <20190619194021.8240-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::432 Subject: [Qemu-devel] [PATCH v1 09/17] 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 , =?utf-8?q?Alex_Benn=C3=A9e?= , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Gerd Hoffmann 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 --- tests/vm/Makefile.include | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) -- 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 Wed Jun 19 19:40:14 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: 167255 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp1127194ilk; Wed, 19 Jun 2019 12:43:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqz7cLqjGNtXWB8702jNnwmL1X1Yly1TJnCrbyKPeGWK3Krmtj1Q29f8lwhcg+EYfrwqRi7a X-Received: by 2002:a50:cc47:: with SMTP id n7mr14719565edi.58.1560973408489; Wed, 19 Jun 2019 12:43:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560973408; cv=none; d=google.com; s=arc-20160816; b=IXAE625BjPRkbG02ryfwdb0XATfUrBjgbCXXVR2RQyAAm9PwTw9v9yEFsD6FiFdhWd 13I7Cmex9DgIUzYkaHrIt3j9K3zy+Y/K9EWCOKliUamxx8Kmoz61pyyhfJ8KvVAAw6ac JOy4vPgNClmjT61Wr4lQmd9QjM9wyM7LNeSeXib/CYbwty0xQ5cgZRTA0KnWmB9t0RTb kRdM73vHSMIKAwp8kd0X8VcGGvFMwF0Indt8TZiMXzqgj7jems/YSNxA0NTK1bzIS52j 2U0KOu/Kjo4c+JWdRoTS6DB+er0lEmMfLZQzNT9yuORtKsjlyFdT5OY1hDWUKb3nSAi1 JZvQ== 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=L6XVojZ9d06YYw7Qa0xt+OkZV+Iz6HolpHL92sjbbUE=; b=g2cbKijNDjpiM6OkHG3iuR7rfQ7yPkhg0mUBgr8QSN+iqvzuU76xLF+v+mmuwSE9pS OJgK1XgRGXTRRcrhwXK7JAxYzQdH6VqyHm68iMIZj90LsoOGmM+ndOscnYYYFM8p37iH 01/HDskLEjmb2j4yENDrrIdvORKbsUIlvX1RgjZeXlMB6M4WN5qfvky8IAeoCxzhBZmC TXLdjfwDU0ZrYpGZBFug57RrWfwhMOGcOP/42AOQz7jXIDKKgGnhbGxCyRaHOlI9d85N iA/9Q+JF4ko8qrik829I+BPF6iAnPr+2KhTldAHrdr1A8DG8G6X2d8lRdHJg5QpIREMd mOSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=SMXD36Bf; 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 q55si15253005eda.257.2019.06.19.12.43.28 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Jun 2019 12:43:28 -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=SMXD36Bf; 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]:41434 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdgUR-00015C-Dr for patch@linaro.org; Wed, 19 Jun 2019 15:43:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53976) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdgRf-0006Aa-4E for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:40:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hdgRc-0000BF-P3 for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:40:34 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]:35085) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hdgRc-00008r-I1 for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:40:32 -0400 Received: by mail-wm1-x329.google.com with SMTP id c6so723874wml.0 for ; Wed, 19 Jun 2019 12:40:31 -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=L6XVojZ9d06YYw7Qa0xt+OkZV+Iz6HolpHL92sjbbUE=; b=SMXD36BfIHTjJWHy9gfisDuwrT/MWMlDBAWWvldMH67j0POs+IOigPjdaJb1R8c/yV 1pnrQiqU/YcilMGhjQ9ObG85L5cZalaVUvNvkoVHEkYqoZ/jUppI55jvWOWX1BXcC7nY iXnWD3IYZi7rw4bXLSTxFxLgt5fRANOmYr6EPWJ1+AAXGIWF8zGwV19Afi8FCS/IN0rZ PVQ7JQUWGRPkKQu+/+CJ36rT03gYCEV0T20S7zb04pX6k4rvvm90w1yNcrFBVfKidFpJ QDGd7XCGJEAAJ9egPvG85Q3MlobVtvXVCJkXppgarFpiHzm0icVkUwjVDeaJLM+x5+zR AyBA== 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=L6XVojZ9d06YYw7Qa0xt+OkZV+Iz6HolpHL92sjbbUE=; b=oWdpqS6GKN8Y/AvfJSFmdGiZW/UwX3aMG39qMiZ1z0OII7ydcA/VQQcZ263MMIquQ4 wX5FLYJn/ty/5OGZC9xKjxHxK5C24CjtEVdcI+XcieGIFKzPJFdDMzRNhP5nZpiDRIAm E15DJLnBcRoGgJu0PxtaiAyj2pLjKNtzJcBl/6rSZ+SfD25FjyeIu9kGWT+VxNTpAanc sb++511A2K0vVSkh+6PoocSlDpKY31D6hWqXFNx061zWXwztxERhvOQW1hHhtd/N/EjN JkZI7ZKE+mu6RPFesE3H9F8+eo3Sw3rzrDOn+OH8i5lKu1hrMte2bKsalmo/k4FqLKcK Kbdg== X-Gm-Message-State: APjAAAU4n1mvwIN6MzdnmzRWlPZLxJfAaSvRPTQEaTlYZyxsA+KVTlm3 hgdOfraCkeFQk62lWat16JXpeQ== X-Received: by 2002:a1c:a848:: with SMTP id r69mr9323555wme.12.1560973229821; Wed, 19 Jun 2019 12:40:29 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id o8sm19763322wrj.71.2019.06.19.12.40.24 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 19 Jun 2019 12:40:27 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 4687D1FF9A; Wed, 19 Jun 2019 20:40:22 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Wed, 19 Jun 2019 20:40:14 +0100 Message-Id: <20190619194021.8240-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190619194021.8240-1-alex.bennee@linaro.org> References: <20190619194021.8240-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] [PATCH v1 10/17] 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 , =?utf-8?q?Alex_Benn=C3=A9e?= , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Gerd Hoffmann 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 --- tests/vm/basevm.py | 86 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 83 insertions(+), 3 deletions(-) -- 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 Wed Jun 19 19:40:15 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: 167265 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp1139627ilk; Wed, 19 Jun 2019 12:58:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqx5eQCVnSwMoqUs3pxZxwSUFgx5ZP6cMBne0vGaOtMn15h/eCs8vI3oCgGjMJDNPm9uaU68 X-Received: by 2002:aa7:d28a:: with SMTP id w10mr86692798edq.251.1560974288762; Wed, 19 Jun 2019 12:58:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560974288; cv=none; d=google.com; s=arc-20160816; b=PUmAoPkv/5MikamRZ3Xj3qIoIDXnSSRqjAX4EtTSC8FexSv/TrwYs8U5tR9bsKO5q5 xtkO/3t8OZwHNF1Cs98/8dogXN8RdAD63ECyebUVk9B3PtJc9InQHKV2SJSm/LjFd306 pKPig2JZ0nzzduvRzilE5qOR0k/UzB7+Te+x8XWxiKHsTugpGedjgSTxidX7RpBZugu6 NjqTnQK6FTBMSlIfy2VbRC3kMFZIr0CALlyvm92rp8kwqIc+OoyR6oUgWVBwfkZYY3JV DUPoUMC8Wl3t7VLh3E7uSo7PuIJxkuGHVF50iZ8Yx2dYtL62iIOIox+dW1AWAgDhdvaz iYyQ== 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=3soHcxEWb8Oo7T3dyQPwcUMo7qCQ9tsZ0YvPTKHGaVI=; b=C08muJblay4Q+gbPSVDiJWtLPOwyOKpvcQeDILpgaxHNsbHtDzyQ+7VT9/iE6FA3O7 8pVxKlXgEO+kBwSwOpMRYX+i5kQ9/zTgWHRcBkuJP2K8/oq3aim1GSNrQYw9nuP8di9R ukyCGP7oBMRceOjQ/w05db4vIGDcJp6BFeN/3DXGdSFJ/4KhJVhLYEXkvvHzA4xy6Ley cyLqLn+hbIBjGksanUMTHGDhf9uW5bpcxBcKoeqhtFyJCFulwNkLQfxuA5AWfnzmVsPr dPA8SvyYb00ma88027It3pKZhRKkNUA8OkJFBIjDpxfuYNgKYb/alkh65U7nYnjO4kSY oJwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=CyTVKeqh; 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 w19si14512960edc.371.2019.06.19.12.58.08 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Jun 2019 12:58:08 -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=CyTVKeqh; 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]:41518 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdgid-0004nY-Ph for patch@linaro.org; Wed, 19 Jun 2019 15:58:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56002) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdgYu-0003vp-Ci for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:48:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hdgYn-00068A-Eb for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:47:59 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:38003) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hdgYk-0005cI-Sn for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:47:55 -0400 Received: by mail-wr1-x436.google.com with SMTP id d18so512176wrs.5 for ; Wed, 19 Jun 2019 12:47:22 -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=3soHcxEWb8Oo7T3dyQPwcUMo7qCQ9tsZ0YvPTKHGaVI=; b=CyTVKeqhbbV4p2Rf4mMdXfImygY3yvfvHBDCn1MWTpivITX3Q/ITsjB74nMpx0gzz0 cjg5AAy/Vk03gq9Sr8S2UvxrJYOhmP3degDIi6Cvcb3vGVfWtJDlbefxZ/YAxRmkeYVQ JpPVVkdJz4Nf6JhE68eH895ICPmiKtUU3++iHtNV98UXAiJrMMOADt8rkfikgDmUe8Ow /drTn+MNjsj24gVmxY2mqA+4zPriEPCIcMai/jlxepeJQCkQy5UvCrb6bQkxoJBSPiYq dheTWmAXQMOTt/6ZuW6kt7/J/GCkP/wxkvL9uP26pE6Y4cSMw5RD+gdz/Acthwi+3Ifb O2Sg== 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=3soHcxEWb8Oo7T3dyQPwcUMo7qCQ9tsZ0YvPTKHGaVI=; b=pnMTgypGL4Mq9gQntBiJOxI0cTjHZhuTTThCtFKWJN/PGHU034X4JU31/SVrZB2QRN PoBYyIuU7vtMNheur8LRvWkQhXFYDNhpIpa5/l3uYOm47tXwSVTe9wKai+5MKGuaNvl1 UFWSV+vO69vpniD7fMn6rwPzL4GuY9q7uVV+L7FhzK7DHzMyJb/a3a4l92H2u08oq5rI ntTUuGmrEYYQksUwveKRRqJ4vwfuZd8r0NsNk+4jx5s1rW6hCIRLnLnhPtGnZk+Ny9AI wnBFBcqRKE7TXB0pJUk+IiaFZp0Jcsg4SdIR0L3KwydB4sajvMLliadfet6kokcsfBA0 tSkg== X-Gm-Message-State: APjAAAV2ge/GFzPmrLeOk9zbmyS4Yyoa928LHDkN92IwyOqBhm7PsR9H kRYAOcUu52Z5Q1XPjmnYExXcQg== X-Received: by 2002:adf:9dcc:: with SMTP id q12mr19243243wre.6.1560973641075; Wed, 19 Jun 2019 12:47:21 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id 11sm2929838wmd.23.2019.06.19.12.47.18 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 19 Jun 2019 12:47:18 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 5A0791FF9B; Wed, 19 Jun 2019 20:40:22 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Wed, 19 Jun 2019 20:40:15 +0100 Message-Id: <20190619194021.8240-12-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190619194021.8240-1-alex.bennee@linaro.org> References: <20190619194021.8240-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] [PATCH v1 11/17] 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?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Gerd Hoffmann , 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 --- tests/vm/openbsd | 161 +++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 148 insertions(+), 13 deletions(-) -- 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 Wed Jun 19 19:40:16 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: 167268 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp1146910ilk; Wed, 19 Jun 2019 13:05:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqy2Uk/jD8BlltvpTpH5OxahqXXbqDEOMO12IhWPYl9AurmK1PlNkR0qmy3axxXQCxyp8R2U X-Received: by 2002:a17:906:7855:: with SMTP id p21mr47309019ejm.287.1560974736812; Wed, 19 Jun 2019 13:05:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560974736; cv=none; d=google.com; s=arc-20160816; b=iVYIGlGfHuL/S1WM4V31PEewNmqDsAqJMf/UwXJ9xkMaXNTOczzZfqRd1KdvJdw1Od jBwXkA9KKEldW58zGEtFwK7vlpRk9SsW8fyvgnNOsGbjcVyDuVIyVQDp6JeaiNCcv0OY bKJQuHRpHS7Rv5mw43a+PKhQLWC1rFWRSDvwhcBHbdkPPkudl+sSPOtwTj6d96RpFNQu mqcrUwABs7v3e/hbG2JgIAqDhytjbvPf+wZ2RirioJSHbGzYCF3Th099hOIZfPxFtwcf nLT6euXm/m1ctwxn9lb/x+7il+ir9tPtaOCkfWfjx1mk0TzUV0OVXi7+bfZh2Og861PO MAWw== 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=iMCV1pDp/0RdCyrr4HygA4HO+17huZdMnbc+nwmxn6o=; b=wLhxCcpnf6gVyGbBjdYFYmCQIU7AuU5jjFzdx8JvZv3+sF9MYzQFEBS4AXANdNCDll NvIAOwB2sevW4I2Jl5waGhWkF9ZObg24vlOCrRvG3kGEQsXqV9NbFp5cUy7YeSs8si8i Le7kbW1Ce8ZT77UiF8RetTarYZffgoSw0+HGz7oMPyWkoy7c1G07BPHbOnpZVXCg1wk7 3XjXRI4c93JnTX4xZcq26i2gt3l7xUsYs6tNYNwcR5Q2ohGGjzaGgg0yYlEOSMf/rKpq 4W8JasDj4Odw1nh9GovjyDxaxrNUo7fPGY7OHSUY5pgsukJgVpxSuIuBbSHjN9naF4WN W0tA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=n5NMR8S0; 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 w13si15797416edc.372.2019.06.19.13.05.36 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Jun 2019 13:05:36 -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=n5NMR8S0; 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]:41604 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdgpr-0001S6-BL for patch@linaro.org; Wed, 19 Jun 2019 16:05:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55987) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdgYp-0003vZ-T5 for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:48:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hdgYk-00066A-SG for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:47:57 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:46368) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hdgYi-0005aY-SW for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:47:53 -0400 Received: by mail-wr1-x435.google.com with SMTP id n4so458320wrw.13 for ; Wed, 19 Jun 2019 12:47:20 -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=iMCV1pDp/0RdCyrr4HygA4HO+17huZdMnbc+nwmxn6o=; b=n5NMR8S0IaqUZP0JCP7N97Nu3QEEqkIKnt4rlGAHww4kSwGQScCStX3HnvP0qxzVjD jSUEr6r1NWu81pCWlI5/byXi5Hi9WCKso194FfWM7SQESPYIH68WPB1x9B0H4DUGe0a9 M784/7Mxn23v2yt1dVy+UAdPnSRgj9D5hdIpDl8SxaLHA2iebbW0CMjkXnWqZC7l31WC PcRWN2jTRGKoCziJHbG35Cvs9j+rHmwle+I2CNDloYS/KLmiLdKQGf0yvc5RlFqacUKc 2+AIB/gxXqGHLGR0NzHZ5NEteK52THmPXpBVr/mi+rk+R0ip4AGrYPZNMCbwouB+mmuE stzA== 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=iMCV1pDp/0RdCyrr4HygA4HO+17huZdMnbc+nwmxn6o=; b=hl5/YwdbMnpBin1/9bTVdWaNSKpCuJIzyGCv+OD2NacyFt4+mgkPGRPnzjCGWKXTtn U7/MZMCZRrDSiDP0WIa1no/PRzbm3QT61mpCKyR5M4IEaKwOxxYg6WuNn9V8t4k8ygaP Rd6u0j3zbqbjogsgPUw4Xljv/1FtPL+EMPQBglZLcqAQVZwBHZHUyILuFStWHVtI6RTW uMtZHaTWD0tk71fe8xaak3EOP1fxID1GNUimaKQadXxGMd+s95PN+mf7NjJBtfixj32M 45msqiJEhzSe4M0BZwq9YIYwCEx8s0c1Zv2+QEBDzLsJgXwUf6lQzciSUxnsraxk280h 1CrA== X-Gm-Message-State: APjAAAUcd+zb2/Ti8Cd/0qkeIeaeQDwPXKfw6QpsoWiJERydbZBocoJf VhXyjttWiznZIDDarnrilX/GzQ== X-Received: by 2002:a5d:4fc8:: with SMTP id h8mr550940wrw.124.1560973639157; Wed, 19 Jun 2019 12:47:19 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id 32sm38584306wra.35.2019.06.19.12.47.18 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 19 Jun 2019 12:47:18 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 6DE491FF9C; Wed, 19 Jun 2019 20:40:22 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Wed, 19 Jun 2019 20:40:16 +0100 Message-Id: <20190619194021.8240-13-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190619194021.8240-1-alex.bennee@linaro.org> References: <20190619194021.8240-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] [PATCH v1 12/17] 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 , =?utf-8?q?Alex_Benn=C3=A9e?= , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Gerd Hoffmann 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> --- tests/vm/freebsd | 182 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 172 insertions(+), 10 deletions(-) -- 2.20.1 Signed-off-by: Alex Bennée diff --git a/tests/vm/freebsd b/tests/vm/freebsd index 091be1a065..2a19461a90 100755 --- a/tests/vm/freebsd +++ b/tests/vm/freebsd @@ -2,41 +2,203 @@ # # FreeBSD VM image # -# Copyright 2017 Red Hat Inc. +# Copyright 2017-2019 Red Hat Inc. # # Authors: # Fam Zheng +# Gerd Hoffmann # # This code is licensed under the GPL version 2 or later. See # the COPYING file in the top-level directory. # import os +import re import sys +import time +import socket import subprocess import basevm class FreeBSDVM(basevm.BaseVM): name = "freebsd" arch = "x86_64" + + link = "https://download.freebsd.org/ftp/releases/ISO-IMAGES/12.0/FreeBSD-12.0-RELEASE-amd64-disc1.iso.xz" + csum = "1d40015bea89d05b8bd13e2ed80c40b522a9ec1abd8e7c8b80954fb485fb99db" + size = "20G" + pkgs = [ + # build tools + "git", + "pkgconf", + "bzip2", + + # gnu tools + "bash", + "gmake", + "gsed", + "flex", "bison", + + # libs: crypto + "gnutls", + + # libs: images + "jpeg-turbo", + "png", + + # libs: ui + "sdl2", + "gtk3", + "libxkbcommon", + + # libs: opengl + "libepoxy", + "mesa-libs", + ] + BUILD_SCRIPT = """ set -e; - rm -rf /var/tmp/qemu-test.* - cd $(mktemp -d /var/tmp/qemu-test.XXXXXX); + rm -rf /home/qemu/qemu-test.* + cd $(mktemp -d /home/qemu/qemu-test.XXXXXX); + mkdir src build; cd src; tar -xf /dev/vtbd1; - ./configure {configure_opts}; + cd ../build + ../src/configure --python=python3.6 {configure_opts}; gmake --output-sync -j{jobs} {target} {verbose}; """ + def console_boot_serial(self): + self.console_wait_send("Autoboot", "3") + self.console_wait_send("OK", "set console=comconsole\n") + self.console_wait_send("OK", "boot\n") + def build_image(self, img): - cimg = self._download_with_cache("http://download.patchew.org/freebsd-11.1-amd64.img.xz", - sha256sum='adcb771549b37bc63826c501f05121a206ed3d9f55f49145908f7e1432d65891') - img_tmp_xz = img + ".tmp.xz" + self.print_step("Downloading install iso") + cimg = self._download_with_cache(self.link, sha256sum=self.csum) img_tmp = img + ".tmp" - sys.stderr.write("Extracting the image...\n") - subprocess.check_call(["ln", "-f", cimg, img_tmp_xz]) - subprocess.check_call(["xz", "--keep", "-dvf", img_tmp_xz]) + iso = img + ".install.iso" + iso_xz = iso + ".xz" + + self.print_step("Preparing iso and disk image") + subprocess.check_call(["cp", "-f", cimg, iso_xz]) + subprocess.check_call(["xz", "-dvf", iso_xz]) + subprocess.check_call(["qemu-img", "create", "-f", "qcow2", + img_tmp, self.size]) + + self.print_step("Booting installer") + self.boot(img_tmp, extra_args = [ + "-bios", "pc-bios/bios-256k.bin", + "-machine", "graphics=off", + "-cdrom", iso + ]) + self.console_init() + self.console_boot_serial() + self.console_wait_send("Console type", "xterm\n") + + # pre-install configuration + self.console_wait_send("Welcome", "\n") + self.console_wait_send("Keymap Selection", "\n") + self.console_wait_send("Set Hostname", "freebsd\n") + self.console_wait_send("Distribution Select", "\n") + self.console_wait_send("Partitioning", "\n") + self.console_wait_send("Partition", "\n") + self.console_wait_send("Scheme", "\n") + self.console_wait_send("Editor", "f") + self.console_wait_send("Confirmation", "c") + + self.print_step("Installation started now, this will take a while") + + # post-install configuration + self.console_wait("New Password:") + self.console_send("%s\n" % self.ROOT_PASS) + self.console_wait("Retype New Password:") + self.console_send("%s\n" % self.ROOT_PASS) + + self.console_wait_send("Network Configuration", "\n") + self.console_wait_send("IPv4", "y") + self.console_wait_send("DHCP", "y") + self.console_wait_send("IPv6", "n") + self.console_wait_send("Resolver", "\n") + + self.console_wait_send("Time Zone Selector", "a\n") + self.console_wait_send("Confirmation", "y") + self.console_wait_send("Time & Date", "\n") + self.console_wait_send("Time & Date", "\n") + + self.console_wait_send("System Configuration", "\n") + self.console_wait_send("System Hardening", "\n") + + # qemu user + self.console_wait_send("Add User Accounts", "y") + self.console_wait("Username") + self.console_send("%s\n" % self.GUEST_USER) + self.console_wait("Full name") + self.console_send("%s\n" % self.GUEST_USER) + self.console_wait_send("Uid", "\n") + self.console_wait_send("Login group", "\n") + self.console_wait_send("Login group", "\n") + self.console_wait_send("Login class", "\n") + self.console_wait_send("Shell", "\n") + self.console_wait_send("Home directory", "\n") + self.console_wait_send("Home directory perm", "\n") + self.console_wait_send("Use password", "\n") + self.console_wait_send("Use an empty password", "\n") + self.console_wait_send("Use a random password", "\n") + self.console_wait("Enter password:") + self.console_send("%s\n" % self.GUEST_PASS) + self.console_wait("Enter password again:") + self.console_send("%s\n" % self.GUEST_PASS) + self.console_wait_send("Lock out", "\n") + self.console_wait_send("OK", "yes\n") + self.console_wait_send("Add another user", "no\n") + + self.console_wait_send("Final Configuration", "\n") + self.console_wait_send("Manual Configuration", "\n") + self.console_wait_send("Complete", "\n") + + self.print_step("Installation finished, rebooting") + self.console_boot_serial() + + # setup qemu user + prompt = "$" + self.console_ssh_init(prompt, self.GUEST_USER, self.GUEST_PASS) + self.console_wait_send(prompt, "exit\n") + + # setup root user + prompt = "root@freebsd:~ #" + self.console_ssh_init(prompt, "root", self.ROOT_PASS) + self.console_sshd_config(prompt) + + # setup serial console + self.console_wait(prompt) + self.console_send("echo 'console=comconsole' >> /boot/loader.conf\n") + + # setup boot delay + self.console_wait(prompt) + self.console_send("echo 'autoboot_delay=1' >> /boot/loader.conf\n") + + # setup virtio-blk #1 (tarfile) + self.console_wait(prompt) + self.console_send("echo 'chmod 666 /dev/vtbd1' >> /etc/rc.local\n") + + self.print_step("Configuration finished, rebooting") + self.console_wait_send(prompt, "reboot\n") + self.console_wait("login:") + self.wait_ssh() + + self.print_step("Installing packages") + self.ssh_root_check("pkg install -y %s\n" % " ".join(self.pkgs)) + + # shutdown + self.ssh_root(self.poweroff) + self.console_wait("Uptime:") + self.wait() + + if os.path.exists(img): + os.remove(img) os.rename(img_tmp, img) + os.remove(iso) + self.print_step("All done") if __name__ == "__main__": sys.exit(basevm.main(FreeBSDVM)) From patchwork Wed Jun 19 19:40:17 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: 167259 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp1135634ilk; Wed, 19 Jun 2019 12:53:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqzfhSzIJvA8zruIjvE/Yotm83KOCS/+MSyQOOoQ0p6Y6xzES/T1W4Na6I23MnW9Eep69JyA X-Received: by 2002:a17:906:7814:: with SMTP id u20mr107702783ejm.202.1560974016202; Wed, 19 Jun 2019 12:53:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560974016; cv=none; d=google.com; s=arc-20160816; b=L/cNALPOOSsehrE647T8+5VAVr0NPR3RzqShvGcrzbLWT0cH/NM2BCJNvZVTXma5HH md46pxeacD9jNKwSOb855BToZZQbKT9hqtfdI9nEw74gRK2gy57UC5ljENnHWtPKH0La ZZyPJGbAPbX5Tu14a7W8cyYfokFkZ0ZOaDkv9snKoPJQO7gtvneNdoY31K2kKylE8Hyz GqbOZYRjB1PMdwCqdKHZQuQCAonHyCPZOfyodvMmdt/7jUCg0ZvzAmpYE+bkMVK7nT4E NCy58vrWwkcZxIh3TGKf+4ANSOvsYAmzvaA4VTrS7Yb6LroiLfod+/M35Oge2C6hNC0v Rzqw== 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=ldUVv4HTWoARPMqPf3QzxXqOvU9Z7IK4lhIlDlw1SdY=; b=gJBnSPHE8VWaihNHBdXX04l56j4A3nJMUGjz5qtpuSGRG1smh9Xt1BXZf6r6eiVIK6 NLc0QP4AjhcYYYkRuhQPuDPnEwz8jAyRuca91s7WBCMrv7cUeXd1ybjQljoehkS3hCGk j9yEH9YlXG4StgKRWNbglkPUiKzwe6rwuvZcQO+4xpNdB7pi8QaeWuksjaLJb86aonkC Z9Zy8apqe04oMK4EfYshitPYlgsqrAtsx+Lvsv68jCIZ0l90NZD7FNZfywCJlKbUk2D/ 6q45R2ofR1eD4L92h170NJFqv7v9K70a2EzKAMeehZjWmTqzIuB43kz4U9GuZDIW7Z4i 1LMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=oPM1XFjF; 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 t2si14234315edq.237.2019.06.19.12.53.35 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Jun 2019 12:53:36 -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=oPM1XFjF; 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]:41478 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdgeF-0007ny-2M for patch@linaro.org; Wed, 19 Jun 2019 15:53:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55996) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdgYt-0003vk-2q for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:48:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hdgYm-00067H-19 for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:47:59 -0400 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:37436) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hdgYk-0005cj-JO for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:47:54 -0400 Received: by mail-wm1-x344.google.com with SMTP id f17so726637wme.2 for ; Wed, 19 Jun 2019 12:47:22 -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=ldUVv4HTWoARPMqPf3QzxXqOvU9Z7IK4lhIlDlw1SdY=; b=oPM1XFjFzZsdkSubeLX9Sws7wmCPsZgO+Z3iM3+cS+lzWom94UKCDiYAZpSiUg1pWF +gbokVPf+IqfbRLL27TE9dORPiT+QewwBzsTYdRI27QHXyaDNhRiw4ZBCLENepPrC1BT i3LngIqFQ9JHQXYWI3WEC7vzVENMMECFLi73kdmUM31Sf4Utd4VMaYnWLzp92xOZPmfz kdb2SUQmt6UpcwZQLse3cyDnfk89rNgPSuiU2xqV3aQ7AWMWcoTg4FVjleapAhcGNtw8 kBc7a/U1F+DngFxHGWv2EsxDabrxdmlZCWIFA2lSX4HtP1rptyVky8CdVlsnS6UBpJ31 aiPw== 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=ldUVv4HTWoARPMqPf3QzxXqOvU9Z7IK4lhIlDlw1SdY=; b=BZpXJa4bhYJUzkPoCepDUsSRzGZTxi8KJHmXYQfVpLrywdkihFnjUX8ApMjCAiVb89 B7tPKSKB/zDmsPSgH2558prI2mpf7VtLXjyhILT/rOu3BQmpnlpdc9MP9awC9HhpYZ3U AXNaY7feU5c+0pSZg4L02ooSpXaEDj616HBh6Ah3pZPuRetNWjxzd9O9gSFNXBaTO0OM 86oNWAJYiLCQqi8yGJ7lDSpfLypcRCaYkdp+aya0nU7hN6l5AZHFnohYWHrWDoeIQaDD es8s/VXOgvjGeMbvAqW3OiMQWPyvi5jQhkveJvdaeOfvnNfMKKIlUVPrwguBFySn4L0W nvPA== X-Gm-Message-State: APjAAAXabFKQ2euFwdKfXRdzHzTjNHfOZBB8UjfbUVh3ZgceFjpAP3BP IkRkxR5bPkEUnlgIks1D8c586A== X-Received: by 2002:a7b:c7c2:: with SMTP id z2mr8983195wmk.147.1560973641798; Wed, 19 Jun 2019 12:47:21 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id q193sm2283841wme.8.2019.06.19.12.47.18 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 19 Jun 2019 12:47:21 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 825451FF87; Wed, 19 Jun 2019 20:40:22 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Wed, 19 Jun 2019 20:40:17 +0100 Message-Id: <20190619194021.8240-14-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190619194021.8240-1-alex.bennee@linaro.org> References: <20190619194021.8240-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::344 Subject: [Qemu-devel] [PATCH v1 13/17] 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?= , 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 --- tests/vm/netbsd | 189 +++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 179 insertions(+), 10 deletions(-) -- 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 Wed Jun 19 19:40:18 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: 167262 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp1136808ilk; Wed, 19 Jun 2019 12:54:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqz7X67cCHRQBBJyRBYwLVeZRSWnFlQdY1dtTPw9+L3f/nzob8pDIYC9taStIwhgRypKBVx2 X-Received: by 2002:a17:906:1306:: with SMTP id w6mr56075033ejb.2.1560974094543; Wed, 19 Jun 2019 12:54:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560974094; cv=none; d=google.com; s=arc-20160816; b=cpGe0OOW6++Xi7TiKQrRMmJiVU3YLFBSL6SNYnsZYByxL5l+/a2dlv0+k+x4WxtdDZ +Gb6KhHYCTBd9YzmuFQWKChqyKt5qCHGMGwwbl3BYxOz4NbZ4M9s4TdmazilXqMF2iRF /ct26F8ney0KL3KggtMxI4cjyLaQIgLLC/2j+uj6yLfh5NQ8vpjmV87vP3uCIb+GJDnR 9QIXF8VTj+asZUcRMlhGCH26jz62ggCBm+crkJZGOusAPPML3FcT80ebtRd17xQ4s4Kb BTBeQlEq1yagt2hiSKr1q0RWU2EFUZholOWqI6VLj+YLeDu4YjlqRvIuWrmD/IbcAuuq E3Mw== 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=oDQCgUljExCFYtLLEJJpwccg9/K7BchyPzoArUB8z3c=; b=fpE0Q/+EGFBWPEHUsCjaLqd9tuEslWBlS3+KCW9IAOiW5SxzdoGPCgFGFmEe7ul5HA oreNAKqvHRBVZx0EMACARh9lyCnZkZHk0OAFMffmJeCDBwYQ0l0cseM5/GEHavmIejFZ 6g+/25nQZZYLCdAcTTu87QoJHY5KT5saxIos74p4hcWYaPWZZxxJUKf1qUP2QLFvRkH0 GfLuJFkpOAV4JQcewX50rKBgUIVKyyElZ4y0N3n4ocj2ViZPzYegnzQqA3Tl8voBSEeR xUftgGjl+8CiCZ38Nij2fvixcqrD/o/FDMTy4h4B9mGMfLafxRC7ILtRd2lta+OphDNs /3oQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=cKsvZfdC; 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 t8si15410844eda.160.2019.06.19.12.54.54 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Jun 2019 12:54:54 -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=cKsvZfdC; 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]:41492 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdgfV-0001GB-E0 for patch@linaro.org; Wed, 19 Jun 2019 15:54:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53989) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdgRg-0006BE-Gv for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:40:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hdgRc-0000BM-Sf for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:40:36 -0400 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:39577) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hdgRc-00009C-K2 for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:40:32 -0400 Received: by mail-wm1-x343.google.com with SMTP id z23so697948wma.4 for ; Wed, 19 Jun 2019 12:40:31 -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=oDQCgUljExCFYtLLEJJpwccg9/K7BchyPzoArUB8z3c=; b=cKsvZfdCdGbDgxILtJOdXnLM8qVBC/JxJINBFxUByZRvsCBiFiuL5oKdUGcH0SyNUD nfFty59Xl+QfF1+Ih/9nIc0yCwk1JufbypLVNtmLJ7rcUzJbxeVLjYyro3+5Ity8bO/Y SoT9rnJZ/O/Lf3Ofeja1f+7iMFYY+u1ARPj3c58iszx3O8JqjE27LdznGYFFR1L6F4gm z6axjLq6N8Z7Nn0VGCuqYePKWnqXDWzX7A64+IGX2kNcFzV+i2NPE/uDC0Q5s4KjSQDP kwu6Vliq5ZlwU1mNjSaijn9Pjf7ubwLPBgUf/cvszpHQsfR/fG8sEe5f+Pkhh/RlILx9 dRkw== 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=oDQCgUljExCFYtLLEJJpwccg9/K7BchyPzoArUB8z3c=; b=SjErezmqtLc7Bd5sgVcWQvJ3BBSrbATRgUEf7s0lm/5TJxNAoi0YbIOznTo0FGjJ7s baIaYCW2K25LE9V9UuJWa23yrGOfVFxL1VYonxyb7AWFcr/BjQ+22HPdfUp72QevPGj1 sm6a6GZKRv4091FBylD0+gpEEGNdXSTq014/6+Tl3Xg9V6ZfMfjDFCEu1ovhI3FkeByc /pFpc07F4YNsoIv2kKLGGex2KOp2GqCgYPV60+tLzrqVDGvxFMhcA9JC5Pb738NtmGTF zp0ETQ3DTfMDkBFQ5/aQknwpw1o3WYHGAaBybC1qWyV+qCMBnV6XPnHPIy5UNHs2zJDn Xkgg== X-Gm-Message-State: APjAAAUnqI+/1viUdh5jWiK5L1H6mYIHmiznITOD7NPkRpAq3vM5O4lL 5jW6fkpuHMG/T/X1jwpl3ect3w== X-Received: by 2002:a1c:35c2:: with SMTP id c185mr9505604wma.58.1560973230281; Wed, 19 Jun 2019 12:40:30 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id c6sm3754300wma.25.2019.06.19.12.40.25 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 19 Jun 2019 12:40:27 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 98ABA1FF9D; Wed, 19 Jun 2019 20:40:22 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Wed, 19 Jun 2019 20:40:18 +0100 Message-Id: <20190619194021.8240-15-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190619194021.8240-1-alex.bennee@linaro.org> References: <20190619194021.8240-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] [PATCH v1 14/17] 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 , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Thomas Huth , =?utf-8?q?Alex_Benn=C3=A9e?= , Gerd Hoffmann 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 Message-Id: <20190617043858.8290-11-kraxel@redhat.com> --- tests/vm/Makefile.include | 3 +- tests/vm/basevm.py | 9 +- tests/vm/fedora | 189 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 199 insertions(+), 2 deletions(-) create mode 100755 tests/vm/fedora -- 2.20.1 Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée diff --git a/tests/vm/Makefile.include b/tests/vm/Makefile.include index a61c236b8e..809b80e2e5 100644 --- a/tests/vm/Makefile.include +++ b/tests/vm/Makefile.include @@ -2,7 +2,7 @@ .PHONY: vm-build-all vm-clean-all -IMAGES := ubuntu.i386 freebsd netbsd openbsd centos +IMAGES := ubuntu.i386 freebsd netbsd openbsd centos fedora IMAGES_DIR := $(HOME)/.cache/qemu-vm/images IMAGE_FILES := $(patsubst %, $(IMAGES_DIR)/%.img, $(IMAGES)) @@ -16,6 +16,7 @@ vm-test: @echo " vm-build-netbsd - Build QEMU in NetBSD VM" @echo " vm-build-openbsd - Build QEMU in OpenBSD VM" @echo " vm-build-centos - Build QEMU in CentOS VM, with Docker" + @echo " vm-build-fedora - Build QEMU in Fedora VM" @echo "" @echo " vm-build-all - Build QEMU in all VMs" @echo " vm-clean-all - Clean up VM images" diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index 592a344773..3d717da498 100755 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -206,7 +206,7 @@ class BaseVM(object): # log console line sys.stderr.write("con recv: %s\n" % line) - def console_wait(self, expect): + def console_wait(self, expect, expectalt = None): vm = self._guest output = "" while True: @@ -215,6 +215,8 @@ class BaseVM(object): except socket.timeout: sys.stderr.write("console: *** read timeout ***\n") sys.stderr.write("console: waiting for: '%s'\n" % expect) + if not expectalt is None: + sys.stderr.write("console: waiting for: '%s' (alt)\n" % expectalt) sys.stderr.write("console: line buffer:\n") sys.stderr.write("\n") self.console_log(output.rstrip()) @@ -223,6 +225,8 @@ class BaseVM(object): output += chars.decode("latin1") if expect in output: break + if not expectalt is None and expectalt in output: + break if "\r" in output or "\n" in output: lines = re.split("[\r\n]", output) output = lines.pop() @@ -230,6 +234,9 @@ class BaseVM(object): self.console_log("\n".join(lines)) if self.debug: self.console_log(output) + if not expectalt is None and expectalt in output: + return False + return True def console_send(self, command): vm = self._guest diff --git a/tests/vm/fedora b/tests/vm/fedora new file mode 100755 index 0000000000..e8fa5bf0d2 --- /dev/null +++ b/tests/vm/fedora @@ -0,0 +1,189 @@ +#!/usr/bin/env python +# +# Fedora VM image +# +# Copyright 2019 Red Hat Inc. +# +# Authors: +# Gerd Hoffmann +# +# This code is licensed under the GPL version 2 or later. See +# the COPYING file in the top-level directory. +# + +import os +import re +import sys +import time +import socket +import subprocess +import basevm + +class FedoraVM(basevm.BaseVM): + name = "fedora" + arch = "x86_64" + + base = "http://dl.fedoraproject.org/pub/fedora/linux/releases/30/" + link = base + "Server/x86_64/iso/Fedora-Server-netinst-x86_64-30-1.2.iso" + repo = base + "Server/x86_64/os/" + full = base + "Everything/x86_64/os/" + csum = "5e4eac4566d8c572bfb3bcf54b7d6c82006ec3c6c882a2c9235c6d3494d7b100" + size = "20G" + pkgs = [ + # tools + 'git-core', + 'flex', 'bison', + 'gcc', 'binutils', 'make', + + # perl + 'perl-Test-Harness', + + # libs: usb + '"pkgconfig(libusb-1.0)"', + '"pkgconfig(libusbredirparser-0.5)"', + + # libs: crypto + '"pkgconfig(gnutls)"', + + # libs: ui + '"pkgconfig(sdl2)"', + '"pkgconfig(gtk+-3.0)"', + '"pkgconfig(ncursesw)"', + + # libs: audio + '"pkgconfig(libpulse)"', + '"pkgconfig(alsa)"', + ] + + BUILD_SCRIPT = """ + set -e; + rm -rf /home/qemu/qemu-test.* + cd $(mktemp -d /home/qemu/qemu-test.XXXXXX); + mkdir src build; cd src; + tar -xf /dev/vdb; + cd ../build + ../src/configure --python=python3 {configure_opts}; + gmake --output-sync -j{jobs} {target} {verbose}; + """ + + def build_image(self, img): + self.print_step("Downloading install iso") + cimg = self._download_with_cache(self.link, sha256sum=self.csum) + img_tmp = img + ".tmp" + iso = img + ".install.iso" + + self.print_step("Preparing iso and disk image") + subprocess.check_call(["cp", "-f", cimg, iso]) + subprocess.check_call(["qemu-img", "create", "-f", "qcow2", + img_tmp, self.size]) + + self.print_step("Booting installer") + self.boot(img_tmp, extra_args = [ + "-bios", "pc-bios/bios-256k.bin", + "-machine", "graphics=off", + "-cdrom", iso + ]) + self.console_init(300) + self.console_wait("installation process.") + time.sleep(0.3) + self.console_send("\t") + time.sleep(0.3) + self.console_send(" console=ttyS0") + proxy = os.environ.get("http_proxy") + if not proxy is None: + self.console_send(" proxy=%s" % proxy) + self.console_send(" inst.proxy=%s" % proxy) + self.console_send(" inst.repo=%s" % self.repo) + self.console_send("\n") + + self.console_wait_send("2) Use text mode", "2\n") + + self.console_wait_send("5) [!] Installation Dest", "5\n") + self.console_wait_send("1) [x]", "c\n") + self.console_wait_send("2) [ ] Use All Space", "2\n") + self.console_wait_send("2) [x] Use All Space", "c\n") + self.console_wait_send("1) [ ] Standard Part", "1\n") + self.console_wait_send("1) [x] Standard Part", "c\n") + + self.console_wait_send("7) [!] Root password", "7\n") + self.console_wait("Password:") + self.console_send("%s\n" % self.ROOT_PASS) + self.console_wait("Password (confirm):") + self.console_send("%s\n" % self.ROOT_PASS) + + self.console_wait_send("8) [ ] User creation", "8\n") + self.console_wait_send("1) [ ] Create user", "1\n") + self.console_wait_send("3) User name", "3\n") + self.console_wait_send("ENTER:", "%s\n" % self.GUEST_USER) + self.console_wait_send("4) [ ] Use password", "4\n") + self.console_wait_send("5) Password", "5\n") + self.console_wait("Password:") + self.console_send("%s\n" % self.GUEST_PASS) + self.console_wait("Password (confirm):") + self.console_send("%s\n" % self.GUEST_PASS) + self.console_wait_send("7) Groups", "c\n") + + while True: + good = self.console_wait("3) [x] Installation", + "3) [!] Installation") + self.console_send("r\n") + if good: + break + time.sleep(10) + + while True: + good = self.console_wait("4) [x] Software", + "4) [!] Software") + self.console_send("r\n") + if good: + break + time.sleep(10) + self.console_send("r\n" % self.GUEST_PASS) + + self.console_wait_send("'b' to begin install", "b\n") + + self.print_step("Installation started now, this will take a while") + + self.console_wait_send("Installation complete", "\n") + self.print_step("Installation finished, rebooting") + + # setup qemu user + prompt = " ~]$" + self.console_ssh_init(prompt, self.GUEST_USER, self.GUEST_PASS) + self.console_wait_send(prompt, "exit\n") + + # setup root user + prompt = " ~]#" + self.console_ssh_init(prompt, "root", self.ROOT_PASS) + self.console_sshd_config(prompt) + + # setup virtio-blk #1 (tarfile) + self.console_wait(prompt) + self.console_send("echo 'KERNEL==\"vdb\" MODE=\"666\"' >> %s\n" % + "/etc/udev/rules.d/99-qemu.rules") + + self.print_step("Configuration finished, rebooting") + self.console_wait_send(prompt, "reboot\n") + self.console_wait("login:") + self.wait_ssh() + + self.print_step("Installing packages") + self.ssh_root_check("rm -vf /etc/yum.repos.d/fedora*.repo\n") + self.ssh_root_check("echo '[fedora]' >> /etc/yum.repos.d/qemu.repo\n") + self.ssh_root_check("echo 'baseurl=%s' >> /etc/yum.repos.d/qemu.repo\n" % self.full) + self.ssh_root_check("echo 'gpgcheck=0' >> /etc/yum.repos.d/qemu.repo\n") + self.ssh_root_check("dnf install -y %s\n" % " ".join(self.pkgs)) + + # shutdown + self.ssh_root(self.poweroff) + self.console_wait("sleep state S5") + self.wait() + + if os.path.exists(img): + os.remove(img) + os.rename(img_tmp, img) + os.remove(iso) + self.print_step("All done") + +if __name__ == "__main__": + sys.exit(basevm.main(FedoraVM)) From patchwork Wed Jun 19 19:40: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: 167266 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp1140802ilk; Wed, 19 Jun 2019 12:59:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqys7uMbsThO6cwUPHtp4PUqDgdoiZuBIZAxmsU0dNq0ftwtBNy3vsHr5YNBxpGp+1T9aVNy X-Received: by 2002:aa7:c14f:: with SMTP id r15mr69368897edp.116.1560974384789; Wed, 19 Jun 2019 12:59:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560974384; cv=none; d=google.com; s=arc-20160816; b=OmGJRw/x5nHEqdi+JuJvCrAsGWVOEF/Qvz7nw49GLdiIrZ4rFeCnVzrqguroL+TKAt mZ2iohq9nW574LXxs650E0efsbIP+KcfnU2gFC9QH8XyViTDjjjo00WheQDdtD8XF0aN zRgV80zXyngekCS6suBxKR4HNdqxSr/294mPkg66sMcqBYs7frCiZNQSLMV1MSXyI5Vx RC7KeLsMOVBVrecYVSffUbqcUqprujlVi0WOqI7Sl9chi6rMIv4UfcAu5KX6wFmImSs3 DQXBw+4BLtPvF8siJ8mWg3/57CEpR7uk7kIXpaR78oL19G/yAyUByKg+1h01ARr/NTPT IUBw== 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=onoeKhH8i7/jHDfnhI6V24OKwHYPamArShy5EWC2B6w=; b=CFSC9DUzVWlpZeKJPYyyIQhTIXda/qVpJTUg0wjFHR4Q2xP0vpVRxeWgYTmWAgWEzU Gis9s82Ay2bLsNnCu8bVqpMJ+NABQF3jJGvN6/Acgw08zni1FOS9S+/Lh/3uPk8bD21o FNZfZb9LfoIa2qZY7ojrssXlyQRNsGiDZuj3ENxv1pyMEJCxO6/c6CORoCW6i28cYkTr tau/2JIuXhkUcETlNQk3lzCAj/paiqtu9QSV9EV/0jI2REs3jEql3uLtMjQSXS60x/NF mRGBsfD631JGo34KbeJcR3hqzrN9/b2KycEMom/mjOJgOUhujhfQiMvPXkOnQm7mlpMF adUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=bPLYOztD; 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 r1si14579307edd.129.2019.06.19.12.59.44 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Jun 2019 12:59:44 -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=bPLYOztD; 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]:41554 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdgkB-0005vq-Q9 for patch@linaro.org; Wed, 19 Jun 2019 15:59:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55966) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdgYo-0003v4-4w for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:48:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hdgYk-00065D-BO for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:47:55 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:35640) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hdgYi-0005bC-C7 for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:47:52 -0400 Received: by mail-wr1-x435.google.com with SMTP id m3so534237wrv.2 for ; Wed, 19 Jun 2019 12:47:20 -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=onoeKhH8i7/jHDfnhI6V24OKwHYPamArShy5EWC2B6w=; b=bPLYOztDZhjrRxVwKgFe5togLrKirPuJkAAU9VtDd3RNium9uKaD3Exmu1IZXJZgd8 AXqvng71GAQh1hD6LLMEJgNL2dLMY3NrKkwmzyflPzsE33FM8tyrhRX/L4qi82+YI9UN TkPCuzftqXfoCLPXler9X0GGLGWADYeWGiHN5Lr4DD8JxSXC64v0iCXI3ILgUgqLbpcB LfBUhKX+P70E3eTASlWga+g1KVnpT8jXbh+E86GSDfO24SgrZh7gG59VXTyqQi0grKc+ Cami+ocTN32GmC/8r908V/5LB7+kF1hNR9MlCMzDvUhORdHJOj5I9d9XZSuRLOV+HyUD qVBg== 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=onoeKhH8i7/jHDfnhI6V24OKwHYPamArShy5EWC2B6w=; b=jUzx4MpOIgDwG00NYiYbLY4EYxd02nEVQROOwmfOwsFYW66/LDPJ+7IMaHMhbWQQXa Al9kCuxdYeicgoQgeiq2/F0Mpp15eP+597gtLHgmfqTdcpxfxcOCFyTjevzbjgIsRgf8 D/xdeAYJx7cemqm/QkJYM26/H7QuQvLUlFP1HQ9Dlh6GdpVFR7/530uCzuDm9Xm/204o 231qD9WJGmPMWY4/VhO9U6N59i95N2PeHV9TTXWPDEtzyhe/bkOM2V2L8am0ujMi9FPf UfeAw3L81pdqz5cIbiwMrQVY2fEm9IkzPrPyPuNVdeGfD5bd8SDf1fiR/o1lF+ALFDUJ tCUQ== X-Gm-Message-State: APjAAAU8OdY/dSJlEVGRY+4xdf6fqXtsVfzcoQAn5Jt9d1a/8f4t1nqB sr/8vNDLtTJuD681gO5gSkea4A== X-Received: by 2002:adf:da47:: with SMTP id r7mr44177wrl.56.1560973639809; Wed, 19 Jun 2019 12:47:19 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id n14sm16674768wra.75.2019.06.19.12.47.18 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 19 Jun 2019 12:47:18 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id AEB0A1FF9E; Wed, 19 Jun 2019 20:40:22 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Wed, 19 Jun 2019 20:40:19 +0100 Message-Id: <20190619194021.8240-16-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190619194021.8240-1-alex.bennee@linaro.org> References: <20190619194021.8240-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] [PATCH v1 15/17] 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?= , 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> --- tests/vm/ubuntu.i386 | 4 ++++ 1 file changed, 4 insertions(+) -- 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 Wed Jun 19 19:40: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: 167269 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp1147328ilk; Wed, 19 Jun 2019 13:06:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqxBkFobJLmk5RT+azNj/X22M7GJNdF8tOH4BDuf7YGeae6PE+ur3gD9XnMimktmc0ENWWhK X-Received: by 2002:a50:886a:: with SMTP id c39mr89625240edc.214.1560974759920; Wed, 19 Jun 2019 13:05:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560974759; cv=none; d=google.com; s=arc-20160816; b=Zp9m/GQQ68/uCrCprwtmACeLYTF4lT8/F2Cefz6FCnlB620pAuF+u25wWpSWVbmcOF 5C56T9XLoGIKPLpshjtnAj0vnGdKbSmINT4f4p3zx2rmlW8uhE60f4X2nqHLICVSXdMT ruL2jt7lenLSot2kYS7/1XBg1MwvSONd25zkVnULc+yW+N4UAD/z/9Frx1OPDPm0eWMT 9fa19NpKxiWfTW7rhBO+Tg59oz6jOrOAZWTIrnhLd/GvFWCdbClNymQG89jvCIkY6dro BL4qabh5QyFiaMPxHmEGkCgSUi4jdq4Yi8Gr76Lzb67+ryEYMtPpiCUED6yKB+7bmFZg ywGA== 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=z4VvhhuchSdMT3GYoRhtK0sFOye981rDs7adl9IorKk=; b=jgWwbhM0wI3fRuN2vjXxV7NfZ7AqrR/bkshLoFVZ3d1jRDTyP3YRgQPdMjQV561aOT pfyNJAttkWxhCedTbpv2TjM88ah9oovpN0KGk0BToc2jxRJWIT+Nb4E2rfnyGaxu2wGw Mw1ohDoAwKe9GZt5JCU7TNAn7s0yJpp36eeFzz5nOI2ACKRxH7ho5CR4oqXcXMqa5ZgJ tOT7MWBEuICUH8Z9BPm02gbsZETnhmVBBhjxdsVcKSJxwKbBQA0CJBIn+3CrR6vTkxk3 YBn/Ri2DEfHpwz+TRV+L6lYrNeoAQqfvArnHKL2TUVLoe6ergLHUtjaULH0pW2YV5bKM Tc5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=XToJjNX3; 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 o1si1386411eja.75.2019.06.19.13.05.59 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Jun 2019 13:05:59 -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=XToJjNX3; 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]:41606 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdgqE-0001Ui-VY for patch@linaro.org; Wed, 19 Jun 2019 16:05:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56122) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdgZA-000459-2T for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:48:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hdgZ8-0006mI-Aw for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:48:19 -0400 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:44734) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hdgZ7-0005bR-Di for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:48:17 -0400 Received: by mail-wr1-x443.google.com with SMTP id r16so477367wrl.11 for ; Wed, 19 Jun 2019 12:47:21 -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=z4VvhhuchSdMT3GYoRhtK0sFOye981rDs7adl9IorKk=; b=XToJjNX3ocCDt98L335DOJbdH5DcmpT4Wv3EJ7NaA5aW84SC4mHOnv544EdzrCbsec rh1xDOwYq9Hfvb/2hjP3c32q9P2ED5wIoZedJiU93bkY1xa/labgXITJBU3pu7LPwGBi fEJaw2ET/JzDuyMaQkq98D6IoQHDHPy+06j1lGOKzP4IV6J+vRNoqDz35oI2wP/L6p1h O+2jzCLIgspbDFvWOdGUeex1qkuhyzMgnQ/JLOoh/YZUm895NsYU3Am0xcvzundGpzHD nTRrlGEM9jzmuWfGVED3E+j1OoQmHKzi/fazISkZ8PIFKKEaAeTPpA7pzD2F80EMflmJ QbLQ== 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=z4VvhhuchSdMT3GYoRhtK0sFOye981rDs7adl9IorKk=; b=FLi6zaxC8lakKWZWiYth5W1Y4mFcOcIn+cMJUrRUVof6oIyfZkxmhd5ZrRaiHE3ALb nje35DEQjh+8BdNL4rzGLTmpfbVuZXzG++fA2nGCVBmJpfvDxza5OMs8OTvt/tBNVzmL KkQ1ht+aF1wtU7DE6zit/61YIcOUrtfkRkUXi+P5FqeFPZWO1EpQ7d0nfwzi3RLONhzs 5zI06zB1PyN9PpllDEWVrxK24jQwxJOo2zT88DnqHoNgOrWQF3siwQRMeK1mghW5+wPF 4mvfPwX1564GgspwBl9hdZ0fBg1B1ASDfVKb4YttB0z7RnpNjLtuiObh6B/sjqiGGVoi 2qUQ== X-Gm-Message-State: APjAAAXa1zqvhrrj3Ru+sEedDy2m//HHYT6oEanpK+2zBBYxQeml48PX LWTY6NTal0AQyTZQgZRwbuhI/w== X-Received: by 2002:adf:db12:: with SMTP id s18mr34656917wri.335.1560973640305; Wed, 19 Jun 2019 12:47:20 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id v27sm36544731wrv.45.2019.06.19.12.47.18 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 19 Jun 2019 12:47:18 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id C12681FF9F; Wed, 19 Jun 2019 20:40:22 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Wed, 19 Jun 2019 20:40:20 +0100 Message-Id: <20190619194021.8240-17-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190619194021.8240-1-alex.bennee@linaro.org> References: <20190619194021.8240-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::443 Subject: [Qemu-devel] [PATCH v1 16/17] .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?= 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 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.20.1 Reviewed-by: Philippe Mathieu-Daudé diff --git a/.travis.yml b/.travis.yml index aeb9b211cd..9750dc905c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -80,7 +80,7 @@ script: matrix: include: - env: - - CONFIG="--disable-system" + - CONFIG="--disable-system --static" # we split the system builds as it takes a while to build them all From patchwork Wed Jun 19 19:40: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: 167267 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp1143219ilk; Wed, 19 Jun 2019 13:02:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqzd30m7As5B2VaJUdge5J55iiBj9h9/aHNkob0nKk/9iX412+RPdlEWFY0y0UBnQff4K9Fw X-Received: by 2002:a17:907:20ed:: with SMTP id rh13mr8553377ejb.34.1560974528493; Wed, 19 Jun 2019 13:02:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560974528; cv=none; d=google.com; s=arc-20160816; b=FZwW1bJRwvmYiYqxh/U7YgN0kllzvwJ70+b0UjPmE3UHrTrgderlxoAGRq30FuX87a LjmYQQb1ZgMU/wkYF4JWjHES2v1cdGM3Sx4Vy/duX/4dwjGZDHKmS58ZwXzslmcWRTwJ f6PqoslAcVfd3ZSW4hpTyq1t8a2V759ojwH8LjyW9Lh7VbA/Uc9WUYyYECqIot0EaMjb iR7X0zchV0Jl/xje32ZgJAuj0bmwDOVFDTTWA5QNDVL2qWjCKiWn6Yzv1JP9iB0L/6eo XoLS30EfOQBqpF45unKuEINJFOJ7k9/zDjh/ZG1KL9wZQ1d+Ixcyc/q8hKHGu5p/4KmO rRRA== 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=tCyaA/37lVkaqonlS+tvjCwQYalKW2S3rd3JDUZadC8=; b=j95OXpJVVm3O+N4EAXjXoecpMx8HnqfOZhgIcYUxK0iDbO71PdBcVzeBAw4dplgF78 KJlks4eIN+SSisw6FXcq6Upghp9/i7uf4peWHJU2aJGAaBX02dwcoViPh0zO/fbTBJrb 8K9ttJbidTjiNv18HnAmqOrUnbcbD+OmlQtjG42f0yWYuF29iM4wvCO3V+RpkT6rHZq4 ReU7i7ihmu4slr3OGRZ0aHJNrLC5oaUQOXKV+9AExBmXIh24T43fGsqtU0Ep07oEDbpd Uaa7pcXUaxjk5/KtvKn3My8C87qYe40xL27YY/wqSKz5BDctp2NLj/WiL+EtlTDg9X8l vrXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=BNSXM843; 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 s43si15192060eda.175.2019.06.19.13.02.08 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Jun 2019 13:02:08 -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=BNSXM843; 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]:41566 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdgmT-0007Wj-QS for patch@linaro.org; Wed, 19 Jun 2019 16:02:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55980) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdgYp-0003v7-7P for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:48:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hdgYk-00066T-TB for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:47:56 -0400 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:54961) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hdgYj-0005aH-RU for qemu-devel@nongnu.org; Wed, 19 Jun 2019 15:47:54 -0400 Received: by mail-wm1-x344.google.com with SMTP id g135so687321wme.4 for ; Wed, 19 Jun 2019 12:47:20 -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=tCyaA/37lVkaqonlS+tvjCwQYalKW2S3rd3JDUZadC8=; b=BNSXM843/luvjaSm/D1+syXE24C/jWC2fPMxHBn9sYEedIJWsvmFBJKD8WMek9QjRC 3DxU0dOHRI2/23vFwpHRb+mSVN6Nzo21ONg/s7GjvcSOjnBvWs9m773qTGBxmSJAGU/i R+76orE0tGdUlPKn8vpR5TywQYnqR37fT5YBvPF9O0IJpeTVUu/EdWyTd7HZKWsWpzZA /0bv6Bc2AAYTjRp6q6JDQGJD/MgUMJa2AJ6cGFpF/gQcquTZD8tR6YaDjSfplQbzrfoe TqANVBYhRXIINu7cokFklOViFnI4ESzQHFshBjjxe4ljekXKbjsO5//Lr2SUbENOKirI M8Cw== 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=tCyaA/37lVkaqonlS+tvjCwQYalKW2S3rd3JDUZadC8=; b=i+4qMdefog8uLG6tR3QO+0UN5+JkiMse36KKDch/op21frJr7CXOZY79Jp/EkWjYLZ z53nME2WTlduJ5xGVok1piQbo4gR7IFF5VNYOriY4oJVAa4qp7LqccS6wScLNliHm5Pr e/F206BJ07RH8N+acqSPAD2axNN9/6JFt9Ol/c52q9iHMYCDBQg95wzmzZdA2YphUDFJ 4plDF8Ok/JkJnRpk36ulcdpQIKUVcIz4IQczoWgTORRqUG2WBhgErRv9aI3F9wS3fypP c3IvzFD3jaKAlOJ9UM8N0VPcGSOGdasWUj/c+69wPV4gWRBA9+ZWGruq0BlIceulpC0B 8LJg== X-Gm-Message-State: APjAAAWJ8DLBV1NEenveZ6nSY2ejlt8DU3VJuDRmPUgwAURqNTmyO1lQ JY28Qz1avMsymjP64W2O5XHx3A== X-Received: by 2002:a1c:9c8a:: with SMTP id f132mr9606393wme.29.1560973638685; Wed, 19 Jun 2019 12:47:18 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id n3sm14517578wro.59.2019.06.19.12.47.18 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 19 Jun 2019 12:47:18 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D39391FFA3; Wed, 19 Jun 2019 20:40:22 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Wed, 19 Jun 2019 20:40:21 +0100 Message-Id: <20190619194021.8240-18-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190619194021.8240-1-alex.bennee@linaro.org> References: <20190619194021.8240-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::344 Subject: [Qemu-devel] [PATCH v1 17/17] .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?= 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 --- .travis.yml | 1 + 1 file changed, 1 insertion(+) -- 2.20.1 Reviewed-by: Philippe Mathieu-Daudé diff --git a/.travis.yml b/.travis.yml index 9750dc905c..a891ce2485 100644 --- a/.travis.yml +++ b/.travis.yml @@ -43,6 +43,7 @@ addons: - glib - pixman - gnu-sed + update: true # The channel name "irc.oftc.net#qemu" is encrypted against qemu/qemu