From patchwork Wed May 31 20:09:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 687299 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d8a:0:0:0:0:0 with SMTP id b10csp1449172wru; Wed, 31 May 2023 13:09:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6oUXqKVUYgHBwG27RmlhTNqsZnxvwGuOglFAhfLRibwVqBrIFtb+34XHaMV38R0PNS1QHv X-Received: by 2002:a05:620a:3e8a:b0:75b:23a1:40d with SMTP id tv10-20020a05620a3e8a00b0075b23a1040dmr6037964qkn.35.1685563779103; Wed, 31 May 2023 13:09:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685563779; cv=none; d=google.com; s=arc-20160816; b=NCmpQ49UKq0aB9WD7JsNtdFAXkZeNy74KnYJiojm+JHJL9pg+mbBNW2Mm9jHOd/Lq/ ZXfBz0/cxh0eA9TRYA6eo6hbAom5DUiudZIWCobFdgOI87EHiRoUQ8uFbjZ2mZbzTXFx 2ERGLGNQI0syMqJ02APQgLgvblYzKY8rj+saq+S8B4h3ZlGz9+3Avqqhq5qkO1Gthn2F 5sMVQyMKL7Pt3q9/lZ2W0neuPbG6qVezJCP2AChr2EOpLInuKAhefBM6z2Ube40F48ZK qM8ilTQ1qmvZiYXfsJobcY6SPnk5026FnhjmNCR6SNMQ6uYdhy+iT6p5npfgvMIRJFWI jzxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=607LSsafa2oxkAIBHPCzkGNm8IQM/g1yzIcaBkYZjtM=; b=pld7fVm+1/GZHuwYsskYs67QG7lQOpkoRLit7WbOeUILhMX5mXXFahBvlmCA7HJlU0 PIzmW0CX1m3/GiHs6xG5WozLd8bubLOrsyeDvC1ScuSFvRr05+O/qFxHKlx+71szSgxt fM4zwXN4jX3kA+PC3EK1kyac8rL9g8E4DEchAgtE+5rCk6IC70zteQDE0uPwr+ncoyCE V57l+VBmEfbB9NyVeVZGqBHXv2m/d1eo2Mkx/LniAL9fldraog2ikJInMYDod2EDV3/y NvHoKqis0tgj+JrzxxIkC3ppSPkRGF4hFwrolK7n2+ew5/BYuu8BdjSlrSR2bdRTJmJf ujMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZtgC7E2s; 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=pass (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 da50-20020a05620a363200b0074a0ed2ff43si8516719qkb.402.2023.05.31.13.09.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 31 May 2023 13:09:39 -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=pass header.i=@linaro.org header.s=google header.b=ZtgC7E2s; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q4S8N-0005Ya-Fq; Wed, 31 May 2023 16:09:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q4S8L-0005Wt-OM for qemu-devel@nongnu.org; Wed, 31 May 2023 16:09:25 -0400 Received: from mail-lf1-x136.google.com ([2a00:1450:4864:20::136]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q4S8J-0006pJ-Kn for qemu-devel@nongnu.org; Wed, 31 May 2023 16:09:25 -0400 Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-4f3b314b1d7so6985380e87.1 for ; Wed, 31 May 2023 13:09:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685563761; x=1688155761; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=607LSsafa2oxkAIBHPCzkGNm8IQM/g1yzIcaBkYZjtM=; b=ZtgC7E2si61n7MtFqHudhreB2BIs4jgYhZaLvkRObaqbc0uIyZasQnbBfQF2Gfp03e oz5qIpSsLF3qr0RYv9LeH7QBxPYfyOHQrYO9qmKoRYi73oWWytS7fb8Pmj+jUorPDohv Rn1biIj23AxQwrcMVIp8Neyw2mrBfymobpYzDvW9ZYxGbFWNKWc1b29If0p7k+nxjwdR jWacDKZtuYhKVnq9OX3HBFBySl77k5CkxNZc4vubsj9TqsVIVS0OxE3z6STJR1tOunJG NaUWRwJYgpkmAeP7YhG0ReGf/aMhhc0P/83anLAAsxFWWF7HAdjPsMxPwQ2W9/pgnaCv JReA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685563761; x=1688155761; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=607LSsafa2oxkAIBHPCzkGNm8IQM/g1yzIcaBkYZjtM=; b=QQGiR+aup5GBpvt/y5m4JYpd6sjCKmU8cZClPgSOOPg+ghkna6jV+VGQosoGqM+qOW 473sApv/V6ysm3eMKTHcn4ChvLY+clkrVnHpvnm2XOJ1bod4Zy15OIoCNaO/SCkiGfWp N7lCO4Pl+VGRoTmqnMs4ML1M/8T9uZenl98VQIHd7DNQh2Gj/KBgLgEBzhJOKJ6sSljl gvKCh4ZS2hLzNT55zeQ1D8SUaD7Xo2rKq3vZiJk75h7Xzc8lPaQflAnImPkCoJJsSajm 2ZEZodUcabbTICHeFXkfvDIaJLgno02sux3LUukvulRAVoabDiVNyOqvGyKKrT4cT+r5 1UCw== X-Gm-Message-State: AC+VfDzRF5xOcIFZYRhmOZHnJPLRdA+8yFyf3+0ZACloW+8puunGT6G3 3NT4y8yvQ/ZA1LatVPwRju/Q2g== X-Received: by 2002:a19:c214:0:b0:4f3:bb14:bd40 with SMTP id l20-20020a19c214000000b004f3bb14bd40mr80346lfc.36.1685563756572; Wed, 31 May 2023 13:09:16 -0700 (PDT) Received: from localhost.localdomain ([176.176.146.12]) by smtp.gmail.com with ESMTPSA id k10-20020a7bc40a000000b003f606869603sm25434925wmi.6.2023.05.31.13.09.14 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 31 May 2023 13:09:16 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Thomas Huth , qemu-devel@nongnu.org Cc: Ed Maste , =?utf-8?q?Alex_Benn=C3=A9e?= , Kyle Evans , Li-Wen Hsu , Erik Skultety , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Dani?= =?utf-8?q?el_P_=2E_Berrang=C3=A9?= , Wainer dos Santos Moschetta , Beraldo Leal , Warner Losh Subject: [PATCH 1/3] tests/vm: Pass project source path to build_image() Date: Wed, 31 May 2023 22:09:04 +0200 Message-Id: <20230531200906.17790-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230531200906.17790-1-philmd@linaro.org> References: <20230531200906.17790-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::136; envelope-from=philmd@linaro.org; helo=mail-lf1-x136.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org To be able to use artifacts from the repository, always pass the repository source path when building a VM image. Signed-off-by: Philippe Mathieu-Daudé --- tests/vm/Makefile.include | 1 + tests/vm/basevm.py | 4 ++-- tests/vm/centos | 2 +- tests/vm/centos.aarch64 | 2 +- tests/vm/freebsd | 2 +- tests/vm/haiku.x86_64 | 2 +- tests/vm/netbsd | 2 +- tests/vm/openbsd | 2 +- tests/vm/ubuntuvm.py | 2 +- 9 files changed, 10 insertions(+), 9 deletions(-) diff --git a/tests/vm/Makefile.include b/tests/vm/Makefile.include index f0f5d32fb0..ff63038d85 100644 --- a/tests/vm/Makefile.include +++ b/tests/vm/Makefile.include @@ -117,6 +117,7 @@ vm-build-%: $(IMAGES_DIR)/%.img $(VM_VENV) $(if $(QEMU_LOCAL),--build-path $(BUILD_DIR)) \ $(if $(EFI_AARCH64),--efi-aarch64 $(EFI_AARCH64)) \ $(if $(LOG_CONSOLE),--log-console) \ + --source-path $(SRC_PATH) \ --image "$<" \ $(if $(BUILD_TARGET),--build-target $(BUILD_TARGET)) \ --snapshot \ diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index 23229e23d1..8ec021ddcf 100644 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -261,7 +261,7 @@ def ssh_check(self, *cmd): def ssh_root_check(self, *cmd): self._ssh_do(self._config["root_user"], cmd, True) - def build_image(self, img): + def build_image(self, img, src_path): raise NotImplementedError def exec_qemu_img(self, *args): @@ -636,7 +636,7 @@ def main(vmcls, config=None): sys.stderr.writelines(["Image file exists: %s\n" % args.image, "Use --force option to overwrite\n"]) return 1 - return vm.build_image(args.image) + return vm.build_image(args.image, args.source_path) if args.build_qemu: vm.add_source_dir(args.build_qemu) cmd = [vm.BUILD_SCRIPT.format( diff --git a/tests/vm/centos b/tests/vm/centos index 097a9ca14d..009faceb9e 100755 --- a/tests/vm/centos +++ b/tests/vm/centos @@ -30,7 +30,7 @@ class CentosVM(basevm.BaseVM): make docker-test-quick@centos8 {verbose} J={jobs} NETWORK=1; """ - def build_image(self, img): + def build_image(self, img, src_path): cimg = self._download_with_cache("https://cloud.centos.org/centos/8-stream/x86_64/images/CentOS-Stream-GenericCloud-8-20220125.1.x86_64.qcow2") img_tmp = img + ".tmp" subprocess.check_call(['cp', '-f', cimg, img_tmp]) diff --git a/tests/vm/centos.aarch64 b/tests/vm/centos.aarch64 index 3f58de1e64..ce09a41b31 100755 --- a/tests/vm/centos.aarch64 +++ b/tests/vm/centos.aarch64 @@ -72,7 +72,7 @@ class CentosAarch64VM(basevm.BaseVM): # Call down to the base class method. super(CentosAarch64VM, self).boot(img, extra_args=extra_args) - def build_image(self, img): + def build_image(self, img, src_path): cimg = self._download_with_cache(self.image_link) img_tmp = img + ".tmp" subprocess.run(['cp', '-f', cimg, img_tmp]) diff --git a/tests/vm/freebsd b/tests/vm/freebsd index 11de6473f4..6a0d7a4569 100755 --- a/tests/vm/freebsd +++ b/tests/vm/freebsd @@ -82,7 +82,7 @@ class FreeBSDVM(basevm.BaseVM): gmake --output-sync -j{jobs} {target} {verbose}; """ - def build_image(self, img): + def build_image(self, img, src_path): self.print_step("Downloading disk image") cimg = self._download_with_cache(self.link, sha256sum=self.csum) tmp_raw = img + ".tmp.raw" diff --git a/tests/vm/haiku.x86_64 b/tests/vm/haiku.x86_64 index 71cf75a9a3..7ee343415d 100755 --- a/tests/vm/haiku.x86_64 +++ b/tests/vm/haiku.x86_64 @@ -93,7 +93,7 @@ class HaikuVM(basevm.BaseVM): make --output-sync -j{jobs} {target} {verbose}; """ - def build_image(self, img): + def build_image(self, img, src_path): self.print_step("Downloading disk image") tarball = self._download_with_cache(self.link, sha256sum=self.csum) diff --git a/tests/vm/netbsd b/tests/vm/netbsd index c7e3f1e735..5bc5ca54ca 100755 --- a/tests/vm/netbsd +++ b/tests/vm/netbsd @@ -79,7 +79,7 @@ class NetBSDVM(basevm.BaseVM): # take more than a minute to be established. ipv6 = False - def build_image(self, img): + def build_image(self, img, src_path): cimg = self._download_with_cache(self.link, sha512sum=self.csum) img_tmp = img + ".tmp" iso = img + ".install.iso" diff --git a/tests/vm/openbsd b/tests/vm/openbsd index 6b4fc29793..1464c52014 100755 --- a/tests/vm/openbsd +++ b/tests/vm/openbsd @@ -73,7 +73,7 @@ class OpenBSDVM(basevm.BaseVM): """ poweroff = "halt -p" - def build_image(self, img): + def build_image(self, img, src_path): self.print_step("Downloading install iso") cimg = self._download_with_cache(self.link, sha256sum=self.csum) img_tmp = img + ".tmp" diff --git a/tests/vm/ubuntuvm.py b/tests/vm/ubuntuvm.py index 6689ad87aa..1311fce4be 100644 --- a/tests/vm/ubuntuvm.py +++ b/tests/vm/ubuntuvm.py @@ -22,7 +22,7 @@ def __init__(self, args, config=None): self.login_prompt = "ubuntu-{}-guest login:".format(self.arch) basevm.BaseVM.__init__(self, args, config) - def build_image(self, img): + def build_image(self, img, src_path): """Build an Ubuntu VM image. The child class will define the install_cmds to init the VM.""" os_img = self._download_with_cache(self.image_link, From patchwork Wed May 31 20:09:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 687301 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d8a:0:0:0:0:0 with SMTP id b10csp1449315wru; Wed, 31 May 2023 13:10:02 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6JPK2X36IlpoT92qKZ5183cd+4Uf9kR7f0vGu7brC6TCZ+4/puJ61cky4NQ9oJYNrXirX9 X-Received: by 2002:a37:349:0:b0:75b:23a0:e7bd with SMTP id 70-20020a370349000000b0075b23a0e7bdmr5979503qkd.30.1685563801857; Wed, 31 May 2023 13:10:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685563801; cv=none; d=google.com; s=arc-20160816; b=N8Gta2DUxwlNlgDhtc4KYcUaVsZwdxbOYRS9ohGvA9445bXYNtMHxgDsE/FpjjC11L zdyetQ9Q/wAEiguTq2/TQiTKFCm7RQtpbepWGT/YDCS8QT/yyghBqgUwTZbasQNf5Ngs E3qOGHW81BxO53ICRgBY3DGae+kLVWir0PdLptYwxPSzkH1369j30JZbV6WVUd2zjR4W 8BMdd41O2+rzBTlCjHrRsMXheFCb4G9pEjvNIYzVTzOLqjcL/SN2ThGhkoJ9651AEHkG Jjnq8Or8JctJIOS33aJceqiN63mr6scL9dJNbF5MYQowVv8NdINr0tsxbSjHDZtQLkte ydEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=gjep5DzSWsJXmCBCJKwibVhQeOvg54d0JGWzz1UBQt4=; b=Lb9h8HvGTY50qipV99WYwreo/arqs26L+cDGXyQbIYijFl+/hMC/D6S+0R/tFluCzJ 1IEX9OT7hW04iaFXQ1OG8JlTjXyiERWvyCSheifk0lFT+ElYA0StbX3WLhuem87PUvBJ BRYkPrw6++mpZL+b92zB+mEr1rYOR62lEMH1m9qfvazmNDUdX+4JcegPK++PbAZkPFsa DBiWOsZGGXJ9rg1nHrjTeo3ZCNpRobwovl/dCGwi1dFglNCQeF/3m4sCPra+tNkyL4KH uJBGq3RB2yM1MMh4mVq3fAv+8hbYes+WmgYbTRTe31FvcVwvO/o/j2HUCrWkVrFVFv+z OURg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="sl4ztxn/"; 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=pass (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 ou47-20020a05620a622f00b007577bd16a23si8313408qkn.434.2023.05.31.13.10.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 31 May 2023 13:10:01 -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=pass header.i=@linaro.org header.s=google header.b="sl4ztxn/"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q4S8M-0005Xq-SU; Wed, 31 May 2023 16:09:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q4S8L-0005We-HU for qemu-devel@nongnu.org; Wed, 31 May 2023 16:09:25 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q4S8J-0006pS-TX for qemu-devel@nongnu.org; Wed, 31 May 2023 16:09:25 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-3f623adec61so881645e9.0 for ; Wed, 31 May 2023 13:09:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685563762; x=1688155762; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gjep5DzSWsJXmCBCJKwibVhQeOvg54d0JGWzz1UBQt4=; b=sl4ztxn/Q3h+5Y7CffKhkGNliaqVEY5rNcTXxm9NsaiTwpbrx+J1iK1H/XDAzg/SnN JfnnHyC8Qke5w9D5IFOLUT4ZeKydknpTr2WbekPXkN+bYNDzv5MXkVBCBPS2zRDCNli/ 553KXmD9eq3u4H7IqPGqQyNJ0fAWMhiiqI+ByNPVKeinzuuG2icpm1++KYjrMVKe30wz OQz2aq5PWsEfOpaA9v57znCjqZkUzIrK7pl5uPgq2//39t4QGD99WkfO2qqSKdtP5LDv nr8k95t7VKrMxg6FIFC5GFAbsy/BkeZE2QHea6Mn6TBePFXrJueDXlRWvTuyUX/C3V63 vH1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685563762; x=1688155762; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gjep5DzSWsJXmCBCJKwibVhQeOvg54d0JGWzz1UBQt4=; b=h5fQ72/28/+cNFUSL7DkekPUmIp4JdK8uvpRGjZz0hNnsk9rzCNOJEJ9b57yLzLX0J 5zqAtySC8RpooANABLPZj/jxytdSZpsj9Jq/tebdBjuBFqwo8o2orEbzxu2Lejr4ADN6 /FpsY3rfRhf86vokCPuocNSlxdodjvKJVeWfUrUmtkssP8VWXNyrKelFg1DCoxGQmzdS oi4H4tu+Cf3+OYCtt7MNqB5MH8utQOPuq0HUaS6v8eaUk3Q+SgACUg6pGKgpjYYS9F4K u6EDr3zgiDlwdWzLcwJMYFnge7xhVd+6NaBwZ6x+hlaVlg2jIXW92Jl/5km4+1HOs4rC FY8Q== X-Gm-Message-State: AC+VfDxUONccBEnaZTj3k0JGP8mOXkhchHHmQh6ct+AuM2bHANZmG+3n KLuEIyPNKQ6wW6NvsYxnCCqfHA== X-Received: by 2002:adf:dd51:0:b0:30a:e5bc:547c with SMTP id u17-20020adfdd51000000b0030ae5bc547cmr156746wrm.9.1685563762459; Wed, 31 May 2023 13:09:22 -0700 (PDT) Received: from localhost.localdomain ([176.176.146.12]) by smtp.gmail.com with ESMTPSA id j28-20020a5d6e5c000000b0030aea925fbesm7946726wrz.50.2023.05.31.13.09.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 31 May 2023 13:09:22 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Thomas Huth , qemu-devel@nongnu.org Cc: Ed Maste , =?utf-8?q?Alex_Benn=C3=A9e?= , Kyle Evans , Li-Wen Hsu , Erik Skultety , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Dani?= =?utf-8?q?el_P_=2E_Berrang=C3=A9?= , Wainer dos Santos Moschetta , Beraldo Leal , Warner Losh Subject: [PATCH 2/3] tests/vm: Introduce get_qemu_packages_from_lcitool_vars() helper Date: Wed, 31 May 2023 22:09:05 +0200 Message-Id: <20230531200906.17790-3-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230531200906.17790-1-philmd@linaro.org> References: <20230531200906.17790-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=philmd@linaro.org; helo=mail-wm1-x329.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org The 'lcitool variables $OS qemu' command produces a file containing consistent environment variables helpful to build QEMU on $OS. In particular the $PKGS variable contains the packages required to build QEMU. Since some of these files are committed in the repository (see 0e103a65ba "gitlab: support for FreeBSD 12, 13 and macOS 11 via cirrus-run"), we can parse these files to get the package list required to build a VM. Add the get_qemu_packages_from_lcitool_vars() helper which return such package list from a lcitool env var file. Signed-off-by: Philippe Mathieu-Daudé --- tests/vm/basevm.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index 8ec021ddcf..2632c3d41a 100644 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -522,6 +522,12 @@ def get_qemu_version(qemu_path): version_num = re.split(' |\(', version_line)[3].split('.')[0] return int(version_num) +def get_qemu_packages_from_lcitool_vars(vars_path): + """Parse a lcitool variables file and return the PKGS list.""" + with open(vars_path, 'r') as fd: + line = list(filter(lambda y: y.startswith('PKGS'), fd.readlines()))[0] + return line.split("'")[1].split() + def parse_config(config, args): """ Parse yaml config and populate our config structure. The yaml config allows the user to override the From patchwork Wed May 31 20:09:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 687300 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d8a:0:0:0:0:0 with SMTP id b10csp1449278wru; Wed, 31 May 2023 13:09:55 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ64UJe3BuWB0n4RCaOKiXO6d1l7nxwiyxwPIul4wDoqx6UnsjVcdXDTEHD/p0rrdOrZrhsD X-Received: by 2002:ac8:57ce:0:b0:3ef:28dc:fdd0 with SMTP id w14-20020ac857ce000000b003ef28dcfdd0mr8438473qta.44.1685563795718; Wed, 31 May 2023 13:09:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685563795; cv=none; d=google.com; s=arc-20160816; b=xKP8Bc5k9/B8Ymf8qfxo8jimYP/YSO5HZJR5gNI53m162ynItMlOtqaB2WFFc2HVWe TvRm08LDWrXvcyOedlC/bMW5oCxGXmCXzB5rXpxlt+Ypa4H0tLYTETpu7lPgloN+jngb tXNqeHG8/fUzVxA7n4SUgvLGRww2uqEvdNiaaEtmgO3q9pW+kDxANbfIc8670xv+h8uT 0laCDyz1mUvnimvdbIsh/po8gxwWUHnzoNbslEXtSN0VP/Nr5FVB5DPvMql3zN6UMXp2 9IlElGbJlb/u9gesihirND1uMtygnQ54E8liFB0ekAyQy2tThxY3Pix2qFxy/BOQTJp6 5rqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ZuHFSUSInpdpLv4yrlAqMcIZx0noGMOR/r58BhLDlnk=; b=EOUb0R9bTarIQjpsQ4s8U9eP+C5t4DPQ00kvDR7xmCiexLKDn5s+HqyFiIf5Z8n7Tk Bv9zvEyAW4brikNL+MRCWZKPl/OeVcITl9RqRJjeEMQmNsdigRKH3wIgLsGdi6meY+cf PyL/yPYQgoNRgdOT1yisgmvJcXUQ2SZXDn67FYoxqWHZhjhQbICMjBG35cnPTrBLf1We PBtorc8YTDxZ3me/XzOfloIKO80rWD6CEcx6YrEnl6iWanRBCiXnfnQgZ3RGDmwUOMlI 5owBLHNIreDieDvVbEMCheIoHA4eRAmj2fFui9kpoEHErAS3KXkVs5zFgBBNeQjL5Tj6 GhJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kHEmulJz; 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=pass (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 x16-20020ac85f10000000b003dfda8e2b48si8981998qta.106.2023.05.31.13.09.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 31 May 2023 13:09:55 -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=pass header.i=@linaro.org header.s=google header.b=kHEmulJz; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q4S8S-0005Zd-Ni; Wed, 31 May 2023 16:09:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q4S8R-0005ZO-Tc for qemu-devel@nongnu.org; Wed, 31 May 2023 16:09:31 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q4S8Q-0006rI-03 for qemu-devel@nongnu.org; Wed, 31 May 2023 16:09:31 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-3f606a80d34so787435e9.0 for ; Wed, 31 May 2023 13:09:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685563768; x=1688155768; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZuHFSUSInpdpLv4yrlAqMcIZx0noGMOR/r58BhLDlnk=; b=kHEmulJz7zguJPIb0tfqgna6W5xTT9unwp6HuqxHDUxC+w50keNoljGK2uVjB10YMV 7LGydJo6azlGAZ+bO+9B99w1ouIWY7EO0mSFSCCPHSPYr5FbD4c2m0n3W70HMACi9Coz 5P3IgTM2a/IHn0LXbz/6Ekj8RULPv/onoPuNuSA+udOg6CVhikZ5hkMzSHBtXdPF5uAD caPp5pTvgIrqESancQjhAIXbx3bb7muaTaF9aizJsRfa18JDZhF9ygtjopmFOJgeOcw/ m00OxxxzRxZ2jdXLJfGZfCkLJammY4G4mrR4TJ7ScOYzBQQG5xh949TSjB6KV5i51pwp o7pQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685563768; x=1688155768; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZuHFSUSInpdpLv4yrlAqMcIZx0noGMOR/r58BhLDlnk=; b=hmqaGQ7USyymkueeKayfvJsRFSq/Yk56nwj7giRT4RscTm8jZ2VkfLGE7YnKZhJlqy /6RhgDTJ96WddQLpuBUx1W66uAV+ZlywCJNjTruA60NH2v2Eho8AIxIlS41kOnr9ZnXk boRhGjKAHoQtuOklu9q4UC3xQlyOkxvwKycasBMz1ksxtfAHM9edEe2pS7XPD8aaOxfX t1vdI7eZ20jBvSeyPzz4S6fDkAeny+JVpe8iJrtkVtjQpHRRLsLSLN6XUEThtN0cyBlS 2i+YIEGxgj+qC33/4vkbj7bnaEl/Bs7iROXnvN7vE7bRTDc2trO+wOHgJm5pOyCev/Kj 2Icw== X-Gm-Message-State: AC+VfDw9AAAuoKGTAIVEsI+TkLRfa0N7krWxccx9yGUnoPJ/U5bN7WuY rtKe7UtrQ+OaRqOMwLkAQ1QqhQ== X-Received: by 2002:a05:600c:28c:b0:3f6:148f:5867 with SMTP id 12-20020a05600c028c00b003f6148f5867mr304334wmk.4.1685563768368; Wed, 31 May 2023 13:09:28 -0700 (PDT) Received: from localhost.localdomain ([176.176.146.12]) by smtp.gmail.com with ESMTPSA id u6-20020adfeb46000000b0030ae53550f5sm7736669wrn.51.2023.05.31.13.09.26 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 31 May 2023 13:09:28 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Thomas Huth , qemu-devel@nongnu.org Cc: Ed Maste , =?utf-8?q?Alex_Benn=C3=A9e?= , Kyle Evans , Li-Wen Hsu , Erik Skultety , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Dani?= =?utf-8?q?el_P_=2E_Berrang=C3=A9?= , Wainer dos Santos Moschetta , Beraldo Leal , Warner Losh Subject: [PATCH 3/3] tests/vm/freebsd: Get up-to-date package list from lcitool vars file Date: Wed, 31 May 2023 22:09:06 +0200 Message-Id: <20230531200906.17790-4-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230531200906.17790-1-philmd@linaro.org> References: <20230531200906.17790-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org See previous commit for rationale on using lcitool vars file to get an up-to-date package list. Since there is a such file generated for FreeBSD 13 available in the repository, use it. That way we don't need to manually keep this array in sync. Inspired-by: Thomas Huth Signed-off-by: Philippe Mathieu-Daudé --- tests/vm/freebsd | 44 ++++---------------------------------------- 1 file changed, 4 insertions(+), 40 deletions(-) diff --git a/tests/vm/freebsd b/tests/vm/freebsd index 6a0d7a4569..4f12878645 100755 --- a/tests/vm/freebsd +++ b/tests/vm/freebsd @@ -31,45 +31,7 @@ class FreeBSDVM(basevm.BaseVM): link = "https://download.freebsd.org/releases/CI-IMAGES/13.2-RELEASE/amd64/Latest/FreeBSD-13.2-RELEASE-amd64-BASIC-CI.raw.xz" csum = "a4fb3b6c7b75dd4d58fb0d75e4caf72844bffe0ca00e66459c028b198ffb3c0e" size = "20G" - pkgs = [ - # build tools - "git", - "pkgconf", - "bzip2", - "python39", - "ninja", - - # gnu tools - "bash", - "gmake", - "gsed", - "gettext", - - # libs: crypto - "gnutls", - - # libs: images - "jpeg-turbo", - "png", - - # libs: ui - "sdl2", - "gtk3", - "libxkbcommon", - - # libs: opengl - "libepoxy", - "mesa-libs", - - # libs: migration - "zstd", - - # libs: networking - "libslirp", - - # libs: sndio - "sndio", - ] + lcitool_vars = ".gitlab-ci.d/cirrus/freebsd-13.vars" BUILD_SCRIPT = """ set -e; @@ -151,8 +113,10 @@ class FreeBSDVM(basevm.BaseVM): self.console_wait(prompt) self.console_send("echo 'chmod 666 /dev/vtbd1' >> /etc/rc.local\n") + vars_path = os.path.join(src_path, self.lcitool_vars) + pkgs = basevm.get_qemu_packages_from_lcitool_vars(vars_path) self.print_step("Installing packages") - self.ssh_root_check("pkg install -y %s\n" % " ".join(self.pkgs)) + self.ssh_root_check("pkg install -y %s\n" % " ".join(pkgs)) # shutdown self.ssh_root(self.poweroff)