ools - xen/xen - xen
aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xm-test/tests/reboot/02_reboot_badopt_neg.py
blob: cfcd52c021a207283b56f7cd472fbae6dcc392cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/python

# Copyright (C) International Business Machines Corp., 2005
# Author: Li Ge <lge@us.ibm.com>

import time
import re

from XmTestLib import *

domain = XmTestDomain()

try:
    domain.start()
except DomainError, e:
    if verbose:
        print "Failed to create test domain because:"
        print e.extra
    FAIL(str(e))

status, output = traceCommand("xm reboot -x %s" % domain.getName())

eyecatcher = "Error"
where = output.find(eyecatcher)
if status == 0:
    domain.destroy()
    FAIL("xm reboot returned invalid %i == 0" % status )
elif where > 1:
    domain.destroy()
    FAIL("xm reboot failed to report error for bad arg")

domain.destroy()