From: Max Reitz <mreitz@redhat.com>
To: qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com>,
Peter Maydell <peter.maydell@linaro.org>,
Kevin Wolf <kwolf@redhat.com>
Subject: [Qemu-devel] [PULL 12/13] iotests: Bind qemu-nbd to localhost in 147
Date: Thu, 31 Jan 2019 01:59:44 +0100 [thread overview]
Message-ID: <20190131005945.20149-13-mreitz@redhat.com> (raw)
In-Reply-To: <20190131005945.20149-1-mreitz@redhat.com>
By default, qemu-nbd binds to 0.0.0.0. However, we then proceed to
connect to "localhost". Usually, this works out fine; but if this test
is run concurrently, some other test function may have bound a different
server to ::1 (on the same port -- you can bind different serves to the
same port, as long as one is on IPv4 and the other on IPv6).
So running qemu-nbd works, it can bind to 0.0.0.0:NBD_PORT. But
potentially a concurrent test has successfully taken [::1]:NBD_PORT. In
this case, trying to connect to "localhost" will lead us to the IPv6
instance, where we do not want to end up.
Fix this by just binding to "localhost". This will make qemu-nbd error
out immediately and not give us cryptic errors later.
(Also, it will allow us to just try a different port as of a future
patch.)
Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-id: 20181221234750.23577-3-mreitz@redhat.com
Reviewed-by: John Snow <jsnow@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
tests/qemu-iotests/147 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/qemu-iotests/147 b/tests/qemu-iotests/147
index 05b374b7d3..3e10a9969e 100755
--- a/tests/qemu-iotests/147
+++ b/tests/qemu-iotests/147
@@ -92,7 +92,7 @@ class QemuNBD(NBDBlockdevAddBase):
self.assertEqual(qemu_nbd('-f', imgfmt, test_img, *args), 0)
def test_inet(self):
- self._server_up('-p', str(NBD_PORT))
+ self._server_up('-b', 'localhost', '-p', str(NBD_PORT))
address = { 'type': 'inet',
'data': {
'host': 'localhost',
--
2.20.1
next prev parent reply other threads:[~2019-01-31 1:01 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-31 0:59 [Qemu-devel] [PULL 00/13] Block patches Max Reitz
2019-01-31 0:59 ` [Qemu-devel] [PULL 01/13] qapi: add x-debug-query-block-graph Max Reitz
2019-01-31 0:59 ` [Qemu-devel] [PULL 02/13] scripts: add render_block_graph function for QEMUMachine Max Reitz
2019-01-31 0:59 ` [Qemu-devel] [PULL 03/13] block/ssh: Convert from DPRINTF() macro to trace events Max Reitz
2019-01-31 0:59 ` [Qemu-devel] [PULL 04/13] block/curl: " Max Reitz
2019-01-31 0:59 ` [Qemu-devel] [PULL 05/13] block/file-posix: " Max Reitz
2019-01-31 0:59 ` [Qemu-devel] [PULL 06/13] block/sheepdog: " Max Reitz
2019-01-31 0:59 ` [Qemu-devel] [PULL 07/13] qemu-io: Add generic function for reinitializing optind Max Reitz
2019-01-31 0:59 ` [Qemu-devel] [PULL 08/13] nvme: use TYPE_NVME instead of constant string Max Reitz
2019-01-31 0:59 ` [Qemu-devel] [PULL 09/13] nvme: ensure the num_queues is not zero Max Reitz
2019-01-31 0:59 ` [Qemu-devel] [PULL 10/13] nvme: use pci_dev directly in nvme_realize Max Reitz
2019-01-31 0:59 ` [Qemu-devel] [PULL 11/13] iotests.py: Add qemu_nbd_pipe() Max Reitz
2019-01-31 0:59 ` Max Reitz [this message]
2019-01-31 0:59 ` [Qemu-devel] [PULL 13/13] iotests: Allow 147 to be run concurrently Max Reitz
2019-02-01 10:28 ` [Qemu-devel] [PULL 00/13] Block patches Peter Maydell
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=20190131005945.20149-13-mreitz@redhat.com \
--to=mreitz@redhat.com \
--cc=kwolf@redhat.com \
--cc=peter.maydell@linaro.org \
--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 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).