source: trunk/packages/xen-3.1/xen-3.1/tools/xm-test/tests/block-list/01_block-list_pos.py @ 34

Last change on this file since 34 was 34, checked in by hartmans, 18 years ago

Add xen and xen-common

  • Property svn:mime-type set to text/script
File size: 1.1 KB
Line 
1#!/usr/bin/python
2                                                                                             
3# Copyright (C) International Business Machines Corp., 2005
4# Author: Li Ge <lge@us.ibm.com)
5
6# Positive Test: create domain with block attached at build time, verify list
7
8
9from XmTestLib import *
10
11if ENABLE_HVM_SUPPORT:
12    SKIP("Block-list not supported for HVM domains")
13
14config = {"disk":"phy:/dev/ram0,xvda1,w"}
15domain = XmTestDomain(extraConfig=config)
16
17try:
18    console = domain.start()
19except DomainError, e:
20    if verbose:
21        print e.extra
22    FAIL("Unable to create domain")
23
24status, output = traceCommand("xm block-list %s" % domain.getId())
25eyecatcher = "51713"
26where = output.find(eyecatcher)
27if status != 0:
28    FAIL("xm block-list returned bad status, expected 0, status is %i" % status)
29elif where < 0:
30    FAIL("Fail to list block device")
31
32#Verify the block device on DomainU
33try:
34    run = console.runCmd("cat /proc/partitions | grep xvda1")
35except ConsoleError, e:
36    saveLog(console.getHistory())
37    FAIL(str(e))
38
39domain.stop()
40
41if run["return"] != 0:
42    FAIL("Failed to verify that block dev is attached on DomainU")
Note: See TracBrowser for help on using the repository browser.