diff --git a/test/integration/smoke/test_deploy_vm.py b/test/integration/smoke/test_deploy_vm.py index 6a8d8e2d2d7..5cc00d01bbf 100644 --- a/test/integration/smoke/test_deploy_vm.py +++ b/test/integration/smoke/test_deploy_vm.py @@ -34,10 +34,6 @@ from marvin.lib.common import get_zone, get_domain, get_template from nose.plugins.attrib import attr - "virtual_machine3" : { - "name" : "testvm3", - "displayname" : "Test VM3", - }, class TestDeployVM(cloudstackTestCase): """Test deploy a VM into a user account """ diff --git a/test/integration/smoke/test_disk_offerings.py b/test/integration/smoke/test_disk_offerings.py index 42c950bd6a9..780c1542703 100644 --- a/test/integration/smoke/test_disk_offerings.py +++ b/test/integration/smoke/test_disk_offerings.py @@ -27,18 +27,6 @@ from nose.plugins.attrib import attr _multiprocess_shared_ = True - "sparse": { - "name": "Sparse Type Disk offering", - "displaytext": "Sparse Type Disk offering", - "disksize": 1, # in GB - "provisioningtype" : "sparse" - }, - "fat": { - "name": "Fat Type Disk offering", - "displaytext": "Fat Type Disk offering", - "disksize": 1, # in GB - "provisioningtype" : "fat" - } class TestCreateDiskOffering(cloudstackTestCase): def setUp(self): diff --git a/test/integration/smoke/test_volumes.py b/test/integration/smoke/test_volumes.py index 127a72114e8..ecce6e3a733 100644 --- a/test/integration/smoke/test_volumes.py +++ b/test/integration/smoke/test_volumes.py @@ -35,12 +35,6 @@ import tempfile _multiprocess_shared_ = True - "sparse_disk_offering": { - "displaytext": "Sparse", - "name": "Sparse", - "provisioningtype": "sparse", - "disksize": 1 - }, class TestCreateVolume(cloudstackTestCase): @classmethod diff --git a/tools/marvin/marvin/config/test_data.py b/tools/marvin/marvin/config/test_data.py index 711227c7f24..eb5ce26a6ec 100644 --- a/tools/marvin/marvin/config/test_data.py +++ b/tools/marvin/marvin/config/test_data.py @@ -205,6 +205,10 @@ test_data = { "name": "testvm2", "displayname": "Test VM2", }, + "virtual_machine3": { + "name": "testvm3", + "displayname": "Test VM3", + }, "server_without_disk": { "displayname": "Test VM-No Disk", "username": "root", @@ -586,5 +590,25 @@ test_data = { "startip": "10.223.252.196", "endip": "10.223.252.197", "vlan": "1001" + }, + "sparse": { + "name": "Sparse Type Disk offering", + "displaytext": + "Sparse Type Disk offering", + "disksize": 1, # in GB + "provisioningtype": "sparse" + }, + "fat": { + "name": "Fat Type Disk offering", + "displaytext": + "Fat Type Disk offering", + "disksize": 1, # in GB + "provisioningtype": "fat" + }, + "sparse_disk_offering": { + "displaytext": "Sparse", + "name": "Sparse", + "provisioningtype": "sparse", + "disksize": 1 } } diff --git a/tools/marvin/marvin/marvinInit.py b/tools/marvin/marvin/marvinInit.py index ba7c4de0130..c35fec6adc1 100644 --- a/tools/marvin/marvin/marvinInit.py +++ b/tools/marvin/marvin/marvinInit.py @@ -43,7 +43,8 @@ class MarvinInit: deploy_dc_flag=None, test_mod_name="deploydc", zone=None, - hypervisor_type=None): + hypervisor_type=None, + user_logfolder_path=None): self.__configFile = config_file self.__deployFlag = deploy_dc_flag self.__logFolderPath = None @@ -55,6 +56,7 @@ class MarvinInit: self.__zoneForTests = zone self.__parsedConfig = None self.__hypervisorType = hypervisor_type + self.__userLogFolderPath = user_logfolder_path def __parseConfig(self): ''' @@ -162,7 +164,8 @@ class MarvinInit: if log_obj: ret = log_obj.\ createLogs(self.__testModName, - self.__parsedConfig.logger) + self.__parsedConfig.logger, + self.__userLogFolderPath) if ret != FAILED: self.__logFolderPath = log_obj.getLogFolderPath() self.__tcRunLogger = log_obj.getLogger() diff --git a/tools/marvin/marvin/marvinLog.py b/tools/marvin/marvin/marvinLog.py index 6168987797f..65687aadde5 100644 --- a/tools/marvin/marvin/marvinLog.py +++ b/tools/marvin/marvin/marvinLog.py @@ -127,7 +127,8 @@ class MarvinLog: def createLogs(self, test_module_name=None, - log_cfg=None): + log_cfg=None, + user_provided_logpath=None): ''' @Name : createLogs @Desc : Gets the Logger with file paths initialized and created @@ -135,6 +136,10 @@ class MarvinLog: creating log folder path log_cfg: Log Configuration provided inside of Configuration + user_provided_logpath:LogPath provided by user + If user provided log path + is available, then one in cfg + will not be picked up. @Output : SUCCESS\FAILED ''' try: @@ -146,8 +151,9 @@ class MarvinLog: temp_path = str(test_module_name) + \ "__" + str(temp_ts) + "_" + random_gen() - temp_dir = "MarvinLogs" - if ((log_cfg is not None) and + if user_provided_logpath: + temp_dir = user_provided_logpath + elif ((log_cfg is not None) and ('LogFolderPath' in log_cfg.__dict__.keys()) and (log_cfg.__dict__.get('LogFolderPath') is not None)): temp_dir = \ diff --git a/tools/marvin/marvin/marvinPlugin.py b/tools/marvin/marvin/marvinPlugin.py index ae839e83d33..4200a657e71 100644 --- a/tools/marvin/marvin/marvinPlugin.py +++ b/tools/marvin/marvin/marvinPlugin.py @@ -64,6 +64,10 @@ class MarvinPlugin(Plugin): self.__tcRunLogger = None self.__testModName = '' self.__hypervisorType = None + ''' + The Log Path provided by user where all logs are routed to + ''' + self.__userLogPath = None Plugin.__init__(self) def configure(self, options, conf): @@ -81,6 +85,7 @@ class MarvinPlugin(Plugin): self.__deployDcFlag = options.deployDc self.__zoneForTests = options.zone self.__hypervisorType = options.hypervisor_type + self.__userLogPath = options.logFolder self.conf = conf if self.startMarvin() == FAILED: print "\nStarting Marvin Failed, exiting. Please Check" @@ -112,6 +117,12 @@ class MarvinPlugin(Plugin): dest="hypervisor_type", help="Runs all tests against the specified " "zone and hypervisor Type") + parser.add_option("--log-folder-path", action="store", + default=None, + dest="logFolder", + help="Collects all logs under the user specified" + "folder" + ) Plugin.options(self, parser, env) def wantClass(self, cls): @@ -221,7 +232,8 @@ class MarvinPlugin(Plugin): self.__deployDcFlag, None, self.__zoneForTests, - self.__hypervisorType) + self.__hypervisorType, + self.__userLogPath) if obj_marvininit and obj_marvininit.init() == SUCCESS: self.__testClient = obj_marvininit.getTestClient() self.__tcRunLogger = obj_marvininit.getLogger() @@ -275,20 +287,21 @@ class MarvinPlugin(Plugin): def finalize(self, result): try: - src = self.__logFolderPath - log_cfg = self.__parsedConfig.logger - tmp = log_cfg.__dict__.get('LogFolderPath') + "/MarvinLogs" - dst = tmp + "//" + random_gen() - mod_name = "test_suite" - if self.__testModName: - mod_name = self.__testModName.split(".") - if len(mod_name) > 2: - mod_name = mod_name[-2] - if mod_name: - dst = tmp + "/" + mod_name + "_" + random_gen() - cmd = "mv " + src + " " + dst - os.system(cmd) - print "===final results are now copied to: %s===" % str(dst) + if not self.__userLogPath: + src = self.__logFolderPath + log_cfg = self.__parsedConfig.logger + tmp = log_cfg.__dict__.get('LogFolderPath') + "/MarvinLogs" + dst = tmp + "//" + random_gen() + mod_name = "test_suite" + if self.__testModName: + mod_name = self.__testModName.split(".") + if len(mod_name) > 2: + mod_name = mod_name[-2] + if mod_name: + dst = tmp + "/" + mod_name + "_" + random_gen() + cmd = "mv " + src + " " + dst + os.system(cmd) + print "===final results are now copied to: %s===" % str(dst) except Exception, e: print "=== Exception occurred under finalize :%s ===" % \ str(GetDetailExceptionInfo(e))