From: Dan S. <dan...@us...> - 2005-11-03 22:49:35
|
Update of /cvsroot/ltp/xmtest/tests/help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10197 Modified Files: Makefile.am Added Files: 06_help_allcmds.py Log Message: New help test to look for tracebacks Index: Makefile.am =================================================================== RCS file: /cvsroot/ltp/xmtest/tests/help/Makefile.am,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Makefile.am 27 Oct 2005 16:42:54 -0000 1.3 --- Makefile.am 3 Nov 2005 22:49:27 -0000 1.4 *************** *** 5,9 **** 03_help_badparm_neg.test \ 04_help_long_pos.test \ ! 05_help_nonroot_pos.test XFAIL_TESTS = --- 5,10 ---- 03_help_badparm_neg.test \ 04_help_long_pos.test \ ! 05_help_nonroot_pos.test \ ! 06_help_allcmds.py XFAIL_TESTS = --- NEW FILE: 06_help_allcmds.py --- #!/usr/bin/python # Copyright (C) International Business Machines Corp., 2005 # Author: Dan Smith <da...@us...> from XmTestLib import * import re MAX_ARGS = 10 # These commands aren't suitable for this test, so we # ignore them skipcommands = ["top", "log"] status, output = traceCommand("xm help --long") commands = [] badcommands = [] lines = output.split("\n") for l in lines: match = re.match("^ ([a-z][^ ]+).*$", l) if match: commands.append(match.group(1)) for c in commands: if c in skipcommands: continue arglist = "" for i in range(0,MAX_ARGS+1): if i > 0: arglist += "%i " % i status, output = traceCommand("xm %s %s" % (c, arglist)) if output.find("Traceback") != -1: badcommands.append(c + " " + arglist) if verbose: print "Got Traceback: %s %s" % (c, arglist) if badcommands: FAIL("Got a traceback on: %s" % str(badcommands)) |