ia64/xen-unstable

view tools/xm-test/tests/create/11_create_concurrent_pos.py @ 19848:5839491bbf20

[IA64] replace MAX_VCPUS with d->max_vcpus where necessary.

don't use MAX_VCPUS, and use vcpu::max_vcpus.
The changeset of 2f9e1348aa98 introduced max_vcpus to allow more vcpus
per guest. This patch is ia64 counter part.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Isaku Yamahata <yamahata@valinux.co.jp>
date Mon Jun 29 11:26:05 2009 +0900 (2009-06-29)
parents fd5140c2854f
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
9 import random
11 if ENABLE_HVM_SUPPORT:
12 MAX_DOMS = getMaxHVMDomains()
13 if MAX_DOMS > 50:
14 MAX_DOMS = 50
15 else:
16 MAX_DOMS = 50
18 MIN_DOMS = 5
19 MEM_PER_DOM = minSafeMem()
21 domains = []
22 console = []
24 free_mem = int(getInfo("free_memory"))
26 NUM_DOMS = free_mem / MEM_PER_DOM
28 if NUM_DOMS < MIN_DOMS:
29 SKIP("Need %i MB of RAM to start %i@%iMB domains! (%i MB avail)" %
30 (MIN_DOMS * MEM_PER_DOM, MIN_DOMS, MEM_PER_DOM,
31 free_mem))
33 if NUM_DOMS > MAX_DOMS:
34 if verbose:
35 print "*** %i doms is too many: capping at %i" % (NUM_DOMS, MAX_DOMS)
36 NUM_DOMS = MAX_DOMS
38 if verbose:
39 print "Watch out! I'm trying to create %i DomUs!" % NUM_DOMS
41 for d in range(0, NUM_DOMS):
42 dom = XmTestDomain(name="11_create_%i" % d,
43 extraConfig={"memory":MEM_PER_DOM})
45 try:
46 cons = dom.start()
47 except DomainError, e:
48 if verbose:
49 print str(e)
50 FAIL("[%i] Failed to create domain" % d)
52 try:
53 cons.runCmd("ls")
54 except ConsoleError, e:
55 FAIL("[%i] Failed to attach console to %s" % (d, dom.getName()))
57 domains.append(dom)
58 console.append(cons)
60 if verbose:
61 print "[%i] Started %s" % (d, dom.getName())
64 # If we make it here, we will test several of the DomUs consoles
66 for i in range(0,5):
67 c = random.randint(0, NUM_DOMS-1)
69 if verbose:
70 print "Testing console of %s" % domains[c].getName()
72 try:
73 run = console[c].runCmd("ls")
74 except ConsoleError, e:
75 FAIL(str(e))
77 if run["return"] != 0:
78 FAIL("'ls' returned invalid %i != 0" % run["return"])