Files
xen/tools/xm-test/tests/block-list/01_block-list_pos.py
T
Ewan Mellor 3cb85f33f0 Update all block tests to use the Xen Virtual Block Device (xvd) rather than IDEor SCSI.
This patch also modifies
09_block_attach_and_dettach_device_check_data_pos.py to force / to be
read-write otherwise the mkdir fails.

Also Whistspace cleanups.

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
2006-11-01 08:39:45 +00:00

43 lines
1.1 KiB
Python

#!/usr/bin/python
# Copyright (C) International Business Machines Corp., 2005
# Author: Li Ge <lge@us.ibm.com)
# Positive Test: create domain with block attached at build time, verify list
from XmTestLib import *
if ENABLE_HVM_SUPPORT:
SKIP("Block-list not supported for HVM domains")
config = {"disk":"phy:/dev/ram0,xvda1,w"}
domain = XmTestDomain(extraConfig=config)
try:
console = domain.start()
except DomainError, e:
if verbose:
print e.extra
FAIL("Unable to create domain")
status, output = traceCommand("xm block-list %s" % domain.getId())
eyecatcher = "51713"
where = output.find(eyecatcher)
if status != 0:
FAIL("xm block-list returned bad status, expected 0, status is %i" % status)
elif where < 0:
FAIL("Fail to list block device")
#Verify the block device on DomainU
try:
run = console.runCmd("cat /proc/partitions | grep xvda1")
except ConsoleError, e:
saveLog(console.getHistory())
FAIL(str(e))
domain.stop()
if run["return"] != 0:
FAIL("Failed to verify that block dev is attached on DomainU")