ia64/xen-unstable

view tools/xm-test/tests/create/11_create_concurrent_pos.py @ 7685:40f3ce3516cb

1. Unmark the 07 and 08 tests of block_attach as XFAIL
2. Change the MEM_PER_DOM amount in 11_create_concurrent to 24MB, so
that the test will run on x86_64.
3. Increase the number of DomUs created in 12_create_concurrent to 5
4. Fix a logic error in 01_unpause
5. Add a test 06_help that checks all xm commands with 0-10 arguments
to make sure none of them traceback with varying argument counts.

Signed-off-by: Dan Smith <danms@us.ibm.com>
author emellor@leeni.uk.xensource.com
date Tue Nov 08 11:56:55 2005 +0100 (2005-11-08)
parents ecb5997f7b25
children 1dc393b65019
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
9 import random
11 MIN_DOMS = 10
12 MAX_DOMS = 50
13 MEM_PER_DOM = 24
15 domains = []
16 console = []
18 free_mem = int(getInfo("free_memory"))
20 NUM_DOMS = free_mem / MEM_PER_DOM
22 if NUM_DOMS < MIN_DOMS:
23 SKIP("Need %i MB of RAM to start %i@%iMB domains! (%i MB avail)" %
24 (MIN_DOMS * MEM_PER_DOM, MIN_DOMS, MEM_PER_DOM,
25 free_mem))
27 if NUM_DOMS > MAX_DOMS:
28 if verbose:
29 print "*** %i doms is too many: capping at %i" % (NUM_DOMS, MAX_DOMS)
30 NUM_DOMS = MAX_DOMS
32 if verbose:
33 print "Watch out! I'm trying to create %i DomUs!" % NUM_DOMS
35 for d in range(0, NUM_DOMS):
36 dom = XmTestDomain(name="11_create_%i" % d,
37 extraOpts={"memory":str(MEM_PER_DOM)})
39 try:
40 dom.start()
41 except DomainError, e:
42 if verbose:
43 print str(e)
44 FAIL("[%i] Failed to create domain" % d)
46 try:
47 cons = XmConsole(dom.getName())
48 cons.sendInput("foo")
49 cons.runCmd("ls")
50 except ConsoleError, e:
51 FAIL("[%i] Failed to attach console to %s" % (d, dom.getName()))
53 domains.append(dom)
54 console.append(cons)
56 if verbose:
57 print "[%i] Started %s" % (d, dom.getName())
60 # If we make it here, we will test several of the DomUs consoles
62 for i in range(0,5):
63 c = random.randint(0, NUM_DOMS-1)
65 if verbose:
66 print "Testing console of %s" % domains[c].getName()
68 try:
69 run = console[c].runCmd("ls")
70 except ConsoleError, e:
71 FAIL(str(e))
73 if run["return"] != 0:
74 FAIL("'ls' returned invalid %i != 0" % run["return"])