Changeset 7a887871 in trunk
- Timestamp:
- 2011-01-18T20:46:59Z (14 years ago)
- Branches:
- master
- Children:
- 420aadd
- Parents:
- fc98ade
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/allmydata/scripts/debug.py ¶
rfc98ade r7a887871 2 2 # do not import any allmydata modules at this level. Do that from inside 3 3 # individual functions instead. 4 import struct, time, os 4 import struct, time, os, sys 5 5 from twisted.python import usage, failure 6 6 from twisted.internet import defer 7 from twisted.scripts import trial as twisted_trial 7 8 8 9 … … 785 786 786 787 788 DEFAULT_TESTSUITE = 'allmydata' 789 790 class TrialOptions(twisted_trial.Options): 791 def getSynopsis(self): 792 return "Usage: tahoe debug trial [options] [[file|package|module|TestCase|testmethod]...]" 793 794 def parseOptions(self, all_subargs, *a, **kw): 795 self.trial_args = list(all_subargs) 796 return twisted_trial.Options.parseOptions(self, all_subargs, *a, **kw) 797 798 def parseArgs(self, *nonoption_args): 799 if not nonoption_args: 800 self.trial_args.append(DEFAULT_TESTSUITE) 801 802 def getUsage(self, width=None): 803 t = twisted_trial.Options.getUsage(self, width) 804 t += """ 805 The 'tahoe debug trial' command uses the correct imports for this instance of 806 Tahoe-LAFS. The default test suite is '%s'. 807 """ % (DEFAULT_TESTSUITE,) 808 return t 809 810 def trial(config): 811 sys.argv = ['trial'] + config.trial_args 812 813 # This does not return. 814 twisted_trial.run() 815 816 787 817 class DebugCommand(usage.Options): 788 818 subCommands = [ … … 794 824 ["corrupt-share", None, CorruptShareOptions, "Corrupt a share by flipping a bit."], 795 825 ["repl", None, ReplOptions, "Open a Python interpreter."], 826 ["trial", None, TrialOptions, "Run tests using Twisted Trial with the right imports."], 796 827 ] 797 828 def postOptions(self): … … 810 841 tahoe debug corrupt-share Corrupt a share by flipping a bit. 811 842 tahoe debug repl Open a Python interpreter. 843 tahoe debug trial Run tests using Twisted Trial with the right imports. 812 844 813 845 Please run e.g. 'tahoe debug dump-share --help' for more details on each … … 823 855 "corrupt-share": corrupt_share, 824 856 "repl": repl, 857 "trial": trial, 825 858 } 826 859
Note: See TracChangeset
for help on using the changeset viewer.