ia64/xen-unstable

annotate tools/xm-test/tests/create/15_create_smallmem_pos.py @ 7870:cbf6f95e9c62

Test for creating a domain with too little memory.
author dan@guaranine.beaverton.ibm.com
date Wed Nov 16 20:33:12 2005 +0100 (2005-11-16)
parents
children 7209244ea3d1
rev   line source
dan@7870 1 #!/usr/bin/python
dan@7870 2
dan@7870 3 # Copyright (C) International Business Machines Corp., 2005
dan@7870 4 # Author: Dan Smith <danms@us.ibm.com>
dan@7870 5
dan@7870 6 from XmTestLib import *
dan@7870 7
dan@7870 8 MEM = 16
dan@7870 9
dan@7870 10 domain = XmTestDomain(extraOpts={"memory":"%i" % MEM})
dan@7870 11
dan@7870 12 try:
dan@7870 13 domain.start()
dan@7870 14 except DomainError, e:
dan@7870 15 FAIL("Unable to start a domain with %i MB" % MEM)
dan@7870 16
dan@7870 17 try:
dan@7870 18 console = XmConsole(domain.getName())
dan@7870 19 console.sendInput("input")
dan@7870 20 console.runCmd("ls")
dan@7870 21 except ConsoleError, e:
dan@7870 22 if e.reason == RUNAWAY:
dan@7870 23 FAIL("Bug #380: Starting a console with %i MB crashed the console daemon" % MEM)
dan@7870 24 else:
dan@7870 25 FAIL("Starting a console with %i MB failed: domain dies immediately!" % MEM)
dan@7870 26
dan@7870 27 domain.destroy()