hostmgr=hostManager() mgmtHostInfo=poolmgr.findSutableHost(inp_dict['repo_url'],inp_dict['profile'],inp_dict['configName']) if mgmtHostInfo!=None and inp_dict['destroy']: poolmgr.destroy(mgmtHostInfo['hostname']) mgmtHostInfo=None if mgmtHostInfo is None: mgmtHostInfo = hostmgr.create(inp_dict['repo_url'],inp_dict['branch'], inp_dict['commit'],inp_dict['configName'],inp_dict['profile']) mgmtHostInfo.update({'state':'active'}) poolmgr.addToPool(mgmtHostInfo) else: mgmtHostInfo=hostmgr.refreshHost(mgmtHostInfo, inp_dict['branch'],inp_dict['commit']) #print mgmtHostInfo managementHost = mgmtHostInfo['hostname'] testenv=testEnv() env=testenv.create(mgmtHostInfo,buildNo,inp_dict['branch']) mailto=inp_dict['mailto'].replace(' ','') mailto=inp_dict['mailto'].split(",") #print "will mail the results to %s"%mailto testenv.createDataCenter(env) env=testenv.execOnJenkins(env,inp_dict['testSpecifierString'],mailto) testenv.addBuildInfo(env) except Exception, e: logging.error(e) finally: logging.info(" freeing resource") poolmgr.free(mgmtHostInfo)
from testEnv import testEnv hostInfo={'mac':'00:16:3e:3c:ec:8d','password':'******','hostname':'centos-simulator-00-16-3e-3c-ec-8d','ip':'10.147.28.143'} print hostInfo['ip'] t=testEnv() env=t.create(hostInfo,"100") t.execTests(env)
'config_file': '/automation/virtenv/00-16-3e-17-43-25/146/00-16-3e-17-43-25.cfg', 'virtenvPath': '/automation/virtenv/00-16-3e-17-43-25/158', 'hostip': '10.147.28.221', 'build_number': '158', 'version': '1254', 'noSimulator': True, 'repo_url': 'https://github.com/apache/cloudstack.git', 'startTime': '', 'commit_id': None, 'branch':'1254' } cscfg = configGenerator.getSetupConfig(env['config_file']) testMgr = testManager('test/integration/smoke-test/integration/smoke/misc-test_ssvm.py-test_nuage_vsp.py,test/integration/smoke/test_ssvm.py', env['virtenvPath']) tests=testMgr.getTests() print "tests= ",tests tests=testMgr.getTests() print "tests= ",tests reportAnalyserMap=testEnv().getReportAnalysers(cscfg, env, True) print reportAnalyserMap for key in reportAnalyserMap.keys(): reportAnalyserMap[key].collectTestsToReRun() tests=reportAnalyserMap[key].suitsToRerun if(tests is None): avoidZones.append(key) else: #print "tests to rerun",tests testMgr.addTestsToReRun(tests) while tests is not None: tests=testMgr.getTests() print tests