Skip to content

Commit e3134cc

Browse files
committed
Final preparation for 1.3
1 parent 5957aad commit e3134cc

File tree

3 files changed

+41
-37
lines changed

3 files changed

+41
-37
lines changed

lib/core/settings.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@
675675
CHECK_ZERO_COLUMNS_THRESHOLD = 10
676676

677677
# Boldify all logger messages containing these "patterns"
678-
BOLD_PATTERNS = ("' injectable", "provided empty", "leftover chars", "might be injectable", "' is vulnerable", "is not injectable", "does not seem to be", "test failed", "test passed", "live test final result", "test shows that", "the back-end DBMS is", "created Github", "blocked by the target server", "protection is involved", "CAPTCHA", "specific response", "NULL connection is supported")
678+
BOLD_PATTERNS = ("' injectable", "provided empty", "leftover chars", "might be injectable", "' is vulnerable", "is not injectable", "does not seem to be", "test failed", "test passed", "live test final result", "test shows that", "the back-end DBMS is", "created Github", "blocked by the target server", "protection is involved", "CAPTCHA", "specific response", "NULL connection is supported", "PASSED", "FAILED")
679679

680680
# Generic www root directory names
681681
GENERIC_DOC_ROOT_DIRECTORY_NAMES = ("htdocs", "httpdocs", "public", "wwwroot", "www")

lib/core/testing.py

+38-34
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
from extra.beep.beep import beep
1919
from lib.controller.controller import start
20+
from lib.core.common import checkIntegrity
2021
from lib.core.common import clearConsoleLine
2122
from lib.core.common import dataToStdout
2223
from lib.core.common import getUnicode
@@ -51,41 +52,44 @@ def smokeTest():
5152
retVal = True
5253
count, length = 0, 0
5354

54-
for root, _, files in os.walk(paths.SQLMAP_ROOT_PATH):
55-
if any(_ in root for _ in ("thirdparty", "extra")):
56-
continue
57-
58-
for filename in files:
59-
if os.path.splitext(filename)[1].lower() == ".py" and filename != "__init__.py":
60-
length += 1
61-
62-
for root, _, files in os.walk(paths.SQLMAP_ROOT_PATH):
63-
if any(_ in root for _ in ("thirdparty", "extra")):
64-
continue
65-
66-
for filename in files:
67-
if os.path.splitext(filename)[1].lower() == ".py" and filename != "__init__.py":
68-
path = os.path.join(root, os.path.splitext(filename)[0])
69-
path = path.replace(paths.SQLMAP_ROOT_PATH, '.')
70-
path = path.replace(os.sep, '.').lstrip('.')
71-
try:
72-
__import__(path)
73-
module = sys.modules[path]
74-
except Exception, msg:
75-
retVal = False
76-
dataToStdout("\r")
77-
errMsg = "smoke test failed at importing module '%s' (%s):\n%s" % (path, os.path.join(root, filename), msg)
78-
logger.error(errMsg)
79-
else:
80-
# Run doc tests
81-
# Reference: http://docs.python.org/library/doctest.html
82-
(failure_count, test_count) = doctest.testmod(module)
83-
if failure_count > 0:
55+
if not checkIntegrity():
56+
retVal = False
57+
else:
58+
for root, _, files in os.walk(paths.SQLMAP_ROOT_PATH):
59+
if any(_ in root for _ in ("thirdparty", "extra")):
60+
continue
61+
62+
for filename in files:
63+
if os.path.splitext(filename)[1].lower() == ".py" and filename != "__init__.py":
64+
length += 1
65+
66+
for root, _, files in os.walk(paths.SQLMAP_ROOT_PATH):
67+
if any(_ in root for _ in ("thirdparty", "extra")):
68+
continue
69+
70+
for filename in files:
71+
if os.path.splitext(filename)[1].lower() == ".py" and filename != "__init__.py":
72+
path = os.path.join(root, os.path.splitext(filename)[0])
73+
path = path.replace(paths.SQLMAP_ROOT_PATH, '.')
74+
path = path.replace(os.sep, '.').lstrip('.')
75+
try:
76+
__import__(path)
77+
module = sys.modules[path]
78+
except Exception, msg:
8479
retVal = False
85-
86-
count += 1
87-
status = '%d/%d (%d%%) ' % (count, length, round(100.0 * count / length))
88-
dataToStdout("\r[%s] [INFO] complete: %s" % (time.strftime("%X"), status))
80+
dataToStdout("\r")
81+
errMsg = "smoke test failed at importing module '%s' (%s):\n%s" % (path, os.path.join(root, filename), msg)
82+
logger.error(errMsg)
83+
else:
84+
# Run doc tests
85+
# Reference: http://docs.python.org/library/doctest.html
86+
(failure_count, test_count) = doctest.testmod(module)
87+
if failure_count > 0:
88+
retVal = False
89+
90+
count += 1
91+
status = '%d/%d (%d%%) ' % (count, length, round(100.0 * count / length))
92+
dataToStdout("\r[%s] [INFO] complete: %s" % (time.strftime("%X"), status))
8993

9094
clearConsoleLine()
9195
if retVal:

txt/checksum.md5

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ fe370021c6bc99daf44b2bfc0d1effb3 lib/core/patch.py
4949
9a7d68d5fa01561500423791f15cc676 lib/core/replication.py
5050
3179d34f371e0295dd4604568fb30bcd lib/core/revision.py
5151
d6269c55789f78cf707e09a0f5b45443 lib/core/session.py
52-
43ee2f1b9e898fa8e9788b921f278609 lib/core/settings.py
52+
c799d8dee38e2da35b8aff0638f21129 lib/core/settings.py
5353
a8a7501d1e6b21669b858a62e921d191 lib/core/shell.py
5454
5dc606fdf0afefd4b305169c21ab2612 lib/core/subprocessng.py
5555
eec3080ba5baca44c6de4595f1c92a0d lib/core/target.py
56-
a057a8ae12fd21f6c409feee1266e7ad lib/core/testing.py
56+
2f87870562ac9a79a5105a0e20fdbf9a lib/core/testing.py
5757
5ebd996b2a77449df90320847e30a073 lib/core/threads.py
5858
2c263c8610667fdc593c50a35ab20f57 lib/core/unescaper.py
5959
5bd7cd6553a4a1c85cbaaddc268108e4 lib/core/update.py

0 commit comments

Comments
 (0)