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