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] Improvements to the 01_reboot test

To: Xen Developers <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH][XM-TEST] Improvements to the 01_reboot test
From: Dan Smith <danms@xxxxxxxxxx>
Date: Wed, 16 Nov 2005 11:06:19 -0800
Delivery-date: Wed, 16 Nov 2005 19:06:18 +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 corrects an issue in the 01_reboot test where we might
reboot a domain that started and died immediately.

Signed-off-by: Dan Smith <danms@xxxxxxxxxx>
# HG changeset patch
# User dan@xxxxxxxxxxxxxxxxxxxxxxxxxxx
# Node ID 5828be7a0e529b86ac1e77307dc76fd55b326739
# Parent  bb952a9c3aaa8ff13677cc8d98e131d9992eac1c
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 bb952a9c3aaa -r 5828be7a0e52 
tools/xm-test/tests/reboot/01_reboot_basic_pos.py
--- a/tools/xm-test/tests/reboot/01_reboot_basic_pos.py Wed Nov 16 16:50:04 2005
+++ b/tools/xm-test/tests/reboot/01_reboot_basic_pos.py Wed Nov 16 19:08:14 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)))
 
+
-- 
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>