]> git.proxmox.com Git - mirror_qemu.git/commitdiff
iotests: 147: Don't test inet6 if not available
authorFam Zheng <famz@redhat.com>
Fri, 5 May 2017 10:21:53 +0000 (18:21 +0800)
committerKevin Wolf <kwolf@redhat.com>
Fri, 26 May 2017 14:48:21 +0000 (16:48 +0200)
This is the case in our docker tests, as we use --net=none there. Skip
this method.

Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
tests/qemu-iotests/147

index 32afea63d4d4ac431bae3c58cbc1acdaaa42f873..db34838cd0a65324bb14bf89f1fb618646e4a5af 100755 (executable)
@@ -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',