qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iotests/162: Fix for newer Linux 5.3+
@ 2019-10-02 17:40 Max Reitz
  2019-10-02 18:13 ` Eric Blake
  0 siblings, 1 reply; 2+ messages in thread
From: Max Reitz @ 2019-10-02 17:40 UTC (permalink / raw)
  To: qemu-block; +Cc: Kevin Wolf, qemu-devel, Max Reitz

Linux 5.3 has made 0.0.0.0/8 a working IPv4 subnet.  As such, "42" is
now a valid host, and the connection to it will (hopefully) time out
over a long period rather than quickly return with EINVAL.

So let us use a negative integer for testing that NBD will not crash
when it receives integer hosts.  This way, the connection will again
fail quickly and reliably.

Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 tests/qemu-iotests/162     | 2 +-
 tests/qemu-iotests/162.out | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/qemu-iotests/162 b/tests/qemu-iotests/162
index 2d719afbed..c0053ed975 100755
--- a/tests/qemu-iotests/162
+++ b/tests/qemu-iotests/162
@@ -46,7 +46,7 @@ echo '=== NBD ==='
 # NBD expects all of its arguments to be strings
 
 # So this should not crash
-$QEMU_IMG info 'json:{"driver": "nbd", "host": 42}'
+$QEMU_IMG info 'json:{"driver": "nbd", "host": -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
diff --git a/tests/qemu-iotests/162.out b/tests/qemu-iotests/162.out
index 3c5be2c569..5a00d36d17 100644
--- a/tests/qemu-iotests/162.out
+++ b/tests/qemu-iotests/162.out
@@ -1,7 +1,7 @@
 QA output created by 162
 
 === NBD ===
-qemu-img: Could not open 'json:{"driver": "nbd", "host": 42}': Failed to connect socket: Invalid argument
+qemu-img: Could not open 'json:{"driver": "nbd", "host": -1}': address resolution failed for -1:10809: Name or service not known
 image: nbd://localhost:PORT
 image: nbd+unix://?socket=42
 
-- 
2.21.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] iotests/162: Fix for newer Linux 5.3+
  2019-10-02 17:40 [PATCH] iotests/162: Fix for newer Linux 5.3+ Max Reitz
@ 2019-10-02 18:13 ` Eric Blake
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Blake @ 2019-10-02 18:13 UTC (permalink / raw)
  To: Max Reitz, qemu-block; +Cc: Kevin Wolf, qemu-devel

On 10/2/19 12:40 PM, Max Reitz wrote:
> Linux 5.3 has made 0.0.0.0/8 a working IPv4 subnet.  As such, "42" is
> now a valid host, and the connection to it will (hopefully) time out
> over a long period rather than quickly return with EINVAL.
> 
> So let us use a negative integer for testing that NBD will not crash
> when it receives integer hosts.  This way, the connection will again
> fail quickly and reliably.
> 
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
>   tests/qemu-iotests/162     | 2 +-
>   tests/qemu-iotests/162.out | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Eric Blake <eblake@redhat.com>

I'm happy to take this through my NBD tree, or it can go with other 
batched iotests, whichever path is easier.

> 
> diff --git a/tests/qemu-iotests/162 b/tests/qemu-iotests/162
> index 2d719afbed..c0053ed975 100755
> --- a/tests/qemu-iotests/162
> +++ b/tests/qemu-iotests/162
> @@ -46,7 +46,7 @@ echo '=== NBD ==='
>   # NBD expects all of its arguments to be strings
>   
>   # So this should not crash
> -$QEMU_IMG info 'json:{"driver": "nbd", "host": 42}'
> +$QEMU_IMG info 'json:{"driver": "nbd", "host": -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
> diff --git a/tests/qemu-iotests/162.out b/tests/qemu-iotests/162.out
> index 3c5be2c569..5a00d36d17 100644
> --- a/tests/qemu-iotests/162.out
> +++ b/tests/qemu-iotests/162.out
> @@ -1,7 +1,7 @@
>   QA output created by 162
>   
>   === NBD ===
> -qemu-img: Could not open 'json:{"driver": "nbd", "host": 42}': Failed to connect socket: Invalid argument
> +qemu-img: Could not open 'json:{"driver": "nbd", "host": -1}': address resolution failed for -1:10809: Name or service not known
>   image: nbd://localhost:PORT
>   image: nbd+unix://?socket=42
>   
> 

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-10-02 18:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-02 17:40 [PATCH] iotests/162: Fix for newer Linux 5.3+ Max Reitz
2019-10-02 18:13 ` Eric Blake

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).