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: Murillo F. Bernardes <mfb@br.ibm.com> |
---|
5 | |
---|
6 | import re |
---|
7 | |
---|
8 | from XmTestLib import * |
---|
9 | from XmTestLib.block_utils import * |
---|
10 | |
---|
11 | if ENABLE_HVM_SUPPORT: |
---|
12 | SKIP("Block-attach not supported for HVM domains") |
---|
13 | |
---|
14 | # Create a domain (default XmTestDomain, with our ramdisk) |
---|
15 | domain = XmTestDomain() |
---|
16 | |
---|
17 | try: |
---|
18 | console = domain.start() |
---|
19 | except DomainError, e: |
---|
20 | if verbose: |
---|
21 | print "Failed to create test domain because:" |
---|
22 | print e.extra |
---|
23 | FAIL(str(e)) |
---|
24 | |
---|
25 | try: |
---|
26 | console.setHistorySaveCmds(value=True) |
---|
27 | # Run 'ls' |
---|
28 | run = console.runCmd("ls") |
---|
29 | except ConsoleError, e: |
---|
30 | saveLog(console.getHistory()) |
---|
31 | FAIL(str(e)) |
---|
32 | |
---|
33 | |
---|
34 | for i in range(10): |
---|
35 | block_attach(domain, "phy:ram1", "xvda1") |
---|
36 | run = console.runCmd("cat /proc/partitions") |
---|
37 | if not re.search("xvda1", run["output"]): |
---|
38 | FAIL("Failed to attach block device: /proc/partitions does not show that!") |
---|
39 | |
---|
40 | block_detach(domain, "xvda1") |
---|
41 | run = console.runCmd("cat /proc/partitions") |
---|
42 | if re.search("xvda1", run["output"]): |
---|
43 | FAIL("Failed to dettach block device: /proc/partitions still showing that!") |
---|
44 | |
---|
45 | # Close the console |
---|
46 | domain.closeConsole() |
---|
47 | |
---|
48 | # Stop the domain (nice shutdown) |
---|
49 | domain.stop() |
---|
Note: See
TracBrowser
for help on using the repository browser.