From patchwork Tue Jul 18 09:30:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 704043 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e4d:0:b0:314:25da:8dc4 with SMTP id r13csp1430030wrt; Tue, 18 Jul 2023 02:32:18 -0700 (PDT) X-Google-Smtp-Source: APBJJlEihR0zgYcngfHu7iO3PaqsxftgaAszJHP5wReOPTUCpGdJYHAf68a2R7s39okP9GrfoilE X-Received: by 2002:a05:620a:17a6:b0:768:75c:a323 with SMTP id ay38-20020a05620a17a600b00768075ca323mr13248373qkb.30.1689672738477; Tue, 18 Jul 2023 02:32:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689672738; cv=none; d=google.com; s=arc-20160816; b=v7pUgKcyPVrV6vsJtl+jHZJz5Ox2adBLdJpiS7qhCvyp/kUrOKAsFlJ90he9e0xUGk OfANjrGpCr+BV+u9Xj/pmGbvNvU6nLP1uf6sgjfqrG5pylA0mHVPT+m0AjSHpsNwBrbU gvG+pkxbSDshOpRvNDeIsAVm0OY6NswgCnCZG6leNBEz1tJHl35esaQNDiPaRooMlyHO G9pqieO/4p5a6nU1kSaHkVzObq4trFxJf9lXBAuKSTPvev9Bh07CC3z9yyY/KbFPsFuk GHNnyz+yDBz++rxlqrNra29z+wwSKrwVj48auBhsjOBZoCauU6fueymONnQ5oBYp4Yla N1bw== 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=zHSH2f6sNdUL3OXSLvMYszb1rthfkO1fWtFRariBUVA=; fh=z8jmayWjiqRYuf6psS5INV4+U6uaCBaj2xXYu45eA64=; b=foV/4Su8UVnJHTsuh+XDXYkZmIlsAcQ5L2lrZZyNdhlXj0jXUX137BkUTs4Ly8yHSu 0XuCWECYFjrSeRRRtj2K+MAN3ymbyl1XHQJIUfLFuHfzrn8/Bi9gUtHcM89x22VzMNbZ m2GppnsOSo7WXWROIqQnolIuifKQsqWVkUtQovPB8SDd/xfyRJQUq/v7UlQXYcr9RdcQ SlerE1se/uZs4UIXDhBCy2z+OdJPLHxMLEKHaPFGKIoJllzy+lR7pZiG+rxbJhk2tFRo om9XUFVe2F8AHXgJzjUqN3DfBomyoNVsYGCLCm6I/l+gXwbOKhBi7FlEZ4BCHdU0aLXD D+3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LecodnJg; 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id gs9-20020a056214226900b006375e2a280asi1027696qvb.178.2023.07.18.02.32.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 18 Jul 2023 02:32:18 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LecodnJg; 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=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qLh2o-00042c-Fw; Tue, 18 Jul 2023 05:30:58 -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 1qLh2m-00041m-MK for qemu-devel@nongnu.org; Tue, 18 Jul 2023 05:30:56 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qLh2l-0004F4-By for qemu-devel@nongnu.org; Tue, 18 Jul 2023 05:30:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689672654; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zHSH2f6sNdUL3OXSLvMYszb1rthfkO1fWtFRariBUVA=; b=LecodnJgV7BL/Nsr+Xqf6v9x0wH/K4hTW77FiHfv7HcPPBNdTMmP74F+ZSg5I3WTrGjKqB x85y7tHvKYML4Hw4yrHdBb8H64Ons/ocLArr145TY98Xdq0ttDDMMF50+l/UxGZxC2G8IC 8LO2HPDHAOjSOR/Ar2goTvTXsWP5Ie0= Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-479-1NP3Kue-NDSFO3gg-_bjBg-1; Tue, 18 Jul 2023 05:30:51 -0400 X-MC-Unique: 1NP3Kue-NDSFO3gg-_bjBg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C94202A59542; Tue, 18 Jul 2023 09:30:50 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.89]) by smtp.corp.redhat.com (Postfix) with ESMTP id D424D2166B25; Tue, 18 Jul 2023 09:30:49 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?D?= =?utf-8?q?aniel_P_=2E_Berrang=C3=A9?= Subject: [PULL 6/8] tests/vm: Introduce get_qemu_packages_from_lcitool_json() helper Date: Tue, 18 Jul 2023 11:30:38 +0200 Message-Id: <20230718093040.172145-7-thuth@redhat.com> In-Reply-To: <20230718093040.172145-1-thuth@redhat.com> References: <20230718093040.172145-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 From: Philippe Mathieu-Daudé 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é Message-Id: <20230711144922.67491-4-philmd@linaro.org> Signed-off-by: Thomas Huth --- 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