ia64/xen-unstable

view tools/xm-test/tests/vcpu-pin/01_vcpu-pin_basic_pos.py @ 9362:92b5fa5e8397

Stop the domain at the end of the test.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author emellor@leeni.uk.xensource.com
date Tue Mar 21 11:44:18 2006 +0100 (2006-03-21)
parents ecb5997f7b25
children bef7f5fcf207
line source
1 #!/usr/bin/python
3 # Copyright (C) International Business Machines Corp., 2005
4 # Author: Dan Smith <danms@us.ibm.com>
6 # 1) Make sure we have a multi cpu system
7 # 2) Create a test domain and pin its VCPU0 to CPU 0 and then 1
9 import sys;
10 import re;
12 from XmTestLib import *
14 # Verify that we can run this test on this host
15 if smpConcurrencyLevel() <= 1:
16 print "*** NOTE: This machine does not have more than one physical"
17 print " or logical cpu. The vcpu-pin test cannot be run!"
18 SKIP("Host not capable of running test")
20 domain = XmTestDomain()
22 try:
23 domain.start()
24 except DomainError, e:
25 if verbose:
26 print "Failed to create test domain because:"
27 print e.extra
28 FAIL(str(e))
30 status, output = traceCommand("xm vcpu-pin %s 0 0" % domain.getName())
32 if status != 0:
33 FAIL("xm vcpu-pin returned invalid %i != 0" % status)
35 cpu = getVcpuInfo(domain.getName())[0]
37 if cpu != 0:
38 FAIL("failed to switch VCPU 0 to CPU 0")
40 status, output = traceCommand("xm vcpu-pin %s 0 1" % domain.getName())
42 if status != 0:
43 FAIL("xm vcpu-pin returned invalid %i != 0" % status)
45 cpu = getVcpuInfo(domain.getName())[0]
47 if cpu != 1:
48 FAIL("failed to switch VCPU 0 to CPU 1")
50 domain.stop()