Improvements to the 01_reboot test
PATCH 1/1 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.
# HG changeset patch
# User [email protected]
# 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.
tools/xm-test/tests/reboot/01_reboot_basic_pos.py +14 -4
@@ -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))) +
Signature · 4 lines
Dan Smith IBM Linux Technology Center Open Hypervisor Team email: [email protected]
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Ewan Mellor
AppliedQuoted 4 lines · Dan Smith
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 <[email protected]>
Applied, thanks.
Ewan.