ia64/xen-unstable

changeset 15746:c362bcee8047

xm-test: Allow dom0 network interface used in tests to be overriden
./configure --with-dom0-intf=<intf> (default vif0.0)
author James Bulpin <james@xensource.com>
date Sun Aug 12 16:09:13 2007 +0100 (2007-08-12)
parents 66a262700cf7
children f2649861d594
files tools/xm-test/configure.ac tools/xm-test/lib/XmTestLib/NetConfig.py tools/xm-test/lib/XmTestLib/XenDevice.py tools/xm-test/lib/XmTestLib/config.py.in
line diff
     1.1 --- a/tools/xm-test/configure.ac	Fri Aug 10 17:23:33 2007 +0100
     1.2 +++ b/tools/xm-test/configure.ac	Sun Aug 12 16:09:13 2007 +0100
     1.3 @@ -85,6 +85,13 @@ AC_SUBST(NET_IP_RANGE)
     1.4  AC_SUBST(NETWORK_ADDRESS)
     1.5  AC_SUBST(NETMASK)
     1.6  
     1.7 +DOM0_INTF="vif0.0"
     1.8 +AC_ARG_WITH(dom0-intf,
     1.9 +        [ --with-dom0-intf=intf Set dom0 interface name [[default="vif0.0"]]],
    1.10 +        [ DOM0_INTF="$withval" ])
    1.11 +
    1.12 +AC_SUBST(DOM0_INTF)
    1.13 +
    1.14  AC_ARG_WITH(hvm-kernel,
    1.15        [[  --with-hvm-kernel=kernel       Use this kernel for hvm disk.img testing]],
    1.16        HVMKERNEL=$withval,
     2.1 --- a/tools/xm-test/lib/XmTestLib/NetConfig.py	Fri Aug 10 17:23:33 2007 +0100
     2.2 +++ b/tools/xm-test/lib/XmTestLib/NetConfig.py	Sun Aug 12 16:09:13 2007 +0100
     2.3 @@ -104,8 +104,8 @@ class NetConfig:
     2.4              if self.network == "169.254.0.0":
     2.5                  checkZeroconfAddresses()
     2.6  
     2.7 -            # Clean out any aliases in the network range for vif0.0. If
     2.8 -            # an alias exists, a test xendevice add command could fail.
     2.9 +            # Clean out any aliases in the network range for dom0's interface.
    2.10 +            # If an alias exists, a test xendevice add command could fail.
    2.11              if NETWORK_IP_RANGE != "dhcp":
    2.12                  self.__cleanDom0Aliases()
    2.13  
    2.14 @@ -139,20 +139,22 @@ class NetConfig:
    2.15  
    2.16      def __cleanDom0Aliases(self):
    2.17          # Remove any aliases within the supplied network IP range on dom0
    2.18 -        scmd = 'ip addr show dev vif0.0'
    2.19 +        scmd = 'ip addr show dev %s' % (DOM0_INTF)
    2.20  
    2.21          status, output = traceCommand(scmd)
    2.22          if status:
    2.23 -            raise NetworkError("Failed to show vif0.0 aliases: %d" % status)
    2.24 +            raise NetworkError("Failed to show %s aliases: %d" %
    2.25 +                               (DOM0_INTF, status))
    2.26  
    2.27          lines = output.split("\n")
    2.28          for line in lines:
    2.29              ip = re.search('(\d+\.\d+\.\d+\.\d+)', line)
    2.30              if ip and self.isIPInRange(ip.group(1)) == True:
    2.31 -                dcmd = 'ip addr del %s dev vif0.0' % ip.group(1)
    2.32 +                dcmd = 'ip addr del %s dev %s' % (ip.group(1), DOM0_INTF)
    2.33                  dstatus, doutput = traceCommand(dcmd)
    2.34                  if dstatus:
    2.35 -                    raise NetworkError("Failed to remove vif0.0 aliases: %d" % status)
    2.36 +                    raise NetworkError("Failed to remove %s aliases: %d" %
    2.37 +                                       (DOM0_INTF, status))
    2.38                  
    2.39      def getNetEnv(self):
    2.40          return self.netenv
     3.1 --- a/tools/xm-test/lib/XmTestLib/XenDevice.py	Fri Aug 10 17:23:33 2007 +0100
     3.2 +++ b/tools/xm-test/lib/XmTestLib/XenDevice.py	Sun Aug 12 16:09:13 2007 +0100
     3.3 @@ -214,7 +214,7 @@ class XenNetDevice(XenDevice):
     3.4      def removeDevice(self):
     3.5          self.releaseNetDevIP()
     3.6  
     3.7 -    def addDom0AliasCmd(self, dev="vif0.0"):
     3.8 +    def addDom0AliasCmd(self, dev=DOM0_INTF):
     3.9          # Method to add start and remove dom0 alias cmds
    3.10          acmd = 'ip addr add %s dev %s' % (self.dom0_alias_ip, dev)
    3.11          rcmd = 'ip addr del %s dev %s' % (self.dom0_alias_ip, dev) 
     4.1 --- a/tools/xm-test/lib/XmTestLib/config.py.in	Fri Aug 10 17:23:33 2007 +0100
     4.2 +++ b/tools/xm-test/lib/XmTestLib/config.py.in	Sun Aug 12 16:09:13 2007 +0100
     4.3 @@ -4,3 +4,4 @@ ENABLE_HVM_SUPPORT = @ENABLE_HVM@
     4.4  NETWORK_IP_RANGE = "@NET_IP_RANGE@"
     4.5  NETWORK = "@NETWORK_ADDRESS@"
     4.6  NETMASK = "@NETMASK@"
     4.7 +DOM0_INTF = "@DOM0_INTF@"