Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 234e4c9

Browse files
committed
consolidated into one script
1 parent 2a9fe62 commit 234e4c9

2 files changed

Lines changed: 13 additions & 30 deletions

File tree

extra/shutils/regressiontest.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# See the file 'doc/COPYING' for copying permission
55

66
import codecs
7+
import inspect
78
import os
89
import re
910
import smtplib
@@ -14,7 +15,7 @@
1415
from email.mime.multipart import MIMEMultipart
1516
from email.mime.text import MIMEText
1617

17-
sys.path.append("../../")
18+
sys.path.append(os.path.normpath("%s/../../" % os.path.dirname(inspect.getfile(inspect.currentframe()))))
1819

1920
from lib.core.revision import getRevisionNumber
2021

@@ -64,7 +65,7 @@ def main():
6465
test_counts = []
6566
attachments = {}
6667

67-
command_line = "cd %s && python sqlmap.py --live-test" % SQLMAP_HOME
68+
command_line = "python /opt/sqlmap/sqlmap.py --live-test" % SQLMAP_HOME
6869
proc = subprocess.Popen(command_line, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
6970

7071
proc.wait()
@@ -138,4 +139,13 @@ def main():
138139
send_email(msg)
139140

140141
if __name__ == "__main__":
141-
main()
142+
log_fd = open("/tmp/regressiontest.txt", "ab")
143+
log_fd.write("Regression test started at %s\n" % TIME)
144+
145+
try:
146+
main()
147+
except Exception, e:
148+
log_fd.write("An exception has occurred:\n%s" % str(traceback.format_exc()))
149+
150+
log_fd.write("\nRegression test finished at %s\n\n" % TIME)
151+
log_fd.close()

extra/shutils/regressiontest_cronjob.sh

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)