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 block_detach
10
SKIP("Block-detach not supported for HVM domains")
12
config = {"disk":"phy:/dev/ram0,xvda1,w"}
13
domain = XmTestDomain(extraConfig=config)
16
console = domain.start()
17
except DomainError, e:
20
FAIL("Unable to create domain")
23
run = console.runCmd("cat /proc/partitions | grep xvda1")
24
run2 = console.runCmd("cat /proc/partitions")
25
except ConsoleError, e:
28
if run["return"] != 0:
29
FAIL("block device isn't attached; can't detach!")
31
block_detach(domain, "xvda1")
34
run = console.runCmd("cat /proc/partitions | grep xvda1")
35
except ConsoleError, e:
36
saveLog(console.getHistory())
42
if run["return"] == 0:
43
FAIL("domU reported block device still connected!" % run["return"])