ia64/xen-unstable

diff 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)
parents
children bef7f5fcf207
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/tools/xm-test/tests/create/16_create_smallmem_neg.py	Wed Apr 19 22:58:03 2006 +0100
     1.3 @@ -0,0 +1,32 @@
     1.4 +#!/usr/bin/python
     1.5 +
     1.6 +# Copyright (C) International Business Machines Corp., 2005
     1.7 +# Author: Dan Smith <danms@us.ibm.com>
     1.8 +
     1.9 +from XmTestLib import *
    1.10 +
    1.11 +# This is under the default lower limit of 32 and we expect this test
    1.12 +# to fail. 16MBs isn't enough for the -xen kernel.
    1.13 +MEM = 16
    1.14 +
    1.15 +domain = XmTestDomain(extraConfig={"memory": MEM,
    1.16 +                                   "extra" :"mem=%iM" % MEM})
    1.17 +
    1.18 +try:
    1.19 +    domain.start()
    1.20 +except DomainError, e:
    1.21 +    FAIL("Unable to start a domain with %i MB" % MEM)
    1.22 +
    1.23 +try:
    1.24 +    console = XmConsole(domain.getName())
    1.25 +    console.sendInput("input")
    1.26 +    console.runCmd("ls")
    1.27 +except ConsoleError, e:
    1.28 +    if e.reason == RUNAWAY:
    1.29 +        print "Domain with %i MB has runaway console as expected" % MEM
    1.30 +    else:
    1.31 +        print "Starting a domain with %i MB failed as expected" % MEM
    1.32 +else:
    1.33 +    FAIL("Starting a console with %i MB passed, expected test to fail" % MEM)
    1.34 +
    1.35 +domain.destroy()