mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-02-03 05:04:11 +03:00
consolidated into one script
This commit is contained in:
parent
2a9fe62c3f
commit
234e4c9f69
|
@ -4,6 +4,7 @@
|
|||
# See the file 'doc/COPYING' for copying permission
|
||||
|
||||
import codecs
|
||||
import inspect
|
||||
import os
|
||||
import re
|
||||
import smtplib
|
||||
|
@ -14,7 +15,7 @@ import time
|
|||
from email.mime.multipart import MIMEMultipart
|
||||
from email.mime.text import MIMEText
|
||||
|
||||
sys.path.append("../../")
|
||||
sys.path.append(os.path.normpath("%s/../../" % os.path.dirname(inspect.getfile(inspect.currentframe()))))
|
||||
|
||||
from lib.core.revision import getRevisionNumber
|
||||
|
||||
|
@ -64,7 +65,7 @@ def main():
|
|||
test_counts = []
|
||||
attachments = {}
|
||||
|
||||
command_line = "cd %s && python sqlmap.py --live-test" % SQLMAP_HOME
|
||||
command_line = "python /opt/sqlmap/sqlmap.py --live-test" % SQLMAP_HOME
|
||||
proc = subprocess.Popen(command_line, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
|
||||
proc.wait()
|
||||
|
@ -138,4 +139,13 @@ def main():
|
|||
send_email(msg)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
log_fd = open("/tmp/regressiontest.txt", "ab")
|
||||
log_fd.write("Regression test started at %s\n" % TIME)
|
||||
|
||||
try:
|
||||
main()
|
||||
except Exception, e:
|
||||
log_fd.write("An exception has occurred:\n%s" % str(traceback.format_exc()))
|
||||
|
||||
log_fd.write("\nRegression test finished at %s\n\n" % TIME)
|
||||
log_fd.close()
|
||||
|
|
|
@ -1,27 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/)
|
||||
# See the file 'doc/COPYING' for copying permission
|
||||
|
||||
SQLMAP_HOME="/opt/sqlmap"
|
||||
REGRESSION_SCRIPT="${SQLMAP_HOME}/extra/shutils"
|
||||
|
||||
FROM="regressiontest@sqlmap.org"
|
||||
TO="bernardo.damele@gmail.com, miroslav.stampar@gmail.com"
|
||||
SUBJECT="Automated regression test failed on $(date)"
|
||||
|
||||
cd $SQLMAP_HOME
|
||||
git pull
|
||||
rm -f output 2>/dev/null
|
||||
|
||||
cd $REGRESSION_SCRIPT
|
||||
echo "Regression test started at $(date)" 1>/tmp/regressiontest.log 2>&1
|
||||
python regressiontest.py 1>>/tmp/regressiontest.log 2>&1
|
||||
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo "Regression test finished at $(date)" 1>>/tmp/regressiontest.log 2>&1
|
||||
cat /tmp/regressiontest.log | mailx -s "${SUBJECT}" -aFrom:${FROM} ${TO}
|
||||
else
|
||||
echo "Regression test finished at $(date)" 1>>/tmp/regressiontest.log 2>&1
|
||||
fi
|
Loading…
Reference in New Issue
Block a user