From: Thomas Huth <thuth@redhat.com>
To: Hanna Reitz <hreitz@redhat.com>,
qemu-block@nongnu.org, Kevin Wolf <kwolf@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [PATCH 1/6] tests/qemu-iotests: Improve the check for GNU sed
Date: Tue, 8 Feb 2022 13:13:15 +0100 [thread overview]
Message-ID: <dd7f32dd-807c-d389-1f19-323141178bba@redhat.com> (raw)
In-Reply-To: <8332fa43-9e77-34f3-c012-062342d62c92@redhat.com>
On 08/02/2022 12.46, Hanna Reitz wrote:
> On 08.02.22 11:13, Thomas Huth wrote:
>> 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>
>> ---
>> 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
>
> This specifically tests for `sed`, whereas...
There was a check for "gsed" one line later:
if ! command -v gsed >/dev/null 2>&1; then
... so the check-block.sh script ran the iotests also if "sed" was not GNU,
but gsed was available.
> [...]
>
>> 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 <http://www.gnu.org/licenses/>.
>> #
>> +# 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
>
> ...this will accept `gsed`, too. The problem is that many bash iotests just
> use `sed` instead of `$SED`, so I think if we let this do the gatekeeping,
> then we should change this to just check for `sed`.
I think we should be fine - at least for the tests in the "auto" group.
Otherwise we would have seen test failures on non-Linux systems like *BSD
earlier already.
Thomas
next prev parent reply other threads:[~2022-02-08 15:08 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-08 10:13 [PATCH 0/6] Improve integration of iotests in the meson test harness Thomas Huth
2022-02-08 10:13 ` [PATCH 1/6] tests/qemu-iotests: Improve the check for GNU sed Thomas Huth
2022-02-08 11:46 ` Hanna Reitz
2022-02-08 12:13 ` Thomas Huth [this message]
2022-02-08 12:28 ` Hanna Reitz
2022-02-08 12:38 ` Thomas Huth
2022-02-08 13:11 ` Philippe Mathieu-Daudé via
2022-02-08 14:52 ` Thomas Huth
2022-02-11 16:14 ` Eric Blake
2022-02-11 16:48 ` Thomas Huth
2022-02-15 13:28 ` Thomas Huth
2022-02-15 13:51 ` Daniel P. Berrangé
2022-02-15 16:09 ` Thomas Huth
2022-02-08 10:13 ` [PATCH 2/6] tests/qemu-iotests/meson.build: Improve the indentation Thomas Huth
2022-02-08 10:51 ` Philippe Mathieu-Daudé via
2022-02-08 12:00 ` Hanna Reitz
2022-02-08 10:13 ` [PATCH 3/6] tests/qemu-iotests: Allow to run "./check -n" from the source directory, too Thomas Huth
2022-02-08 12:26 ` Hanna Reitz
2022-02-08 10:13 ` [PATCH 4/6] tests/qemu-iotests/meson.build: Call the 'check' script directly Thomas Huth
2022-02-08 12:36 ` Paolo Bonzini
2022-02-08 15:10 ` Thomas Huth
2022-02-08 16:19 ` Paolo Bonzini
2022-02-08 13:12 ` Hanna Reitz
2022-02-08 15:46 ` Thomas Huth
2022-02-08 10:13 ` [PATCH 5/6] tests: Do not treat the iotests as separate meson test target anymore Thomas Huth
2022-02-08 10:26 ` Peter Maydell
2022-02-08 11:16 ` Thomas Huth
2022-02-08 11:33 ` Peter Maydell
2022-02-08 12:37 ` Paolo Bonzini
2022-02-08 10:13 ` [PATCH 6/6] 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=dd7f32dd-807c-d389-1f19-323141178bba@redhat.com \
--to=thuth@redhat.com \
--cc=hreitz@redhat.com \
--cc=kwolf@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/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).