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.
This commit is contained in:
dan@guaranine.beaverton.ibm.com committed 2005-11-16 20:32:36 +01:00
1 parent a71d394cc3
commit 574b65be2f
1 file changed
+14 -4
@@ -18,6 +18,13 @@ except DomainError, e:
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())
if status != 0:
@@ -40,8 +47,11 @@ console.closeConsole()
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)))
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.