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

Skip to content

Commit 7dcc203

Browse files
committed
smoke test adjustments
1 parent 092829c commit 7dcc203

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

lib/core/common.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1413,6 +1413,7 @@ def commonFinderOnly(initial, sequence):
14131413
return longestCommonPrefix(*filter(lambda x: x.startswith(initial), sequence))
14141414

14151415
def smokeTest():
1416+
retVal = True
14161417
for root, _, files in os.walk(paths.SQLMAP_ROOT_PATH):
14171418
for file in files:
14181419
if os.path.splitext(file)[1].lower() == '.py' and file != '__init__.py':
@@ -1422,7 +1423,13 @@ def smokeTest():
14221423
try:
14231424
module = __import__(path)
14241425
except Exception, msg:
1425-
raise sqlmapGenericException, "smoke test failed at importing module '%s' (%s):\n\n%s" % (path, os.path.join(paths.SQLMAP_ROOT_PATH, file), msg)
1426-
1427-
infoMsg = "smoke test passed"
1428-
logger.info(infoMsg)
1426+
retVal = False
1427+
errMsg = "smoke test failed at importing module '%s' (%s):\n%s\n" % (path, os.path.join(paths.SQLMAP_ROOT_PATH, file), msg)
1428+
logger.error(errMsg)
1429+
if retVal:
1430+
infoMsg = "smoke test PASSED"
1431+
logger.info(infoMsg)
1432+
else:
1433+
errMsg = "smoke test FAILED"
1434+
logger.error(errMsg)
1435+
return retVal

0 commit comments

Comments
 (0)