Skip to content

Commit

Permalink
iotests/162: Fix for newer Linux 5.3+
Browse files Browse the repository at this point in the history
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>
Message-id: 20191002174052.5773-1-mreitz@redhat.com
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
  • Loading branch information
XanClic committed Oct 10, 2019
1 parent da51e99 commit 35f05b2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/qemu-iotests/162
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion 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

Expand Down

0 comments on commit 35f05b2

Please sign in to comment.