From nobody Sat Apr 20 16:15:51 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1652400561; cv=none; d=zohomail.com; s=zohoarc; b=mniC1vogs910j2sl9YN2kqQQ5qGhEl6GqOtL/d46jHPgN7L0qgolK0sY4qHT6Vp3C1lXt7ptVQ0fqJpqluE2BnK5QLj02ySGOs4K7go0tU4/J/HPPcgse5rk2EGV+IFFDN1oKZltYnG/8DAZpTQmQmipuYbr0hwi3m9WJDz1QbQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652400561; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=QAlfHE0S+gyqfR5Q2gK3MvdtQHArphqode9YDHd963A=; b=a5P/OQc11BVlbrfnSrukAxDclklKLkwPZ+vJvBflU1wqGAKaA3/swNLjAZF9YBbSDwDRqMKNtr8MUBsTo28YulZQv4dELdUV1v9xu36uJQ26Gu0HfaEKo1L3buHtTdcrigk6BVFtv8nh692dmTzJj4eOPyEzH/ww+VQHj+1TTrY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1652400561375832.0629195391796; Thu, 12 May 2022 17:09:21 -0700 (PDT) Received: from localhost ([::1]:38048 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1npIrw-0002Bo-CN for importer2@patchew.org; Thu, 12 May 2022 20:09:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56174) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npIp3-0007HU-HM for qemu-devel@nongnu.org; Thu, 12 May 2022 20:06:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:36040) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npIp1-0007lb-WC for qemu-devel@nongnu.org; Thu, 12 May 2022 20:06:21 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-327-qwr93pwGO9uccjOjmTZhMQ-1; Thu, 12 May 2022 20:06:16 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A355C80B712; Fri, 13 May 2022 00:06:15 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.8.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id E8FE015230CE; Fri, 13 May 2022 00:06:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652400379; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QAlfHE0S+gyqfR5Q2gK3MvdtQHArphqode9YDHd963A=; b=MV33Ev2QDFnnd7YLWVnKJONBu5Lqirf1ylL9TZ5v9CAF438iLj+vrI3t/VTC2ldPJ0qJD1 SLFnQAH7XCxg142ffdFsugtSBS5vQT0TThYPwDnT0GGt1N1eUS9Ed0nGjEJhexxCgqKEoi JEXRLAhOOMf9/2Z7y2/3tWx85xjlB6Q= X-MC-Unique: qwr93pwGO9uccjOjmTZhMQ-1 From: John Snow To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Cleber Rosa , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Hanna Reitz , Thomas Huth , Daniel Berrange , Kevin Wolf , John Snow , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Beraldo Leal Subject: [RFC PATCH 1/9] python: update for mypy 0.950 Date: Thu, 12 May 2022 20:06:01 -0400 Message-Id: <20220513000609.197906-2-jsnow@redhat.com> In-Reply-To: <20220513000609.197906-1-jsnow@redhat.com> References: <20220513000609.197906-1-jsnow@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1652400562140100002 Content-Type: text/plain; charset="utf-8" typeshed (included in mypy) recently updated to improve the typing for WriteTransport objects. I was working around this, but now there's a version where I shouldn't work around it. Unfortunately this creates some minor ugliness if I want to support both pre- and post-0.950 versions. For now, for my sanity, just disable the unused-ignores warning. Signed-off-by: John Snow Reviewed-by: Paolo Bonzini --- python/qemu/qmp/util.py | 4 +++- python/setup.cfg | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/python/qemu/qmp/util.py b/python/qemu/qmp/util.py index eaa5fc7d5f9..ca6225e9cda 100644 --- a/python/qemu/qmp/util.py +++ b/python/qemu/qmp/util.py @@ -40,7 +40,9 @@ async def flush(writer: asyncio.StreamWriter) -> None: drain. The flow control limits are restored after the call is completed. """ - transport =3D cast(asyncio.WriteTransport, writer.transport) + transport =3D cast( # type: ignore[redundant-cast] + asyncio.WriteTransport, writer.transport + ) =20 # https://github.com/python/typeshed/issues/5779 low, high =3D transport.get_write_buffer_limits() # type: ignore diff --git a/python/setup.cfg b/python/setup.cfg index e877ea56475..c2c61c75190 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -79,6 +79,7 @@ strict =3D True python_version =3D 3.6 warn_unused_configs =3D True namespace_packages =3D True +warn_unused_ignores =3D False =20 [mypy-qemu.utils.qom_fuse] # fusepy has no type stubs: --=20 2.34.1 From nobody Sat Apr 20 16:15:52 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1652400680; cv=none; d=zohomail.com; s=zohoarc; b=dq69tWaY38J65lDD+uufcnkqs0Xp7Fy6kZag9bPKSUMgcErIJi2l1E3PGPRxgkZ6VT84v9JQMwpPJ5aNg/gE4FkL2XgQrHjfXzOi6nFHH6RlzokXuNkg0XKcnl1F5afw0cJ6aUuDTznXoF9jz4644V7/PqEQIi+9kNYb6Lm5XwM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652400680; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=HOJMbiUnopmGM1dRC1dc/YvTedKqIIqVE73B8Mo8sqs=; b=JYJxxX5sHGfn0GDqDR4Eea/3OlJZP9yrJFLWg3f4xKSAdZIPYR8WoMJuYExSAXhvHCBFEIMrul5se40+RvFr9rxVgKcAxcHrc22sw3S8DdZjUWqoNvwrx887jzyt3lP34qmsa6jmIb0pD+L6yq8M7vSQgN4mMa2UNDkQzZoCWdA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1652400680903608.0844166821112; Thu, 12 May 2022 17:11:20 -0700 (PDT) Received: from localhost ([::1]:45688 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1npItr-0007TZ-T0 for importer2@patchew.org; Thu, 12 May 2022 20:11:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56210) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npIp4-0007IN-S3 for qemu-devel@nongnu.org; Thu, 12 May 2022 20:06:23 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:45292) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npIp2-0007lo-MH for qemu-devel@nongnu.org; Thu, 12 May 2022 20:06:22 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-208-3JErJMvCN-u-v8dCFuXqlg-1; Thu, 12 May 2022 20:06:16 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 548458015BA; Fri, 13 May 2022 00:06:16 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.8.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id B1F3315341CE; Fri, 13 May 2022 00:06:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652400380; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HOJMbiUnopmGM1dRC1dc/YvTedKqIIqVE73B8Mo8sqs=; b=HMOO0WXLEOYZAjwzmGeA6Lfk0LWzMHEYedMWvOb/D1AEpO3Q0IV1IiLCf3luNn4VNjSSJO qjQJYOE5t27rh7seeBnVJggs84V3FAP2jurHWbZmldCr/VsTi9O8ezm9i/HaazKXrjxQp+ Wke6RHJs2dybKL0mk13rVeJ2KhKCd0g= X-MC-Unique: 3JErJMvCN-u-v8dCFuXqlg-1 From: John Snow To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Cleber Rosa , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Hanna Reitz , Thomas Huth , Daniel Berrange , Kevin Wolf , John Snow , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Beraldo Leal Subject: [RFC PATCH 2/9] tests: add "TESTS_PYTHON" variable to Makefile Date: Thu, 12 May 2022 20:06:02 -0400 Message-Id: <20220513000609.197906-3-jsnow@redhat.com> In-Reply-To: <20220513000609.197906-1-jsnow@redhat.com> References: <20220513000609.197906-1-jsnow@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1652400682688100001 Content-Type: text/plain; charset="utf-8" This is a convenience feature: $(PYTHON) points to the Python executable we were instructed to use by the configure script. We use that Python to create a virtual environment with the "check-venv" target in tests/Makefile.include. $(TESTS_PYTHON) points to the Python executable belonging to the virtual environment tied to the build. This Python executable is a symlink to the binary used to create the venv, which will be the version provided at configure time. Using $(TESTS_PYTHON) therefore uses the $(PYTHON) executable, but with paths modified to use packages installed to the venv. Signed-off-by: John Snow Reviewed-by: Paolo Bonzini --- tests/Makefile.include | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index ec84b2ebc04..146aaa96a00 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -89,6 +89,7 @@ TARGETS=3D$(patsubst libqemu-%.fa, %, $(filter libqemu-%.= fa, $(ninja-targets))) TESTS_VENV_DIR=3D$(BUILD_DIR)/tests/venv TESTS_VENV_REQ=3D$(SRC_PATH)/tests/requirements.txt TESTS_RESULTS_DIR=3D$(BUILD_DIR)/tests/results +TESTS_PYTHON=3D$(TESTS_VENV_DIR)/bin/python ifndef AVOCADO_TESTS AVOCADO_TESTS=3Dtests/avocado endif @@ -108,7 +109,7 @@ $(TESTS_VENV_DIR): $(TESTS_VENV_REQ) $(PYTHON) -m venv $@, \ VENV, $@) $(call quiet-command, \ - $(TESTS_VENV_DIR)/bin/python -m pip -q install -r $(TESTS_VENV= _REQ), \ + $(TESTS_PYTHON) -m pip -q install -r $(TESTS_VENV_REQ), \ PIP, $(TESTS_VENV_REQ)) $(call quiet-command, touch $@) =20 @@ -126,7 +127,7 @@ FEDORA_31_DOWNLOAD=3D$(filter $(FEDORA_31_ARCHES),$(FED= ORA_31_ARCHES_CANDIDATES)) # download one specific Fedora 31 image get-vm-image-fedora-31-%: check-venv $(call quiet-command, \ - $(TESTS_VENV_DIR)/bin/python -m avocado vmimage get \ + $(TESTS_PYTHON) -m avocado vmimage get \ --distro=3Dfedora --distro-version=3D31 --arch=3D$*, \ "AVOCADO", "Downloading avocado tests VM image for $*") =20 @@ -135,7 +136,7 @@ get-vm-images: check-venv $(patsubst %,get-vm-image-fed= ora-31-%, $(FEDORA_31_DOW =20 check-avocado: check-venv $(TESTS_RESULTS_DIR) get-vm-images $(call quiet-command, \ - $(TESTS_VENV_DIR)/bin/python -m avocado \ + $(TESTS_PYTHON) -m avocado \ --show=3D$(AVOCADO_SHOW) run --job-results-dir=3D$(TESTS_RESUL= TS_DIR) \ $(if $(AVOCADO_TAGS),, --filter-by-tags-include-empty \ --filter-by-tags-include-empty-key) \ --=20 2.34.1 From nobody Sat Apr 20 16:15:52 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1652400818; cv=none; d=zohomail.com; s=zohoarc; b=dnNa24EKsUxNMSVL0jQ+6uI9/LPIsBYgWA9fVzEr3hD1qcm04QgEokC6L7HJEG0xbnwKOTRBVSRNM4jiwxnFjs2Bd83vsjOx6ysH+YiGu/uH/ZXdFXdDFS10ZvPCNilO7zEVCpSajMoRtumiuyfERWXxYpqpize6heGfC5UkHT0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652400818; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=A1PasI3s2VjRNgk2DHwV+Lp12HBmfXCsex2gKvSrwok=; b=mAw5/gjsx9oXpwAbDIux9I2QXyQt5woi1+oI/0TZLp0sELg5K2Cv+nwwBE0gRDFqzEQj0jdfgBq9hqnns//IA5YhfWCPTVsEIj2JQf28+A0cdrrensXqTiyq0beO6+1ZPqHPT5melf9h7Xhjcm9iuro1mQdCdPRCmACujkW2tnU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1652400818844463.3740989913139; Thu, 12 May 2022 17:13:38 -0700 (PDT) Received: from localhost ([::1]:50498 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1npIw5-0002Yt-SE for importer2@patchew.org; Thu, 12 May 2022 20:13:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56214) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npIp5-0007IY-5a for qemu-devel@nongnu.org; Thu, 12 May 2022 20:06:23 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:54178) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npIp3-0007lw-8e for qemu-devel@nongnu.org; Thu, 12 May 2022 20:06:22 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [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-487-NDwFBwVYPxav_t7V5s0VvQ-1; Thu, 12 May 2022 20:06:17 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 19C96296A629; Fri, 13 May 2022 00:06:17 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.8.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6E95A15341CE; Fri, 13 May 2022 00:06:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652400380; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=A1PasI3s2VjRNgk2DHwV+Lp12HBmfXCsex2gKvSrwok=; b=YyOP0PbJDVKdUpVQMDW7Hpzf3w5/UWX8a1SqTJG/j3JMt5k8qaJeIRZdN4mlIQcHqsj2CL pkoYy3EdQ/Vrvmgo8xa+1gdC+3OuhrBJbjkIhmqYZJUk6ePq8tkjQTV4ojWlPo05pxQ1Cn KZxZBp7AtOQ8AeGJ5NJvlGgV8SzV4+Y= X-MC-Unique: NDwFBwVYPxav_t7V5s0VvQ-1 From: John Snow To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Cleber Rosa , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Hanna Reitz , Thomas Huth , Daniel Berrange , Kevin Wolf , John Snow , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Beraldo Leal Subject: [RFC PATCH 3/9] tests: install "qemu" namespace package into venv Date: Thu, 12 May 2022 20:06:03 -0400 Message-Id: <20220513000609.197906-4-jsnow@redhat.com> In-Reply-To: <20220513000609.197906-1-jsnow@redhat.com> References: <20220513000609.197906-1-jsnow@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1652400819387100002 Content-Type: text/plain; charset="utf-8" This patch adds the "qemu" namespace package to the $build/tests/venv directory. It does so in "editable" mode, which means that changes to the source python directory will actively be reflected by the venv. This patch also then removes any sys.path hacking from the avocado test scripts directly. By doing this, the environment of where to find these packages is managed entirely by the virtual environment and not by the scripts themselves. Signed-off-by: John Snow Reviewed-by: Paolo Bonzini --- tests/Makefile.include | 5 ++++- tests/avocado/avocado_qemu/__init__.py | 11 +++++------ tests/avocado/virtio_check_params.py | 1 - tests/avocado/virtio_version.py | 1 - tests/requirements.txt | 1 + 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index 146aaa96a00..dbbf1ba535b 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -104,10 +104,13 @@ else AVOCADO_CMDLINE_TAGS=3D$(addprefix -t , $(AVOCADO_TAGS)) endif =20 -$(TESTS_VENV_DIR): $(TESTS_VENV_REQ) +$(TESTS_VENV_DIR): $(TESTS_VENV_REQ) $(SRC_PATH)/python/setup.cfg $(call quiet-command, \ $(PYTHON) -m venv $@, \ VENV, $@) + $(call quiet-command, \ + $(TESTS_PYTHON) -m pip -q install \ + -e "$(SRC_PATH)/python/", PIP, "$(SRC_PATH)/python/") $(call quiet-command, \ $(TESTS_PYTHON) -m pip -q install -r $(TESTS_VENV_REQ), \ PIP, $(TESTS_VENV_REQ)) diff --git a/tests/avocado/avocado_qemu/__init__.py b/tests/avocado/avocado= _qemu/__init__.py index 39f15c1d518..b656a70c55b 100644 --- a/tests/avocado/avocado_qemu/__init__.py +++ b/tests/avocado/avocado_qemu/__init__.py @@ -21,6 +21,11 @@ from avocado.utils import cloudinit, datadrainer, process, ssh, vmimage from avocado.utils.path import find_command =20 +from qemu.machine import QEMUMachine +from qemu.utils import (get_info_usernet_hostfwd_port, kvm_available, + tcg_available) + + #: The QEMU build root directory. It may also be the source directory #: if building from the source dir, but it's safer to use BUILD_DIR for #: that purpose. Be aware that if this code is moved outside of a source @@ -35,12 +40,6 @@ else: SOURCE_DIR =3D BUILD_DIR =20 -sys.path.append(os.path.join(SOURCE_DIR, 'python')) - -from qemu.machine import QEMUMachine -from qemu.utils import (get_info_usernet_hostfwd_port, kvm_available, - tcg_available) - =20 def has_cmd(name, args=3DNone): """ diff --git a/tests/avocado/virtio_check_params.py b/tests/avocado/virtio_ch= eck_params.py index e869690473a..4093da8a674 100644 --- a/tests/avocado/virtio_check_params.py +++ b/tests/avocado/virtio_check_params.py @@ -22,7 +22,6 @@ import re import logging =20 -sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'pytho= n')) from qemu.machine import QEMUMachine from avocado_qemu import QemuSystemTest from avocado import skip diff --git a/tests/avocado/virtio_version.py b/tests/avocado/virtio_version= .py index 208910bb844..c84e48813a1 100644 --- a/tests/avocado/virtio_version.py +++ b/tests/avocado/virtio_version.py @@ -11,7 +11,6 @@ import sys import os =20 -sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'pytho= n')) from qemu.machine import QEMUMachine from avocado_qemu import QemuSystemTest =20 diff --git a/tests/requirements.txt b/tests/requirements.txt index a21b59b4439..0ba561b6bdf 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,5 +1,6 @@ # Add Python module requirements, one per line, to be installed # in the tests/venv Python virtual environment. For more info, # refer to: https://pip.pypa.io/en/stable/user_guide/#id1 +# Note that qemu.git/python/ is always implicitly installed. avocado-framework=3D=3D88.1 pycdlib=3D=3D1.11.0 --=20 2.34.1 From nobody Sat Apr 20 16:15:52 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1652400552; cv=none; d=zohomail.com; s=zohoarc; b=l04TIamXqw2ca4dVabeORWm8GUWW1oatka5McS5iZ3PXpOTGIRb6rbrQqWFx5bIpk4widEdomE+1MRyE8Qq81zuPacIl8iaXAW4wkRFMeg8h6hBzqedmuXDZy3h7ofeEY0xLw1MMParuSjGKIqQG4jFSYyVA1j0D55eKuVpCc98= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652400552; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Z2bK0RIexSAs/ZjbONnlUeZVujcs8NOILosPHHmuTIw=; b=MZqesXqYaRU2NWRhjYQoZ53I41zfxDDSRDOUV0E33EcA5gx//+hXngUNx60E3KaTuIH2Btv6r8tkLlVie+rgoSVe142qZYyGoWV1aPNZGzwa35Gni7AddlqounYony5IVA6l67UgTrqpkfBu5/HYzsjOTjbHv7WVIacbKgAnRfY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1652400552843963.8996234303155; Thu, 12 May 2022 17:09:12 -0700 (PDT) Received: from localhost ([::1]:37342 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1npIrn-0001ic-Bc for importer2@patchew.org; Thu, 12 May 2022 20:09:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56244) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npIp7-0007Jl-Lo for qemu-devel@nongnu.org; Thu, 12 May 2022 20:06:25 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:34091) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npIp5-0007mO-6D for qemu-devel@nongnu.org; Thu, 12 May 2022 20:06:24 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [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-237-aEXgc4EwNJ6TehhRqIy1UA-1; Thu, 12 May 2022 20:06:19 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E8DC1296A60F; Fri, 13 May 2022 00:06:18 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.8.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2A35F15341D5; Fri, 13 May 2022 00:06:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652400382; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Z2bK0RIexSAs/ZjbONnlUeZVujcs8NOILosPHHmuTIw=; b=h6VdSUCPiWoA5sqxwKKVvmoF32aN+P4EvV/EkHnpMpOh54I2nwge3Mxkz3QSQiizJmoEab gXoh8fkWiq0ffaYYBl2oWCljmM05m/OPU0YCcTs5ARtyCL5aQrz45eKAeq+LgPSkgZHfh8 7Vx7qx6+4gq8/ap6u63AYu9avbvJ02s= X-MC-Unique: aEXgc4EwNJ6TehhRqIy1UA-1 From: John Snow To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Cleber Rosa , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Hanna Reitz , Thomas Huth , Daniel Berrange , Kevin Wolf , John Snow , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Beraldo Leal Subject: [RFC PATCH 4/9] tests: silence pip upgrade warnings during venv creation Date: Thu, 12 May 2022 20:06:04 -0400 Message-Id: <20220513000609.197906-5-jsnow@redhat.com> In-Reply-To: <20220513000609.197906-1-jsnow@redhat.com> References: <20220513000609.197906-1-jsnow@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, 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+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1652400554142100007 Content-Type: text/plain; charset="utf-8" Turn off the nag warning coaxing us to upgrade pip. It's not really that interesting to see in CI logs, and as long as nothing is broken -- nothing is broken. Signed-off-by: John Snow --- tests/Makefile.include | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index dbbf1ba535b..dfb678d379f 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -109,11 +109,11 @@ $(TESTS_VENV_DIR): $(TESTS_VENV_REQ) $(SRC_PATH)/pyth= on/setup.cfg $(PYTHON) -m venv $@, \ VENV, $@) $(call quiet-command, \ - $(TESTS_PYTHON) -m pip -q install \ + $(TESTS_PYTHON) -m pip -q --disable-pip-version-check install \ -e "$(SRC_PATH)/python/", PIP, "$(SRC_PATH)/python/") $(call quiet-command, \ - $(TESTS_PYTHON) -m pip -q install -r $(TESTS_VENV_REQ), \ - PIP, $(TESTS_VENV_REQ)) + $(TESTS_PYTHON) -m pip -q --disable-pip-version-check install \ + -r $(TESTS_VENV_REQ), PIP, $(TESTS_VENV_REQ)) $(call quiet-command, touch $@) =20 $(TESTS_RESULTS_DIR): --=20 2.34.1 From nobody Sat Apr 20 16:15:52 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1652400561; cv=none; d=zohomail.com; s=zohoarc; b=WOFQI8kWplrEvraawFVwYhdvmbMJojKgFCz8FFcSQdKu9VEYNqMovkCaoYLPT0CdSU9hlc39xxck+0EcZ3GgiblxFTceaY9KTcabJBmGOlTMSShR1uHBymCYWI6LjRCBwIRPltkkesklcag/n6KTzniorgDWWgV/tsUfMZHpZd8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652400561; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=XuMCfxaDqDZ58iJAXLKJBM72WmXQ2NKkDazn4DtMVy4=; b=HYKLEmuSmY2P4QrCm+9utaA5Q2K8h18jrY5cY3K3A0ABhJgbqbOYiUHnHuFXBYNjuwME5InpbzXtIlCEWjmLCpLHy/hS24ed5qApsDib+snHcQehXHxX8TAJUrplrVXbVogF4/ZqFZ56P7U4jQ29qeDDr1ahQWFLwZJLowcGwZk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1652400561380295.41885553803195; Thu, 12 May 2022 17:09:21 -0700 (PDT) Received: from localhost ([::1]:37982 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1npIrv-00029G-U7 for importer2@patchew.org; Thu, 12 May 2022 20:09:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56302) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npIp9-0007Kr-F9 for qemu-devel@nongnu.org; Thu, 12 May 2022 20:06:28 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:38450) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npIp7-0007n5-Su for qemu-devel@nongnu.org; Thu, 12 May 2022 20:06:27 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [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-502-Tsw5qhDNPqe2WHUhVmxtGQ-1; Thu, 12 May 2022 20:06:21 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2ABA1296A629; Fri, 13 May 2022 00:06:21 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.8.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id 11FD515341CE; Fri, 13 May 2022 00:06:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652400384; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XuMCfxaDqDZ58iJAXLKJBM72WmXQ2NKkDazn4DtMVy4=; b=XNQDmKAvofJ40XkVBj8Hn8CbP7ZANO54QTn3VmgedPe0XNqVMRvhwwQGDR991YUQskrOXc w326YizVQ+4rIVhLQZjeSxt2Crli5c+p7jp4bMJYEuL0qy7ty1hqYNFvLvre5MIL+uMbt0 7VcTgjmXsRsPvNN9sOJ/i4ioUBs1Gtk= X-MC-Unique: Tsw5qhDNPqe2WHUhVmxtGQ-1 From: John Snow To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Cleber Rosa , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Hanna Reitz , Thomas Huth , Daniel Berrange , Kevin Wolf , John Snow , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Beraldo Leal Subject: [RFC PATCH 5/9] tests: use tests/venv to run basevm.py-based scripts Date: Thu, 12 May 2022 20:06:05 -0400 Message-Id: <20220513000609.197906-6-jsnow@redhat.com> In-Reply-To: <20220513000609.197906-1-jsnow@redhat.com> References: <20220513000609.197906-1-jsnow@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1652400562137100001 Content-Type: text/plain; charset="utf-8" This patch co-opts the virtual environment being used by avocado tests to also run the basevm.py tests. This is being done in preparation for for the qemu.qmp package being removed from qemu.git. As part of the change, remove any sys.path() hacks and treat "qemu" as a normal third-party import. Signed-off-by: John Snow Reviewed-by: Paolo Bonzini --- tests/vm/Makefile.include | 13 +++++++------ tests/vm/basevm.py | 6 +++--- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/tests/vm/Makefile.include b/tests/vm/Makefile.include index ae91f5043e5..588bc999cc9 100644 --- a/tests/vm/Makefile.include +++ b/tests/vm/Makefile.include @@ -84,10 +84,11 @@ vm-clean-all: =20 $(IMAGES_DIR)/%.img: $(SRC_PATH)/tests/vm/% \ $(SRC_PATH)/tests/vm/basevm.py \ - $(SRC_PATH)/tests/vm/Makefile.include + $(SRC_PATH)/tests/vm/Makefile.include \ + check-venv @mkdir -p $(IMAGES_DIR) $(call quiet-command, \ - $(PYTHON) $< \ + $(TESTS_PYTHON) $< \ $(if $(V)$(DEBUG), --debug) \ $(if $(GENISOIMAGE),--genisoimage $(GENISOIMAGE)) \ $(if $(QEMU_LOCAL),--build-path $(BUILD_DIR)) \ @@ -101,9 +102,9 @@ $(IMAGES_DIR)/%.img: $(SRC_PATH)/tests/vm/% \ =20 =20 # Build in VM $(IMAGE) -vm-build-%: $(IMAGES_DIR)/%.img +vm-build-%: $(IMAGES_DIR)/%.img check-venv $(call quiet-command, \ - $(PYTHON) $(SRC_PATH)/tests/vm/$* \ + $(TESTS_PYTHON) $(SRC_PATH)/tests/vm/$* \ $(if $(V)$(DEBUG), --debug) \ $(if $(DEBUG), --interactive) \ $(if $(J),--jobs $(J)) \ @@ -127,9 +128,9 @@ vm-boot-serial-%: $(IMAGES_DIR)/%.img -device virtio-net-pci,netdev=3Dvnet \ || true =20 -vm-boot-ssh-%: $(IMAGES_DIR)/%.img +vm-boot-ssh-%: $(IMAGES_DIR)/%.img check-venv $(call quiet-command, \ - $(PYTHON) $(SRC_PATH)/tests/vm/$* \ + $(TESTS_PYTHON) $(SRC_PATH)/tests/vm/$* \ $(if $(J),--jobs $(J)) \ $(if $(V)$(DEBUG), --debug) \ $(if $(QEMU_LOCAL),--build-path $(BUILD_DIR)) \ diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index 254e11c932b..d7d0413df35 100644 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -18,9 +18,6 @@ import logging import time import datetime -sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'pytho= n')) -from qemu.machine import QEMUMachine -from qemu.utils import get_info_usernet_hostfwd_port, kvm_available import subprocess import hashlib import argparse @@ -31,6 +28,9 @@ import traceback import shlex =20 +from qemu.machine import QEMUMachine +from qemu.utils import get_info_usernet_hostfwd_port, kvm_available + SSH_KEY_FILE =3D os.path.join(os.path.dirname(__file__), "..", "keys", "id_rsa") SSH_PUB_KEY_FILE =3D os.path.join(os.path.dirname(__file__), --=20 2.34.1 From nobody Sat Apr 20 16:15:52 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1652400688; cv=none; d=zohomail.com; s=zohoarc; b=Rr3JEXr1qHlg3CqUu2yK+V6NrYpecEzpxLRW1SrXj4BUIql6tPUiqiGhW8WVTq/HhKRQOF45bD3PIvJaY3rGUKN3PvSFi5ZrCicJIqOG9z/0dheTzb2FQ3TrMbq/+zQCRf+60eipOe/ik/KQ2R1GJ9ApBbBTOvBAH1oYIMx0j/Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652400688; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=5rUyOS5lbWF5DqiEcMhdYvKM5BVBWmgaTd7NDt8TGNU=; b=kBg8AdJrZiJ2Iz0Nd+twB55tyk0QsiNEyNTxx8YV2zBnnLz2Nb5w5DPTImOk0JHmuGtChcTG7rFbEK79EByekNLO36/V4d4BFoYaQ6+nT0FYG77retJ/ZfQqWsqyB6CE0nUO33ZarhfDhTKRDVttaDlZzKS5L0AhF2AznZnrbhc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1652400688741870.254483343448; Thu, 12 May 2022 17:11:28 -0700 (PDT) Received: from localhost ([::1]:46058 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1npItz-0007jS-Me for importer2@patchew.org; Thu, 12 May 2022 20:11:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56340) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npIpA-0007LD-Oo for qemu-devel@nongnu.org; Thu, 12 May 2022 20:06:29 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:37002) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npIp8-0007nC-6N for qemu-devel@nongnu.org; Thu, 12 May 2022 20:06:28 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [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-520-QbtMM-7iMMir9kcspHhW0A-1; Thu, 12 May 2022 20:06:22 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C9AC71C04B6E; Fri, 13 May 2022 00:06:21 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.8.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3FE5015341CE; Fri, 13 May 2022 00:06:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652400385; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5rUyOS5lbWF5DqiEcMhdYvKM5BVBWmgaTd7NDt8TGNU=; b=hmGbOOoX0lPGoamxUa/PJioqIAbMv1z2MYnXzSAEpAEpufBn0Y54mgbSnToygjsNyknG4i axAlSKMOVznJg+PG9hr0/sT9V8HvIZxFlFWMQfUf5r/jU1O5RkVVP+CyTmkyyLHWjRjG5R HZvjW02y2uRyvA9tWygItuM2xI8FVOk= X-MC-Unique: QbtMM-7iMMir9kcspHhW0A-1 From: John Snow To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Cleber Rosa , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Hanna Reitz , Thomas Huth , Daniel Berrange , Kevin Wolf , John Snow , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Beraldo Leal Subject: [RFC PATCH 6/9] tests: add check-venv as a dependency of check and check-block Date: Thu, 12 May 2022 20:06:06 -0400 Message-Id: <20220513000609.197906-7-jsnow@redhat.com> In-Reply-To: <20220513000609.197906-1-jsnow@redhat.com> References: <20220513000609.197906-1-jsnow@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1652400690756100001 Content-Type: text/plain; charset="utf-8" This patch is being front-loaded before iotests actually relies on the tests/venv being created in order to preserve bisectability. Problems I am aware of here (There are a lot, sorry): - I am not sure the right place to express this dependency, so I did it in tests/Makefile.include. It seems to work. I wasn't sure how to express it in tests/qemu-iotests/meson.build, but I am not sure if that would make it work for both "check" and "check-block" anyway. - I don't really understand why I need empty rules for Make to process the pre-requisite. Without the "do-nothing" recipes, the venv building doesn't seem to trigger at all. What I have seems to work, but I'm worried I broke something unseen. - This adds avocado as a dependency of "check"/"check-block", which is not technically true. It was just a sin of convenience to create one shared "testing venv". Maybe I'll figure out a scheme to have avocado's dependencies be "extras" that get added in to a standard "core set". - This patch ignore the requisite that RPM builds be able to run without internet access, meaning that a PyPI fetch is not permissable. I plan to solve this by using an environment variable (QEMU_CHECK_NO_PYPI) that changes the behavior of the venv setup slightly, and qemu specfiles can opt-in to this behavior. Signed-off-by: John Snow --- tests/Makefile.include | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index dfb678d379f..fa7af711fe5 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -154,10 +154,17 @@ check-acceptance-deprecated-warning: =20 check-acceptance: check-acceptance-deprecated-warning | check-avocado =20 +# Before we delegate to meson, create the python venv for block tests. +.PHONY: check-block +check-block: check-venv + @echo # Without some rule, this doesn't run at all. Why? + + # Consolidated targets =20 .PHONY: check check-clean get-vm-images -check: +check: check-venv + @echo # ??? =20 check-build: run-ninja =20 --=20 2.34.1 From nobody Sat Apr 20 16:15:52 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1652400934; cv=none; d=zohomail.com; s=zohoarc; b=Qmv61DCi4rpWViA2mNvK8D256wAdjCx3erWlmDdls6c5ceB0WwUU/+Sn6Tcc87eOv8eVF+pTYJivaegbPO6o50SM4MjXh+CJA8y5gMK5hwY1BdkUF1sbpbn0VlK7p1UiDDvCJ9h61p5+XOSuwyjh9dJqivYiJVHylC7rszoL7N4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652400934; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=FC2FNO1LE7MC60AjofgfjqIcMDscN/YWRdjjucrzlEQ=; b=e8wRmUIQM4v/wjURQX5qZYvJPY9eszLdJrpctcUgQwj9ArJOYtwLq4yl8AWC4SSoFrrJX28bg9gAZ5QCKt7r73msoAbryHnaKp5r7Xmo4rJPT39fTXKyQKEpsZ/wlJgvW7AGObRUfSfP9xDhpT0PaVDfbMaITj6yCyr7KGsq3Bw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1652400934533521.6743394453432; Thu, 12 May 2022 17:15:34 -0700 (PDT) Received: from localhost ([::1]:54328 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1npIxw-0005N2-Vz for importer2@patchew.org; Thu, 12 May 2022 20:15:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56360) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npIpC-0007MK-JI for qemu-devel@nongnu.org; Thu, 12 May 2022 20:06:31 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:34982) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npIpA-0007ni-6d for qemu-devel@nongnu.org; Thu, 12 May 2022 20:06:29 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-523-P26kv79TPFSoXuvzfrWQ2Q-1; Thu, 12 May 2022 20:06:23 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 23876185A794; Fri, 13 May 2022 00:06:23 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.8.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id 15AEF15341CE; Fri, 13 May 2022 00:06:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652400387; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FC2FNO1LE7MC60AjofgfjqIcMDscN/YWRdjjucrzlEQ=; b=EN0hr/IcIMB6IwaM2P0E1mNEq1KcunaUa7qoEo9MPdzMz592utXQae1x3+f69XDB22cK0+ gu44Ki5T5T0ODrsgMunhugXwnCJtl0/PjTfkN79jyKz+DrN7xud4xuTZk8NONY74Z8LiCb uKX8qMcT/LWuYpfRM7/UPU1KhaqO6us= X-MC-Unique: P26kv79TPFSoXuvzfrWQ2Q-1 From: John Snow To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Cleber Rosa , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Hanna Reitz , Thomas Huth , Daniel Berrange , Kevin Wolf , John Snow , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Beraldo Leal Subject: [RFC PATCH 7/9] tests: add check-venv to build-tcg-disabled CI recipe Date: Thu, 12 May 2022 20:06:07 -0400 Message-Id: <20220513000609.197906-8-jsnow@redhat.com> In-Reply-To: <20220513000609.197906-1-jsnow@redhat.com> References: <20220513000609.197906-1-jsnow@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1652400936017100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: John Snow Reviewed-by: Paolo Bonzini --- .gitlab-ci.d/buildtest.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml index 0aea7ab84c2..5c6201847f1 100644 --- a/.gitlab-ci.d/buildtest.yml +++ b/.gitlab-ci.d/buildtest.yml @@ -245,6 +245,7 @@ build-tcg-disabled: - make -j"$JOBS" - make check-unit - make check-qapi-schema + - make check-venv - cd tests/qemu-iotests/ - ./check -raw 001 002 003 004 005 008 009 010 011 012 021 025 032 033= 048 052 063 077 086 101 104 106 113 148 150 151 152 157 159 160 163 --=20 2.34.1 From nobody Sat Apr 20 16:15:52 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1652400818; cv=none; d=zohomail.com; s=zohoarc; b=ID4HNHxMpxEZ7TbVO8TZDMTfiz4+t+n6wGDP25vZsh9XSycMBwfwPVbT2eTJR71gK2qDrrt6MyisGb9XGVlLa4iRLKxb1mtp9gQLcrYCswCh8gCOwX/+/x+ojpeJTcufSrQRFeXiDqO9QEuvIdazTyfNrvwLEBQCLpDgKcVo7h8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652400818; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=fYZbJ70OmbPfbMKX54+AlxbyC4G+hCh+4siMBCUdMnQ=; b=VWz4G2AixDzjoKhzb56jlwTHq2pl0wNONETzjKH1hQdsFlgyUeKvIYeYPKOZM9jyLTYwzcudTsh+EDskIokAAdkjSVp+WafQDOnYsVkHz8JmBzrjpXh/DGPI7250pQzXX+lMF4j7FLyLkt0G+PcZ29+4p+l3TzUF9HRgPfE0ovY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1652400818080341.85745425882305; Thu, 12 May 2022 17:13:38 -0700 (PDT) Received: from localhost ([::1]:50488 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1npIw4-0002YW-S2 for importer2@patchew.org; Thu, 12 May 2022 20:13:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56346) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npIpA-0007LF-SA for qemu-devel@nongnu.org; Thu, 12 May 2022 20:06:29 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:23918) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npIp9-0007nP-0U for qemu-devel@nongnu.org; Thu, 12 May 2022 20:06:28 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [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-453-Kp7wuxKyO0G3Zrb2FZZc8A-1; Thu, 12 May 2022 20:06:25 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E1EE6296A629; Fri, 13 May 2022 00:06:24 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.8.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id 78B8B15341CE; Fri, 13 May 2022 00:06:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652400386; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fYZbJ70OmbPfbMKX54+AlxbyC4G+hCh+4siMBCUdMnQ=; b=dlapaF7lAixmWQ10niSTgsQYTy1MKCk1SGABb8ouAGrXoIhycchupDB51ZHKS/AKhmE/fy /RO2Z51hPIrnJ52bzaPMByWBwjb8kmwUfXBF2k/ljj4xFEAFrmkrf1dHu2tLf5aa8/tNRB r2jfnaryK6Sn6phzuwAVheZQWpvz6WI= X-MC-Unique: Kp7wuxKyO0G3Zrb2FZZc8A-1 From: John Snow To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Cleber Rosa , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Hanna Reitz , Thomas Huth , Daniel Berrange , Kevin Wolf , John Snow , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Beraldo Leal Subject: [RFC PATCH 8/9] iotests: fix source directory location Date: Thu, 12 May 2022 20:06:08 -0400 Message-Id: <20220513000609.197906-9-jsnow@redhat.com> In-Reply-To: <20220513000609.197906-1-jsnow@redhat.com> References: <20220513000609.197906-1-jsnow@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, 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+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1652400819375100001 Content-Type: text/plain; charset="utf-8" If you invoke the check script from outside of the tests/qemu-iotests directory, the directories initialized as source_iotests and build_iotests will be incorrect. We can use the location of the source file itself to be more accurate. (I don't know if this is actually *used*, but what was there was wrong, I think.) Signed-off-by: John Snow Reviewed-by: Paolo Bonzini --- tests/qemu-iotests/testenv.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/testenv.py b/tests/qemu-iotests/testenv.py index a864c74b123..0007da3f06c 100644 --- a/tests/qemu-iotests/testenv.py +++ b/tests/qemu-iotests/testenv.py @@ -217,10 +217,10 @@ def __init__(self, imgfmt: str, imgproto: str, aiomod= e: str, self.build_iotests =3D os.path.dirname(os.path.abspath(sys.arg= v[0])) else: # called from the source tree - self.source_iotests =3D os.getcwd() + self.source_iotests =3D str(Path(__file__, '../').resolve()) self.build_iotests =3D self.source_iotests =20 - self.build_root =3D os.path.join(self.build_iotests, '..', '..') + self.build_root =3D str(Path(self.build_iotests, '../..').resolve(= )) =20 self.init_directories() self.init_binaries() --=20 2.34.1 From nobody Sat Apr 20 16:15:52 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1652401029; cv=none; d=zohomail.com; s=zohoarc; b=kpXzrEMpCCKIt6ZyZ+S7ywlBPGI0guBAHoRGZikeyRNk/+oNCh4YrqHWP1zNcM2TCYgDNcen9rpdBpBOWk6hzhpZhQ787V5gITsSWLl0fQGHTm7hi3ckKzAd3jXKdJFWbvQEjhDG4BgOfLhvQrEffnpALvYOnlOeTFJxRMl8+0w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652401029; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=H8uNAFWjMGftZ0M1OlBuJbAV4IpB/yDoRqa4iGIxhxQ=; b=k+WPUKg8EgLhkfUbahyOiwZNNeJMmonpn8A3wy+BRzv9ybcQ+4NjvfEORT4ZPasu5ujk0Hp6tEP+tsyfugLujVMNDv0Pa4CZr5ZNh0tGArcCjKhEOmkj+8aspOdyber5IG6ImmnLzWqUsR59iuqanhb7OYIwhBuoIOesQDGtn3o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1652401029527105.63940134254847; Thu, 12 May 2022 17:17:09 -0700 (PDT) Received: from localhost ([::1]:56532 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1npIzU-0006xs-JH for importer2@patchew.org; Thu, 12 May 2022 20:17:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56382) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npIpE-0007Oa-Nw for qemu-devel@nongnu.org; Thu, 12 May 2022 20:06:36 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:30804) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npIpC-0007oE-Ci for qemu-devel@nongnu.org; Thu, 12 May 2022 20:06:31 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-486-wh66j9hyP6WAx2GbSheQVA-1; Thu, 12 May 2022 20:06:26 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 04D5F801E80; Fri, 13 May 2022 00:06:26 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.8.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2041715341CE; Fri, 13 May 2022 00:06:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652400389; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=H8uNAFWjMGftZ0M1OlBuJbAV4IpB/yDoRqa4iGIxhxQ=; b=PISIVD6daJVTkaB7nSOyXsurLkM6NlM52lOu4xESWWM/mD2fit6Ru7BhQsdp5XLtnYDo0d eVe/jJIWH+rSBN8JGDrd/bUYEZ+K9oKDzzgGqvh8fuoY+qUDSJvSdWX884uUJzZh380SpD jaUMJpHe3WH3f3IcoIWco/QyQDo0PqA= X-MC-Unique: wh66j9hyP6WAx2GbSheQVA-1 From: John Snow To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Cleber Rosa , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Hanna Reitz , Thomas Huth , Daniel Berrange , Kevin Wolf , John Snow , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Beraldo Leal Subject: [RFC PATCH 9/9] iotests: use tests/venv for running tests Date: Thu, 12 May 2022 20:06:09 -0400 Message-Id: <20220513000609.197906-10-jsnow@redhat.com> In-Reply-To: <20220513000609.197906-1-jsnow@redhat.com> References: <20220513000609.197906-1-jsnow@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1652401030370100001 Content-Type: text/plain; charset="utf-8" Essentially, this: (A) adjusts the python binary to be the one found in the venv (which is a symlink to the python binary chosen at configure time) (B) adds a new VIRTUAL_ENV export variable (C) changes PATH to front-load the venv binary directory. If the venv directory isn't found, raise a friendly exception that tries to give the human operator a friendly clue as to what's gone wrong. In the very near future, I'd like to teach iotests how to fix this problem entirely of its own volition, but that's a trick for a little later. Signed-off-by: John Snow --- tests/qemu-iotests/testenv.py | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/tests/qemu-iotests/testenv.py b/tests/qemu-iotests/testenv.py index 0007da3f06c..fd3720ed7e7 100644 --- a/tests/qemu-iotests/testenv.py +++ b/tests/qemu-iotests/testenv.py @@ -65,8 +65,9 @@ class TestEnv(ContextManager['TestEnv']): # lot of them. Silence pylint: # pylint: disable=3Dtoo-many-instance-attributes =20 - env_variables =3D ['PYTHONPATH', 'TEST_DIR', 'SOCK_DIR', 'SAMPLE_IMG_D= IR', - 'PYTHON', 'QEMU_PROG', 'QEMU_IMG_PROG', + env_variables =3D ['PYTHONPATH', 'VIRTUAL_ENV', 'PYTHON', + 'TEST_DIR', 'SOCK_DIR', 'SAMPLE_IMG_DIR', + 'QEMU_PROG', 'QEMU_IMG_PROG', 'QEMU_IO_PROG', 'QEMU_NBD_PROG', 'QSD_PROG', 'QEMU_OPTIONS', 'QEMU_IMG_OPTIONS', 'QEMU_IO_OPTIONS', 'QEMU_IO_OPTIONS_NO_FMT', @@ -98,6 +99,10 @@ def get_env(self) -> Dict[str, str]: if val is not None: env[v] =3D val =20 + env['PATH'] =3D os.pathsep.join(( + os.path.join(self.virtual_env, 'bin'), + os.environ['PATH'] + )) return env =20 def init_directories(self) -> None: @@ -107,13 +112,17 @@ def init_directories(self) -> None: SOCK_DIR SAMPLE_IMG_DIR """ - - # Path where qemu goodies live in this source tree. - qemu_srctree_path =3D Path(__file__, '../../../python').resolve() + venv_path =3D Path(self.build_root, 'tests/venv/') + if not venv_path.exists(): + raise FileNotFoundError( + f"Virtual environment \"{venv_path!s}\" isn't found." + " (Maybe you need to run 'make check-venv'" + " from the build dir?)" + ) + self.virtual_env: str =3D str(venv_path) =20 self.pythonpath =3D os.pathsep.join(filter(None, ( self.source_iotests, - str(qemu_srctree_path), os.getenv('PYTHONPATH'), ))) =20 @@ -138,7 +147,7 @@ def init_binaries(self) -> None: PYTHON (for bash tests) QEMU_PROG, QEMU_IMG_PROG, QEMU_IO_PROG, QEMU_NBD_PROG, QSD_PR= OG """ - self.python =3D sys.executable + self.python: str =3D os.path.join(self.virtual_env, 'bin', 'python= 3') =20 def root(*names: str) -> str: return os.path.join(self.build_root, *names) @@ -300,6 +309,7 @@ def print_env(self, prefix: str =3D '') -> None: {prefix}GDB_OPTIONS -- {GDB_OPTIONS} {prefix}VALGRIND_QEMU -- {VALGRIND_QEMU} {prefix}PRINT_QEMU_OUTPUT -- {PRINT_QEMU} +{prefix}VIRTUAL_ENV -- {VIRTUAL_ENV} {prefix}""" =20 args =3D collections.defaultdict(str, self.get_env()) --=20 2.34.1