debuggers.hg

view tools/xm-test/tests/create/12_create_concurrent_stress_pos.py @ 0:7d21f7218375

Exact replica of unstable on 051908 + README-this
author Mukesh Rathor
date Mon May 19 15:34:57 2008 -0700 (2008-05-19)
parents
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())