mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
correctly. Many checks were looking using output.find("Error") > 1, which is
incorrect, as we do not guarantee that the word "Error" will be first in the
output (never mind the fact that strings are indexed from 0).
All these checks have been changed to compare against -1. In particular, this
should fix the failure of create_noparm_neg and create_badparm_neg on a machine
with the /etc/xen/xmdefconfig file in place, as xm create issues the
Using config file "/etc/xen/xmdefconfig" diagnostic before reporting the error.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
22 lines
524 B
Python
22 lines
524 B
Python
#!/usr/bin/python
|
|
|
|
# Copyright (C) International Business Machines Corp., 2005
|
|
# Author: Li Ge <lge@us.ibm.com>
|
|
|
|
# Test Description:
|
|
# Negative Tests:
|
|
# Test console command with non existent option in the command line.
|
|
# Verify fail.
|
|
|
|
import re
|
|
|
|
from XmTestLib import *
|
|
|
|
status, output = traceCommand("xm console -x")
|
|
eyecatcher = "Error"
|
|
where = output.find(eyecatcher)
|
|
if status == 0:
|
|
FAIL("xm console returned invalid %i != 0" % status)
|
|
elif where == -1:
|
|
FAIL("xm console didn't report error on bad argument")
|