All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Roman Bogorodskiy <bogorodskiy@gmail.com>
Cc: qemu-devel@nongnu.org, Kevin Wolf <kwolf@redhat.com>,
	Hanna Reitz <hreitz@redhat.com>,
	"open list:Block layer core" <qemu-block@nongnu.org>
Subject: Re: [PATCH v2 01/10] iotests: use gsed when necessary
Date: Thu, 26 Nov 2026 09:31:22 +0000	[thread overview]
Message-ID: <awf8atJJ3A_8caLc@redhat.com> (raw)
In-Reply-To: <20261125191701.93931-2-bogorodskiy@gmail.com>

On Wed, Nov 25, 2026 at 08:16:51PM +0100, Roman Bogorodskiy wrote:
> Some iotests fail on FreeBSD because the tests call sed
> directly, and BSD sed is not always compatible with GNU sed.
> As common.rc already provides the gsed() wrapper, use it
> instead if needed.
> 
> Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
> ---
>  tests/qemu-iotests/115           | 2 +-
>  tests/qemu-iotests/common.filter | 6 +++---
>  2 files changed, 4 insertions(+), 4 deletions(-)


We use plain 'sed' across countless test files, and only call
'gsed' in one test file and common.filter. It feels like a
loosing battle to keep fixing things to use gsed when they
hit an incompatibility.

How about we rename the 'gsed()' wrapper function to simply
'sed()', and thus make GNU sed a mandatory dependency for
all tests.


> 
> diff --git a/tests/qemu-iotests/115 b/tests/qemu-iotests/115
> index 5c8a12f85a..e3ff91de7a 100755
> --- a/tests/qemu-iotests/115
> +++ b/tests/qemu-iotests/115
> @@ -78,7 +78,7 @@ _make_test_img -o "refcount_bits=64,cluster_size=512,preallocation=metadata" 256
>  # qemu-img check for that purpose, too.
>  
>  $QEMU_IMG check "$TEST_IMG" | \
> -    sed -e 's/^.* = \([0-9]\+\.[0-9]\+% allocated\).*\(clusters\)$/\1 \2/' \
> +    gsed -e 's/^.* = \([0-9]\+\.[0-9]\+% allocated\).*\(clusters\)$/\1 \2/' \
>          -e '/^Image end offset/d'
>  
>  # (Note that we cannot use _check_test_img because that function filters out the
> diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.filter
> index ce4213cb97..f7211a0a29 100644
> --- a/tests/qemu-iotests/common.filter
> +++ b/tests/qemu-iotests/common.filter
> @@ -130,7 +130,7 @@ _filter_actual_image_size()
>  # Filename filters for qemu-img create
>  _filter_img_create_filenames()
>  {
> -    sed \
> +    gsed \
>          -e "s#$REMOTE_TEST_DIR#TEST_DIR#g" \
>          -e "s#$IMGPROTO:$TEST_DIR#TEST_DIR#g" \
>          -e "s#$TEST_DIR#TEST_DIR#g" \
> @@ -296,7 +296,7 @@ _filter_qemu_img_map()
>          data_file_filter=(-e "s#$data_file_pattern#\\1#")
>      fi
>  
> -    sed -e 's/\([0-9a-fx]* *[0-9a-fx]* *\)[0-9a-fx]* */\1/g' \
> +    gsed -e 's/\([0-9a-fx]* *[0-9a-fx]* *\)[0-9a-fx]* */\1/g' \
>          -e 's/"offset": [0-9]\+/"offset": OFFSET/g' \
>          -e 's/Mapped to *//' \
>          "${data_file_filter[@]}" \
> @@ -310,7 +310,7 @@ _filter_nbd()
>      # receive callbacks sometimes, making them unreliable.
>      #
>      # Filter out the TCP port number since this changes between runs.
> -    sed -e '/nbd\/.*\.c:/d' \
> +    gsed -e '/nbd\/.*\.c:/d' \
>          -e 's#127\.0\.0\.1:[0-9]*#127.0.0.1:PORT#g' \
>          -e 's#localhost:[0-9]*#localhost:PORT#g' \
>          -e 's#host=127\.0\.0\.1,port=[0-9]*#host=127.0.0.1,port=PORT#g' \
> -- 
> 2.56.0
> 
> 

With regards,
Daniel
-- 
|: https://berrange.com       ~~        https://hachyderm.io/@berrange :|
|: https://libvirt.org          ~~          https://entangle-photo.org :|
|: https://pixelfed.art/berrange   ~~    https://fstop138.berrange.com :|



  reply	other threads:[~2026-11-26  9:31 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25 19:16 [PATCH v2 00/10] fix tests on FreeBSD Roman Bogorodskiy
2026-11-25 19:16 ` [PATCH v2 01/10] iotests: use gsed when necessary Roman Bogorodskiy
2026-11-26  9:31   ` Daniel P. Berrangé [this message]
2026-11-26 18:28     ` Roman Bogorodskiy
2026-11-25 19:16 ` [PATCH v2 02/10] iotests: fix default QEMU_PROG on FreeBSD amd64 Roman Bogorodskiy
2026-11-26  9:09   ` Daniel P. Berrangé
2026-11-25 19:16 ` [PATCH v2 03/10] iotests: fix the dd() wrapper Roman Bogorodskiy
2026-11-26  9:10   ` Daniel P. Berrangé
2026-11-25 19:16 ` [PATCH v2 04/10] tests/qtest: unset socket timeout Roman Bogorodskiy
2026-11-26  9:12   ` Daniel P. Berrangé
2026-11-25 19:16 ` [PATCH v2 05/10] iotests: skip preallocation tests if not supported Roman Bogorodskiy
2026-11-26  9:53   ` Daniel P. Berrangé
2026-11-26 18:16     ` Roman Bogorodskiy
2026-11-26 18:21       ` Daniel P. Berrangé
2026-11-25 19:16 ` [PATCH v2 06/10] iotests: mark 149 as Linux-only Roman Bogorodskiy
2026-11-26  9:14   ` Daniel P. Berrangé
2026-11-25 19:16 ` [PATCH v2 07/10] iotests: fix test 162 Roman Bogorodskiy
2026-11-26  9:20   ` Daniel P. Berrangé
2026-11-25 19:16 ` [PATCH v2 08/10] iotests: fix possible race in 145 Roman Bogorodskiy
2026-11-26  9:21   ` Daniel P. Berrangé
2026-11-25 19:16 ` [PATCH v2 09/10] iotests: properly skip tests that require OFD locking support Roman Bogorodskiy
2026-11-26  9:23   ` Daniel P. Berrangé
2026-11-25 19:17 ` [PATCH v2 10/10] iotests: fix test 211 Roman Bogorodskiy
2026-11-26  9:27   ` Daniel P. Berrangé

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=awf8atJJ3A_8caLc@redhat.com \
    --to=berrange@redhat.com \
    --cc=bogorodskiy@gmail.com \
    --cc=hreitz@redhat.com \
    --cc=kwolf@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.