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