source: trunk/packages/xen-common/xen-common/tools/xm-test/tests/save/03_save_bogusfile_neg.py @ 34

Last change on this file since 34 was 34, checked in by hartmans, 17 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# Test Description:
6# Negative Test:
7# Create a new domain. Save this domain to bogus file reference. Verify fail.
8
9import time
10
11from XmTestLib import *
12
13if ENABLE_HVM_SUPPORT:
14    SKIP("Save currently not supported for HVM domains")
15
16domain = XmTestDomain()
17
18try:
19    console = domain.start()
20except DomainError, e:
21    if verbose:
22        print "Failed to create test domain because:"
23        print e.extra
24    FAIL(str(e))
25
26domain.closeConsole()
27
28# Save it out
29status, output = traceCommand("xm save %s /NOWHERE/test.state" % domain.getName())
30eyecatcher1 = "Traceback"
31eyecatcher2 = "Error:"
32where1 = output.find(eyecatcher1)
33where2 = output.find(eyecatcher2)
34if status == 0:
35    FAIL("xm save returned bad status, expected non 0, status is: %i" % status)
36elif where1 == 0:
37    FAIL("xm save returned a stack dump, expected nice error message")
38elif where2 == -1:
39    FAIL("xm save returned bad output, expected Error:, output is: %s" % output)
Note: See TracBrowser for help on using the repository browser.