From: Dan Smith Subject: [PATCH][XM-TEST] Detect bug #380 and restart console daemon Date: Wed, 16 Nov 2005 07:50:13 -0800 Message-ID: <87mzk4egne.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 --=-=-= Signed-off-by: Dan Smith --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=04_smallmem.patch # HG changeset patch # User dan@guaranine.beaverton.ibm.com # Node ID 9601144afb9b9b9bb55464dcac57304c169be7c2 # Parent 9bf6f907b3ff0261902f06d261f76c1bd12af9f5 Make test 04_memset detect bug #380 and restart the console daemon. This should allow the rest of the tests to run without reporting failure because this test killed the console system. diff -r 9bf6f907b3ff -r 9601144afb9b tools/xm-test/lib/XmTestLib/Console.py --- a/tools/xm-test/lib/XmTestLib/Console.py Wed Nov 16 10:29:52 2005 +++ b/tools/xm-test/lib/XmTestLib/Console.py Wed Nov 16 15:53:32 2005 @@ -33,9 +33,13 @@ from Test import * +TIMEDOUT = 1 +RUNAWAY = 2 + class ConsoleError(Exception): - def __init__(self, msg): + def __init__(self, msg, reason=TIMEDOUT): self.errMsg = msg + self.reason = reason def __str__(self): return str(self.errMsg) @@ -149,7 +153,7 @@ if self.limit and bytes >= self.limit: raise ConsoleError("Console run-away (exceeded %i bytes)" - % self.limit) + % self.limit, RUNAWAY) if self.debugMe: print "Ignored %i bytes of miscellaneous console output" % bytes @@ -187,7 +191,7 @@ if self.limit and bytes >= self.limit: raise ConsoleError("Console run-away (exceeded %i bytes)" - % self.limit) + % self.limit, RUNAWAY) if str == "\n": if lines > 0: diff -r 9bf6f907b3ff -r 9601144afb9b tools/xm-test/tests/memset/04_memset_smallmem_pos.py --- a/tools/xm-test/tests/memset/04_memset_smallmem_pos.py Wed Nov 16 10:29:52 2005 +++ b/tools/xm-test/tests/memset/04_memset_smallmem_pos.py Wed Nov 16 15:53:32 2005 @@ -36,6 +36,17 @@ # See if this hits the byte limit console.runCmd("ls") except ConsoleError, e: - FAIL(str(e)) + if e.reason == RUNAWAY: + # Need to stop the domain before we restart the console daemon + domain.destroy() + if verbose: + print "*** Attempting restart of xenconsoled" + s, o = traceCommand("killall xenconsoled") + s, o = traceCommand("xenconsoled") + if s != 0: + print "*** Starting xenconsoled failed: %i" % s + FAIL("Bug #380: I crashed the console system") + else: + FAIL(str(e)) domain.destroy() --=-=-= -- 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 --=-=-=--