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

[Xen-changelog] Make 01_reboot test more robust.



# HG changeset patch
# User dan@xxxxxxxxxxxxxxxxxxxxxxxxxxx
# Node ID 28eec8977024d29f1d2ab18e0783256a753c7acc
# Parent  8ed932ab9f2ac7eda18356ed7e2503225b297209
Make 01_reboot test more robust.
We need to attach a console before rebooting to make sure the domain did
actually boot in the first place.  Also, use a better method for pulling out
the uptime string.

diff -r 8ed932ab9f2a -r 28eec8977024 
tools/xm-test/tests/reboot/01_reboot_basic_pos.py
--- a/tools/xm-test/tests/reboot/01_reboot_basic_pos.py Wed Nov 16 12:38:16 2005
+++ b/tools/xm-test/tests/reboot/01_reboot_basic_pos.py Wed Nov 16 19:32:36 2005
@@ -17,6 +17,13 @@
         print "Failed to create test domain because:"
         print e.extra
     FAIL(str(e))
+
+try:
+    console = XmConsole(domain.getName())
+except ConsoleError, e:
+    FAIL(str(e))
+
+console.closeConsole()
 
 status, output = traceCommand("xm reboot %s" % domain.getName())
 
@@ -40,8 +47,11 @@
 
 domain.destroy()
 
-items = re.split(" +", run["output"])
-uptime = int(items[3])
-if uptime > 1:
-    FAIL("Uptime too large (%i > 1 minutes); domain didn't reboot")
+match = re.match("^[^up]*up ([0-9]+).*$", run["output"])
+if match:
+    if int(match.group(1)) > 1:
+        FAIL("Uptime too large (%i > 1 minutes); domain didn't reboot")
+else:
+    FAIL("Invalid uptime string: %s (%s)" % (run["output"], match.group(1)))
 
+

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


 


Rackspace

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