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-devel

[Xen-devel] [PATCH][XM-TEST]

To: Xen Developers <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH][XM-TEST]
From: Dan Smith <danms@xxxxxxxxxx>
Date: Mon, 14 Nov 2005 16:14:57 -0800
Delivery-date: Tue, 15 Nov 2005 00:15:01 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux)
This patch makes xm-test run in 45 minutes, as opposed to 100 minutes
on my machine.  I left the waitForBoot() line commented out so that it
can easily be re-enabled if a slower machine needs it, although I hope
not.

Signed-off-by: Dan Smith <danms@xxxxxxxxxx>
# HG changeset patch
# User danms@xxxxxxxxxx
# Node ID 50e47ac8c475b8d062db55457419ea563307a86f
# Parent  995e94c4802e5c0376b0483f3b2473a8f7d7808e
Reduce the time required to start xm-test domains by allowing the console
to retry connecting to the DomU multiple times.  A polling approach instead
of a wait-and-hope-it-works approach.

diff -r 995e94c4802e -r 50e47ac8c475 tools/xm-test/lib/XmTestLib/Console.py
--- a/tools/xm-test/lib/XmTestLib/Console.py    Fri Nov 11 18:11:13 2005
+++ b/tools/xm-test/lib/XmTestLib/Console.py    Mon Nov 14 19:55:17 2005
@@ -62,26 +62,37 @@
         self.historySaveCmds  = historySaveCmds
         self.debugMe          = False
         self.limit            = None
+        self.delay            = 2
 
         consoleCmd = ["/usr/sbin/xm", "xm", "console", domain]
 
-        if verbose:
-            print "Console executing: " + str(consoleCmd)
-
-        pid, fd = pty.fork()
-
-        if pid == 0:
-            os.execvp("/usr/sbin/xm", consoleCmd[1:])
-
-        self.consolePid = pid
-        self.consoleFd  = fd
-
-        tty.setraw(self.consoleFd, termios.TCSANOW)
+        start = time.time()
+
+        while (time.time() - start) < self.TIMEOUT:
+            if verbose:
+                print "Console executing: %s" % str(consoleCmd)
+
+            pid, fd = pty.fork()
+
+            if pid == 0:
+                os.execvp("/usr/sbin/xm", consoleCmd[1:])
+
+            self.consolePid = pid
+            self.consoleFd  = fd
+
+            tty.setraw(self.consoleFd, termios.TCSANOW)
             
-        bytes = self.__chewall(self.consoleFd)
-        if bytes < 0:
-            raise ConsoleError("Console didn't respond")
-
+            bytes = self.__chewall(self.consoleFd)
+
+            if bytes > 0:
+                return
+
+            if verbose:
+                print "Console didn't attach, waiting %i sec..." % self.delay
+            time.sleep(self.delay)
+
+        raise ConsoleError("Console didn't respond after %i secs" % 
self.TIMEOUT)
+    
     def __addToHistory(self, line):
         self.historyBuffer.append(line)
         self.historyLines += 1
diff -r 995e94c4802e -r 50e47ac8c475 tools/xm-test/lib/XmTestLib/XenDomain.py
--- a/tools/xm-test/lib/XmTestLib/XenDomain.py  Fri Nov 11 18:11:13 2005
+++ b/tools/xm-test/lib/XmTestLib/XenDomain.py  Mon Nov 14 19:55:17 2005
@@ -228,7 +228,7 @@
 #            status, output = traceCommand("xm list")
 
         XenDomain.start(self)
-        waitForBoot()
+#        waitForBoot()
 
     def startNow(self):
         XenDomain.start(self)
-- 
Dan Smith
IBM Linux Technology Center
Open Hypervisor Team
email: danms@xxxxxxxxxx
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>