3
# Copyright (C) International Business Machines Corp., 2005
4
# Author: Li Ge <lge@us.ibm.com)
6
# Positive Test: create domain, attach block device, verify list
9
from XmTestLib import *
10
from XmTestLib.block_utils import block_attach
12
if ENABLE_HVM_SUPPORT:
13
SKIP("Block-list not supported for HVM domains")
15
domain = XmTestDomain()
18
console = domain.start()
19
except DomainError, e:
22
FAIL("Unable to create domain")
24
#Attach one virtual block device to domainU
25
block_attach(domain, "phy:/dev/ram0", "xvda1")
27
#Verify block-list on Domain0
28
status, output = traceCommand("xm block-list %s" % domain.getId())
30
where = output.find(eyecatcher)
32
FAIL("xm block-list returned bad status, expected 0, status is %i" % status)
34
FAIL("Fail to list block device")
36
#Verify attached block device on DomainU
38
run = console.runCmd("cat /proc/partitions | grep xvda1")
39
except ConsoleError, e:
40
saveLog(console.getHistory())
45
if run["return"] != 0:
46
FAIL("Failed to verify that block dev is attached on DomainU")