automated testing changes, in addition to an automated.xml

This commit is contained in:
Sam Robertson 2012-02-03 16:59:20 -08:00
parent 1f0ea28cc4
commit 4acfc2eb1d
3 changed files with 4456 additions and 10 deletions

View File

@ -259,10 +259,23 @@
</exec>
</target>
<target name="xmltest-hudson" description="Used to run the daily tests using tools/testClient/example.xml as the source of tests">
<property name="xmltest" value="example.xml"/>
<echo message="Running daily test run with ${xmltest}.py"/>
<antcall target="xmltest-execute"/>
<target name="xmltest-automated" description="Used to run the daily tests using tools/testClient/automated.xml as the source of tests">
<property name="xmltest" value="automated.xml"/>
<echo message="Running daily test run with ${xmltest}.py"/>
<antcall target="xmltest-execute"/>
</target>
<target name="automated-test-run" description="Run the automated tests in tools/testClient/testcases/automated.xml using the debug server">
<property name="env.CATALINA_HOME" value="/usr/share/cloud"/>
<echo message="CATALINA_HOME = ${env.CATALINA_HOME}"/>
<antcall target="build-all"/>
<antcall target="deploy-server"/>
<antcall target="deploydb"/>
<antcall target="start-tomcat"/>
<echo message="running tests..."/>
<antcall target="xmltest-automated"/>
<antcall target="stop-tomcat"/>
<antcall target="clean-tomcat"/>
</target>
<!-- ====================== XMLTEST Python Based testing ================== -->

File diff suppressed because it is too large Load Diff

View File

@ -43,11 +43,11 @@ class xml_to_python(object):
# this could be handled much cleaner
try:
itemValue = item.getElementsByTagName("value")[0].childNodes[0].nodeValue.strip()
except Exception:
except:
itemValue = None
try:
itemParam = item.getElementsByTagName("param")[0].childNodes[0].nodeValue.strip()
except Exception:
except:
itemParam = None
# handle getparam and setparam and random attributes here...
@ -64,7 +64,7 @@ class xml_to_python(object):
else:
try:
val = int(itemValue)
except Exception:
except:
val = "'%s'" % itemValue
self._write("%s%s.%s = %s" % (INDENT, self.cmd_name_var, itemName, val))
@ -78,7 +78,11 @@ class xml_to_python(object):
#if item.getAttribute("list") == "true":
itemName = item.getElementsByTagName("name")[0].childNodes[0].nodeValue.strip()
itemParam = item.getElementsByTagName("param")[0].childNodes[0].nodeValue.strip()
try:
itemParam = item.getElementsByTagName("param")[0].childNodes[0].nodeValue.strip()
except:
print "parse_returnvalue: No 'param' found in : '" + item.toprettyxml() + "'"
itemParam = None
if item.getAttribute("setparam") == "true":
self._write("%s%s = %s.%s" % (INDENT, itemParam, self.cmd_name_resp, itemName))
@ -97,7 +101,11 @@ class xml_to_python(object):
self.cmd_name_var = "_%s" % self.cmd_name
self.cmd_name_resp = "resp_%s" % self.cmd_name
testCaseName = cmd.getElementsByTagName("testcase")[0].childNodes[0].nodeValue.strip()
try:
testCaseName = cmd.getElementsByTagName("testcase")[0].childNodes[0].nodeValue.strip()
except:
print "parse_command: No 'testcase' found in: " + cmd.toprettyxml()
testCaseName = None
self._write("\n%s# %s" % (INDENT, testCaseName))
self._write("%s%s = %s.%sCmd()" % (INDENT, self.cmd_name_var, self.cmd_name, self.cmd_name))
@ -189,4 +197,4 @@ if __name__ == "__main__":
processor = xml_to_python(options.debug)
processor.parse_xmlFile(options.xmlfile, outFile)
processor.parse_xmlFile(options.xmlfile, outFile)