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 *
10
SKIP("Block-detach not supported for HVM domains")
12
domain = XmTestDomain()
15
console = domain.start()
16
except DomainError, e:
19
FAIL("Unable to create domain")
21
block_attach(domain, "phy:/dev/ram0", "xvda1")
23
run = console.runCmd("cat /proc/partitions | grep xvda1")
24
except ConsoleError, e:
25
saveLog(console.getHistory())
28
if run["return"] != 0:
29
FAIL("Failed to verify that block dev is attached")
31
block_detach(domain, "xvda1")
33
run = console.runCmd("cat /proc/partitions | grep xvda1")
34
except ConsoleError, e:
35
saveLog(console.getHistory())
40
if run["return"] == 0:
41
FAIL("block-detach failed to detach block device")