ia64/xen-unstable

changeset 11960:fd5140c2854f

Fix Memory assumptions in the create tests.

Use the architecture specified idea of minimum memory.

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
author Ewan Mellor <ewan@xensource.com>
date Tue Oct 24 14:52:20 2006 +0100 (2006-10-24)
parents 55ff34dceb0b
children d246b79986d1 a661566745ae
files tools/xm-test/tests/create/11_create_concurrent_pos.py tools/xm-test/tests/create/12_create_concurrent_stress_pos.py tools/xm-test/tests/create/15_create_smallmem_pos.py tools/xm-test/tests/create/16_create_smallmem_neg.py
line diff
     1.1 --- a/tools/xm-test/tests/create/11_create_concurrent_pos.py	Tue Oct 24 14:48:06 2006 +0100
     1.2 +++ b/tools/xm-test/tests/create/11_create_concurrent_pos.py	Tue Oct 24 14:52:20 2006 +0100
     1.3 @@ -16,7 +16,7 @@ else:
     1.4      MAX_DOMS = 50
     1.5  
     1.6  MIN_DOMS    = 5
     1.7 -MEM_PER_DOM = 24
     1.8 +MEM_PER_DOM = minSafeMem()
     1.9  
    1.10  domains = []
    1.11  console = []
     2.1 --- a/tools/xm-test/tests/create/12_create_concurrent_stress_pos.py	Tue Oct 24 14:48:06 2006 +0100
     2.2 +++ b/tools/xm-test/tests/create/12_create_concurrent_stress_pos.py	Tue Oct 24 14:52:20 2006 +0100
     2.3 @@ -8,11 +8,18 @@ from XmTestLib import *
     2.4  import time
     2.5  
     2.6  DOMS=5
     2.7 -MEM=32
     2.8 +MEM=minSafeMem()
     2.9  DUR=60
    2.10  
    2.11  domains = []
    2.12  
    2.13 +free_mem = int(getInfo("free_memory"))
    2.14 +NUM_DOMS = int(free_mem / MEM)
    2.15 +
    2.16 +if NUM_DOMS < DOMS:
    2.17 +    SKIP("Need %i MB of RAM to start %i@%iMB domains! (%i MB avail)" %
    2.18 +         (DOMS * MEM, DOMS, MEM, free_mem))
    2.19 +
    2.20  for i in range(0,DOMS):
    2.21      dom = XmTestDomain(extraConfig={"memory" : MEM})
    2.22  
     3.1 --- a/tools/xm-test/tests/create/15_create_smallmem_pos.py	Tue Oct 24 14:48:06 2006 +0100
     3.2 +++ b/tools/xm-test/tests/create/15_create_smallmem_pos.py	Tue Oct 24 14:52:20 2006 +0100
     3.3 @@ -5,8 +5,8 @@
     3.4  
     3.5  from XmTestLib import *
     3.6  
     3.7 -# 32MBs is the default lower limit for creating domains, it should work
     3.8 -MEM = 32
     3.9 +# Create a domain with the minimum memory allocation
    3.10 +MEM = minSafeMem()
    3.11  
    3.12  domain = XmTestDomain(extraConfig={"memory": MEM,
    3.13                                     "extra" :"mem=%iM" % MEM})
     4.1 --- a/tools/xm-test/tests/create/16_create_smallmem_neg.py	Tue Oct 24 14:48:06 2006 +0100
     4.2 +++ b/tools/xm-test/tests/create/16_create_smallmem_neg.py	Tue Oct 24 14:52:20 2006 +0100
     4.3 @@ -3,6 +3,7 @@
     4.4  # Copyright (C) International Business Machines Corp., 2005
     4.5  # Author: Dan Smith <danms@us.ibm.com>
     4.6  
     4.7 +import re
     4.8  from XmTestLib import *
     4.9  
    4.10  # This is under the default lower limit of 32 and we expect this test
    4.11 @@ -16,13 +17,14 @@ try:
    4.12      console = domain.start()
    4.13      console.runCmd("ls")
    4.14  except DomainError, e:
    4.15 -    FAIL("Unable to start a domain with %i MB" % MEM)
    4.16 +    if not re.search('^Error: Domain memory must be at least \d+ KB', e.extra):
    4.17 +        # PPC gracefully fails like this, rather than crashing.
    4.18 +        FAIL("Unable to start a domain with %i MB" % MEM)
    4.19  except ConsoleError, e:
    4.20      if e.reason == RUNAWAY:
    4.21          print "Domain with %i MB has runaway console as expected" % MEM
    4.22 -    else:
    4.23 -        print "Starting a domain with %i MB failed as expected" % MEM
    4.24  else:
    4.25      FAIL("Starting a console with %i MB passed, expected test to fail" % MEM)
    4.26  
    4.27 +print "Starting a domain with %i MB failed as expected" % MEM
    4.28  domain.destroy()