ia64/xen-unstable

changeset 7690:8e1703090053

Added file missed on commit of earlier patch by Dan Smith.
author emellor@leeni.uk.xensource.com
date Tue Nov 08 12:30:38 2005 +0100 (2005-11-08)
parents 53f52fc28f8b
children a5195bf5671d
files tools/xm-test/tests/help/06_help_allcmds.py
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/tools/xm-test/tests/help/06_help_allcmds.py	Tue Nov 08 12:30:38 2005 +0100
     1.3 @@ -0,0 +1,44 @@
     1.4 +#!/usr/bin/python
     1.5 +
     1.6 +# Copyright (C) International Business Machines Corp., 2005
     1.7 +# Author: Dan Smith <danms@us.ibm.com>
     1.8 +
     1.9 +from XmTestLib import *
    1.10 +
    1.11 +import re
    1.12 +
    1.13 +MAX_ARGS = 10
    1.14 +
    1.15 +# These commands aren't suitable for this test, so we
    1.16 +# ignore them
    1.17 +skipcommands = ["top", "log"]
    1.18 +
    1.19 +status, output = traceCommand("xm help --long")
    1.20 +
    1.21 +commands = []
    1.22 +badcommands = []
    1.23 +
    1.24 +lines = output.split("\n")
    1.25 +for l in lines:
    1.26 +    match = re.match("^    ([a-z][^ ]+).*$", l)
    1.27 +    if match:
    1.28 +        commands.append(match.group(1))
    1.29 +
    1.30 +for c in commands:
    1.31 +    if c in skipcommands:
    1.32 +        continue
    1.33 +
    1.34 +    arglist = ""
    1.35 +    for i in range(0,MAX_ARGS+1):
    1.36 +        if i > 0:
    1.37 +            arglist += "%i " % i
    1.38 +
    1.39 +        status, output = traceCommand("xm %s %s" % (c, arglist))
    1.40 +
    1.41 +        if output.find("Traceback") != -1:
    1.42 +            badcommands.append(c + " " + arglist)
    1.43 +            if verbose:
    1.44 +                print "Got Traceback: %s %s" % (c, arglist)
    1.45 +
    1.46 +if badcommands:
    1.47 +    FAIL("Got a traceback on: %s" % str(badcommands))