Mailing List Archive

Two domUs, ping from one to the other
# HG changeset patch
# User emellor@leeni.uk.xensource.com
# Node ID da3b19d7bf9ea1b0bc351e6b9aad083e36cf3746
# Parent 9d812d5470e8461d864cdf8251df820fe86ddf48
Two domUs, ping from one to the other

Signed-off-by: Jim Dykman <dykman@us.ibm.com>

diff -r 9d812d5470e8 -r da3b19d7bf9e tools/xm-test/tests/network/11_network_domU_ping_pos.py
--- /dev/null Fri Dec 9 10:40:28 2005
+++ b/tools/xm-test/tests/network/11_network_domU_ping_pos.py Fri Dec 9 10:40:41 2005
@@ -0,0 +1,79 @@
+#!/usr/bin/python
+
+# Copyright (C) International Business Machines Corp., 2005
+# Author: <dykman@us.ibm.com>
+
+# Ping tests to domU interface
+# - creates two guest domains
+# - sets up a single NIC on each on same subnet
+# - conducts ping tests to the domU IP address.
+
+# ping -c 1 -s $size $domU_IP
+# where $size = 1, 48, 64, 512, 1440, 1500, 1505,
+# 4096, 4192, 32767, 65507, 65508
+
+pingsizes = [. 1, 48, 64, 512, 1440, 1500, 1505, 4096, 4192,
+ 32767, 65507 ]
+
+
+
+from XmTestLib import *
+
+
+def netDomain(ip):
+ dom = XmTestDomain(extraOpts={ 'nics' : 1 })
+ try:
+ dom.configSetVar('vif', " [ 'ip=" + ip + "' ]")
+ dom.start()
+ except DomainError, e:
+ if verbose:
+ print "Failed to create test domain because:"
+ print e.extra
+ FAIL(str(e))
+ try:
+ # Attach a console
+ console = XmConsole(dom.getName(), historySaveCmds=True)
+ # Activate the console
+ console.sendInput("bhs")
+ except ConsoleError, e:
+ FAIL(str(e))
+ return console
+
+rc = 0
+
+Net = XmNetwork()
+
+try:
+ # pick an IP address
+ ip1 = Net.ip("dom1", "eth2")
+ mask1 = Net.mask("dom1", "eth2")
+except NetworkError, e:
+ FAIL(str(e))
+
+try:
+ # pick another IP address
+ ip2 = Net.ip("dom2", "eth2")
+ mask2 = Net.mask("dom2", "eth2")
+except NetworkError, e:
+ FAIL(str(e))
+
+# Fire up a pair of guest domains w/1 nic each
+pinger_console = netDomain(ip1)
+victim_console = netDomain(ip2)
+
+try:
+ pinger_console.runCmd("ifconfig eth0 inet "+ip1+" netmask "+mask1+" up")
+ victim_console.runCmd("ifconfig eth0 inet "+ip2+" netmask "+mask2+" up")
+
+ # Ping the victim over eth0
+ fails=""
+ for size in pingsizes:
+ out = pinger_console.runCmd("ping -q -c 1 -s " + str(size) + " " + ip2)
+ if out["return"]:
+ fails += " " + str(size)
+except ConsoleError, e:
+ FAIL(str(e))
+
+if len(fails):
+ FAIL("Ping failed for size" + fails + ".")
+

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