def create_rpt(info, status, msg, keyStrings, elapsed, rptf): testtime = "%.2f" % elapsed testsuites = Element('testsuites', {'time': testtime}) for (mod, suiteNameDict) in status.iteritems(): testsuite = SubElement( testsuites, 'testsuite', { 'package': info["pkgname"], 'URL': info["srce"], 'hostname': hostname, 'name': pkgDict[mod] }) for (suitename, status4ThisSuite) in suiteNameDict.iteritems(): failureCnt = "0" errCnt = "0" if (status4ThisSuite == False): failureCnt = "1" else: failureCnt = "0" print "==-->>Package Name: '%s', Suite Name: '%s', Status = '%s'" \ % (mod, suitename, status4ThisSuite) if (info["ok"] == False): errCnt = "1" else: errCnt = "0" testcase = SubElement(testsuite, 'testcase', { 'errors': errCnt, 'failures': failureCnt, 'name': suitename }) if (failureCnt == "1"): failure = SubElement(testcase, 'failure', {'Message': msg[mod][suitename]}) misStr = None if (keyStrings[mod][suitename] != None): for j in keyStrings[mod][suitename]: if (misStr == None): misStr = j else: misStr += ", " + j missing = SubElement(failure, 'Missing', {'MissingString': misStr}) else: failure = SubElement(testcase, 'info', {'Message': msg[mod][suitename]}) if (errCnt == "1"): error = SubElement(testcase, 'error', {'Error': info["err"]}) fo = open(rptf, "wb") fo.write(prettify(testsuites)) fo.close() if not os.path.exists(rptf): reportfile = None return rptf
def create_projectFile(ddl, projFilename): proj = Element('project') db = SubElement(proj, 'database') schemas = SubElement(db, 'schemas') schema = SubElement(schemas, 'schema', {'path': ddl}) thisProjectFile = "/tmp/" + projFilename + "4projectFile.xml" fo = open(thisProjectFile, "wb") fo.write(prettify(proj)) fo.close() if not os.path.exists(thisProjectFile): thisProjectFile = None return thisProjectFile
def create_projectFile(ddl, projFilename): proj = Element('project') db = SubElement(proj, 'database') schemas = SubElement(db, 'schemas') schema = SubElement(schemas, 'schema', {'path':ddl}) thisProjectFile = "/tmp/" + projFilename + "4projectFile.xml" fo = open(thisProjectFile, "wb") fo.write(prettify(proj)) fo.close() if not os.path.exists(thisProjectFile): thisProjectFile = None return thisProjectFile
def create_projectFile(ddl, projFilename): proj = Element("project") db = SubElement(proj, "database") schemas = SubElement(db, "schemas") schema = SubElement(schemas, "schema", {"path": ddl}) thisProjectFile = "/tmp/" + projFilename + "4projectFile.xml" fo = open(thisProjectFile, "wb") fo.write(prettify(proj)) fo.close() if not os.path.exists(thisProjectFile): thisProjectFile = None return thisProjectFile
def create_rpt(info, status, msg, keyStrings, elapsed): testtime = "%.2f" % elapsed testsuites = Element('testsuites', {'time':testtime}) for (mod, suiteNameDict) in status.iteritems(): testsuite = SubElement(testsuites, 'testsuite', {'package':info["pkgname"],'URL':info["srce"], 'hostname':hostname, 'name':pkgDict[mod]}) for (suitename, status4ThisSuite) in suiteNameDict.iteritems(): failureCnt = "0" errCnt = "0" if(status4ThisSuite == False): failureCnt = "1" else: failureCnt = "0" print "==-->>Package Name: '%s', Suite Name: '%s', Status = '%s'" \ % (mod, suitename, status4ThisSuite) if(info["ok"] == False): errCnt = "1" else: errCnt = "0" testcase = SubElement(testsuite, 'testcase', {'errors':errCnt,'failures':failureCnt, 'name':suitename}) if(failureCnt == "1"): failure = SubElement(testcase, 'failure', {'Message':msg[mod][suitename]}) misStr = None if(keyStrings[mod][suitename] != None): for j in keyStrings[mod][suitename]: if(misStr == None): misStr = j else: misStr += ", " + j missing = SubElement(failure, 'Missing', {'MissingString':misStr}) else: failure = SubElement(testcase, 'info', {'Message':msg[mod][suitename]}) if(errCnt == "1"): error = SubElement(testcase, 'error', {'Error':info["err"]}) rptf = "/tmp/exp_rpt.xml" fo = open(rptf, "wb") fo.write(prettify(testsuites)) fo.close() if not os.path.exists(rptf): rptf = None return rptf
def create_rpt(info, status, msg, keyStrings, elapsed, rptf): testtime = "%.2f" % elapsed testsuites = Element("testsuites", {"time": testtime}) for (mod, suiteNameDict) in status.iteritems(): testsuite = SubElement( testsuites, "testsuite", {"package": info["pkgname"], "URL": info["srce"], "hostname": hostname, "name": pkgDict[mod]}, ) for (suitename, status4ThisSuite) in suiteNameDict.iteritems(): failureCnt = "0" errCnt = "0" if status4ThisSuite == False: failureCnt = "1" else: failureCnt = "0" print "==-->>Package Name: '%s', Suite Name: '%s', Status = '%s'" % (mod, suitename, status4ThisSuite) if info["ok"] == False: errCnt = "1" else: errCnt = "0" testcase = SubElement(testsuite, "testcase", {"errors": errCnt, "failures": failureCnt, "name": suitename}) if failureCnt == "1": failure = SubElement(testcase, "failure", {"Message": msg[mod][suitename]}) misStr = None if keyStrings[mod][suitename] != None: for j in keyStrings[mod][suitename]: if misStr == None: misStr = j else: misStr += ", " + j missing = SubElement(failure, "Missing", {"MissingString": misStr}) else: failure = SubElement(testcase, "info", {"Message": msg[mod][suitename]}) if errCnt == "1": error = SubElement(testcase, "error", {"Error": info["err"]}) fo = open(rptf, "wb") fo.write(prettify(testsuites)) fo.close() if not os.path.exists(rptf): reportfile = None return rptf
def create_deploymentFile(options): kfactor = options.kfactor sitesperhost = options.sitescount hostcount = options.hostcount deployment = Element('deployment') cluster = SubElement(deployment, 'cluster', {'kfactor':kfactor,'sitesperhost':sitesperhost,'hostcount':hostcount}) httpd = SubElement(deployment, 'httpd', {'port':"8080"}) jsonapi = SubElement(httpd, 'jsonapi', {'enabled':"true"}) deploymentFile = "/tmp/deploymentFile.xml" fo = open(deploymentFile, "wb") fo.write(prettify(deployment)) fo.close() if not os.path.exists(deploymentFile): deploymentFile = None return deploymentFile
def create_deploymentFile(options): kfactor = options.kfactor sitesperhost = options.sitescount hostcount = options.hostcount deployment = Element('deployment') cluster = SubElement(deployment, 'cluster', {'kfactor':kfactor, 'sitesperhost':sitesperhost, 'hostcount':hostcount}) httpd = SubElement(deployment, 'httpd', {'port':"8080"}) jsonapi = SubElement(httpd, 'jsonapi', {'enabled':"true"}) deploymentFile = "/tmp/deploymentFile.xml" fo = open(deploymentFile, "wb") fo.write(prettify(deployment)) fo.close() if not os.path.exists(deploymentFile): deploymentFile = None return deploymentFile
def create_deploymentFile(options): kfactor = options.kfactor sitesperhost = options.sitescount hostcount = options.hostcount deployment = Element("deployment") cluster = SubElement( deployment, "cluster", {"kfactor": kfactor, "sitesperhost": sitesperhost, "hostcount": hostcount} ) httpd = SubElement(deployment, "httpd", {"port": "8080"}) jsonapi = SubElement(httpd, "jsonapi", {"enabled": "true"}) deploymentFile = "/tmp/deploymentFile.xml" fo = open(deploymentFile, "wb") fo.write(prettify(deployment)) fo.close() if not os.path.exists(deploymentFile): deploymentFile = None return deploymentFile