From cf1cd117e2b38f1b5d28e435b4b527a32055e133 Mon Sep 17 00:00:00 2001 From: Fam Zheng Date: Fri, 5 May 2017 18:21:53 +0800 Subject: iotests: 147: Don't test inet6 if not available This is the case in our docker tests, as we use --net=none there. Skip this method. Signed-off-by: Fam Zheng Signed-off-by: Kevin Wolf --- tests/qemu-iotests/147 | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests/qemu-iotests') diff --git a/tests/qemu-iotests/147 b/tests/qemu-iotests/147 index 32afea63d4..db34838cd0 100755 --- a/tests/qemu-iotests/147 +++ b/tests/qemu-iotests/147 @@ -147,6 +147,13 @@ class BuiltinNBD(NBDBlockdevAddBase): self._server_down() def test_inet6(self): + try: + socket.getaddrinfo("::0", "0", socket.AF_INET6, + socket.SOCK_STREAM, socket.IPPROTO_TCP, + socket.AI_ADDRCONFIG | socket.AI_CANONNAME) + except socket.gaierror: + # IPv6 not available, skip + return address = { 'type': 'inet', 'data': { 'host': '::1', -- cgit v1.2.3