mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-25 19:13:48 +03:00
Send an email also when regression test is successful
This commit is contained in:
parent
f970b4f240
commit
d6db83fe88
|
@ -30,7 +30,7 @@ SMTP_TIMEOUT = 30
|
|||
FROM = "regressiontest@sqlmap.org"
|
||||
#TO = "dev@sqlmap.org"
|
||||
TO = ["bernardo.damele@gmail.com", "miroslav.stampar@gmail.com"]
|
||||
SUBJECT = "Regression test on %s using revision %s" % (START_TIME, REVISION)
|
||||
SUBJECT = "regression test started on %s using revision %s" % (START_TIME, REVISION)
|
||||
|
||||
def prepare_email(content):
|
||||
global FROM
|
||||
|
@ -132,9 +132,11 @@ def main():
|
|||
|
||||
content += "#######################################################################\n\n"
|
||||
|
||||
end_string = "Regression test finished at %s" % time.strftime("%H:%M:%S %d-%m-%Y", time.gmtime())
|
||||
|
||||
if content:
|
||||
content += "Regression test finished at %s" % time.strftime("%H:%M:%S %d-%m-%Y", time.gmtime())
|
||||
SUBJECT += " (%s)" % ", ".join("#%d" % count for count in test_counts)
|
||||
content += end_string
|
||||
SUBJECT = "Failed %s (%s)" % (SUBJECT, ", ".join("#%d" % count for count in test_counts))
|
||||
|
||||
msg = prepare_email(content)
|
||||
|
||||
|
@ -144,6 +146,10 @@ def main():
|
|||
msg.attach(attachment)
|
||||
|
||||
send_email(msg)
|
||||
else:
|
||||
SUBJECT += "Successful %s" % SUBJECT
|
||||
msg = prepare_email("All test cases were successful\n\n%s" % end_string)
|
||||
send_email(msg)
|
||||
|
||||
if __name__ == "__main__":
|
||||
log_fd = open("/tmp/sqlmapregressiontest.log", "wb")
|
||||
|
|
Loading…
Reference in New Issue
Block a user