ia64/xen-unstable

view tools/xm-test/tests/block-destroy/06_block-destroy_check_list_pos.py @ 13256:b82e1ed0870a

[XM-TEST] Tweak 06_block-destroy_check_list_pos to allow more time to check
block device has gone away from point of view of domain sxp.

Signed-off-by: Steven Hand <steven@xensource.com>
author Steven Hand <steven@xensource.com>
date Thu Jan 04 15:08:40 2007 +0000 (2007-01-04)
parents 52732dd77150
children
line source
1 #!/usr/bin/python
3 # Copyright (C) International Business Machines Corp., 2005
4 # Author: Dan Smith <danms@us.ibm.com>
6 from XmTestLib import *
7 from XmTestLib.block_utils import *
9 import re, time
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
20 if ENABLE_HVM_SUPPORT:
21 SKIP("Block-detach not supported for HVM domains")
23 domain = XmTestDomain()
25 try:
26 domain.start()
27 except DomainError,e:
28 FAIL(str(e))
30 block_attach(domain, "phy:/dev/ram0", "xvda1")
32 if not checkXmLongList(domain):
33 FAIL("xm long list does not show that xvda1 was attached")
35 block_detach(domain, "xvda1")
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")