diff options
author | James Bulpin <james@xensource.com> | 2007-08-12 16:09:13 +0100 |
---|---|---|
committer | James Bulpin <james@xensource.com> | 2007-08-12 16:09:13 +0100 |
commit | 9119ea5153b5feb9aee3ce8d66f909f529f443e9 (patch) | |
tree | 09c3cc725ebb50a296c7fa5d6fcbfae697fd46c8 /tools/xm-test/lib | |
parent | 0067e950074566bfc542ce3cf640c4546217d915 (diff) | |
download | xen-9119ea5153b5feb9aee3ce8d66f909f529f443e9.tar.gz xen-9119ea5153b5feb9aee3ce8d66f909f529f443e9.tar.bz2 xen-9119ea5153b5feb9aee3ce8d66f909f529f443e9.zip |
xm-test: Allow dom0 network interface used in tests to be overriden
./configure --with-dom0-intf=<intf> (default vif0.0)
Diffstat (limited to 'tools/xm-test/lib')
-rw-r--r-- | tools/xm-test/lib/XmTestLib/NetConfig.py | 14 | ||||
-rw-r--r-- | tools/xm-test/lib/XmTestLib/XenDevice.py | 2 | ||||
-rw-r--r-- | tools/xm-test/lib/XmTestLib/config.py.in | 1 |
3 files changed, 10 insertions, 7 deletions
diff --git a/tools/xm-test/lib/XmTestLib/NetConfig.py b/tools/xm-test/lib/XmTestLib/NetConfig.py index 652db573f6..fe0cfb429f 100644 --- a/tools/xm-test/lib/XmTestLib/NetConfig.py +++ b/tools/xm-test/lib/XmTestLib/NetConfig.py @@ -104,8 +104,8 @@ class NetConfig: if self.network == "169.254.0.0": checkZeroconfAddresses() - # Clean out any aliases in the network range for vif0.0. If - # an alias exists, a test xendevice add command could fail. + # Clean out any aliases in the network range for dom0's interface. + # If an alias exists, a test xendevice add command could fail. if NETWORK_IP_RANGE != "dhcp": self.__cleanDom0Aliases() @@ -139,20 +139,22 @@ class NetConfig: def __cleanDom0Aliases(self): # Remove any aliases within the supplied network IP range on dom0 - scmd = 'ip addr show dev vif0.0' + scmd = 'ip addr show dev %s' % (DOM0_INTF) status, output = traceCommand(scmd) if status: - raise NetworkError("Failed to show vif0.0 aliases: %d" % status) + raise NetworkError("Failed to show %s aliases: %d" % + (DOM0_INTF, status)) lines = output.split("\n") for line in lines: ip = re.search('(\d+\.\d+\.\d+\.\d+)', line) if ip and self.isIPInRange(ip.group(1)) == True: - dcmd = 'ip addr del %s dev vif0.0' % ip.group(1) + dcmd = 'ip addr del %s dev %s' % (ip.group(1), DOM0_INTF) dstatus, doutput = traceCommand(dcmd) if dstatus: - raise NetworkError("Failed to remove vif0.0 aliases: %d" % status) + raise NetworkError("Failed to remove %s aliases: %d" % + (DOM0_INTF, status)) def getNetEnv(self): return self.netenv diff --git a/tools/xm-test/lib/XmTestLib/XenDevice.py b/tools/xm-test/lib/XmTestLib/XenDevice.py index d899a5e4c8..79dfbfc73a 100644 --- a/tools/xm-test/lib/XmTestLib/XenDevice.py +++ b/tools/xm-test/lib/XmTestLib/XenDevice.py @@ -214,7 +214,7 @@ class XenNetDevice(XenDevice): def removeDevice(self): self.releaseNetDevIP() - def addDom0AliasCmd(self, dev="vif0.0"): + def addDom0AliasCmd(self, dev=DOM0_INTF): # Method to add start and remove dom0 alias cmds acmd = 'ip addr add %s dev %s' % (self.dom0_alias_ip, dev) rcmd = 'ip addr del %s dev %s' % (self.dom0_alias_ip, dev) diff --git a/tools/xm-test/lib/XmTestLib/config.py.in b/tools/xm-test/lib/XmTestLib/config.py.in index 986eb36aff..21c6cc5585 100644 --- a/tools/xm-test/lib/XmTestLib/config.py.in +++ b/tools/xm-test/lib/XmTestLib/config.py.in @@ -4,3 +4,4 @@ ENABLE_HVM_SUPPORT = @ENABLE_HVM@ NETWORK_IP_RANGE = "@NET_IP_RANGE@" NETWORK = "@NETWORK_ADDRESS@" NETMASK = "@NETMASK@" +DOM0_INTF = "@DOM0_INTF@" |