qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Thomas Huth <thuth@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Hanna Reitz <hreitz@redhat.com>,
	qemu-devel@nongnu.org, qemu-block@nongnu.org,
	Peter Maydell <peter.maydell@linaro.org>
Subject: Re: [PATCH v2 2/8] tests/qemu-iotests: Improve the check for GNU sed
Date: Fri, 11 Feb 2022 09:57:48 +0100	[thread overview]
Message-ID: <YgYlDBG6UGUuGc95@redhat.com> (raw)
In-Reply-To: <20220209101530.3442837-3-thuth@redhat.com>

Am 09.02.2022 um 11:15 hat Thomas Huth geschrieben:
> 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 <thuth@redhat.com>

I agree that skipping bash tests is slightly better than skipping all
tests. And that the skipping should really be done in qemu-iotests
itself and not in a wrapper around it.

But can't we make it even better and skip only bash tests that actually
use sed?

> +# 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

Couldn't we just define 'sed' as a function or alias here that skips the
test with _notrun only when it's actually called?

Kevin



  reply	other threads:[~2022-02-11  8:59 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-09 10:15 [PATCH v2 0/8] Improve integration of iotests in the meson test harness Thomas Huth
2022-02-09 10:15 ` [PATCH v2 1/8] tests/qemu-iotests/testrunner: Allow parallel test invocations Thomas Huth
2022-02-11  9:29   ` Kevin Wolf
2022-02-11  9:38     ` Vladimir Sementsov-Ogievskiy
2022-02-11 13:53     ` Thomas Huth
2022-02-11 16:00       ` Kevin Wolf
2022-02-11 16:14         ` Hanna Reitz
2022-02-11 17:32           ` Kevin Wolf
2022-02-09 10:15 ` [PATCH v2 2/8] tests/qemu-iotests: Improve the check for GNU sed Thomas Huth
2022-02-11  8:57   ` Kevin Wolf [this message]
2022-02-09 10:15 ` [PATCH v2 3/8] tests/qemu-iotests/meson.build: Improve the indentation Thomas Huth
2022-02-09 10:15 ` [PATCH v2 4/8] tests/qemu-iotests: Allow to run "./check -n" from the source directory, too Thomas Huth
2022-02-09 10:15 ` [PATCH v2 5/8] tests/qemu-iotests/meson.build: Call the 'check' script directly Thomas Huth
2022-02-09 10:15 ` [PATCH v2 6/8] tests: Do not treat the iotests as separate meson test target anymore Thomas Huth
2022-02-09 10:15 ` [PATCH v2 7/8] tests/qemu-iotests/testrunner: Print diff to stderr in TAP mode Thomas Huth
2022-02-15  8:36   ` Paolo Bonzini
2022-02-09 10:15 ` [PATCH v2 8/8] tests: Remove check-block.sh Thomas Huth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YgYlDBG6UGUuGc95@redhat.com \
    --to=kwolf@redhat.com \
    --cc=hreitz@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).