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 07/10] iotests: fix test 162
Date: Thu, 26 Nov 2026 09:20:06 +0000 [thread overview]
Message-ID: <awf5xhHOrEn-4gOy@redhat.com> (raw)
In-Reply-To: <20261125191701.93931-8-bogorodskiy@gmail.com>
On Wed, Nov 25, 2026 at 08:16:57PM +0100, Roman Bogorodskiy wrote:
> Test 162 expects Linux error messages. These messages could
> be different on other OSes, on FreeBSD for example.
> Add a _normalize_errors() helper to normalize these
> error messages.
>
> Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
> ---
> tests/qemu-iotests/162 | 14 +++++++++++---
> 1 file changed, 11 insertions(+), 3 deletions(-)
>
> diff --git a/tests/qemu-iotests/162 b/tests/qemu-iotests/162
> index 4f01611886..73a0c43e2c 100755
> --- a/tests/qemu-iotests/162
> +++ b/tests/qemu-iotests/162
> @@ -33,6 +33,12 @@ _cleanup()
> }
> trap "_cleanup; exit \$status" 0 1 2 3 15
>
> +_normalize_errors()
> +{
> + sed -e "s/Name does not resolve/Name or service not known/" \
> + -e "s/Can't assign requested address/Connection refused/"
> +}
Rather than attempt to re-map OS dependent messages, I'd be more
inclined to just cull the 'strerror()' strings from the expected
output file.
> # get standard environment, filters and checks
> . ./common.rc
> . ./common.filter
> @@ -45,7 +51,7 @@ echo '=== NBD ==='
> # NBD expects all of its arguments to be strings
>
> # So this should not crash
> -$QEMU_IMG info 'json:{"driver": "nbd", "host": -1}'
> +$QEMU_IMG info 'json:{"driver": "nbd", "host": -1}' 2>&1 | _normalize_errors
| sed -E 's/(address resolution failed for -1:10809).*$/\1/'
>
> # And this should not treat @port as if it had not been specified
> # (We need to set up a server here, because the error message for "Connection
> @@ -78,10 +84,12 @@ echo '=== SSH ==='
> # expected to be an integer
>
> # So "0" should be converted to an integer here (instead of crashing)
> -$QEMU_IMG info 'json:{"driver": "ssh", "host": "localhost", "port": "0", "path": "/foo"}'
> +$QEMU_IMG info \
> + 'json:{"driver": "ssh", "host": "localhost", "port": "0", "path": "/foo"}' 2>&1 | \
> + _normalize_errors
> # The same, basically (all values for --image-opts are seen as strings in qemu)
> $QEMU_IMG info --image-opts \
> - driver=ssh,host=localhost,port=0,path=/foo
> + driver=ssh,host=localhost,port=0,path=/foo 2>&1 | _normalize_errors
| sed -e 's/(Failed to connect to 'localhost:0').*$/\1/'
>
> # This, however, should fail because of the wrong type
> $QEMU_IMG info 'json:{"driver": "ssh", "host": "localhost", "port": 0.42, "path": "/foo"}'
> --
> 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 :|
next prev parent reply other threads:[~2026-11-26 9:20 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é
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é [this message]
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=awf5xhHOrEn-4gOy@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.