view tools/xm-test/tests/create/16_create_smallmem_neg.py @ 9786:a22ce69dd703

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@us.ibm.com>
author stekloff@dyn9047022152.beaverton.ibm.com
date Wed Apr 19 22:58:03 2006 +0100 (2006-04-19)
children bef7f5fcf207
line source
1 #!/usr/bin/python
3 # Copyright (C) International Business Machines Corp., 2005
4 # Author: Dan Smith <danms@us.ibm.com>
6 from XmTestLib import *
8 # This is under the default lower limit of 32 and we expect this test
9 # to fail. 16MBs isn't enough for the -xen kernel.
10 MEM = 16
12 domain = XmTestDomain(extraConfig={"memory": MEM,
13 "extra" :"mem=%iM" % MEM})
15 try:
16 domain.start()
17 except DomainError, e:
18 FAIL("Unable to start a domain with %i MB" % MEM)
20 try:
21 console = XmConsole(domain.getName())
22 console.sendInput("input")
23 console.runCmd("ls")
24 except ConsoleError, e:
25 if e.reason == RUNAWAY:
26 print "Domain with %i MB has runaway console as expected" % MEM
27 else:
28 print "Starting a domain with %i MB failed as expected" % MEM
29 else:
30 FAIL("Starting a console with %i MB passed, expected test to fail" % MEM)
32 domain.destroy()