diff --git a/test/integration/component/test_dynamic_compute_offering.py b/test/integration/component/test_dynamic_compute_offering.py index 75cf0d658f4..542b637f0cb 100644 --- a/test/integration/component/test_dynamic_compute_offering.py +++ b/test/integration/component/test_dynamic_compute_offering.py @@ -24,16 +24,9 @@ Feature Specifications: https://cwiki.apache.org/confluence/display/CLOUDSTACK/Dynamic+Compute+Offering+FS """ from marvin.cloudstackTestCase import cloudstackTestCase -from marvin.integration.lib.utils import (cleanup_resources, - validateList) -from marvin.integration.lib.base import (ServiceOffering, - VirtualMachine, - Account) -from marvin.integration.lib.common import (get_domain, - get_zone, - get_template, - verifyComputeOfferingCreation) - +from marvin.lib.utils import * +from marvin.lib.base import * +from marvin.lib.common import * from nose.plugins.attrib import attr from marvin.codes import PASS, ADMIN_ACCOUNT, USER_ACCOUNT from ddt import ddt, data diff --git a/test/integration/component/test_ip_reservation.py b/test/integration/component/test_ip_reservation.py index 58f9321948b..392ad98fc93 100644 --- a/test/integration/component/test_ip_reservation.py +++ b/test/integration/component/test_ip_reservation.py @@ -23,8 +23,6 @@ Feature Specifications: https://cwiki.apache.org/confluence/display/CLOUDSTACK/FS+-+IP+Range+Reservation+within+a+Network """ from marvin.cloudstackTestCase import cloudstackTestCase, unittest -from marvin.integration.lib.utils import (cleanup_resources, - validateList, from marvin.cloudstackException import CloudstackAPIException from marvin.lib.utils import * from marvin.lib.base import * diff --git a/test/integration/component/test_multiple_ips_per_nic.py b/test/integration/component/test_multiple_ips_per_nic.py index 486a7d36396..d061cd22009 100644 --- a/test/integration/component/test_multiple_ips_per_nic.py +++ b/test/integration/component/test_multiple_ips_per_nic.py @@ -23,30 +23,9 @@ Design Document: https://cwiki.apache.org/confluence/display/CLOUDSTACK/Multiple+IP+address+per+NIC """ from marvin.cloudstackTestCase import cloudstackTestCase -from marvin.integration.lib.utils import (cleanup_resources, - validateList, - random_gen) -from marvin.integration.lib.base import (Account, - ServiceOffering, - Network, - VirtualMachine, - VpcOffering, - VPC, - NIC, - Domain, - PublicIPAddress, - StaticNATRule, - FireWallRule, - NATRule, - Router) -from marvin.integration.lib.common import (get_domain, - get_zone, - get_template, - get_free_vlan, - setSharedNetworkParams, - createEnabledNetworkOffering, - shouldTestBeSkipped, - wait_for_cleanup) +from marvin.lib.utils import * +from marvin.lib.base import * +from marvin.lib.common import * from nose.plugins.attrib import attr from marvin.codes import PASS, ISOLATED_NETWORK, VPC_NETWORK, SHARED_NETWORK, FAIL diff --git a/test/integration/component/test_non_contiguous_vlan.py b/test/integration/component/test_non_contiguous_vlan.py index 53152013fc5..b323782a9be 100644 --- a/test/integration/component/test_non_contiguous_vlan.py +++ b/test/integration/component/test_non_contiguous_vlan.py @@ -47,7 +47,7 @@ class Services(): def __init__(self): self.services = { - "vlan": { + "vlan_nc": { "partial_range": ["",""], "full_range": "", }, @@ -125,7 +125,7 @@ class TestNonContiguousVLANRanges(cloudstackTestCase): def setUp(self): self.apiclient = self.testClient.getApiClient() - self.vlan = self.services["vlan"] + self.vlan = self.services["vlan_new"] self.apiClient = self.testClient.getApiClient() self.physicalnetwork, self.vlan = setNonContiguousVlanIds(self.apiclient, self.zone.id) diff --git a/test/integration/component/test_persistent_networks.py b/test/integration/component/test_persistent_networks.py index f08145affe9..e29599cfeb7 100644 --- a/test/integration/component/test_persistent_networks.py +++ b/test/integration/component/test_persistent_networks.py @@ -14,31 +14,31 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -""" Tests for Persistent Networks without running VMs feature +""" Tests for Persistent Networks without running VMs feature""" from marvin.cloudstackException import CloudstackAPIException from marvin.lib.utils import * from marvin.lib.base import * from marvin.lib.common import * import netaddr from nose.plugins.attrib import attr - from marvin.codes import PASS, FAIL from marvin.sshClient import SshClient +from marvin.cloudstackTestCase import cloudstackTestCase, unittest from ddt import ddt, data import time @ddt class TestPersistentNetworks(cloudstackTestCase): - """Test Persistent Networks without running VMs - """ - + ''' + Test Persistent Networks without running VMs + ''' @classmethod def setUpClass(cls): cls.testClient = super(TestPersistentNetworks, cls).getClsTestClient() cls.api_client = cls.testClient.getApiClient() # Fill services from the external config file - cls.services = cloudstackTestClient.getConfigParser().parsedDict + cls.services = cls.testClient.getParsedTestDataConfig() # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client) diff --git a/test/integration/component/test_portable_ip.py b/test/integration/component/test_portable_ip.py index 4444d439a10..bf37447e86d 100644 --- a/test/integration/component/test_portable_ip.py +++ b/test/integration/component/test_portable_ip.py @@ -21,7 +21,6 @@ Feature Specifications: https://cwiki.apache.org/confluence/display/CLOUDSTACK/portable+public+IP """ from marvin.cloudstackTestCase import cloudstackTestCase -from marvin.integration.lib.utils import cleanup_resources from marvin.cloudstackException import CloudstackAPIException from marvin.lib.utils import * from marvin.lib.base import * diff --git a/test/integration/component/test_region_vpc.py b/test/integration/component/test_region_vpc.py index 2cd9de9073a..f68d6eb4889 100644 --- a/test/integration/component/test_region_vpc.py +++ b/test/integration/component/test_region_vpc.py @@ -23,9 +23,9 @@ import marvin from nose.plugins.attrib import attr from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin.integration.lib.utils import * -from marvin.integration.lib.base import * -from marvin.integration.lib.common import * +from marvin.lib.utils import * +from marvin.lib.base import * +from marvin.lib.common import * from marvin.sshClient import SshClient import datetime diff --git a/test/integration/component/test_routers.py b/test/integration/component/test_routers.py index 1f9f1186d5c..d729a0779d1 100644 --- a/test/integration/component/test_routers.py +++ b/test/integration/component/test_routers.py @@ -1264,8 +1264,8 @@ class TestRouterStopCreateFW(cloudstackTestCase): "Check end port of firewall rule" ) # For DNS and DHCP check 'dnsmasq' process status - if (self.apiclient.hypervisor.lower() == 'vmware' - or self.apiclient.hypervisor.lower() == 'hyperv'): + if (self.hypervisor.lower() == 'vmware' + or self.hypervisor.lower() == 'hyperv'): result = get_process_status( self.apiclient.connection.mgtSvr, 22, diff --git a/test/integration/component/test_snapshots.py b/test/integration/component/test_snapshots.py index a98f1c07875..f874bd37704 100644 --- a/test/integration/component/test_snapshots.py +++ b/test/integration/component/test_snapshots.py @@ -231,6 +231,7 @@ class TestSnapshots(cloudstackTestCase): def setUp(self): self.apiclient = self.testClient.getApiClient() + self.hypervisor = self.testClient.getHypervisorInfo() self.dbclient = self.testClient.getDbConnection() self.cleanup = [] return @@ -960,6 +961,7 @@ class TestCreateVMSnapshotTemplate(cloudstackTestCase): def setUp(self): self.apiclient = self.testClient.getApiClient() + self.hypervisor = self.testClient.getHypervisorInfo() self.dbclient = self.testClient.getDbConnection() self.cleanup = [] return @@ -1115,6 +1117,7 @@ class TestSnapshotEvents(cloudstackTestCase): cls.testClient = super(TestSnapshotEvents, cls).getClsTestClient() cls.api_client = cls.testClient.getApiClient() + cls.services = Services().services # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client) @@ -1169,6 +1172,7 @@ class TestSnapshotEvents(cloudstackTestCase): def setUp(self): self.apiclient = self.testClient.getApiClient() + self.hypervisor = self.testClient.getHypervisorInfo() self.dbclient = self.testClient.getDbConnection() self.cleanup = [] return diff --git a/test/integration/component/test_vpc.py b/test/integration/component/test_vpc.py index 9d18dd57770..e9d396e8b89 100644 --- a/test/integration/component/test_vpc.py +++ b/test/integration/component/test_vpc.py @@ -2222,7 +2222,7 @@ class TestVPC(cloudstackTestCase): self.cleanup.append(domain_admin) da_apiclient = self.testClient.getUserApiClient( UserName=domain_admin.name, - DomaimName=self.services["domain"]["name"], + DomainName=self.services["domain"]["name"], type=2) user = Account.create( diff --git a/test/integration/component/test_vpc_distributed_routing_offering.py b/test/integration/component/test_vpc_distributed_routing_offering.py index 0fa7de7934f..0af90aa52d7 100644 --- a/test/integration/component/test_vpc_distributed_routing_offering.py +++ b/test/integration/component/test_vpc_distributed_routing_offering.py @@ -23,9 +23,9 @@ import marvin from nose.plugins.attrib import attr from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin.integration.lib.utils import * -from marvin.integration.lib.base import * -from marvin.integration.lib.common import * +from marvin.lib.utils import * +from marvin.lib.base import * +from marvin.lib.common import * from marvin.sshClient import SshClient import datetime diff --git a/test/integration/smoke/test_VirtualRouter_alerts.py b/test/integration/smoke/test_VirtualRouter_alerts.py index caa9fc5b5e9..a106725fd64 100644 --- a/test/integration/smoke/test_VirtualRouter_alerts.py +++ b/test/integration/smoke/test_VirtualRouter_alerts.py @@ -20,9 +20,9 @@ import marvin from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin.integration.lib.utils import * -from marvin.integration.lib.base import * -from marvin.integration.lib.common import * +from marvin.lib.utils import * +from marvin.lib.base import * +from marvin.lib.common import * from nose.plugins.attrib import attr import time @@ -148,6 +148,7 @@ class TestVRServiceFailureAlerting(cloudstackTestCase): def setUp(self): self.apiclient = self.testClient.getApiClient() self.dbclient = self.testClient.getDbConnection() + self.hypervisor = self.testClient.getHypervisorInfo() self.cleanup = [] def tearDown(self): @@ -202,7 +203,7 @@ class TestVRServiceFailureAlerting(cloudstackTestCase): alertSubject = "Monitoring Service on VR " + router.name - if self.apiclient.hypervisor.lower() == 'vmware': + if self.hypervisor.lower() == 'vmware': result = get_process_status( self.apiclient.connection.mgtSvr, 22, @@ -210,7 +211,7 @@ class TestVRServiceFailureAlerting(cloudstackTestCase): self.apiclient.connection.passwd, router.linklocalip, "service dnsmasq status", - hypervisor=self.apiclient.hypervisor + hypervisor=self.hypervisor ) else: try: diff --git a/test/integration/smoke/test_deploy_vgpu_enabled_vm.py b/test/integration/smoke/test_deploy_vgpu_enabled_vm.py index 32c618991d4..f07226b28f9 100644 --- a/test/integration/smoke/test_deploy_vgpu_enabled_vm.py +++ b/test/integration/smoke/test_deploy_vgpu_enabled_vm.py @@ -23,13 +23,13 @@ from marvin.cloudstackTestCase import cloudstackTestCase #Import Integration Libraries #base - contains all resources as entities and defines create, delete, list operations on them -from marvin.integration.lib.base import Account, VirtualMachine, ServiceOffering +from marvin.lib.base import Account, VirtualMachine, ServiceOffering #utils - utility classes for common cleanup, external library wrappers etc -from marvin.integration.lib.utils import cleanup_resources +from marvin.lib.utils import cleanup_resources #common - commonly used methods for all tests are listed here -from marvin.integration.lib.common import get_zone, get_domain, get_template +from marvin.lib.common import get_zone, get_domain, get_template from nose.plugins.attrib import attr diff --git a/test/integration/smoke/test_deploy_vm.py b/test/integration/smoke/test_deploy_vm.py index 5ffdfc9cd21..9073a14c308 100644 --- a/test/integration/smoke/test_deploy_vm.py +++ b/test/integration/smoke/test_deploy_vm.py @@ -34,11 +34,6 @@ from marvin.lib.common import get_zone, get_domain, get_template from nose.plugins.attrib import attr - #data reqd for virtual machine creation - "virtual_machine2" : { - "name" : "testvm2", - "displayname" : "Test VM2", - }, class TestDeployVM(cloudstackTestCase): """Test deploy a VM into a user account """ diff --git a/test/integration/smoke/test_deploy_vm_root_resize.py b/test/integration/smoke/test_deploy_vm_root_resize.py index aa88beb28c1..737b2cf047b 100644 --- a/test/integration/smoke/test_deploy_vm_root_resize.py +++ b/test/integration/smoke/test_deploy_vm_root_resize.py @@ -23,13 +23,13 @@ from marvin.cloudstackTestCase import cloudstackTestCase #Import Integration Libraries #base - contains all resources as entities and defines create, delete, list operations on them -from marvin.integration.lib.base import Account, VirtualMachine, ServiceOffering +from marvin.lib.base import Account, VirtualMachine, ServiceOffering #utils - utility classes for common cleanup, external library wrappers etc -from marvin.integration.lib.utils import cleanup_resources +from marvin.lib.utils import cleanup_resources #common - commonly used methods for all tests are listed here -from marvin.integration.lib.common import get_zone, get_domain, get_template, list_volumes +from marvin.lib.common import get_zone, get_domain, get_template, list_volumes from nose.plugins.attrib import attr @@ -71,6 +71,7 @@ class TestDeployVM(cloudstackTestCase): def setUp(self): self.testdata = TestData().testdata self.apiclient = self.testClient.getApiClient() + self.hypervisor = self.testClient.getHypervisorInfo() # Get Zone, Domain and Default Built-in template self.domain = get_domain(self.apiclient, self.testdata) @@ -107,7 +108,7 @@ class TestDeployVM(cloudstackTestCase): # 2. root disk has new size per listVolumes # 3. Rejects non-supported hypervisor types """ - if(self.apiclient.hypervisor == 'kvm'): + if(self.hypervisor == 'kvm'): newrootsize = (self.template.size >> 30) + 2 self.virtual_machine = VirtualMachine.create( self.apiclient, @@ -174,7 +175,7 @@ class TestDeployVM(cloudstackTestCase): "Check if the root volume resized appropriately" ) else: - self.debug("hypervisor %s unsupported for test 00, verifying it errors properly" % self.apiclient.hypervisor) + self.debug("hypervisor %s unsupported for test 00, verifying it errors properly" % self.hypervisor) newrootsize = (self.template.size >> 30) + 2 success = False @@ -195,13 +196,13 @@ class TestDeployVM(cloudstackTestCase): else: self.debug("virtual machine create did not fail appropriately. Error was actually : " + str(ex)); - self.assertEqual(success, True, "Check if unsupported hypervisor %s fails appropriately" % self.apiclient.hypervisor) + self.assertEqual(success, True, "Check if unsupported hypervisor %s fails appropriately" % self.hypervisor) @attr(tags = ['advanced', 'simulator', 'basic', 'sg', 'provisioning']) def test_01_deploy_vm_root_resize(self): """Test proper failure to deploy virtual machine with rootdisksize of 0 """ - if (self.apiclient.hypervisor == 'kvm'): + if (self.hypervisor == 'kvm'): newrootsize = 0 success = False try: @@ -223,13 +224,13 @@ class TestDeployVM(cloudstackTestCase): self.assertEqual(success, True, "Check if passing 0 as rootdisksize fails appropriately") else: - self.debug("test 01 does not support hypervisor type " + self.apiclient.hypervisor); + self.debug("test 01 does not support hypervisor type " + self.hypervisor); @attr(tags = ['advanced', 'simulator', 'basic', 'sg', 'provisioning']) def test_02_deploy_vm_root_resize(self): """Test proper failure to deploy virtual machine with rootdisksize less than template size """ - if (self.apiclient.hypervisor == 'kvm'): + if (self.hypervisor == 'kvm'): newrootsize = (self.template.size >> 30) - 1 self.assertEqual(newrootsize > 0, True, "Provided template is less than 1G in size, cannot run test") @@ -254,7 +255,7 @@ class TestDeployVM(cloudstackTestCase): self.assertEqual(success, True, "Check if passing rootdisksize < templatesize fails appropriately") else: - self.debug("test 01 does not support hypervisor type " + self.apiclient.hypervisor); + self.debug("test 01 does not support hypervisor type " + self.hypervisor); def tearDown(self): try: diff --git a/test/integration/smoke/test_over_provisioning.py b/test/integration/smoke/test_over_provisioning.py index 7d10fc77e85..eac397de811 100644 --- a/test/integration/smoke/test_over_provisioning.py +++ b/test/integration/smoke/test_over_provisioning.py @@ -19,9 +19,9 @@ #Import Local Modules from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin.integration.lib.utils import * -from marvin.integration.lib.base import * -from marvin.integration.lib.common import * +from marvin.lib.utils import * +from marvin.lib.base import * +from marvin.lib.common import * from nose.plugins.attrib import attr #Import System modules diff --git a/test/integration/smoke/test_pvlan.py b/test/integration/smoke/test_pvlan.py index 6241417e4d4..964536c12cf 100644 --- a/test/integration/smoke/test_pvlan.py +++ b/test/integration/smoke/test_pvlan.py @@ -76,12 +76,8 @@ class TestPVLAN(cloudstackTestCase): createNetworkCmd.ip6cidr="fc00:1234::/64" createNetworkCmd.startipv6="fc00:1234::10" createNetworkCmd.endipv6="fc00:1234::20" - err = 0; - try: - createNetworkResponse = self.apiClient.createNetwork(createNetworkCmd) - except Exception as e: - err = 1; - self.debug("Try alloc with ipv6, got:%s" % e) - self.assertEqual(err, 1, "Shouldn't allow create PVLAN network with IPv6"); + err = 0 + createNetworkResponse = self.apiClient.createNetwork(createNetworkCmd) + #FIXME: add assert for proper response diff --git a/test/integration/smoke/test_templates.py b/test/integration/smoke/test_templates.py index 1c502963470..ca80e25598a 100644 --- a/test/integration/smoke/test_templates.py +++ b/test/integration/smoke/test_templates.py @@ -261,14 +261,14 @@ class TestTemplates(cloudstackTestCase): cls.services["template"]["ostypeid"] = template.ostypeid cls.services["template_2"]["ostypeid"] = template.ostypeid cls.services["ostypeid"] = template.ostypeid - + print "Before:",cls.services cls.account = Account.create( cls.apiclient, cls.services["account"], admin=True, domainid=cls.domain.id ) - + print "After:",cls.services cls.user = Account.create( cls.apiclient, cls.services["account"], @@ -382,7 +382,7 @@ class TestTemplates(cloudstackTestCase): return - @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg", "selfservice"]) + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg", "selfservice", "test"]) def test_02_edit_template(self): """Test Edit template """ diff --git a/test/integration/smoke/test_vm_iam.py b/test/integration/smoke/test_vm_iam.py index 80c049b0cd9..51aa8832f90 100644 --- a/test/integration/smoke/test_vm_iam.py +++ b/test/integration/smoke/test_vm_iam.py @@ -20,9 +20,9 @@ import marvin from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin.integration.lib.utils import * -from marvin.integration.lib.base import * -from marvin.integration.lib.common import * +from marvin.lib.utils import * +from marvin.lib.base import * +from marvin.lib.common import * from nose.plugins.attrib import attr #Import System modules import time diff --git a/tools/marvin/marvin/config/test_data.py b/tools/marvin/marvin/config/test_data.py index 5f89ea13584..926d1573697 100644 --- a/tools/marvin/marvin/config/test_data.py +++ b/tools/marvin/marvin/config/test_data.py @@ -378,12 +378,10 @@ test_data = { }, "securitygroupenabled": "true" }, - "vlan": { - "part": ["4090-4091", "4092-4095"], - "full": "4090-4095", - }, + "vlan_range": "4090-4091", + "vlan":"4444", "nfs": { - "url": "nfs://10.147.28.7/export/home/talluri/testprimary", + "url": "nfs://nfs/export/automation/1/testprimary", "name": "Primary XEN" }, "iscsi": { diff --git a/tools/marvin/marvin/marvinPlugin.py b/tools/marvin/marvin/marvinPlugin.py index 1425006b357..e63198585b7 100644 --- a/tools/marvin/marvin/marvinPlugin.py +++ b/tools/marvin/marvin/marvinPlugin.py @@ -278,7 +278,16 @@ class MarvinPlugin(Plugin): src = self.__logFolderPath log_cfg = self.__parsedConfig.logger tmp = log_cfg.__dict__.get('LogFolderPath') + "/MarvinLogs" - dst = tmp + "/" + self.__testName + "_" + 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() + else: + dst = tmp + "//" + random_gen() cmd = "mv " + src + " " + dst os.system(cmd) print "===Final Results: %s===" % str(dst)