|
20 | 20 |
|
21 | 21 | from lib.core.revision import getRevisionNumber |
22 | 22 |
|
23 | | -TIME = time.strftime("%H:%M:%S %d-%m-%Y", time.gmtime()) |
| 23 | +START_TIME = time.strftime("%H:%M:%S %d-%m-%Y", time.gmtime()) |
24 | 24 | SQLMAP_HOME = "/opt/sqlmap" |
25 | 25 | REVISION = getRevisionNumber() |
26 | 26 |
|
|
30 | 30 | |
31 | 31 | |
32 | 32 | |
33 | | -SUBJECT = "Regression test on %s using revision %s" % (TIME, REVISION) |
| 33 | +SUBJECT = "Regression test on %s using revision %s" % (START_TIME, REVISION) |
34 | 34 |
|
35 | 35 | def prepare_email(content): |
36 | 36 | global FROM |
@@ -71,16 +71,14 @@ def main(): |
71 | 71 | test_counts = [] |
72 | 72 | attachments = {} |
73 | 73 |
|
74 | | - proc = subprocess.Popen("cd /opt/sqlmap/ ; python /opt/sqlmap/sqlmap.py --update", shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
75 | | - proc.wait() |
76 | | - stdout, stderr = proc.communicate() |
| 74 | + updateproc = subprocess.Popen("cd /opt/sqlmap/ ; python /opt/sqlmap/sqlmap.py --update", shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
| 75 | + stdout, stderr = updateproc.communicate() |
77 | 76 |
|
78 | 77 | if stderr: |
79 | 78 | failure_email("Update of sqlmap failed with error:\n\n%s" % stderr) |
80 | 79 |
|
81 | | - proc = subprocess.Popen("python /opt/sqlmap/sqlmap.py --live-test", shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
82 | | - proc.wait() |
83 | | - stdout, stderr = proc.communicate() |
| 80 | + regressionproc = subprocess.Popen("python /opt/sqlmap/sqlmap.py --live-test", shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
| 81 | + stdout, stderr = regressionproc.communicate() |
84 | 82 |
|
85 | 83 | if stderr: |
86 | 84 | failure_email("Execution of regression test failed with error:\n\n%s" % stderr) |
@@ -149,12 +147,12 @@ def main(): |
149 | 147 |
|
150 | 148 | if __name__ == "__main__": |
151 | 149 | log_fd = open("/tmp/sqlmapregressiontest.log", "wb") |
152 | | - log_fd.write("Regression test started at %s\n" % TIME) |
| 150 | + log_fd.write("Regression test started at %s\n" % START_TIME) |
153 | 151 |
|
154 | 152 | try: |
155 | 153 | main() |
156 | 154 | except Exception, e: |
157 | 155 | log_fd.write("An exception has occurred:\n%s" % str(traceback.format_exc())) |
158 | 156 |
|
159 | | - log_fd.write("Regression test finished at %s\n\n" % TIME) |
| 157 | + log_fd.write("Regression test finished at %s\n\n" % time.strftime("%H:%M:%S %d-%m-%Y", time.gmtime()) |
160 | 158 | log_fd.close() |
0 commit comments