[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Fix the 15_create_smallmem_pos.py test, which was failing because the



# HG changeset patch
# User stekloff@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# Node ID a22ce69dd70396bf53880271daade5aa16d72bfc
# Parent  5b1e10215e38cd1cc5e2385e35a14daa0d346cb4
Fix the 15_create_smallmem_pos.py test, which was failing because the
set console.limit command in the test was never being run. The select in
Console.py was never timing out because there was always someting to read on
the fd, the OOM messages are constant. So the test would hang.

The fix includes:

1) Changing MEM in 15_create_smallmem_pos.py to 32MBs, which is the default
   for the tools that should work.
2) Change the XmConsole init to add an argument to set the console limit
   when it's created.
3) Set a default large limit for console so we won't hang in the future.
4) Added a new 16_create_smallmem_neg.py test to handle failure situation.
5) Added comment in README.

Signed-off-by: Daniel Stekloff <dsteklof@xxxxxxxxxx>

diff -r 5b1e10215e38 -r a22ce69dd703 tools/xm-test/README
--- a/tools/xm-test/README      Wed Apr 19 22:54:49 2006 +0100
+++ b/tools/xm-test/README      Wed Apr 19 22:58:03 2006 +0100
@@ -212,6 +212,24 @@ Known Issues
 Known Issues
 ============
 
+If you create a domain with a small amount of memory, under 32MBs, you
+may run into out of memory situations for the domain. There's no way
+to know the amount of memory needed by the kernel and modules used. Xm-test
+uses 64MBs as default and that should work. If there are out of memory
+issues, the default can be changed. Edit xm-test/lib/XmTestLib/XenDomain.py
+and change ParavirtDefaults and HVMDefaults "memory".
+
+There are two tests that work with small memory, 15_create_smallmem_pos.py 
+and 16_create_smallmem_neg.py. The first makes sure the default 32 MBs 
+limit works. The second checks a low memory fail situation. These tests
+are located in the xm-test/tests/create directory and can be easily edited
+to change the MEM value they should test. If the 32MBs test fails, the
+failure should be reported to the Xen xen-devel mailing list. The Xen
+tools use 32MBs as a lower acceptable limit for domain creation. The Xen
+mailing lists are located here:
+
+http://lists.xensource.com/
+
 
 Reporting Bugs
 ==============
diff -r 5b1e10215e38 -r a22ce69dd703 tools/xm-test/lib/XmTestLib/Console.py
--- a/tools/xm-test/lib/XmTestLib/Console.py    Wed Apr 19 22:54:49 2006 +0100
+++ b/tools/xm-test/lib/XmTestLib/Console.py    Wed Apr 19 22:58:03 2006 +0100
@@ -46,7 +46,7 @@ class ConsoleError(Exception):
 
 class XmConsole:
 
-    def __init__(self, domain, historyLimit=256, historySaveAll=True, 
historySaveCmds=False):
+    def __init__(self, domain, historyLimit=256, historySaveAll=True, 
historySaveCmds=False, cLimit=131072):
         """
         Parameters:
           historyLimit:     specifies how many lines of history are maintained
@@ -65,7 +65,7 @@ class XmConsole:
         self.historySaveAll   = historySaveAll
         self.historySaveCmds  = historySaveCmds
         self.debugMe          = False
-        self.limit            = None
+        self.limit            = cLimit
 
         consoleCmd = ["/usr/sbin/xm", "xm", "console", domain]
 
diff -r 5b1e10215e38 -r a22ce69dd703 
tools/xm-test/tests/create/15_create_smallmem_pos.py
--- a/tools/xm-test/tests/create/15_create_smallmem_pos.py      Wed Apr 19 
22:54:49 2006 +0100
+++ b/tools/xm-test/tests/create/15_create_smallmem_pos.py      Wed Apr 19 
22:58:03 2006 +0100
@@ -5,7 +5,8 @@
 
 from XmTestLib import *
 
-MEM = 16
+# 32MBs is the default lower limit for creating domains, it should work
+MEM = 32
 
 domain = XmTestDomain(extraConfig={"memory": MEM,
                                    "extra" :"mem=%iM" % MEM})
@@ -17,7 +18,6 @@ except DomainError, e:
 
 try:
     console = XmConsole(domain.getName())
-    console.setLimit(65536)
     console.sendInput("input")
     console.runCmd("ls")
 except ConsoleError, e:
diff -r 5b1e10215e38 -r a22ce69dd703 tools/xm-test/tests/create/Makefile.am
--- a/tools/xm-test/tests/create/Makefile.am    Wed Apr 19 22:54:49 2006 +0100
+++ b/tools/xm-test/tests/create/Makefile.am    Wed Apr 19 22:58:03 2006 +0100
@@ -13,7 +13,8 @@ TESTS = 01_create_basic_pos.test \
        12_create_concurrent_stress_pos.test \
        13_create_multinic_pos.test \
        14_create_blockroot_pos.test \
-       15_create_smallmem_pos.test
+       15_create_smallmem_pos.test \
+       16_create_smallmem_neg.test
 
 EXTRA_DIST = $(TESTS)
 
diff -r 5b1e10215e38 -r a22ce69dd703 
tools/xm-test/tests/create/16_create_smallmem_neg.py
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/xm-test/tests/create/16_create_smallmem_neg.py      Wed Apr 19 
22:58:03 2006 +0100
@@ -0,0 +1,32 @@
+#!/usr/bin/python
+
+# Copyright (C) International Business Machines Corp., 2005
+# Author: Dan Smith <danms@xxxxxxxxxx>
+
+from XmTestLib import *
+
+# This is under the default lower limit of 32 and we expect this test
+# to fail. 16MBs isn't enough for the -xen kernel.
+MEM = 16
+
+domain = XmTestDomain(extraConfig={"memory": MEM,
+                                   "extra" :"mem=%iM" % MEM})
+
+try:
+    domain.start()
+except DomainError, e:
+    FAIL("Unable to start a domain with %i MB" % MEM)
+
+try:
+    console = XmConsole(domain.getName())
+    console.sendInput("input")
+    console.runCmd("ls")
+except ConsoleError, e:
+    if e.reason == RUNAWAY:
+        print "Domain with %i MB has runaway console as expected" % MEM
+    else:
+        print "Starting a domain with %i MB failed as expected" % MEM
+else:
+    FAIL("Starting a console with %i MB passed, expected test to fail" % MEM)
+
+domain.destroy()

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.