source: trunk/packages/xen-3.1/xen-3.1/tools/xm-test/tests/help/06_help_allcmds.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: 976 bytes
Line 
1#!/usr/bin/python
2
3# Copyright (C) International Business Machines Corp., 2005
4# Author: Dan Smith <danms@us.ibm.com>
5
6from XmTestLib import *
7
8import re
9
10MAX_ARGS = 10
11
12# These commands aren't suitable for this test, so we
13# ignore them
14skipcommands = ["top", "log"]
15
16status, output = traceCommand("xm help --long")
17
18commands = []
19badcommands = []
20
21lines = output.split("\n")
22for l in lines:
23    match = re.match("^    ([a-z][^ ]+).*$", l)
24    if match:
25        commands.append(match.group(1))
26
27for c in commands:
28    if c in skipcommands:
29        continue
30
31    arglist = ""
32    for i in range(0,MAX_ARGS+1):
33        if i > 0:
34            arglist += "%i " % i
35
36        status, output = traceCommand("xm %s %s" % (c, arglist))
37
38        if output.find("Traceback") != -1:
39            badcommands.append(c + " " + arglist)
40            if verbose:
41                print "Got Traceback: %s %s" % (c, arglist)
42
43if badcommands:
44    FAIL("Got a traceback on: %s" % str(badcommands))
Note: See TracBrowser for help on using the repository browser.