~ubuntu-branches/ubuntu/utopic/xen/utopic

« back to all changes in this revision

Viewing changes to tools/xm-test/tests/shutdown/02_shutdown_badparm_neg.py

  • Committer: Bazaar Package Importer
  • Author(s): Bastian Blank
  • Date: 2010-05-06 15:47:38 UTC
  • mto: (1.3.1) (15.1.1 sid) (4.1.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20100506154738-agoz0rlafrh1fnq7
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
 
12
import commands
 
13
 
 
14
from XmTestLib import *
 
15
 
 
16
eyecatcher = "Error:"
 
17
 
 
18
# Create a domain (default XmTestDomain, with our ramdisk)
 
19
domain = XmTestDomain()
 
20
 
 
21
# Start it
 
22
try:
 
23
    domain.start(noConsole=True)
 
24
except DomainError, e:
 
25
    if verbose:
 
26
        print "Failed to create test domain because:"
 
27
        print e.extra
 
28
    FAIL(str(e))
 
29
 
 
30
 
 
31
ret, output = traceCommand("xm shutdown -x %s" % domain.getName())
 
32
where = output.find(eyecatcher)
 
33
if (ret == 0):
 
34
    FAIL("xm shutdown returned invalid %i == 0" % ret)
 
35
elif where == -1:
 
36
    FAIL("xm shutdown failed to report error for bad arg")
 
37
 
 
38
# Stop the domain (nice shutdown)
 
39
domain.stop()