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.0 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 | from XmTestLib import * |
---|
7 | from XmTestLib.block_utils import * |
---|
8 | |
---|
9 | import re, time |
---|
10 | |
---|
11 | def checkXmLongList(domain): |
---|
12 | s, o = traceCommand("xm list --long %s" % domain.getName()) |
---|
13 | if s != 0: |
---|
14 | FAIL("xm list --long <dom> failed") |
---|
15 | if re.search("xvda1", o): |
---|
16 | return True |
---|
17 | else: |
---|
18 | return False |
---|
19 | |
---|
20 | if ENABLE_HVM_SUPPORT: |
---|
21 | SKIP("Block-detach not supported for HVM domains") |
---|
22 | |
---|
23 | domain = XmTestDomain() |
---|
24 | |
---|
25 | try: |
---|
26 | domain.start() |
---|
27 | except DomainError,e: |
---|
28 | FAIL(str(e)) |
---|
29 | |
---|
30 | block_attach(domain, "phy:/dev/ram0", "xvda1") |
---|
31 | |
---|
32 | if not checkXmLongList(domain): |
---|
33 | FAIL("xm long list does not show that xvda1 was attached") |
---|
34 | |
---|
35 | block_detach(domain, "xvda1") |
---|
36 | |
---|
37 | if checkXmLongList(domain): |
---|
38 | # device info is removed by hotplug scripts - give them a chance |
---|
39 | # to fire (they run asynchronously with us). |
---|
40 | time.sleep(1) |
---|
41 | if checkXmLongList(domain): |
---|
42 | FAIL("xm long list does not show that xvda1 was removed") |
---|
Note: See
TracBrowser
for help on using the repository browser.