From b1a36249699361fd9b477b96981a3fda416de588 Mon Sep 17 00:00:00 2001 From: Matthias Andree Date: Sun, 10 Jul 2005 16:36:19 +0000 Subject: Pull out important configuration to the head of the script. python2 -> python svn path=/trunk/; revision=4106 --- dist-tools/test/torturetest.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'dist-tools') diff --git a/dist-tools/test/torturetest.py b/dist-tools/test/torturetest.py index f8a3535c..0b557382 100755 --- a/dist-tools/test/torturetest.py +++ b/dist-tools/test/torturetest.py @@ -1,7 +1,17 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python import sys, getopt, os, smtplib, commands, time, gtk, gtk.glade +### CUSTOMIZE THESE! +# Mail address to use in From: header, user@host.domain format +fromaddr = "esr@thyrsus.com" +# local user name to receive mail as +localuser = "esr" +# server to inject mail into +smtpserver = "localhost" +# delay after sending mail +delay = 5 + protocols = ('POP3', 'APOP', 'IMAP',) class TestSite: @@ -57,8 +67,8 @@ class TestSite: def entryprint(self): "Print a .fetchmailrc entry corresponding to a site entry." rep = "poll %s-%s via %s with proto %s %s\n" \ - " user %s there with password '%s' is esr here" \ - % (self.host,self.protocol,self.host,self.protocol,self.options,self.username,self.password) + " user %s there with password '%s' is %s here" \ + % (self.host,self.protocol,self.host,self.protocol,self.options,self.username,self.password,localuser) if self.ssl and self.ssl != 'False': rep += " options ssl" rep += "\n\n" @@ -80,8 +90,7 @@ class TestSite: def testmail(self, n=None): "Send test mail to the site." - server = smtplib.SMTP("localhost") - fromaddr = "esr@thyrsus.com" + server = smtplib.SMTP(smtpserver) if self.mailaddr.find("@") > -1: toaddr = self.mailaddr else: @@ -283,7 +292,7 @@ if __name__ == "__main__": i+= 1 # Send test mail to each site sys.stdout.write("Delaying to give the test mail time to land...") - time.sleep(5) + time.sleep(delay) sys.stdout.write("here we go:\n") # Fall through elif switch == "-v": -- cgit v1.2.3