diff --git a/lib/core/testing.py b/lib/core/testing.py
index 41b3ac323de..2dc155af742 100644
--- a/lib/core/testing.py
+++ b/lib/core/testing.py
@@ -33,6 +33,7 @@
from lib.parse.cmdline import cmdLineParser
failedItem = None
+failedParseOn = None
def smokeTest():
"""
@@ -104,6 +105,7 @@ def liveTest():
This will run the test of a program against the live testing environment
"""
global failedItem
+ global failedParseOn
retVal = True
count = 0
@@ -165,12 +167,18 @@ def liveTest():
if result:
logger.info("test passed")
+ cleanCase()
else:
errMsg = "test failed "
if failedItem:
- errMsg += "at parsing item: %s" % failedItem
+ errMsg += "at parsing item: %s - scan folder is %s" % (failedItem, paths.SQLMAP_OUTPUT_PATH)
+ console_output_fd = open("%s%sconsole_output" % (paths.SQLMAP_OUTPUT_PATH, os.sep), "wb")
+ console_output_fd.write(failedParseOn)
+ console_output_fd.close()
+
logger.error(errMsg)
beep()
+
if conf.stopFail is True:
return retVal
@@ -187,7 +195,9 @@ def liveTest():
def initCase(switches=None):
global failedItem
+ global failedParseOn
failedItem = None
+ failedParseOn = None
paths.SQLMAP_OUTPUT_PATH = tempfile.mkdtemp(prefix="sqlmaptest-")
paths.SQLMAP_DUMP_PATH = os.path.join(paths.SQLMAP_OUTPUT_PATH, "%s", "dump")
@@ -210,6 +220,7 @@ def cleanCase():
def runCase(switches=None, parse=None):
global failedItem
+ global failedParseOn
initCase(switches)
@@ -257,7 +268,9 @@ def runCase(switches=None, parse=None):
failedItem = item
break
- cleanCase()
+ if failedItem is not None:
+ failedParseOn = console
+
return retVal
def replaceVars(item, vars_):
diff --git a/xml/livetests.xml b/xml/livetests.xml
index 6bf84df51f3..e67a30c4405 100644
--- a/xml/livetests.xml
+++ b/xml/livetests.xml
@@ -76,6 +76,7 @@
+
@@ -86,7 +87,7 @@
-
+
@@ -119,6 +120,7 @@
+
@@ -129,7 +131,7 @@
-
+
@@ -162,6 +164,7 @@
+
@@ -172,7 +175,7 @@
-
+
@@ -219,6 +222,7 @@
+
@@ -229,7 +233,7 @@
-
+