|
|
|
|
|
|
|
|
|
|
xen-devel
[Xen-devel] [PATCH][XM-TEST] Improvements to the 01_reboot test
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>
|
- [Xen-devel] [PATCH][XM-TEST] Improvements to the 01_reboot test,
Dan Smith <=
|
|
|
|
|