|
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 | |
|---|
| 33 | status, output = traceCommand("xm block-attach %s phy:NOT-EXIST xvda1 w" % domain.getName()) |
|---|
| 34 | eyecatcher = "Error" |
|---|
| 35 | where = re.compile(eyecatcher, re.IGNORECASE).search(output) |
|---|
| 36 | if status == 0: |
|---|
| 37 | FAIL("xm block-attach returned bad status, expected non 0, status is: %i" % status ) |
|---|
| 38 | elif where is None: |
|---|
| 39 | FAIL("xm block-attach returned bad output, expected Error, output is: %s" % output ) |
|---|
| 40 | |
|---|
| 41 | try: |
|---|
| 42 | run = console.runCmd("cat /proc/partitions") |
|---|
| 43 | except ConsoleError, e: |
|---|
| 44 | FAIL(str(e)) |
|---|
| 45 | |
|---|
| 46 | # Close the console |
|---|
| 47 | domain.closeConsole() |
|---|
| 48 | |
|---|
| 49 | # Stop the domain (nice shutdown) |
|---|
| 50 | domain.stop() |
|---|
| 51 | |
|---|
| 52 | if re.search("xvda1",run["output"]): |
|---|
| 53 | FAIL("Non existent Device was connected to the domU") |
|---|
Note: See
TracBrowser
for help on using the repository browser.