From patchwork Tue Jul 11 14:49:21 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: 701522 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp5761606wrs; Tue, 11 Jul 2023 07:50:21 -0700 (PDT) X-Google-Smtp-Source: APBJJlEzOHPzXxTDSqpdsjcq39DBT4rGMh/h3Sr4OKraFwlNC8K/d0cup96ks7cWgJCkbZx+07is X-Received: by 2002:a0c:e312:0:b0:636:435:377a with SMTP id s18-20020a0ce312000000b006360435377amr13794118qvl.16.1689087020775; Tue, 11 Jul 2023 07:50:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689087020; cv=none; d=google.com; s=arc-20160816; b=GYaCRjnwBZ+hRc9GNzW6im+/Oc0v0jnb1hY+627ZJ4+q2RQvaSdkbZ3Z3BhMDNy3Z+ sZm/Gsp1hBbRtBMZoEgX5PoYn4RdaQ7Ym3+6KDawlS4JORGZg9ZKFj8uA2tuWxr8mF47 UzulDglQXXhpSBntZns59B9ZkpgQ1Bo5nyD6viRd7FkvsCeq/Zqt7wasA1JQol6eTl1t /AKeYIj5Cv7XcF6jVwj8lx9jS9I200ONJxxNq8I+FRniJmRK2+MG6AJRLCpQDUcHiRc6 zGhAHGDASUoMb7A9Z4siIdp1zcc++UZrXvtD0tttqooDe64Ll03hD0JMrHkF7s2YGMto q4PQ== 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=DQpa/hfpAq5E6avQ+sBqrAEF6fPdfI9vuVD97imT8vE=; fh=rN/eMtQuTlvWYS5S98Qlg+9zwvtNKB2+ClDmDM0vn/w=; b=aF91xfNdRLFGcK9jXKjpPmCYuU6RJ+lUPcNdX3jNYKDexpWYrBTGwkq5yz+WDDOJFB HoAYpwqEj7AQy7fGpRfOjw8WzDXDxg2U5jdb8Tz+A1kvxCi0TW/63ED4uBtFNRCI5b+j 1sLRxI9/qqFXtwnIo2bf1f+bp2gIwn70JNxaTlJaO1FUyRP67v2iRF4uVfMhGErAu0pd byyCuZYOHGkIiKvuRO2AMmi6DppnnaYw1Jsn+CIZ6z5z76JCBqXowzCCYV086qJaMTd3 tcKeDbqRRr1jZXhOQ8cvK49eBJNysB5ZQ9lVoK6ClnnkL2rC9coBxuGIr2p4AM4aEkaV RMWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=elItkfJU; 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 i24-20020a0cab58000000b005ef470bb7c8si847462qvb.366.2023.07.11.07.50.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Jul 2023 07:50:20 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=elItkfJU; 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 1qJEga-0001H6-6f; Tue, 11 Jul 2023 10:49:52 -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 1qJEgY-0001Gc-Co for qemu-devel@nongnu.org; Tue, 11 Jul 2023 10:49:50 -0400 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qJEgT-0002oB-D0 for qemu-devel@nongnu.org; Tue, 11 Jul 2023 10:49:50 -0400 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-98e39784a85so1388299666b.1 for ; Tue, 11 Jul 2023 07:49:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1689086983; x=1691678983; 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=DQpa/hfpAq5E6avQ+sBqrAEF6fPdfI9vuVD97imT8vE=; b=elItkfJU2ESHqMFI5dBdmImo6shfsO3P2JzUdo1pO4tFYCYLuNJ7G9WMB3n1HpAVp4 wi4nawp07DPujTSJ/qZlGTRDdLW/M3Fc6izltzFeZbph9GjtV9r7xTj9m4PHv4CWR3oi KRtOeMie0yaYiuL4hqsYrOoxlSYsNFEJ86TPygAD5B19etrwQG/U/mhEK5JCoHkzkgJh RyTXsUyBo5xRwW/6+oKvzrQYIm8o7mqYTWRTlawE6azAczBDH7EgwI+8/f/DNH9uydfu QYUdHmV5c5GQi2zpd2OcZN7KodR1ouWDEoVtX2CgAN+ZLK1HTYtpCQjF4lGhZm2SVfBI gbFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689086983; x=1691678983; 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=DQpa/hfpAq5E6avQ+sBqrAEF6fPdfI9vuVD97imT8vE=; b=UnEEEMkLTnHPk1DL6P+FHJwHU7I+/nHdCm3SQPMWdewtrfBKUIIpRSDscEv33XuGVK Lrnd6Krs4l8HlK3K+qV6pAL2wslSFb8WSEpgHMcGOnKbrc/mtUxxeXixWByjR8NQB6M6 zI1IuMx3TUSii3h2oUynT3gItOgTEd5h9mztOw+tJLgT5db3kmrfgwjuEcaaHQrnWs3W uBJf6W+URNfpA+mbB+HAvKfJx4RtaH3JyYvTgVpAGgbFOkiHif7R8sVd1Q++631w8/Fz onlCHmL1ci5pq9nf8aMHkmmT3uX3d6XeY4EvSAM8it/JOq4wQ957tamljnNVmwQQxfEd U/yg== X-Gm-Message-State: ABy/qLaqloQNvxlqhnx6A8iLRftPaiFhnxXGh7zvQHrQGjMV7v0TknSC Oa9DI/tbjhtDg9abcHw597Oxx0lLauNkPBTe31Y= X-Received: by 2002:a17:906:648d:b0:993:e695:b585 with SMTP id e13-20020a170906648d00b00993e695b585mr15875875ejm.9.1689086983713; Tue, 11 Jul 2023 07:49:43 -0700 (PDT) Received: from m1x-phil.lan ([176.187.194.156]) by smtp.gmail.com with ESMTPSA id s7-20020a170906284700b0098e48ad11f2sm1268031ejc.93.2023.07.11.07.49.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 11 Jul 2023 07:49:43 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Thomas Huth Cc: Warner Losh , =?utf-8?q?Alex_Benn=C3=A9e?= , Ed Maste , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= , =?utf-8?q?Phi?= =?utf-8?q?lippe_Mathieu-Daud=C3=A9?= , Erik Skultety , Wainer dos Santos Moschetta , Kyle Evans , Li-Wen Hsu , Beraldo Leal Subject: [PATCH v3 3/4] tests/vm: Introduce get_qemu_packages_from_lcitool_json() helper Date: Tue, 11 Jul 2023 16:49:21 +0200 Message-Id: <20230711144922.67491-4-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230711144922.67491-1-philmd@linaro.org> References: <20230711144922.67491-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62c; envelope-from=philmd@linaro.org; helo=mail-ej1-x62c.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 Add the get_qemu_packages_from_lcitool_json() helper which return such package list from a lcitool env var file in JSON format. Suggested-by: Daniel P. Berrangé Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Daniel P. Berrangé --- tests/vm/basevm.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index 23229e23d1..a97e23b0ce 100644 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -27,6 +27,7 @@ import multiprocessing import traceback import shlex +import json from qemu.machine import QEMUMachine from qemu.utils import get_info_usernet_hostfwd_port, kvm_available @@ -501,6 +502,16 @@ def gen_cloud_init_iso(self): stderr=self._stdout) return os.path.join(cidir, "cloud-init.iso") + def get_qemu_packages_from_lcitool_json(self, json_path=None): + """Parse a lcitool variables json file and return the PKGS list.""" + if json_path is None: + json_path = os.path.join( + os.path.dirname(__file__), "generated", self.name + ".json" + ) + with open(json_path, "r") as fh: + return json.load(fh)["pkgs"] + + def get_qemu_path(arch, build_path=None): """Fetch the path to the qemu binary.""" # If QEMU environment variable set, it takes precedence