source: trunk/packages/xen-3.1/xen-3.1/tools/xm-test/tests/block-destroy/04_block-destroy_nonattached_neg.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.0 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#Negative Test: attempt removal of non-attached device from live domain
7
8from XmTestLib import *
9
10if ENABLE_HVM_SUPPORT:
11    SKIP("Block-detach not supported for HVM domains")
12
13domain = XmTestDomain()
14                                                                                                       
15try:
16    domain.start(noConsole=True)
17except DomainError, e:
18    if verbose:
19        print e.extra
20    FAIL("Unable to create domain")
21
22status, output = traceCommand("xm block-detach %s xvda1" % domain.getId())
23
24eyecatcher1 = "Error:"
25eyecatcher2 = "Traceback"
26where1 = output.find(eyecatcher1)
27where2 = output.find(eyecatcher2)
28if status == 0:
29    FAIL("xm block-detach returned bad status, expected non 0, status is: %i" % status)
30elif where2 == 0:
31    FAIL("xm block-detach returned a stack dump, expected nice error message")
32elif where1 < 0:
33    FAIL("xm block-detach returned bad output, expected Error:, output is: %s" % output)
Note: See TracBrowser for help on using the repository browser.