[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH v2 10/18] qemu-iotests: Ensure GNU sed is us
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [RFC PATCH v2 10/18] qemu-iotests: Ensure GNU sed is used |
Date: |
Tue, 29 Jan 2019 16:21:44 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 |
On 1/29/19 11:53 AM, Philippe Mathieu-Daudé wrote:
> Various sed regexp from common.filter use sed GNU extensions.
> Instead of spending time to write these regex to be POSIX compliant,
> verify the GNU sed is available and use it.
>
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
> ---
> I think the test isn't well placed in common.filter and should be in
> common.rc, but couldn't get that working.
> ---
> +++ b/tests/qemu-iotests/common.filter
> @@ -23,37 +23,37 @@
> #
> _filter_date()
> {
> - sed \
> + ${SED} \
I might have written $SED instead of ${SED}, but that's merely
aesthetics and not a correctness issue.
> +++ b/tests/qemu-iotests/common.rc
> @@ -17,6 +17,18 @@
> # along with this program. If not, see <http://www.gnu.org/licenses/>.
> #
>
If SED is inherited in the environment prior to this point,...
> +for sed in sed gsed; do
> + (command $sed --version | grep 'GNU sed') > /dev/null 2>&1
Why do you need command here? (It doesn't hurt, but I also don't see how
it helps).
> + if [ "$?" -eq 0 ]; then
> + SED=$sed
> + break
> + fi
> +done
...but neither sed nor gsed are GNU sed,
> +if [ -z "$SED" ]; then
> + echo "$0: GNU sed not found"
> + exit 1
> +fi
...then you fail to diagnose that. Fix it by adding SED= prior to the loop.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-devel] [PATCH v2 05/18] qemu-iotests: Add dependency to qemu-nbd tool, (continued)
- [Qemu-devel] [PATCH v2 07/18] tests/multiboot: Improve portability by searching bash in the $PATH, Philippe Mathieu-Daudé, 2019/01/29
- [Qemu-devel] [PATCH v2 06/18] qemu-iotests: Improve portability by searching bash in the $PATH, Philippe Mathieu-Daudé, 2019/01/29
- [Qemu-devel] [PATCH v2 08/18] tests/bios-tables: Improve portability by searching bash in the $PATH, Philippe Mathieu-Daudé, 2019/01/29
- [Qemu-devel] [PATCH v2 09/18] tests/vm/openbsd: Install Bash from the ports, Philippe Mathieu-Daudé, 2019/01/29
- [Qemu-devel] [RFC PATCH v2 10/18] qemu-iotests: Ensure GNU sed is used, Philippe Mathieu-Daudé, 2019/01/29
- Re: [Qemu-devel] [RFC PATCH v2 10/18] qemu-iotests: Ensure GNU sed is used,
Eric Blake <=
- [Qemu-devel] [PATCH v2 11/18] tests/vm/openbsd: Install GNU sed from the ports, Philippe Mathieu-Daudé, 2019/01/29
- [Qemu-devel] [RFC PATCH v2 12/18] test-iov: Disable iov/io test on OpenBSD, Philippe Mathieu-Daudé, 2019/01/29
- [Qemu-devel] [RFC PATCH v2 13/18] oslib-posix: Ignore fcntl("/dev/null", F_SETFL, O_NONBLOCK) failure, Philippe Mathieu-Daudé, 2019/01/29
- [Qemu-devel] [PATCH v2 14/18] tests/vm: Run tests on OpenBSD, Philippe Mathieu-Daudé, 2019/01/29
- [Qemu-devel] [RFC PATCH v2 15/18] iotests: Let verify_platform() check for unsupported platforms, Philippe Mathieu-Daudé, 2019/01/29
- [Qemu-devel] [RFC PATCH v2 16/18] iotests: Disable 208 on OpenBSD, Philippe Mathieu-Daudé, 2019/01/29
- [Qemu-devel] [RFC PATCH v2 17/18] iotests: Disable 209 on OpenBSD, Philippe Mathieu-Daudé, 2019/01/29
- [Qemu-devel] [RFC PATCH v2 18/18] iotests: Disable 236 and 238 on OpenBSD, Philippe Mathieu-Daudé, 2019/01/29