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,11 +259,24 @@
</exec> </exec>
</target> </target>
<target name="xmltest-hudson" description="Used to run the daily tests using tools/testClient/example.xml as the source of tests"> <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="example.xml"/> <property name="xmltest" value="automated.xml"/>
<echo message="Running daily test run with ${xmltest}.py"/> <echo message="Running daily test run with ${xmltest}.py"/>
<antcall target="xmltest-execute"/> <antcall target="xmltest-execute"/>
</target> </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 ================== --> <!-- ====================== XMLTEST Python Based testing ================== -->
</project> </project>

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 # this could be handled much cleaner
try: try:
itemValue = item.getElementsByTagName("value")[0].childNodes[0].nodeValue.strip() itemValue = item.getElementsByTagName("value")[0].childNodes[0].nodeValue.strip()
except Exception: except:
itemValue = None itemValue = None
try: try:
itemParam = item.getElementsByTagName("param")[0].childNodes[0].nodeValue.strip() itemParam = item.getElementsByTagName("param")[0].childNodes[0].nodeValue.strip()
except Exception: except:
itemParam = None itemParam = None
# handle getparam and setparam and random attributes here... # handle getparam and setparam and random attributes here...
@ -64,7 +64,7 @@ class xml_to_python(object):
else: else:
try: try:
val = int(itemValue) val = int(itemValue)
except Exception: except:
val = "'%s'" % itemValue val = "'%s'" % itemValue
self._write("%s%s.%s = %s" % (INDENT, self.cmd_name_var, itemName, val)) 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": #if item.getAttribute("list") == "true":
itemName = item.getElementsByTagName("name")[0].childNodes[0].nodeValue.strip() itemName = item.getElementsByTagName("name")[0].childNodes[0].nodeValue.strip()
try:
itemParam = item.getElementsByTagName("param")[0].childNodes[0].nodeValue.strip() 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": if item.getAttribute("setparam") == "true":
self._write("%s%s = %s.%s" % (INDENT, itemParam, self.cmd_name_resp, itemName)) 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_var = "_%s" % self.cmd_name
self.cmd_name_resp = "resp_%s" % self.cmd_name self.cmd_name_resp = "resp_%s" % self.cmd_name
try:
testCaseName = cmd.getElementsByTagName("testcase")[0].childNodes[0].nodeValue.strip() 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("\n%s# %s" % (INDENT, testCaseName))
self._write("%s%s = %s.%sCmd()" % (INDENT, self.cmd_name_var, self.cmd_name, self.cmd_name)) self._write("%s%s = %s.%sCmd()" % (INDENT, self.cmd_name_var, self.cmd_name, self.cmd_name))