[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 2/8] tests/qemu-iotests: Improve the check for GNU sed
From: |
Kevin Wolf |
Subject: |
Re: [PATCH v2 2/8] tests/qemu-iotests: Improve the check for GNU sed |
Date: |
Fri, 11 Feb 2022 09:57:48 +0100 |
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
- [PATCH v2 0/8] Improve integration of iotests in the meson test harness, Thomas Huth, 2022/02/09
- [PATCH v2 2/8] tests/qemu-iotests: Improve the check for GNU sed, Thomas Huth, 2022/02/09
- Re: [PATCH v2 2/8] tests/qemu-iotests: Improve the check for GNU sed,
Kevin Wolf <=
- [PATCH v2 3/8] tests/qemu-iotests/meson.build: Improve the indentation, Thomas Huth, 2022/02/09
- [PATCH v2 6/8] tests: Do not treat the iotests as separate meson test target anymore, Thomas Huth, 2022/02/09
- [PATCH v2 8/8] tests: Remove check-block.sh, Thomas Huth, 2022/02/09
- [PATCH v2 1/8] tests/qemu-iotests/testrunner: Allow parallel test invocations, Thomas Huth, 2022/02/09
- Re: [PATCH v2 1/8] tests/qemu-iotests/testrunner: Allow parallel test invocations, Kevin Wolf, 2022/02/11
- Re: [PATCH v2 1/8] tests/qemu-iotests/testrunner: Allow parallel test invocations, Vladimir Sementsov-Ogievskiy, 2022/02/11
- Re: [PATCH v2 1/8] tests/qemu-iotests/testrunner: Allow parallel test invocations, Thomas Huth, 2022/02/11
- Re: [PATCH v2 1/8] tests/qemu-iotests/testrunner: Allow parallel test invocations, Kevin Wolf, 2022/02/11
- Re: [PATCH v2 1/8] tests/qemu-iotests/testrunner: Allow parallel test invocations, Hanna Reitz, 2022/02/11
- Re: [PATCH v2 1/8] tests/qemu-iotests/testrunner: Allow parallel test invocations, Kevin Wolf, 2022/02/11