Revision a02dbfca

b/qa/ganeti-qa.py
52 52
from ganeti import utils
53 53
from ganeti import rapi # pylint: disable=W0611
54 54
from ganeti import constants
55
from ganeti import netutils
55 56
from ganeti import pathutils
56 57

  
57 58
from ganeti.http.auth import ParsePasswordFile
......
612 613
  if not qa_config.TestEnabled("group-custom-ssh-port"):
613 614
    return
614 615

  
616
  std_port = netutils.GetDaemonPort(constants.SSH)
615 617
  port = 211
616 618
  master = qa_config.GetMasterNode()
617 619
  with qa_config.AcquireManyNodesCtx(1, exclude=master) as nodes:
620
    # Checks if the node(s) could be contacted through IPv6.
621
    # If yes, better skip the whole test.
622

  
623
    for node in nodes:
624
      if qa_utils.UsesIPv6Connection(node.primary, std_port):
625
        print ("Node %s is likely to be reached using IPv6,"
626
               "skipping the test" % (node.primary, ))
627
        return
628

  
618 629
    for node in nodes:
619 630
      qa_node.NodeRemove(node)
620 631
    with qa_iptables.RulesContext(nodes) as r:
b/qa/qa_utils.py
28 28
import os
29 29
import random
30 30
import re
31
import socket
31 32
import subprocess
32 33
import sys
33 34
import tempfile
......
906 907
    else:
907 908
      ret_policy[key] = val
908 909
  return (ret_policy, ret_specs)
910

  
911

  
912
def UsesIPv6Connection(host, port):
913
  """Returns True if the connection to a given host/port could go through IPv6.
914

  
915
  """
916
  return any(t[0] == socket.AF_INET6 for t in socket.getaddrinfo(host, port))

Also available in: Unified diff