ia64/xen-unstable

view tools/xm-test/tests/create/12_create_concurrent_stress_pos.py @ 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 bef7f5fcf207
children
line source
1 #!/usr/bin/python
3 # Copyright (C) International Business Machines Corp., 2005
4 # Authors: Dan Smith <danms@us.ibm.com>
6 from XmTestLib import *
8 import time
10 DOMS=5
11 MEM=minSafeMem()
12 DUR=60
14 domains = []
16 free_mem = int(getInfo("free_memory"))
17 NUM_DOMS = int(free_mem / MEM)
19 if NUM_DOMS < DOMS:
20 SKIP("Need %i MB of RAM to start %i@%iMB domains! (%i MB avail)" %
21 (DOMS * MEM, DOMS, MEM, free_mem))
23 for i in range(0,DOMS):
24 dom = XmTestDomain(extraConfig={"memory" : MEM})
26 try:
27 cons = dom.start()
28 except DomainError, e:
29 if verbose:
30 print str(e)
31 FAIL("Failed to start %s" % dom.getName())
33 if verbose:
34 print "[%i/%i] Started %s" % (i, DOMS, dom.getName())
36 domains.append([dom, cons])
38 # Started DOMS domains, now we put them to work
40 for d, c in domains:
41 if verbose:
42 print "Starting task on %s" % d.getName()
43 c.sendInput("gzip -c </dev/zero >/dev/null &\n")
45 if verbose:
46 print "Waiting %i seconds..." % DUR
48 time.sleep(DUR)
50 for d, c in domains:
52 if verbose:
53 print "Testing domain %s..." % d.getName()
55 run = c.runCmd("ls")
57 if run["return"] != 0:
58 FAIL("Domain %s didn't survive!" % d.getName())