]> git.proxmox.com Git - mirror_qemu.git/commit
iotests: Allow 147 to be run concurrently
authorMax Reitz <mreitz@redhat.com>
Fri, 21 Dec 2018 23:47:50 +0000 (00:47 +0100)
committerMax Reitz <mreitz@redhat.com>
Wed, 30 Jan 2019 23:44:55 +0000 (00:44 +0100)
commit908b30164bbffad7430d551b2a03a8fbcaa631ef
tree734fbaa105148714a6a6ea137746a8b6803124aa
parentdfadac9a37a7d1e8e891f347f77702f97856c227
iotests: Allow 147 to be run concurrently

To do this, we need to allow creating the NBD server on various ports
instead of a single one (which may not even work if you run just one
instance, because something entirely else might be using that port).

So we just pick a random port in [32768, 32768 + 1024) and try to create
a server there.  If that fails, we just retry until something sticks.

For the IPv6 test, we need a different range, though (just above that
one).  This is because "localhost" resolves to both 127.0.0.1 and ::1.
This means that if you bind to it, it will bind to both, if possible, or
just one if the other is already in use.  Therefore, if the IPv6 test
has already taken [::1]:some_port and we then try to take
localhost:some_port, that will work -- only the second server will be
bound to 127.0.0.1:some_port alone and not [::1]:some_port in addition.
So we have two different servers on the same port, one for IPv4 and one
for IPv6.

But when we then try to connect to the server through
localhost:some_port, we will always end up at the IPv6 one (as long as
it is up), and this may not be the one we want.

Thus, we must make sure not to create an IPv6-only NBD server on the
same port as a normal "dual-stack" NBD server -- which is done by using
distinct port ranges, as explained above.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-id: 20181221234750.23577-4-mreitz@redhat.com
Reviewed-by: John Snow <jsnow@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
tests/qemu-iotests/147