diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2001-02-13 17:49:19 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2001-02-13 17:49:19 +0000 |
commit | b4d6afdfb1f5fe1ff3b69708eb9d8d714b81f0cb (patch) | |
tree | e8dfaf8f8829bf5633e4c4e0e8a636c5d68bb583 | |
parent | c26be3ebc71edef37d43c39371e380634af98f9a (diff) | |
download | fetchmail-b4d6afdfb1f5fe1ff3b69708eb9d8d714b81f0cb.tar.gz fetchmail-b4d6afdfb1f5fe1ff3b69708eb9d8d714b81f0cb.tar.bz2 fetchmail-b4d6afdfb1f5fe1ff3b69708eb9d8d714b81f0cb.zip |
We have -v and -p.
svn path=/trunk/; revision=3090
-rwxr-xr-x | torturetest.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/torturetest.py b/torturetest.py index 02c431f2..a27b358f 100755 --- a/torturetest.py +++ b/torturetest.py @@ -84,6 +84,8 @@ class TestSite: return self.id() + ": abnormal termination\n" elif os.WEXITSTATUS(self.status) > 1: return self.id() + ": %d\n" % os.WEXITSTATUS(status) + self.output + else: + return self.id() + ": succeeded\n" if __name__ == "__main__": # Start by reading in the sitelist @@ -98,7 +100,8 @@ if __name__ == "__main__": else: sitelist.append(TestSite(line)) - (options, arguments) = getopt.getopt(sys.argv[1:], "dftig") + (options, arguments) = getopt.getopt(sys.argv[1:], "dfp:tigv") + verbose = 0 for (switch, value) in options: if switch == "-d": # Prettprint the sitelist @@ -108,6 +111,14 @@ if __name__ == "__main__": # Dump the sitelist as a .fetchmailrc file map(lambda x: sys.stdout.write(x.entryprint()), sitelist) sys.exit(0) + elif switch == "-p": + # Probe a single site + selected = [] + for site in sitelist: + if site.id().find(value) > -1: + selected.append(site) + sitelist = selected + # Fall through elif switch == "-t": # Dump the sitelist in HTML table form map(lambda x: sys.stdout.write(x.tableprint()), sitelist) @@ -124,6 +135,9 @@ if __name__ == "__main__": time.sleep(5) sys.stdout.write("here we go:\n") # Fall through + elif switch == "-v": + # Display the test output + verbose = 1 # If no options, run the torture test try: @@ -132,6 +146,8 @@ if __name__ == "__main__": for site in sitelist: print "Testing " + site.id() site.fetch() + if verbose: + print site.output if not site.failed(): failures += 1 else: |