From patchwork Tue Feb 8 10:13:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 12738462 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D4A7FC433EF for ; Tue, 8 Feb 2022 10:49:05 +0000 (UTC) Received: from localhost ([::1]:34814 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nHO3T-0008BB-I6 for qemu-devel@archiver.kernel.org; Tue, 08 Feb 2022 05:49:03 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39274) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHNV0-0006Yz-1G for qemu-devel@nongnu.org; Tue, 08 Feb 2022 05:13:27 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:49101) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHNUw-0003VK-Ek for qemu-devel@nongnu.org; Tue, 08 Feb 2022 05:13:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644315202; 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=P09O67l/FWSsw6LKH5uauxICQiasws3LKwEkfmqQzXg=; b=JiPXbPgZWBMpWpbtjP4OBLeSMUxKRCFy9s423KEyc487m2p95TqHWkTVTF1pH9SS4+kmFJ hUbTokztZcglSnI2QROUzFaR67xojnxxK/tlxSV5RPmRXLAz4swezedlRQEnI7Yjh5akaJ fQnHEPaa9bKkdfJ8hpTjCUnWzlld594= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-613-IWYZAH_kP1W0Guxby_-X2w-1; Tue, 08 Feb 2022 05:13:18 -0500 X-MC-Unique: IWYZAH_kP1W0Guxby_-X2w-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7148C802926; Tue, 8 Feb 2022 10:13:17 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.143]) by smtp.corp.redhat.com (Postfix) with ESMTP id E3B7A2856D; Tue, 8 Feb 2022 10:13:15 +0000 (UTC) From: Thomas Huth To: qemu-block@nongnu.org, Hanna Reitz , Kevin Wolf Subject: [PATCH 1/6] tests/qemu-iotests: Improve the check for GNU sed Date: Tue, 8 Feb 2022 11:13:06 +0100 Message-Id: <20220208101311.1511083-2-thuth@redhat.com> In-Reply-To: <20220208101311.1511083-1-thuth@redhat.com> References: <20220208101311.1511083-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=thuth@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_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: , Cc: Paolo Bonzini , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Instead of failing the iotests if GNU sed is not available (or skipping them completely in the check-block.sh script), it would be better to simply skip the bash-based tests, so that the python-based tests could still be run. Thus add the check for BusyBox sed to common.rc and mark the tests as "not run" if GNU sed is not available. Then we can also remove the sed checks from the check-block.sh script. Signed-off-by: Thomas Huth --- tests/check-block.sh | 12 ------------ tests/qemu-iotests/common.rc | 26 +++++++++++++------------- 2 files changed, 13 insertions(+), 25 deletions(-) diff --git a/tests/check-block.sh b/tests/check-block.sh index 720a46bc36..af0c574812 100755 --- a/tests/check-block.sh +++ b/tests/check-block.sh @@ -52,18 +52,6 @@ if LANG=C bash --version | grep -q 'GNU bash, version [123]' ; then skip "bash version too old ==> Not running the qemu-iotests." fi -if ! (sed --version | grep 'GNU sed') > /dev/null 2>&1 ; then - if ! command -v gsed >/dev/null 2>&1; then - skip "GNU sed not available ==> Not running the qemu-iotests." - fi -else - # Double-check that we're not using BusyBox' sed which says - # that "This is not GNU sed version 4.0" ... - if sed --version | grep -q 'not GNU sed' ; then - skip "BusyBox sed not supported ==> Not running the qemu-iotests." - fi -fi - cd tests/qemu-iotests # QEMU_CHECK_BLOCK_AUTO is used to disable some unstable sub-tests diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc index 9885030b43..9ea504810c 100644 --- a/tests/qemu-iotests/common.rc +++ b/tests/qemu-iotests/common.rc @@ -17,17 +17,27 @@ # along with this program. If not, see . # +# bail out, setting up .notrun file +_notrun() +{ + echo "$*" >"$OUTPUT_DIR/$seq.notrun" + echo "$seq not run: $*" + status=0 + exit +} + +# We need GNU sed for the iotests. Make sure to not use BusyBox sed +# which says that "This is not GNU sed version 4.0" SED= for sed in sed gsed; do - ($sed --version | grep 'GNU sed') > /dev/null 2>&1 + ($sed --version | grep -v "not GNU sed" | grep 'GNU sed') > /dev/null 2>&1 if [ "$?" -eq 0 ]; then SED=$sed break fi done if [ -z "$SED" ]; then - echo "$0: GNU sed not found" - exit 1 + _notrun "GNU sed not found" fi dd() @@ -722,16 +732,6 @@ _img_info() done } -# bail out, setting up .notrun file -# -_notrun() -{ - echo "$*" >"$OUTPUT_DIR/$seq.notrun" - echo "$seq not run: $*" - status=0 - exit -} - # bail out, setting up .casenotrun file # The function _casenotrun() is used as a notifier. It is the # caller's responsibility to make skipped a particular test. From patchwork Tue Feb 8 10:13:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 12738418 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7AB02C433F5 for ; Tue, 8 Feb 2022 10:17:14 +0000 (UTC) Received: from localhost ([::1]:35090 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nHNYf-0002AD-I6 for qemu-devel@archiver.kernel.org; Tue, 08 Feb 2022 05:17:13 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39276) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHNV0-0006Z0-1O for qemu-devel@nongnu.org; Tue, 08 Feb 2022 05:13:27 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:55633) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHNUy-0003Vd-1q for qemu-devel@nongnu.org; Tue, 08 Feb 2022 05:13:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644315203; 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=7ECeRVpveuPMX4p72u5tRSTxGkzUVUk35XAc2P2iljA=; b=N/83bT+uwFxdUL5GrOytuW4gzvpCbmJUY4fXSZt6Dmaio1OB7369mdld3uzaJcpUxsIcn4 ZhBGLRGgYup3ulvwU/A02by6LWbYk8nuxYkK0mL6C6cX32Y4nG0o2qJutwAv6lGyUmDHhK 7MGPxX112TfG1AvSybuOaNjAfVPq5gg= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-505-5VNm4nGBM_qIvosl1mEPRA-1; Tue, 08 Feb 2022 05:13:20 -0500 X-MC-Unique: 5VNm4nGBM_qIvosl1mEPRA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 73CA11091DA1; Tue, 8 Feb 2022 10:13:19 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.143]) by smtp.corp.redhat.com (Postfix) with ESMTP id C8BCA2856D; Tue, 8 Feb 2022 10:13:17 +0000 (UTC) From: Thomas Huth To: qemu-block@nongnu.org, Hanna Reitz , Kevin Wolf Subject: [PATCH 2/6] tests/qemu-iotests/meson.build: Improve the indentation Date: Tue, 8 Feb 2022 11:13:07 +0100 Message-Id: <20220208101311.1511083-3-thuth@redhat.com> In-Reply-To: <20220208101311.1511083-1-thuth@redhat.com> References: <20220208101311.1511083-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=thuth@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_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: , Cc: Paolo Bonzini , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" By using subdir_done(), we can get rid of one level of indentation in this file. This will make it easier to add more conditions to skip the iotests in future patches. Signed-off-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Hanna Reitz --- tests/qemu-iotests/meson.build | 61 ++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 29 deletions(-) diff --git a/tests/qemu-iotests/meson.build b/tests/qemu-iotests/meson.build index 5be3c74127..e1832c90e0 100644 --- a/tests/qemu-iotests/meson.build +++ b/tests/qemu-iotests/meson.build @@ -1,30 +1,33 @@ -if have_tools and targetos != 'windows' - qemu_iotests_binaries = [qemu_img, qemu_io, qemu_nbd, qsd] - qemu_iotests_env = {'PYTHON': python.full_path()} - qemu_iotests_formats = { - 'qcow2': 'quick', - 'raw': 'slow', - 'qed': 'thorough', - 'vmdk': 'thorough', - 'vpc': 'thorough' - } - - foreach k, v : emulators - if k.startswith('qemu-system-') - qemu_iotests_binaries += v - endif - endforeach - foreach format, speed: qemu_iotests_formats - if speed == 'quick' - suites = 'block' - else - suites = ['block-' + speed, speed] - endif - test('qemu-iotests ' + format, sh, args: [files('../check-block.sh'), format], - depends: qemu_iotests_binaries, env: qemu_iotests_env, - protocol: 'tap', - suite: suites, - timeout: 0, - is_parallel: false) - endforeach +if not have_tools or targetos == 'windows' + subdir_done() endif + +qemu_iotests_binaries = [qemu_img, qemu_io, qemu_nbd, qsd] +qemu_iotests_env = {'PYTHON': python.full_path()} +qemu_iotests_formats = { + 'qcow2': 'quick', + 'raw': 'slow', + 'qed': 'thorough', + 'vmdk': 'thorough', + 'vpc': 'thorough' +} + +foreach k, v : emulators + if k.startswith('qemu-system-') + qemu_iotests_binaries += v + endif +endforeach + +foreach format, speed: qemu_iotests_formats + if speed == 'quick' + suites = 'block' + else + suites = ['block-' + speed, speed] + endif + test('qemu-iotests ' + format, sh, args: [files('../check-block.sh'), format], + depends: qemu_iotests_binaries, env: qemu_iotests_env, + protocol: 'tap', + suite: suites, + timeout: 0, + is_parallel: false) +endforeach From patchwork Tue Feb 8 10:13:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 12738419 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6ACC4C433EF for ; Tue, 8 Feb 2022 10:21:44 +0000 (UTC) Received: from localhost ([::1]:43882 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nHNd1-0008M1-4C for qemu-devel@archiver.kernel.org; Tue, 08 Feb 2022 05:21:43 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39324) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHNV2-0006Zv-90 for qemu-devel@nongnu.org; Tue, 08 Feb 2022 05:13:30 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:46026) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHNV0-0003WV-2A for qemu-devel@nongnu.org; Tue, 08 Feb 2022 05:13:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644315205; 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=yJ7ga4OVxPAFbEoiqCPWMcvTKn1SeVT+NFgRh/tiCf4=; b=IT4gEH50R2Yj6nLSOrknASs2T8LFOxZXLgl27MiMU9xw5QRB0NUc3DU0hcPVs0z1geg524 ccU0RalfCMfPK1KcVGF1WFtUKtEjShxZmybJ5QWQCDvI8MUdA4lkmCh0iSo6XIKJ9Uv+YK VpETO7P1/Ifee/KhZhebSezYS44PEzc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-607-sxYn3gV2OrS8C-TjKviiiQ-1; Tue, 08 Feb 2022 05:13:22 -0500 X-MC-Unique: sxYn3gV2OrS8C-TjKviiiQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 89AF0835B74; Tue, 8 Feb 2022 10:13:21 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.143]) by smtp.corp.redhat.com (Postfix) with ESMTP id D4E1E2A182; Tue, 8 Feb 2022 10:13:19 +0000 (UTC) From: Thomas Huth To: qemu-block@nongnu.org, Hanna Reitz , Kevin Wolf Subject: [PATCH 3/6] tests/qemu-iotests: Allow to run "./check -n" from the source directory, too Date: Tue, 8 Feb 2022 11:13:08 +0100 Message-Id: <20220208101311.1511083-4-thuth@redhat.com> In-Reply-To: <20220208101311.1511083-1-thuth@redhat.com> References: <20220208101311.1511083-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=thuth@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_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: , Cc: Paolo Bonzini , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" For better integration of the iotests into the meson build system, it would be very helpful to get the list of the tests in the "auto" group during the "configure" step already. However, "check -n -g auto" currently only works if the binaries have already been built. Re-order the code in the "check" a little bit so that we can use the -n option without building the binaries first. Signed-off-by: Thomas Huth --- tests/qemu-iotests/check | 52 ++++++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check index 75de1b4691..0fa75abf13 100755 --- a/tests/qemu-iotests/check +++ b/tests/qemu-iotests/check @@ -120,6 +120,30 @@ def make_argparser() -> argparse.ArgumentParser: if __name__ == '__main__': args = make_argparser().parse_args() + if os.path.islink(sys.argv[0]): + # called from the build tree + source_iotests = os.path.dirname(os.readlink(sys.argv[0])) + else: + source_iotests = os.getcwd() + + testfinder = TestFinder(source_iotests) + + groups = args.groups.split(',') if args.groups else None + x_groups = args.exclude_groups.split(',') if args.exclude_groups else None + + try: + tests = testfinder.find_tests(groups=groups, exclude_groups=x_groups, + tests=args.tests, + start_from=args.start_from) + if not tests: + raise ValueError('No tests selected') + except ValueError as e: + sys.exit(e) + + if args.dry_run: + print('\n'.join(tests)) + sys.exit(0) + env = TestEnv(imgfmt=args.imgfmt, imgproto=args.imgproto, aiomode=args.aiomode, cachemode=args.cachemode, imgopts=args.imgopts, misalign=args.misalign, @@ -140,11 +164,6 @@ if __name__ == '__main__': os.chdir(exec_path.parent) os.execve(cmd[0], cmd, full_env) - testfinder = TestFinder(test_dir=env.source_iotests) - - groups = args.groups.split(',') if args.groups else None - x_groups = args.exclude_groups.split(',') if args.exclude_groups else None - group_local = os.path.join(env.source_iotests, 'group.local') if os.path.isfile(group_local): try: @@ -152,21 +171,8 @@ if __name__ == '__main__': except ValueError as e: sys.exit(f"Failed to parse group file '{group_local}': {e}") - try: - tests = testfinder.find_tests(groups=groups, exclude_groups=x_groups, - tests=args.tests, - start_from=args.start_from) - if not tests: - raise ValueError('No tests selected') - except ValueError as e: - sys.exit(e) - - if args.dry_run: - print('\n'.join(tests)) - else: - with TestRunner(env, tap=args.tap, - color=args.color) as tr: - paths = [os.path.join(env.source_iotests, t) for t in tests] - ok = tr.run_tests(paths, args.jobs) - if not ok: - sys.exit(1) + with TestRunner(env, tap=args.tap, color=args.color) as tr: + paths = [os.path.join(env.source_iotests, t) for t in tests] + ok = tr.run_tests(paths, args.jobs) + if not ok: + sys.exit(1) From patchwork Tue Feb 8 10:13:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 12738480 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A23A1C433EF for ; Tue, 8 Feb 2022 10:54:14 +0000 (UTC) Received: from localhost ([::1]:43110 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nHO8S-0005XJ-N1 for qemu-devel@archiver.kernel.org; Tue, 08 Feb 2022 05:54:13 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39372) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHNV9-0006hI-Na for qemu-devel@nongnu.org; Tue, 08 Feb 2022 05:13:38 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:38521) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHNV5-0003Xk-KV for qemu-devel@nongnu.org; Tue, 08 Feb 2022 05:13:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644315211; 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=hMEOBliNuNFDoW3KcZY4JZ0xnzZRaUSYHXf9076Q59c=; b=ZpTfVGFM7I3ttNbVKbOaIsq/rVoRj4jtYNqydQmcpZ5HfBZjb25TYNRqSC6bs/WXAV4LVP lbus1dCXvTlhnpQaN7ZajPSYm5V3YVCHOeZJfQJUXo7qFKV0YjmnpqfPq8ceT4wgMhQ+qW Jfojvokkx73Xqe1Rbx4tgwZDJLycphE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-297-PeOYOCX0MjOKrMwWzXFsDA-1; Tue, 08 Feb 2022 05:13:25 -0500 X-MC-Unique: PeOYOCX0MjOKrMwWzXFsDA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A690E46887; Tue, 8 Feb 2022 10:13:23 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.143]) by smtp.corp.redhat.com (Postfix) with ESMTP id 02C882856D; Tue, 8 Feb 2022 10:13:21 +0000 (UTC) From: Thomas Huth To: qemu-block@nongnu.org, Hanna Reitz , Kevin Wolf Subject: [PATCH 4/6] tests/qemu-iotests/meson.build: Call the 'check' script directly Date: Tue, 8 Feb 2022 11:13:09 +0100 Message-Id: <20220208101311.1511083-5-thuth@redhat.com> In-Reply-To: <20220208101311.1511083-1-thuth@redhat.com> References: <20220208101311.1511083-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=thuth@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_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: , Cc: Paolo Bonzini , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" We can get a nicer progress indication if we add the iotests individually via the 'check' script instead of going through the check-block.sh wrapper. For this, we have to add some of the sanity checks that have originally been done in the tests/check-block.sh script (whether "bash" is available or whether CFLAGS contain -fsanitize switches) to the meson.build file now, and add the environment variables that have been set up by the tests/check-block.sh script before. Signed-off-by: Thomas Huth --- tests/qemu-iotests/meson.build | 45 ++++++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 8 deletions(-) diff --git a/tests/qemu-iotests/meson.build b/tests/qemu-iotests/meson.build index e1832c90e0..5a6ccd35d8 100644 --- a/tests/qemu-iotests/meson.build +++ b/tests/qemu-iotests/meson.build @@ -1,9 +1,29 @@ -if not have_tools or targetos == 'windows' +if not have_tools or targetos == 'windows' or \ + config_host.has_key('CONFIG_GPROF') subdir_done() endif +bash = find_program('bash', required: false) +if not bash.found() or \ + run_command(bash, ['--version']).stdout().contains('GNU bash, version 3') + message('bash >= v4.0 not available ==> Disabled the qemu-iotests.') + subdir_done() +endif + +foreach cflag: config_host['QEMU_CFLAGS'].split() + if cflag.startswith('-fsanitize') and \ + not cflag.contains('safe-stack') and not cflag.contains('cfi-icall') + message('Sanitizers are enabled ==> Disabled the qemu-iotests.') + subdir_done() + endif +endforeach + qemu_iotests_binaries = [qemu_img, qemu_io, qemu_nbd, qsd] -qemu_iotests_env = {'PYTHON': python.full_path()} +qemu_iotests_env = { + 'PYTHON': python.full_path(), + 'PYTHONUTF8': '1', + 'QEMU_CHECK_BLOCK_AUTO': '1' +} qemu_iotests_formats = { 'qcow2': 'quick', 'raw': 'slow', @@ -18,16 +38,25 @@ foreach k, v : emulators endif endforeach +check_script = find_program(meson.current_build_dir() / 'check') +iotests = run_command(python, [check_script.full_path(), '-g', 'auto', '-n'], + check: true).stdout().strip().replace('tests/', '').split('\n') + foreach format, speed: qemu_iotests_formats if speed == 'quick' suites = 'block' else suites = ['block-' + speed, speed] endif - test('qemu-iotests ' + format, sh, args: [files('../check-block.sh'), format], - depends: qemu_iotests_binaries, env: qemu_iotests_env, - protocol: 'tap', - suite: suites, - timeout: 0, - is_parallel: false) + foreach tst: iotests + test('iotest-' + format + '-' + tst, + python, args: [check_script.full_path(), '-tap', '-' + format, tst], + depends: qemu_iotests_binaries, + env: qemu_iotests_env + \ + { 'TEST_DIR': + meson.current_build_dir() / 'scratch' / format + '-' + tst }, + protocol: 'tap', + suite: suites, + timeout: 0) + endforeach endforeach From patchwork Tue Feb 8 10:13:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 12738417 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C7D2EC433EF for ; Tue, 8 Feb 2022 10:17:05 +0000 (UTC) Received: from localhost ([::1]:34358 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nHNYW-0001f6-Ox for qemu-devel@archiver.kernel.org; Tue, 08 Feb 2022 05:17:04 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39342) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHNV5-0006es-Hk for qemu-devel@nongnu.org; Tue, 08 Feb 2022 05:13:31 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:36702) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHNV3-0003XY-UP for qemu-devel@nongnu.org; Tue, 08 Feb 2022 05:13:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644315209; 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=BuC7ZFTQmNcpyNWYLnXkfBYwzsG2a+jVBV25Sxw7JfU=; b=JTQRFDloL1KelOKmdwxdxs6x8xIySmF3vyhWPxV/tLwzSShZ6dmRusEJ6s3SB31wFTal5i D4Zaz/UhGrhm8ZUf4sjIGwdCOvKSdvHg9+0UTVtwN1PKnjgBxWJBPQ5ntiBSOeBs6lQ04I /aFMrDCc2NiQRSAj+a+dSwKcPtZpj1A= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-549-LblKzggoMM64MsEZFCTdzw-1; Tue, 08 Feb 2022 05:13:28 -0500 X-MC-Unique: LblKzggoMM64MsEZFCTdzw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A8E82101F00E; Tue, 8 Feb 2022 10:13:26 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.143]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0F3602856D; Tue, 8 Feb 2022 10:13:23 +0000 (UTC) From: Thomas Huth To: qemu-block@nongnu.org, Hanna Reitz , Kevin Wolf Subject: [PATCH 5/6] tests: Do not treat the iotests as separate meson test target anymore Date: Tue, 8 Feb 2022 11:13:10 +0100 Message-Id: <20220208101311.1511083-6-thuth@redhat.com> In-Reply-To: <20220208101311.1511083-1-thuth@redhat.com> References: <20220208101311.1511083-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=thuth@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_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: , Cc: Paolo Bonzini , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Now that we add the single iotests directly in meson.build, we do not have to separate the block suite from the other suites anymore. Signed-off-by: Thomas Huth --- meson.build | 6 +++--- scripts/mtest2make.py | 4 ---- tests/Makefile.include | 9 +-------- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/meson.build b/meson.build index 5f43355071..b203402ee1 100644 --- a/meson.build +++ b/meson.build @@ -3,9 +3,9 @@ project('qemu', ['c'], meson_version: '>=0.58.2', 'b_staticpic=false', 'stdsplit=false'], version: files('VERSION')) -add_test_setup('quick', exclude_suites: ['block', 'slow', 'thorough'], is_default: true) -add_test_setup('slow', exclude_suites: ['block', 'thorough'], env: ['G_TEST_SLOW=1', 'SPEED=slow']) -add_test_setup('thorough', exclude_suites: ['block'], env: ['G_TEST_SLOW=1', 'SPEED=thorough']) +add_test_setup('quick', exclude_suites: ['slow', 'thorough'], is_default: true) +add_test_setup('slow', exclude_suites: ['thorough'], env: ['G_TEST_SLOW=1', 'SPEED=slow']) +add_test_setup('thorough', env: ['G_TEST_SLOW=1', 'SPEED=thorough']) not_found = dependency('', required: false) keyval = import('keyval') diff --git a/scripts/mtest2make.py b/scripts/mtest2make.py index 4d542e8aaa..304634b71e 100644 --- a/scripts/mtest2make.py +++ b/scripts/mtest2make.py @@ -101,10 +101,6 @@ def emit_suite(name, suite, prefix): testsuites = defaultdict(Suite) for test in introspect['tests']: process_tests(test, targets, testsuites) -# HACK: check-block is a separate target so that it runs with --verbose; -# only write the dependencies -emit_suite_deps('block', testsuites['block'], 'check') -del testsuites['block'] emit_prolog(testsuites, 'check') for name, suite in testsuites.items(): emit_suite(name, suite, 'check') diff --git a/tests/Makefile.include b/tests/Makefile.include index 9157a57b1a..f93ae5b479 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -151,16 +151,9 @@ check-acceptance: check-acceptance-deprecated-warning | check-avocado # Consolidated targets -.PHONY: check-block check check-clean get-vm-images +.PHONY: check check-clean get-vm-images check: -ifeq ($(CONFIG_TOOLS)$(CONFIG_POSIX),yy) -check: check-block -check-block: run-ninja - $(if $(MAKE.n),,+)$(MESON) test $(MTESTARGS) $(.mtestargs) --verbose \ - --logbase iotestslog $(call .speed.$(SPEED), block block-slow block-thorough) -endif - check-build: run-ninja check-clean: From patchwork Tue Feb 8 10:13:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 12738463 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 552E1C433EF for ; Tue, 8 Feb 2022 10:51:26 +0000 (UTC) Received: from localhost ([::1]:39110 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nHO5l-0002hu-42 for qemu-devel@archiver.kernel.org; Tue, 08 Feb 2022 05:51:25 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39396) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHNVB-0006hN-57 for qemu-devel@nongnu.org; Tue, 08 Feb 2022 05:13:38 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:35237) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHNV9-0003Y4-Er for qemu-devel@nongnu.org; Tue, 08 Feb 2022 05:13:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644315212; 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=JaHUvzjFbj1WpZOCy8SCdLGzCdMLYST/KTk2UyzmokA=; b=W/HdC+Qld54k2ACxKOVinX8qOBwqBFpdp2HtsbwR3GN+YIaCxjjWDzPNi626VBOAQg1dOR zwfAvr9mKQoNcypCyKnO2hf1xjmmgyN/2tWFQAb5nKCsfL2hlQx67+wJHPFQGlvb7h+Hd+ DiOkcn4PKiQztyeE8Wugwj6b9cMwtKo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-531--v8wMULdMEqPnNNKk97WAw-1; Tue, 08 Feb 2022 05:13:29 -0500 X-MC-Unique: -v8wMULdMEqPnNNKk97WAw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A55216127C; Tue, 8 Feb 2022 10:13:28 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.143]) by smtp.corp.redhat.com (Postfix) with ESMTP id 123D82856D; Tue, 8 Feb 2022 10:13:26 +0000 (UTC) From: Thomas Huth To: qemu-block@nongnu.org, Hanna Reitz , Kevin Wolf Subject: [PATCH 6/6] tests: Remove check-block.sh Date: Tue, 8 Feb 2022 11:13:11 +0100 Message-Id: <20220208101311.1511083-7-thuth@redhat.com> In-Reply-To: <20220208101311.1511083-1-thuth@redhat.com> References: <20220208101311.1511083-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=thuth@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_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: , Cc: Paolo Bonzini , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Now that the iotests are added by the meson.build file already, we do not need the check-block.sh wrapper script anymore. Signed-off-by: Thomas Huth --- tests/check-block.sh | 73 -------------------------------------------- 1 file changed, 73 deletions(-) delete mode 100755 tests/check-block.sh diff --git a/tests/check-block.sh b/tests/check-block.sh deleted file mode 100755 index af0c574812..0000000000 --- a/tests/check-block.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/sh - -if [ "$#" -eq 0 ]; then - echo "Usage: $0 fmt..." >&2 - exit 99 -fi - -# Honor the SPEED environment variable, just like we do it for "meson test" -format_list="$@" -if [ "$SPEED" = "slow" ] || [ "$SPEED" = "thorough" ]; then - group= -else - group="-g auto" -fi - -skip() { - echo "1..0 #SKIP $*" - exit 0 -} - -if grep -q "CONFIG_GPROF=y" config-host.mak 2>/dev/null ; then - skip "GPROF is enabled ==> Not running the qemu-iotests." -fi - -# Disable tests with any sanitizer except for specific ones -SANITIZE_FLAGS=$( grep "CFLAGS.*-fsanitize" config-host.mak 2>/dev/null ) -ALLOWED_SANITIZE_FLAGS="safe-stack cfi-icall" -#Remove all occurrencies of allowed Sanitize flags -for j in ${ALLOWED_SANITIZE_FLAGS}; do - TMP_FLAGS=${SANITIZE_FLAGS} - SANITIZE_FLAGS="" - for i in ${TMP_FLAGS}; do - if ! echo ${i} | grep -q "${j}" 2>/dev/null; then - SANITIZE_FLAGS="${SANITIZE_FLAGS} ${i}" - fi - done -done -if echo ${SANITIZE_FLAGS} | grep -q "\-fsanitize" 2>/dev/null; then - # Have a sanitize flag that is not allowed, stop - skip "Sanitizers are enabled ==> Not running the qemu-iotests." -fi - -if [ -z "$(find . -name 'qemu-system-*' -print)" ]; then - skip "No qemu-system binary available ==> Not running the qemu-iotests." -fi - -if ! command -v bash >/dev/null 2>&1 ; then - skip "bash not available ==> Not running the qemu-iotests." -fi - -if LANG=C bash --version | grep -q 'GNU bash, version [123]' ; then - skip "bash version too old ==> Not running the qemu-iotests." -fi - -cd tests/qemu-iotests - -# QEMU_CHECK_BLOCK_AUTO is used to disable some unstable sub-tests -export QEMU_CHECK_BLOCK_AUTO=1 -export PYTHONUTF8=1 -# If make was called with -jN we want to call ./check with -j N. Extract the -# flag from MAKEFLAGS, so that if it absent (or MAKEFLAGS is not defined), JOBS -# would be an empty line otherwise JOBS is prepared string of flag with value: -# "-j N" -# Note, that the following works even if make was called with "-j N" or even -# "--jobs N", as all these variants becomes simply "-jN" in MAKEFLAGS variable. -JOBS=$(echo "$MAKEFLAGS" | sed -n 's/\(^\|.* \)-j\([0-9]\+\)\( .*\|$\)/-j \2/p') - -ret=0 -for fmt in $format_list ; do - ${PYTHON} ./check $JOBS -tap -$fmt $group || ret=1 -done - -exit $ret