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

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


  • To: Xen Developers <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • From: Dan Smith <danms@xxxxxxxxxx>
  • Date: Mon, 14 Nov 2005 16:14:57 -0800
  • Delivery-date: Tue, 15 Nov 2005 00:15:01 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

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

 


Rackspace

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