[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] xm-test: Allow dom0 network interface used in tests to be overriden



# HG changeset patch
# User James Bulpin <james@xxxxxxxxxxxxx>
# Date 1186931353 -3600
# Node ID c362bcee8047d3d30b8c7655d26d8a8702371b6f
# Parent  66a262700cf7cbe7fe853a87f85b31a5864cc82d
xm-test: Allow dom0 network interface used in tests to be overriden
  ./configure --with-dom0-intf=<intf>  (default vif0.0)
---
 tools/xm-test/configure.ac               |    7 +++++++
 tools/xm-test/lib/XmTestLib/NetConfig.py |   14 ++++++++------
 tools/xm-test/lib/XmTestLib/XenDevice.py |    2 +-
 tools/xm-test/lib/XmTestLib/config.py.in |    1 +
 4 files changed, 17 insertions(+), 7 deletions(-)

diff -r 66a262700cf7 -r c362bcee8047 tools/xm-test/configure.ac
--- a/tools/xm-test/configure.ac        Fri Aug 10 17:23:33 2007 +0100
+++ b/tools/xm-test/configure.ac        Sun Aug 12 16:09:13 2007 +0100
@@ -85,6 +85,13 @@ AC_SUBST(NETWORK_ADDRESS)
 AC_SUBST(NETWORK_ADDRESS)
 AC_SUBST(NETMASK)
 
+DOM0_INTF="vif0.0"
+AC_ARG_WITH(dom0-intf,
+        [ --with-dom0-intf=intf Set dom0 interface name [[default="vif0.0"]]],
+        [ DOM0_INTF="$withval" ])
+
+AC_SUBST(DOM0_INTF)
+
 AC_ARG_WITH(hvm-kernel,
       [[  --with-hvm-kernel=kernel       Use this kernel for hvm disk.img 
testing]],
       HVMKERNEL=$withval,
diff -r 66a262700cf7 -r c362bcee8047 tools/xm-test/lib/XmTestLib/NetConfig.py
--- a/tools/xm-test/lib/XmTestLib/NetConfig.py  Fri Aug 10 17:23:33 2007 +0100
+++ b/tools/xm-test/lib/XmTestLib/NetConfig.py  Sun Aug 12 16:09:13 2007 +0100
@@ -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 -r 66a262700cf7 -r c362bcee8047 tools/xm-test/lib/XmTestLib/XenDevice.py
--- a/tools/xm-test/lib/XmTestLib/XenDevice.py  Fri Aug 10 17:23:33 2007 +0100
+++ b/tools/xm-test/lib/XmTestLib/XenDevice.py  Sun Aug 12 16:09:13 2007 +0100
@@ -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 -r 66a262700cf7 -r c362bcee8047 tools/xm-test/lib/XmTestLib/config.py.in
--- a/tools/xm-test/lib/XmTestLib/config.py.in  Fri Aug 10 17:23:33 2007 +0100
+++ b/tools/xm-test/lib/XmTestLib/config.py.in  Sun Aug 12 16:09:13 2007 +0100
@@ -4,3 +4,4 @@ NETWORK_IP_RANGE = "@NET_IP_RANGE@"
 NETWORK_IP_RANGE = "@NET_IP_RANGE@"
 NETWORK = "@NETWORK_ADDRESS@"
 NETMASK = "@NETMASK@"
+DOM0_INTF = "@DOM0_INTF@"

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.