ia64/xen-unstable

view tools/xm-test/tests/create/15_create_smallmem_pos.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)
parents 1dc393b65019
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 # 32MBs is the default lower limit for creating domains, it should work
9 MEM = 32
11 domain = XmTestDomain(extraConfig={"memory": MEM,
12 "extra" :"mem=%iM" % MEM})
14 try:
15 domain.start()
16 except DomainError, e:
17 FAIL("Unable to start a domain with %i MB" % MEM)
19 try:
20 console = XmConsole(domain.getName())
21 console.sendInput("input")
22 console.runCmd("ls")
23 except ConsoleError, e:
24 if e.reason == RUNAWAY:
25 FAIL("Bug #380: Starting a console with %i MB crashed the console daemon" % MEM)
26 else:
27 FAIL("Starting a console with %i MB failed: domain dies immediately!" % MEM)
29 domain.destroy()