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.3 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 | |
---|
10 | if ENABLE_HVM_SUPPORT: |
---|
11 | SKIP("Block-attach not supported for HVM domains") |
---|
12 | |
---|
13 | # Create a domain (default XmTestDomain, with our ramdisk) |
---|
14 | domain = XmTestDomain() |
---|
15 | |
---|
16 | try: |
---|
17 | console = domain.start() |
---|
18 | except DomainError, e: |
---|
19 | if verbose: |
---|
20 | print "Failed to create test domain because:" |
---|
21 | print e.extra |
---|
22 | FAIL(str(e)) |
---|
23 | |
---|
24 | try: |
---|
25 | console.setHistorySaveCmds(value=True) |
---|
26 | # Run 'ls' |
---|
27 | run = console.runCmd("ls") |
---|
28 | except ConsoleError, e: |
---|
29 | saveLog(console.getHistory()) |
---|
30 | FAIL(str(e)) |
---|
31 | |
---|
32 | status, output = traceCommand("xm block-attach %s file:/dev/NOT-EXIST xvda1 w" % domain.getName()) |
---|
33 | eyecatcher = "Error" |
---|
34 | where = re.compile(eyecatcher, re.IGNORECASE).search(output) |
---|
35 | if status == 0: |
---|
36 | FAIL("xm block-attach returned bad status, expected non 0, status is: %i" % status ) |
---|
37 | elif where is None: |
---|
38 | FAIL("xm block-attach returned bad output, expected Error, output is: %s" % output ) |
---|
39 | |
---|
40 | try: |
---|
41 | run = console.runCmd("cat /proc/partitions") |
---|
42 | except ConsoleError, e: |
---|
43 | FAIL(str(e)) |
---|
44 | |
---|
45 | # Close the console |
---|
46 | domain.closeConsole() |
---|
47 | |
---|
48 | # Stop the domain (nice shutdown) |
---|
49 | domain.stop() |
---|
50 | |
---|
51 | if re.search("xvda1",run["output"]): |
---|
52 | FAIL("Non existent Device was connected to the domU") |
---|
Note: See
TracBrowser
for help on using the repository browser.