All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adam Wendt <adam@ipcoast.com>
To: xen-devel@lists.xensource.com
Subject: [XM-TEST][PATCH] hvm network test fixes
Date: Wed, 01 Feb 2006 12:41:10	[thread overview]
Message-ID: <113882647017019708adam@ipcoast.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 961 bytes --]

The following patch allows the network tests to pass with hvm support enabled.

More specifically:
02_network_local_ping_pos.py
REASON: ping loopback failed for size 65507. ping eth0 failed for size 65507.
(but all other size pings work)

05_network_dom0_ping_pos.py
REASON: Ping to dom0 failed for size 65507.
(but all other size pings work)

11_network_domU_ping_pos.py
passes 100% (even the large ping, i know the large ping is another bug but is it
supposed to work or fail on this test?)

Let me know if there's anything I should change in the patch, my next step is to
try to build some network tests that put a little strain on the network, the hvm
image doesn't appear to have support for ping -f so I'll need to find another
solution, any ideas? (Yes I can probably ping -f from outside the domain at it,
but would be nice to have something to test the other direction, or even ssh to
test that data isn't being corrupted.)

Adam Wendt
IPCoast, Inc.



[-- Attachment #2: xmtestnetworkhvm.patch --]
[-- Type: application/octet-stream, Size: 4382 bytes --]

# HG changeset patch
# User adam@ipcoast.com
# Node ID 20630fa9c577af094375463c991d06313b2fa97a
# Parent  0c94043f5c5b845a2b0731c444aec09ef7a901f4
Fix xm-test network tests to work with hvm support enabled.

diff -r 0c94043f5c5b -r 20630fa9c577 tools/xm-test/lib/XmTestLib/Network.py
--- a/tools/xm-test/lib/XmTestLib/Network.py	Wed Feb  1 15:28:50 2006
+++ b/tools/xm-test/lib/XmTestLib/Network.py	Wed Feb  1 20:28:32 2006
@@ -25,6 +25,7 @@
 
 from Test import *
 from Xm import *
+from config import *
 
 class NetworkError(Exception):
     def __init__(self, msg):
@@ -36,6 +37,9 @@
 def undo_dom0_alias(eth, ip):
     traceCommand("ip addr del " + ip + " dev " + eth)
 
+def net_from_ip(ip):
+    return ip[:ip.rfind(".")] + ".0/24"
+    
 class XmNetwork:
 
     def __init__(self):
@@ -56,14 +60,21 @@
         domnum = int(dom[len("dom"):])
         return "169.254."+ str(ethnum+153) + "." + str(domnum+10)
 
-    def ip(self, dom, interface, todomname=None, toeth=None):
+    def ip(self, dom, interface, todomname=None, toeth=None, bridge=None):
         newip = self.calc_ip_address(dom, interface)
 
         # If the testcase is going to talk to dom0, we need to add an 
         # IP address in the proper subnet
         if dom == "dom0":
-            # The domain's vif is a convenient place to add to
-            vifname = "vif" + str(domid(todomname)) + "." + toeth[3:]
+	    if ENABLE_HVM_SUPPORT:
+	        # HVM uses ioemu which uses a bridge
+		if not bridge:
+		    SKIP("no bridge supplied")
+		else:
+		    vifname = bridge
+	    else:
+                # The domain's vif is a convenient place to add to
+                vifname = "vif" + str(domid(todomname)) + "." + toeth[3:]
 
             # register the exit handler FIRST, just in case
             atexit.register(undo_dom0_alias, vifname, newip)
@@ -73,6 +84,15 @@
                                               " dev " + vifname)
             if status:
                 SKIP("\"ip addr add\" failed")
+
+	    if ENABLE_HVM_SUPPORT:
+	        # We need to add a route to the bridge device
+		network = net_from_ip(newip)
+		status, output = traceCommand("ip route add " + network + " dev " + vifname + " scope link")
+
+                if status:
+		    SKIP("\"ip route add\" failed")
+
         return newip
 
     def mask(self, dom, interface):
diff -r 0c94043f5c5b -r 20630fa9c577 tools/xm-test/tests/network/02_network_local_ping_pos.py
--- a/tools/xm-test/tests/network/02_network_local_ping_pos.py	Wed Feb  1 15:28:50 2006
+++ b/tools/xm-test/tests/network/02_network_local_ping_pos.py	Wed Feb  1 20:28:32 2006
@@ -28,7 +28,11 @@
 mask = Net.mask("dom1", "eth0")
 
 # Fire up a guest domain w/1 nic
-config = {"vif" : ['ip=%s' % ip]}
+if ENABLE_HVM_SUPPORT:
+    config = {"vif" : ['type=ioemu']}
+else:
+    config = {"vif" : ['ip=%s' % ip ]}
+
 domain = XmTestDomain(extraConfig=config)
 try:
     domain.start()
diff -r 0c94043f5c5b -r 20630fa9c577 tools/xm-test/tests/network/05_network_dom0_ping_pos.py
--- a/tools/xm-test/tests/network/05_network_dom0_ping_pos.py	Wed Feb  1 15:28:50 2006
+++ b/tools/xm-test/tests/network/05_network_dom0_ping_pos.py	Wed Feb  1 20:28:32 2006
@@ -31,7 +31,13 @@
         FAIL(str(e))
 
 # Fire up a guest domain w/1 nic
-config = {"vif"  : ["ip=%s" % ip]}
+if ENABLE_HVM_SUPPORT:
+    brg = "xenbr0"
+    config = {"vif" : ['type=ioemu, bridge=%s' % brg]}
+else:
+    config = {"vif" : ['ip=%s' % ip ]}
+    brg = None
+
 domain = XmTestDomain(extraConfig=config)
 try:
     domain.start()
@@ -52,7 +58,7 @@
 
 try:
     # Add a suitable dom0 IP address 
-    dom0ip = Net.ip("dom0", "eth0", todomname=domain.getName(), toeth="eth0")
+    dom0ip = Net.ip("dom0", "eth0", todomname=domain.getName(), toeth="eth0", bridge=brg)
 except NetworkError, e:
         FAIL(str(e))
 
diff -r 0c94043f5c5b -r 20630fa9c577 tools/xm-test/tests/network/11_network_domU_ping_pos.py
--- a/tools/xm-test/tests/network/11_network_domU_ping_pos.py	Wed Feb  1 15:28:50 2006
+++ b/tools/xm-test/tests/network/11_network_domU_ping_pos.py	Wed Feb  1 20:28:32 2006
@@ -18,7 +18,11 @@
 from XmTestLib import *
 
 def netDomain(ip):
-    config = {"vif"  : ["ip=%s" % ip]}
+    if ENABLE_HVM_SUPPORT:
+        config = {"vif" : ['type=ioemu']}
+    else:
+        config = {"vif" : ['ip=%s' % ip ]}
+
     dom = XmTestDomain(extraConfig=config)
     try:
         dom.start()

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

             reply	other threads:[~2006-02-01 12:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-01 12:41 Adam Wendt [this message]
2006-02-01 20:52 ` [XM-TEST][PATCH] hvm network test fixes Dan Smith
2006-02-01 21:12   ` Nivedita Singhvi
2006-02-10  1:13 ` Ewan Mellor
  -- strict thread matches above, loose matches on Subject: below --
2006-02-01 13:14 Adam Wendt
2006-02-01 21:28 ` Dan Smith
2006-02-01 13:32 Adam Wendt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=113882647017019708adam@ipcoast.com \
    --to=adam@ipcoast.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.