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] [XM-TEST] Fix memset tests when backend drivers are

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] [XM-TEST] Fix memset tests when backend drivers are compiled into domU kernel
From: James Dykman <dykman@xxxxxxxxxx>
Date: Mon, 1 May 2006 10:06:17 -0400
Delivery-date: Mon, 01 May 2006 07:06:43 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Xm-tests 01_memset_basic_pos.test and 03_memset_random_pos.test start 
domUs with 64MB of memory, 
and assume that all of that memory is available in the domU. They then 
perform various xm memset tests
based on the assumed starting conditions.

When netback & blkback are comiled into the domU kernel, they eat about 
5MB. This mismatch will cause
01_memset_basic_pos.test to fail every time. 03_memset_random_pos.test 
will probably fail, but can
pass with some lucky numbers from the random number generator.

This patch changes both tests to read the starting memory allocation from 
the balloon driver in the domU.

Signed-off-by: Jim Dykman <dykman@xxxxxxxxxx>

diff -r e0e68942b205 tools/xm-test/tests/memset/01_memset_basic_pos.py
--- a/tools/xm-test/tests/memset/01_memset_basic_pos.py Fri Apr 28 
16:44:00 2006 +0100
+++ b/tools/xm-test/tests/memset/01_memset_basic_pos.py Mon May  1 
09:50:46 2006 -0400
@@ -44,8 +44,20 @@ except ConsoleError, e:
 except ConsoleError, e:
     FAIL(str(e))

+try:
+    run = console.runCmd("cat /proc/xen/balloon | grep Current");
+except ConsoleError, e:
+    FAIL(str(e))
+
+match = re.match("[^0-9]+([0-9]+)", run["output"])
+if not match:
+    FAIL("Invalid domU meminfo line")
+
+origmem = int(match.group(1)) / 1024
+newmem = origmem - 1
+
 # set mem-set for less than default
-cmd = "xm mem-set %s %i" % (domain.getName(), 63)
+cmd = "xm mem-set %s %i" % (domain.getName(), newmem)
 status, output = traceCommand(cmd)
 if status != 0:
     if verbose:
@@ -55,7 +67,7 @@ if status != 0:

 for i in [1,2,3,4,5,6,7,8,9,10]:
     mem = getDomMem(domain.getName())
-    if mem == 63:
+    if mem == newmem:
         break
     time.sleep(1)

@@ -63,8 +75,8 @@ mem = getDomMem(domain.getName())
 mem = getDomMem(domain.getName())
 if not mem:
     FAIL("Failed to get memory amount for domain %s" % domain.getName())
-elif mem != 63:
-    FAIL("Dom0 failed to verify 63 MB; got %i MB" % mem)
+elif mem != newmem:
+    FAIL("Dom0 failed to verify %i MB; got %i MB" % newmem,mem)

 # verify memory set internally
 try:
@@ -79,7 +91,7 @@ if not m:

 domUmem = int(m.group(1)) / 1024

-if domUmem != 63:
+if domUmem != newmem:
     FAIL("DomU reported incorrect memory amount: %i MB" % (domUmem))

 # quiesce everything
diff -r e0e68942b205 tools/xm-test/tests/memset/03_memset_random_pos.py
--- a/tools/xm-test/tests/memset/03_memset_random_pos.py        Fri Apr 28 
16:44:00 2006 +0100
+++ b/tools/xm-test/tests/memset/03_memset_random_pos.py        Mon May  1 
09:50:46 2006 -0400
@@ -22,14 +22,24 @@ except DomainError, e:
     FAIL(str(e))

 times = random.randint(10,50)
-origmem = domain.config.getOpt("memory")
-currmem = domain.config.getOpt("memory")

 try:
     console = XmConsole(domain.getName())
     console.sendInput("input")
 except ConsoleError, e:
     FAIL(str(e))
+
+try:
+    run = console.runCmd("cat /proc/xen/balloon | grep Current");
+except ConsoleError, e:
+    FAIL(str(e))
+
+match = re.match("[^0-9]+([0-9]+)", run["output"])
+if not match:
+    FAIL("Invalid domU meminfo line")
+
+origmem = int(match.group(1)) / 1024
+currmem = origmem

 for i in range(0,times):
     amt = random.randint(-10,10)


Attachment: memset.patch
Description: Binary data

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>