WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 7/10][TOOLS][XM-TEST] Add ability to inspect messages

To: Xen-Devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH 7/10][TOOLS][XM-TEST] Add ability to inspect messages from domain for arbitrary strings
From: Tony Breeds <tony@xxxxxxxxxxxxxxxxxx>
Date: Fri, 20 Oct 2006 13:21:45 +1000
Cc: XenPPC-devel <xen-ppc-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Thu, 19 Oct 2006 21:56:49 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1161308910@xxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Mail-followup-to: Xen-Devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, XenPPC-devel <xen-ppc-devel@xxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.9i
Add ability to inspect messages from domain for arbitrary strings.

Used on PowerPC to FAIL(), if the guest domain hits a BUG() and enters XMON.

Signed-off-by: Tony Breeds <tony@xxxxxxxxxxxxxxxxxx>
---

tools/xm-test/lib/XmTestLib/Console.py |    5 +++++
tools/xm-test/lib/XmTestLib/arch.py    |   20 ++++++++++++++++++++
2 files changed, 25 insertions(+)

--- a/tools/xm-test/lib/XmTestLib/Console.py    Thu Oct 19 12:00:21 2006 +1000
+++ b/tools/xm-test/lib/XmTestLib/Console.py    Thu Oct 19 12:09:21 2006 +1000
@@ -31,6 +31,7 @@ import fcntl
 import fcntl
 import select
 
+import arch
 from Test import *
 
 TIMEDOUT = 1
@@ -120,6 +121,7 @@ class XmConsole:
     def __getprompt(self, fd):
         timeout = 0
         bytes = 0
+        buffer = ""
         while timeout < 180:
             # eat anything while total bytes less than limit else raise RUNAWAY
             while (not self.limit) or (bytes < self.limit):
@@ -130,6 +132,7 @@ class XmConsole:
                         if self.debugMe:
                             sys.stdout.write(foo)
                         bytes += 1
+                        buffer += foo
                     except Exception, exn:
                         raise ConsoleError(str(exn))
                 else:
@@ -137,6 +140,8 @@ class XmConsole:
             else:
                 raise ConsoleError("Console run-away (exceeded %i bytes)"
                                    % self.limit, RUNAWAY)
+            # Check to see if the buffer contains anything interetsing
+            arch.checkBuffer(buffer)
             # press enter
             os.write(self.consoleFd, "\n")
             # look for prompt
diff -r 2cc5afde2692 -r 6bad455e70de tools/xm-test/lib/XmTestLib/arch.py
--- a/tools/xm-test/lib/XmTestLib/arch.py       Thu Oct 19 12:00:21 2006 +1000
+++ b/tools/xm-test/lib/XmTestLib/arch.py       Thu Oct 19 12:09:21 2006 +1000
@@ -25,6 +25,8 @@ import config
 import config
 import commands
 
+from Test import *
+
 BLOCK_ROOT_DEV = "hda"
 
 # This isn't truly platform related but it makes the code tidier
@@ -38,6 +40,9 @@ def getRdPath():
     return rdpath
 
 # Begin: Intel ia32 and ia64 as well as AMD 32-bit and 64-bit processors
+def ia_checkBuffer(buffer):
+    return
+
 def ia_minSafeMem():
     return 32
 
@@ -81,6 +86,19 @@ ia_HVMDefaults =      {"memory"       : 
 # End  : Intel ia32 and ia64 as well as AMD 32-bit and 64-bit processors
 
 # Begin: PowerPC
+def ppc_checkBuffer(buffer):
+    checks = [
+        {"pattern" : re.compile("^\d+:mon>\s*$", re.MULTILINE),
+         "message" : "domain trapped into XMON"},
+    ]
+
+    for i in range(0, len(checks)):
+        check=checks[i]
+        if check.get('pattern').search(buffer):
+               FAIL(check.get('message'))
+
+    return
+
 def ppc_minSafeMem():
     return 64
 
@@ -116,6 +134,7 @@ if _arch == "x86" or _arch == "ia64":
 if _arch == "x86" or _arch == "ia64":
     minSafeMem = ia_minSafeMem
     getDefaultKernel = ia_getDefaultKernel
+    checkBuffer = ia_checkBuffer
     if config.ENABLE_HVM_SUPPORT:
         configDefaults = ia_HVMDefaults
     else:
@@ -123,6 +142,7 @@ elif _arch == "powerpc":
 elif _arch == "powerpc":
     minSafeMem = ppc_minSafeMem
     getDefaultKernel = ppc_getDefaultKernel
+    checkBuffer = ppc_checkBuffer
     configDefaults = ppc_ParavirtDefaults
 else:
     raise ValueError, "Unknown architecture!"


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH 7/10][TOOLS][XM-TEST] Add ability to inspect messages from domain for arbitrary strings, Tony Breeds <=