source: trunk/packages/xen-3.1/xen-3.1/tools/xm-test/tests/shutdown/02_shutdown_badparm_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: 881 bytes
Line 
1#!/usr/bin/python
2
3# Copyright (C) International Business Machines Corp., 2005
4# Author: Paul Larson  <pl@us.ibm.com>
5
6# Description:
7# Positive Tests:
8# Test for xm shutdown
9# 1) Create domain
10# 2) call xm shutdown with a bad parameter, expect failure
11
12import commands
13
14from XmTestLib import *
15
16eyecatcher = "Error:"
17
18# Create a domain (default XmTestDomain, with our ramdisk)
19domain = XmTestDomain()
20
21# Start it
22try:
23    domain.start(noConsole=True)
24except DomainError, e:
25    if verbose:
26        print "Failed to create test domain because:"
27        print e.extra
28    FAIL(str(e))
29
30
31ret, output = traceCommand("xm shutdown -x %s" % domain.getName())
32where = output.find(eyecatcher)
33if (ret == 0):
34    FAIL("xm shutdown returned invalid %i == 0" % ret)
35elif where == -1:
36    FAIL("xm shutdown failed to report error for bad arg")
37
38# Stop the domain (nice shutdown)
39domain.stop()
Note: See TracBrowser for help on using the repository browser.