mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-26 19:43:48 +03:00
smoke test adjustments
This commit is contained in:
parent
092829c189
commit
7dcc2031ac
|
@ -1413,6 +1413,7 @@ def commonFinderOnly(initial, sequence):
|
||||||
return longestCommonPrefix(*filter(lambda x: x.startswith(initial), sequence))
|
return longestCommonPrefix(*filter(lambda x: x.startswith(initial), sequence))
|
||||||
|
|
||||||
def smokeTest():
|
def smokeTest():
|
||||||
|
retVal = True
|
||||||
for root, _, files in os.walk(paths.SQLMAP_ROOT_PATH):
|
for root, _, files in os.walk(paths.SQLMAP_ROOT_PATH):
|
||||||
for file in files:
|
for file in files:
|
||||||
if os.path.splitext(file)[1].lower() == '.py' and file != '__init__.py':
|
if os.path.splitext(file)[1].lower() == '.py' and file != '__init__.py':
|
||||||
|
@ -1422,7 +1423,13 @@ def smokeTest():
|
||||||
try:
|
try:
|
||||||
module = __import__(path)
|
module = __import__(path)
|
||||||
except Exception, msg:
|
except Exception, msg:
|
||||||
raise sqlmapGenericException, "smoke test failed at importing module '%s' (%s):\n\n%s" % (path, os.path.join(paths.SQLMAP_ROOT_PATH, file), msg)
|
retVal = False
|
||||||
|
errMsg = "smoke test failed at importing module '%s' (%s):\n%s\n" % (path, os.path.join(paths.SQLMAP_ROOT_PATH, file), msg)
|
||||||
infoMsg = "smoke test passed"
|
logger.error(errMsg)
|
||||||
logger.info(infoMsg)
|
if retVal:
|
||||||
|
infoMsg = "smoke test PASSED"
|
||||||
|
logger.info(infoMsg)
|
||||||
|
else:
|
||||||
|
errMsg = "smoke test FAILED"
|
||||||
|
logger.error(errMsg)
|
||||||
|
return retVal
|
Loading…
Reference in New Issue
Block a user