From: Dan Smith Subject: [PATCH][XM-TEST] Improvements to the 01_reboot test Date: Wed, 16 Nov 2005 11:06:19 -0800 Message-ID: <877jb8ct04.fsf@theine.beaverton.ibm.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Xen Developers List-Id: xen-devel@lists.xenproject.org --=-=-= 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 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=01_reboot.patch # HG changeset patch # User dan@guaranine.beaverton.ibm.com # 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@us.ibm.com --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=-=-=--