WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] While testing TCP & UDP tests (coming soon), I tracked d

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] While testing TCP & UDP tests (coming soon), I tracked down a bug in the
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 27 Feb 2006 23:10:08 +0000
Delivery-date: Mon, 27 Feb 2006 23:10:37 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User emellor@xxxxxxxxxxxxxxxxxxxxxx
# Node ID d741fa2723094a51274466e91b71c13291732e94
# Parent  136aea67b3698aa19e977cd44db7785498a3ad87
While testing TCP & UDP tests (coming soon), I tracked down a bug in the
IP addressing scheme
used by xm-test: each machine running network tests is using the same IP
addresses, so two machines
in the same network can cross-pollinate/interfere with each other's tests.

This patch changes the IP addressing scheme to add some randomness. It's
gone through a couple of dozen
passes of xm-test, some on -bridge and some on -route, while xm-test was
running on another box on the same network.

Signed-off-by: Jim Dykman <dykman@xxxxxxxxxx>

diff -r 136aea67b369 -r d741fa272309 tools/xm-test/lib/XmTestLib/Network.py
--- a/tools/xm-test/lib/XmTestLib/Network.py    Mon Feb 27 15:13:05 2006
+++ b/tools/xm-test/lib/XmTestLib/Network.py    Mon Feb 27 15:14:11 2006
@@ -22,6 +22,7 @@
 import sys;
 import os;
 import atexit;
+import random;
 
 from Test import *
 from Xm import *
@@ -53,12 +54,22 @@
         if rc == 0:
             SKIP("Zeroconf address found: " + out)
 
+        # Randomize one octet of the IP addresses we choose, so that
+        # multiple machines running network tests don't interfere 
+        # with each other. 
+        self.subnet = random.randint(1,254)
+
     def calc_ip_address(self, dom, interface):
         # Generate an IP address from the dom# and eth#:
-        #      169.254.(eth#+153).(dom#+10)
+        #      169.254.(self.subnet).(eth#)*16 + (dom# + 1)
         ethnum = int(interface[len("eth"):])
+        if (ethnum > 15):
+            raise NetworkError("ethnum > 15 : " + interface)
         domnum = int(dom[len("dom"):])
-        return "169.254."+ str(ethnum+153) + "." + str(domnum+10)
+        if (domnum > 14):
+            raise NetworkError("domnum > 14 : " + dom)
+
+        return "169.254."+ str(self.subnet) + "." + str(ethnum*16+domnum+1)
 
     def ip(self, dom, interface, todomname=None, toeth=None, bridge=None):
         newip = self.calc_ip_address(dom, interface)
@@ -96,4 +107,4 @@
         return newip
 
     def mask(self, dom, interface):
-        return "255.255.255.0"
+        return "255.255.255.240"

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] While testing TCP & UDP tests (coming soon), I tracked down a bug in the, Xen patchbot -unstable <=