CLOUDSTACK-5674: Added few fixes for CLOUDSTACK-5674
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/afb58b37 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/afb58b37 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/afb58b37 Branch: refs/heads/marvin Commit: afb58b37a318272299f09c3970d5a615ca602755 Parents: 09e1eb6 Author: Santhosh Edukulla <santhosh.eduku...@citrix.com> Authored: Wed Mar 19 18:34:59 2014 -0700 Committer: Girish Shilamkar <gir...@clogeny.com> Committed: Wed Mar 19 18:34:59 2014 -0700 ---------------------------------------------------------------------- tools/marvin/marvin/lib/utils.py | 3 +- tools/marvin/marvin/marvinInit.py | 3 +- tools/marvin/marvin/marvinPlugin.py | 74 ++++++++------------------------ 3 files changed, 20 insertions(+), 60 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/afb58b37/tools/marvin/marvin/lib/utils.py ---------------------------------------------------------------------- diff --git a/tools/marvin/marvin/lib/utils.py b/tools/marvin/marvin/lib/utils.py index 440ff77..7617f90 100644 --- a/tools/marvin/marvin/lib/utils.py +++ b/tools/marvin/marvin/lib/utils.py @@ -271,7 +271,8 @@ def is_snapshot_on_nfs(apiclient, dbconn, config, zoneid, snapshotid): # snapshot extension to be appended to the snapshot path obtained from db snapshot_extensions = {"vmware": ".ovf", "kvm": "", - "xenserver": ".vhd"} + "xenserver": ".vhd", + "simulator":""} qresultset = dbconn.execute( "select id from snapshots where uuid = '%s';" \ http://git-wip-us.apache.org/repos/asf/cloudstack/blob/afb58b37/tools/marvin/marvin/marvinInit.py ---------------------------------------------------------------------- diff --git a/tools/marvin/marvin/marvinInit.py b/tools/marvin/marvin/marvinInit.py index bed8e7f..5059cdb 100644 --- a/tools/marvin/marvin/marvinInit.py +++ b/tools/marvin/marvin/marvinInit.py @@ -122,8 +122,7 @@ class MarvinInit: (self.__createTestClient() != FAILED) and (self.__deployDC() != FAILED)): return SUCCESS - else: - return FAILED + return FAILED except Exception, e: print "\n Exception Occurred Under init " \ "%s" % GetDetailExceptionInfo(e) http://git-wip-us.apache.org/repos/asf/cloudstack/blob/afb58b37/tools/marvin/marvin/marvinPlugin.py ---------------------------------------------------------------------- diff --git a/tools/marvin/marvin/marvinPlugin.py b/tools/marvin/marvin/marvinPlugin.py index 09ff340..222b357 100644 --- a/tools/marvin/marvin/marvinPlugin.py +++ b/tools/marvin/marvin/marvinPlugin.py @@ -40,6 +40,7 @@ class MarvinPlugin(Plugin): def __init__(self): self.__identifier = None self.__testClient = None + self.__logFolderPath = None self.__parsedConfig = None ''' Contains Config File @@ -210,38 +211,6 @@ class MarvinPlugin(Plugin): if type == 'dir': return os.path.split(inp)[-1] - def __runSuite(self, test_suite=None): - try: - if test_suite: - if self.wantFile(test_suite): - test_mod_name = self.__getModName(test_suite) - temp_obj = MarvinInit(self.__configFile, - None, test_mod_name, - self.__zoneForTests) - if temp_obj and temp_obj.init() == SUCCESS: - print "\nMarvin Initialization Successful." \ - "Test Suite:%s" % str(test_suite) - self.__testClient = temp_obj.getTestClient() - self.__tcRunLogger = temp_obj.getLogger() - self.__parsedConfig = temp_obj.getParsedConfig() - self.__resultStream = temp_obj.getResultFile() - self.__testRunner = nose.core.\ - TextTestRunner(stream=self.__resultStream, - descriptions=True, - verbosity=2) - return SUCCESS - return FAILED - except Exception as e: - print "\n Exception Occurred when running suite :%s Error : %s" \ - % (test_suite, GetDetailExceptionInfo(e)) - return FAILED - - def __runSuites(self, suites): - for suite in suites: - if os.path.isdir(suite): - return self.__runSuites(suite) - self.__runSuite(suite) - def startMarvin(self): ''' @Name : startMarvin @@ -252,31 +221,22 @@ class MarvinPlugin(Plugin): Creates a debugstream for tc debug log ''' try: - if self.__deployDcFlag: - print "\n***Step1 :Deploy Flag is Enabled, will deployDC****" - obj_marvininit = MarvinInit(self.__configFile, - self.__deployDcFlag, - "DeployDc", - self.__zoneForTests) - if not obj_marvininit or obj_marvininit.init() != SUCCESS: - return FAILED - print "\n====Now Start Running Test Suites====" - if len(self.conf.testNames) == 0: - if self.conf.workingDir == '': - print "\n==== " \ - "No Test Suites are provided, please check ====" - return FAILED - else: - if self.conf.workingDir != '': - test_names = self.conf.workingDir - else: - test_names = self.conf.testNames - for suites in test_names: - if os.path.isdir(suites): - self.__runSuites(suites) - if os.path.isfile(suites): - self.__runSuite(suites) - return SUCCESS + obj_marvininit = MarvinInit(self.__configFile, + self.__deployDcFlag, + None, + self.__zoneForTests) + if obj_marvininit and obj_marvininit.init() == SUCCESS: + self.__testClient = temp_obj.getTestClient() + self.__tcRunLogger = temp_obj.getLogger() + self.__parsedConfig = temp_obj.getParsedConfig() + self.__resultStream = temp_obj.getResultFile() + self.__logFolderPath = temp_obj.getLogFolderPath() + self.__testRunner = nose.core.\ + TextTestRunner(stream=self.__resultStream, + descriptions=True, + verbosity=2) + return SUCCESS + return FAILED except Exception as e: print "Exception Occurred under startMarvin: %s" % \ GetDetailExceptionInfo(e)