Last change
on this file since 34 was
34,
checked in by hartmans, 18 years ago
|
Add xen and xen-common
|
-
Property svn:mime-type set to
text/script
|
File size:
1.2 KB
|
Line | |
---|
1 | #!/usr/bin/python |
---|
2 | |
---|
3 | # Copyright (C) International Business Machines Corp., 2005 |
---|
4 | # Author: Dan Smith <danms@us.ibm.com> |
---|
5 | |
---|
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 |
---|
8 | |
---|
9 | import sys; |
---|
10 | import re; |
---|
11 | |
---|
12 | from XmTestLib import * |
---|
13 | |
---|
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") |
---|
19 | |
---|
20 | domain = XmTestDomain() |
---|
21 | |
---|
22 | try: |
---|
23 | domain.start(noConsole=True) |
---|
24 | except DomainError, e: |
---|
25 | if verbose: |
---|
26 | print "Failed to create test domain because:" |
---|
27 | print e.extra |
---|
28 | FAIL(str(e)) |
---|
29 | |
---|
30 | status, output = traceCommand("xm vcpu-pin %s 0 0" % domain.getName()) |
---|
31 | |
---|
32 | if status != 0: |
---|
33 | FAIL("xm vcpu-pin returned invalid %i != 0" % status) |
---|
34 | |
---|
35 | cpu = getVcpuInfo(domain.getName())[0] |
---|
36 | |
---|
37 | if cpu != 0: |
---|
38 | FAIL("failed to switch VCPU 0 to CPU 0") |
---|
39 | |
---|
40 | status, output = traceCommand("xm vcpu-pin %s 0 1" % domain.getName()) |
---|
41 | |
---|
42 | if status != 0: |
---|
43 | FAIL("xm vcpu-pin returned invalid %i != 0" % status) |
---|
44 | |
---|
45 | cpu = getVcpuInfo(domain.getName())[0] |
---|
46 | |
---|
47 | if cpu != 1: |
---|
48 | FAIL("failed to switch VCPU 0 to CPU 1") |
---|
49 | |
---|
50 | domain.stop() |
---|
Note: See
TracBrowser
for help on using the repository browser.