From patchwork Wed Mar 15 17:43:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 663376 Delivered-To: patch@linaro.org Received: by 2002:a5d:5602:0:0:0:0:0 with SMTP id l2csp1715148wrv; Wed, 15 Mar 2023 10:47:44 -0700 (PDT) X-Google-Smtp-Source: AK7set+HgvMDBuC/MgmKo0d6BecSdSF020kLK1LKEVAZf1kDNPNTew+h/ToFMcVgCp25KGW50eSb X-Received: by 2002:a05:622a:18a:b0:3b9:bc8c:c210 with SMTP id s10-20020a05622a018a00b003b9bc8cc210mr1348798qtw.27.1678902464711; Wed, 15 Mar 2023 10:47:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678902464; cv=none; d=google.com; s=arc-20160816; b=VpHzyrrAA3X9blHp+rBSeBdjqooAimS5jECszGYAcpLisR15O0UXfFVlnKZx8zLnAy zcFNpsAfmkFnVacpNyY6DS437e5A4a4ZUUugc/BLDlIvyVAuTyVAeEYdjRlyCzEzOsOp YOuPv9IGcV1B+VWd4N2zRInKAMWTjGG3wpOJIlbxjjkN906lExWE+SCRUf88ivMpmLB9 RQM0Dl+Ygg9FqrRlzTQ2PZmEq1YNk1rnplJFX8d8lObQ6DVEdNsSefypCzOW2co0uTxc hlotodwkhA1gfLh8+rRnseq2jvzcWEsLwn+lOQ9IvVzwyagNhFg0uQZiWkGHkGYiRZtu nOdQ== 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=RIvbfo0IIlc3X5pccePnUec4yCPh7dln0aorBfnrbhQ=; b=HdQLa8OcY9WXWM7en5Ly9UxfS1IVr0OGPNHUU9xJODcLWv5d8ceh41BErlOd1slYNi lirz2vPPQZO6dg7QNmKgVloNSlx+Yi2T0pJk0pRsRDtSNXtuzyr23AV2K22f530Cw9Hn o+1i7cbLVMKEOZIfN+tzwmklCyjZcbwhl0WkViFDN4/K01LWkaXgZdxE2fc8Lb3UzcZh dJzW3b0FW51cSiL7eBgs65JHKcLpid15E+70FIxLCRsd+xM6rKwbeI5A+plDiCCNwK8f 3o9Kra0f2UcohrEa54HHV/s3GI9aat10kyklLpvN44q2XNbnHh3ixOdr3lyH5WFAcRaa 4vpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QRGJf3yo; 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 l13-20020a05622a050d00b003b9b94f85casi4690367qtx.542.2023.03.15.10.47.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Mar 2023 10:47:44 -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=QRGJf3yo; 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 1pcVAY-0002Ut-3b; Wed, 15 Mar 2023 13:44:11 -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 1pcVAS-0002Po-6n for qemu-devel@nongnu.org; Wed, 15 Mar 2023 13:44:04 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pcVAB-0000cr-Rk for qemu-devel@nongnu.org; Wed, 15 Mar 2023 13:44:03 -0400 Received: by mail-wr1-x42a.google.com with SMTP id p4so11870485wre.11 for ; Wed, 15 Mar 2023 10:43:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678902227; 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=RIvbfo0IIlc3X5pccePnUec4yCPh7dln0aorBfnrbhQ=; b=QRGJf3yo39nlVeahj8Lp9NaZDSwquXrLTwIb/t4B9gkjzWQDgqBKG8QTo09F8dXsZ7 hB1H/PN0GN8IwDvY8VOdymgBj36108d1Jb74hOi4HT9fZOdKBsOxzyB1UPIT47YLy56x /gqBIA2Zwb+Rkoph5ksfCL+dbcU1ZrYmGN1CH6PFmWiNygiPwJvX4hSSyUAQQuTiX7Aj 9fXSVtZIu1D5tfuG2QmL5VD4CWddpUjUVCS3wYfGZKpvDKCjXEcRygCr1o8h2HdC6Ipm hTaxNl8n03dxk/hDwgXtbLuE6CGVSuH0x4fKDmu6hxqkZwyGclbL5zj88b6Cmn12gV51 skug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678902227; 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=RIvbfo0IIlc3X5pccePnUec4yCPh7dln0aorBfnrbhQ=; b=F0IgXE3WFklXGYWX+wEfYJOqCivGtUorEwTOyUXX7qndztYXk1HN4qRVt4Vyj81Y6T Djw3P5RbymTJ68m0FytYIRUqiwiLK8FZ5M7zqICrCN8aftg8F14KI7PUBIdLVaXpj1EQ gT+PmpFo3F2VBNP9sxSMJ3FAip6pTZHrH6+cTXOzDfVcHHiw1S3BIxZeAVK3wAfPKZwS ZaW/EpOlrZna9WBFWVG28QVRITkoZJV3EeW6U+yOxTgBDnibLf/ws/nVf8gvuOHTe48g 4YzuJCGqP05FwZmNjNmyiknsJyW1tSMpjeDsK/gVP6osFzfPZUAmQ7myUBhGMH6tUckN ZsMg== X-Gm-Message-State: AO0yUKUfo/L0OxV870r8olVhsdyLWi1XzDRac2HcsRYbYzEmb+lsvcSg T4fGhJfzAkXoAG3lMhS+0SDyug== X-Received: by 2002:a5d:6888:0:b0:2cf:f2f9:5aac with SMTP id h8-20020a5d6888000000b002cff2f95aacmr2751970wru.45.1678902226906; Wed, 15 Mar 2023 10:43:46 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id p12-20020a5d68cc000000b002ceacff44c7sm5166876wrw.83.2023.03.15.10.43.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Mar 2023 10:43:45 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id C9E531FFCB; Wed, 15 Mar 2023 17:43:43 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Akihiko Odaki , =?utf-8?q?Marc-Andr=C3=A9_Lurea?= =?utf-8?q?u?= , qemu-riscv@nongnu.org, Riku Voipio , Igor Mammedov , Xiao Guangrong , Thomas Huth , Wainer dos Santos Moschetta , "Dr. David Alan Gilbert" , Alex Williamson , Hao Wu , Cleber Rosa , Daniel Henrique Barboza , Jan Kiszka , Aurelien Jarno , qemu-arm@nongnu.org, Marcelo Tosatti , Eduardo Habkost , Alexandre Iooss , Gerd Hoffmann , Palmer Dabbelt , Ilya Leoshkevich , qemu-ppc@nongnu.org, Juan Quintela , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Darren Kenny , kvm@vger.kernel.org, Marcel Apfelbaum , Peter Maydell , Richard Henderson , Stafford Horne , Weiwei Li , Sunil V L , Stefan Hajnoczi , Thomas Huth , Vijai Kumar K , Liu Zhiwei , David Gibson , Song Gao , Paolo Bonzini , "Michael S. Tsirkin" , Niek Linnenbank , Greg Kurz , Laurent Vivier , Qiuhao Li , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Xiaojuan Yang , Mahmoud Mandour , Alexander Bulekov , Jiaxun Yang , qemu-block@nongnu.org, Yanan Wang , David Woodhouse , qemu-s390x@nongnu.org, Strahinja Jankovic , Bandan Das , Alistair Francis , Aleksandar Rikalo , Tyrone Ting , Kevin Wolf , David Hildenbrand , Beraldo Leal , Beniamino Galvani , Paul Durrant , Bin Meng , Sunil Muthuswamy , Hanna Reitz , Peter Xu , =?utf-8?q?Al?= =?utf-8?q?ex_Benn=C3=A9e?= , =?utf-8?q?Daniel_P=2E_?= =?utf-8?q?Berrang=C3=A9?= Subject: [PATCH v2 19/32] iotests: allow test discovery before building Date: Wed, 15 Mar 2023 17:43:18 +0000 Message-Id: <20230315174331.2959-20-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230315174331.2959-1-alex.bennee@linaro.org> References: <20230315174331.2959-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42a.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 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: Daniel P. Berrangé The 'check' script can be invoked in "dry run" mode, in which case it merely does test discovery and prints out all their names. Despite only doing test discovery it still validates that the various QEMU binaries can be found. This makes it impossible todo test discovery prior to building QEMU. This is a desirable feature to support, because it will let meson discover tests. Fortunately the code in the TestEnv constructor is ordered in a way that makes this fairly trivial to achieve. We can just short circuit the constructor after the basic directory paths have been set. Reviewed-by: Thomas Huth Reviewed-by: Alex Bennée Signed-off-by: Daniel P. Berrangé Acked-by: Hanna Czenczek Tested-by: Thomas Huth Message-Id: <20230303160727.3977246-3-berrange@redhat.com> Signed-off-by: Alex Bennée --- tests/qemu-iotests/check | 3 ++- tests/qemu-iotests/testenv.py | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check index da7e8a87fe..bb294ef556 100755 --- a/tests/qemu-iotests/check +++ b/tests/qemu-iotests/check @@ -145,7 +145,8 @@ if __name__ == '__main__': aiomode=args.aiomode, cachemode=args.cachemode, imgopts=args.imgopts, misalign=args.misalign, debug=args.debug, valgrind=args.valgrind, - gdb=args.gdb, qprint=args.print) + gdb=args.gdb, qprint=args.print, + dry_run=args.dry_run) if len(sys.argv) > 1 and sys.argv[-len(args.tests)-1] == '--': if not args.tests: diff --git a/tests/qemu-iotests/testenv.py b/tests/qemu-iotests/testenv.py index aa9d735414..9a37ad9152 100644 --- a/tests/qemu-iotests/testenv.py +++ b/tests/qemu-iotests/testenv.py @@ -178,7 +178,8 @@ def __init__(self, source_dir: str, build_dir: str, debug: bool = False, valgrind: bool = False, gdb: bool = False, - qprint: bool = False) -> None: + qprint: bool = False, + dry_run: bool = False) -> None: self.imgfmt = imgfmt self.imgproto = imgproto self.aiomode = aiomode @@ -218,6 +219,10 @@ def __init__(self, source_dir: str, build_dir: str, self.build_root = os.path.join(self.build_iotests, '..', '..') self.init_directories() + + if dry_run: + return + self.init_binaries() self.malloc_perturb_ = os.getenv('MALLOC_PERTURB_',