Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8072E11C9C for ; Mon, 28 Apr 2014 11:00:28 +0000 (UTC) Received: (qmail 5185 invoked by uid 500); 28 Apr 2014 11:00:12 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 4929 invoked by uid 500); 28 Apr 2014 11:00:07 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 4661 invoked by uid 99); 28 Apr 2014 11:00:04 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Apr 2014 11:00:04 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 07E0B99828F; Mon, 28 Apr 2014 11:00:04 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: talluri@apache.org To: commits@cloudstack.apache.org Date: Mon, 28 Apr 2014 11:00:19 -0000 Message-Id: <80f9f3ed40f84ebb94dd7297923aebf3@git.apache.org> In-Reply-To: <0a090dbf096c4028a3a7246bfae69ea3@git.apache.org> References: <0a090dbf096c4028a3a7246bfae69ea3@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [18/18] git commit: updated refs/heads/4.4-automation to 404ac54 Marvin + test changes from master Signed-off-by: SrikanteswaraRao Talluri Signed-off-by: SrikanteswaraRao Talluri Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/404ac549 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/404ac549 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/404ac549 Branch: refs/heads/4.4-automation Commit: 404ac549bfd84e97c756009f214e74cdb73548de Parents: 6f7f999 Author: SrikanteswaraRao Talluri Authored: Mon Apr 28 14:55:11 2014 +0530 Committer: SrikanteswaraRao Talluri Committed: Mon Apr 28 16:28:43 2014 +0530 ---------------------------------------------------------------------- .../maint/test_egress_rules_host_maintenance.py | 20 +- .../component/maint/test_high_availability.py | 26 +- .../maint/test_host_high_availability.py | 36 +- .../component/maint/test_multiple_ip_ranges.py | 20 +- .../component/maint/test_redundant_router.py | 70 +- ...test_redundant_router_deployment_planning.py | 17 +- .../test_redundant_router_network_rules.py | 17 +- .../maint/test_vpc_host_maintenance.py | 21 +- .../maint/test_vpc_on_host_maintenance.py | 17 +- .../component/test_VirtualRouter_alerts.py | 22 +- test/integration/component/test_accounts.py | 141 +- .../component/test_add_remove_network.py | 118 +- .../component/test_advancedsg_networks.py | 71 +- .../component/test_affinity_groups.py | 115 +- .../component/test_allocation_states.py | 39 +- test/integration/component/test_asa1000v_fw.py | 18 +- test/integration/component/test_assign_vm.py | 39 +- test/integration/component/test_baremetal.py | 28 +- .../component/test_base_image_updation.py | 22 +- test/integration/component/test_blocker_bugs.py | 74 +- .../component/test_cpu_domain_limits.py | 38 +- test/integration/component/test_cpu_limits.py | 35 +- .../component/test_cpu_max_limits.py | 25 +- .../component/test_cpu_project_limits.py | 17 +- .../component/test_custom_hostname.py | 44 +- .../component/test_deploy_vm_userdata_reg.py | 19 +- .../component/test_dynamic_compute_offering.py | 44 +- .../component/test_egress_fw_rules.py | 19 +- test/integration/component/test_egress_rules.py | 126 +- test/integration/component/test_eip_elb.py | 22 +- test/integration/component/test_escalations.py | 8230 ++++++++++++++++++ .../component/test_explicit_dedication.py | 15 +- test/integration/component/test_haproxy.py | 15 +- .../component/test_implicit_planner.py | 15 +- .../component/test_ip_reservation.py | 109 +- test/integration/component/test_ldap.py | 6 +- .../integration/component/test_memory_limits.py | 32 +- .../component/test_mm_domain_limits.py | 36 +- .../integration/component/test_mm_max_limits.py | 23 +- .../component/test_mm_project_limits.py | 17 +- .../component/test_multiple_ip_ranges.py | 28 +- .../component/test_multiple_ips_per_nic.py | 490 +- .../component/test_netscaler_configs.py | 116 +- test/integration/component/test_netscaler_lb.py | 116 +- .../component/test_netscaler_lb_algo.py | 106 +- .../component/test_netscaler_lb_sticky.py | 17 +- .../component/test_netscaler_nw_off.py | 82 +- .../component/test_network_offering.py | 39 +- .../component/test_non_contiguous_vlan.py | 22 +- .../component/test_persistent_networks.py | 112 +- test/integration/component/test_portable_ip.py | 142 +- .../component/test_project_configs.py | 62 +- .../component/test_project_limits.py | 35 +- .../component/test_project_resources.py | 69 +- .../integration/component/test_project_usage.py | 102 +- test/integration/component/test_projects.py | 109 +- .../component/test_recurring_snapshots.py | 16 +- .../component/test_redundant_router_cleanups.py | 17 +- .../component/test_redundant_router_services.py | 17 +- .../component/test_redundant_router_upgrades.py | 17 +- test/integration/component/test_region_vpc.py | 38 +- test/integration/component/test_regions.py | 8 +- .../component/test_regions_accounts.py | 8 +- .../component/test_reset_ssh_keypair.py | 24 +- .../component/test_resource_limits.py | 33 +- test/integration/component/test_routers.py | 45 +- .../component/test_security_groups.py | 59 +- .../component/test_shared_networks.py | 17 +- test/integration/component/test_snapshot_gc.py | 16 +- .../component/test_snapshot_limits.py | 16 +- test/integration/component/test_snapshots.py | 34 +- .../component/test_snapshots_improvement.py | 26 +- test/integration/component/test_stopped_vm.py | 99 +- .../component/test_storage_motion.py | 15 +- test/integration/component/test_tags.py | 34 +- test/integration/component/test_templates.py | 31 +- test/integration/component/test_update_vm.py | 12 +- test/integration/component/test_usage.py | 78 +- .../component/test_vm_passwdenabled.py | 18 +- test/integration/component/test_vmware_drs.py | 61 +- test/integration/component/test_volumes.py | 60 +- test/integration/component/test_vpc.py | 49 +- .../test_vpc_distributed_routing_offering.py | 35 +- test/integration/component/test_vpc_network.py | 54 +- .../component/test_vpc_network_lbrules.py | 17 +- .../component/test_vpc_network_pfrules.py | 17 +- .../component/test_vpc_network_staticnatrule.py | 17 +- .../integration/component/test_vpc_offerings.py | 17 +- test/integration/component/test_vpc_routers.py | 200 +- .../component/test_vpc_vm_life_cycle.py | 61 +- .../component/test_vpc_vms_deployment.py | 17 +- test/integration/component/test_vpn_users.py | 23 +- test/integration/smoke/test_affinity_groups.py | 85 +- .../smoke/test_deploy_vgpu_enabled_vm.py | 18 +- test/integration/smoke/test_deploy_vm.py | 60 +- .../smoke/test_deploy_vm_root_resize.py | 29 +- .../smoke/test_deploy_vm_with_userdata.py | 60 +- ...deploy_vms_with_varied_deploymentplanners.py | 56 +- test/integration/smoke/test_disk_offerings.py | 125 +- test/integration/smoke/test_global_settings.py | 6 +- test/integration/smoke/test_guest_vlan_range.py | 39 +- test/integration/smoke/test_hosts.py | 88 +- test/integration/smoke/test_internal_lb.py | 79 +- test/integration/smoke/test_iso.py | 125 +- test/integration/smoke/test_loadbalance.py | 126 +- .../smoke/test_multipleips_per_nic.py | 50 +- test/integration/smoke/test_network.py | 230 +- test/integration/smoke/test_network_acl.py | 74 +- test/integration/smoke/test_nic.py | 118 +- .../smoke/test_non_contigiousvlan.py | 4 +- .../integration/smoke/test_over_provisioning.py | 29 +- .../integration/smoke/test_portable_publicip.py | 110 +- test/integration/smoke/test_primary_storage.py | 31 +- test/integration/smoke/test_privategw_acl.py | 6 +- test/integration/smoke/test_public_ip_range.py | 50 +- test/integration/smoke/test_pvlan.py | 18 +- test/integration/smoke/test_regions.py | 35 +- .../smoke/test_reset_vm_on_reboot.py | 86 +- test/integration/smoke/test_resource_detail.py | 95 +- test/integration/smoke/test_routers.py | 90 +- test/integration/smoke/test_scale_vm.py | 97 +- .../integration/smoke/test_secondary_storage.py | 12 +- .../integration/smoke/test_service_offerings.py | 136 +- test/integration/smoke/test_snapshots.py | 135 +- test/integration/smoke/test_ssvm.py | 34 +- test/integration/smoke/test_templates.py | 175 +- test/integration/smoke/test_vm_ha.py | 6 +- test/integration/smoke/test_vm_iam.py | 12 +- test/integration/smoke/test_vm_life_cycle.py | 186 +- test/integration/smoke/test_vm_snapshots.py | 106 +- test/integration/smoke/test_volumes.py | 177 +- test/integration/smoke/test_vpc_vpn.py | 112 +- tools/marvin/marvin/__init__.py | 2 +- tools/marvin/marvin/asyncJobMgr.py | 12 +- tools/marvin/marvin/cloudstackConnection.py | 476 +- tools/marvin/marvin/cloudstackException.py | 19 +- tools/marvin/marvin/cloudstackTestCase.py | 6 +- tools/marvin/marvin/cloudstackTestClient.py | 550 +- tools/marvin/marvin/codegenerator.py | 15 +- tools/marvin/marvin/codes.py | 21 +- tools/marvin/marvin/config/__init__.py | 16 + tools/marvin/marvin/config/config.cfg | 38 +- tools/marvin/marvin/config/test_data.cfg | 427 + tools/marvin/marvin/config/test_data.py | 629 ++ tools/marvin/marvin/configGenerator.py | 230 +- tools/marvin/marvin/dbConnection.py | 9 +- tools/marvin/marvin/deployAndRun.py | 6 +- tools/marvin/marvin/deployDataCenter.py | 1523 ++-- tools/marvin/marvin/integration/__init__.py | 18 - tools/marvin/marvin/integration/lib/__init__.py | 16 - tools/marvin/marvin/integration/lib/base.py | 3889 --------- tools/marvin/marvin/integration/lib/common.py | 1036 --- tools/marvin/marvin/integration/lib/utils.py | 453 - tools/marvin/marvin/jsonHelper.py | 9 +- tools/marvin/marvin/lib/__init__.py | 16 + tools/marvin/marvin/lib/base.py | 4085 +++++++++ tools/marvin/marvin/lib/common.py | 1062 +++ tools/marvin/marvin/lib/utils.py | 498 ++ tools/marvin/marvin/marvinInit.py | 250 +- tools/marvin/marvin/marvinLog.py | 141 +- tools/marvin/marvin/marvinPlugin.py | 308 +- tools/marvin/marvin/src/__init__.py | 16 + tools/marvin/marvin/sshClient.py | 142 +- tools/marvin/marvin/tcExecuteEngine.py | 10 +- tools/marvin/marvin/testSetupSuccess.py | 1 + tools/marvin/setup.py | 60 +- 166 files changed, 20856 insertions(+), 11014 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/404ac549/test/integration/component/maint/test_egress_rules_host_maintenance.py ---------------------------------------------------------------------- diff --git a/test/integration/component/maint/test_egress_rules_host_maintenance.py b/test/integration/component/maint/test_egress_rules_host_maintenance.py index 2b81787..a27ada3 100644 --- a/test/integration/component/maint/test_egress_rules_host_maintenance.py +++ b/test/integration/component/maint/test_egress_rules_host_maintenance.py @@ -23,9 +23,9 @@ from nose.plugins.attrib import attr from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * from marvin.sshClient import SshClient -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 * #Import System modules import time @@ -100,19 +100,17 @@ class TestEgressAfterHostMaintenance(cloudstackTestCase): @classmethod def setUpClass(cls): - cls.services = Services().services - cls.api_client = super( - TestEgressAfterHostMaintenance, - cls - ).getClsTestClient().getApiClient() + cls.testClient = super(TestEgressAfterHostMaintenance, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + cls.services = Services().services # Get Zone, Domain and templates - cls.domain = get_domain(cls.api_client, cls.services) - cls.zone = get_zone(cls.api_client, cls.services) + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) cls.services['mode'] = cls.zone.networktype cls.pod = get_pod( cls.api_client, - zoneid=cls.zone.id + zone_id=cls.zone.id ) template = get_template( http://git-wip-us.apache.org/repos/asf/cloudstack/blob/404ac549/test/integration/component/maint/test_high_availability.py ---------------------------------------------------------------------- diff --git a/test/integration/component/maint/test_high_availability.py b/test/integration/component/maint/test_high_availability.py index 6ada659..cc687f8 100644 --- a/test/integration/component/maint/test_high_availability.py +++ b/test/integration/component/maint/test_high_availability.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 @@ -107,24 +107,16 @@ class TestHighAvailability(cloudstackTestCase): @classmethod def setUpClass(cls): - cls.api_client = super( - TestHighAvailability, - cls - ).getClsTestClient().getApiClient() + cls.testClient = super(TestHighAvailability, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + cls.services = Services().services # Get Zone, Domain and templates - cls.domain = get_domain( - cls.api_client, - cls.services - ) - cls.zone = get_zone( - cls.api_client, - cls.services - ) + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) cls.pod = get_pod( cls.api_client, - zoneid=cls.zone.id, - services=cls.services + zone_id=cls.zone.id ) cls.template = get_template( cls.api_client, http://git-wip-us.apache.org/repos/asf/cloudstack/blob/404ac549/test/integration/component/maint/test_host_high_availability.py ---------------------------------------------------------------------- diff --git a/test/integration/component/maint/test_host_high_availability.py b/test/integration/component/maint/test_host_high_availability.py index b4c50c7..4cd7fd8 100644 --- a/test/integration/component/maint/test_host_high_availability.py +++ b/test/integration/component/maint/test_host_high_availability.py @@ -21,9 +21,10 @@ 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 * +import time class Services: @@ -76,20 +77,13 @@ class TestHostHighAvailability(cloudstackTestCase): @classmethod def setUpClass(cls): - cls.api_client = super( - TestHostHighAvailability, - cls - ).getClsTestClient().getApiClient() + cls.testClient = super(TestHostHighAvailability, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + cls.services = Services().services # Get Zone, Domain and templates - cls.domain = get_domain( - cls.api_client, - cls.services - ) - cls.zone = get_zone( - cls.api_client, - cls.services - ) + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) cls.template = get_template( cls.api_client, @@ -626,11 +620,7 @@ class TestHostHighAvailability(cloudstackTestCase): #verify the VM live migration happened to another running host self.debug("Waiting for VM to come up") - wait_for_vm( - self.apiclient, - virtualmachineid=vm_with_ha_enabled.id, - interval=timeout - ) + time.sleep(timeout) vms = VirtualMachine.list( self.apiclient, @@ -758,11 +748,7 @@ class TestHostHighAvailability(cloudstackTestCase): #verify the VM live migration happened to another running host self.debug("Waiting for VM to come up") - wait_for_vm( - self.apiclient, - virtualmachineid=vm_with_ha_disabled.id, - interval=timeout - ) + time.sleep(timeout) vms = VirtualMachine.list( self.apiclient, http://git-wip-us.apache.org/repos/asf/cloudstack/blob/404ac549/test/integration/component/maint/test_multiple_ip_ranges.py ---------------------------------------------------------------------- diff --git a/test/integration/component/maint/test_multiple_ip_ranges.py b/test/integration/component/maint/test_multiple_ip_ranges.py index dc8021b..982dd7c 100644 --- a/test/integration/component/maint/test_multiple_ip_ranges.py +++ b/test/integration/component/maint/test_multiple_ip_ranges.py @@ -18,10 +18,10 @@ """ from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin.cloudstackException import cloudstackAPIException -from marvin.integration.lib.utils import * -from marvin.integration.lib.base import * -from marvin.integration.lib.common import * +from marvin.cloudstackException import CloudstackAPIException +from marvin.lib.utils import * +from marvin.lib.base import * +from marvin.lib.common import * # from netaddr import * import netaddr from nose.plugins.attrib import attr @@ -87,13 +87,15 @@ class TestMultipleIpRanges(cloudstackTestCase): """ @classmethod def setUpClass(cls): - cls.api_client = super(TestMultipleIpRanges, cls).getClsTestClient().getApiClient() - cls.dbclient = super(TestMultipleIpRanges, cls).getClsTestClient().getDbConnection() + cls.testClient = super(TestEgressAfterHostMaintenance, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + cls.dbclient = cls.testClient.getDbConnection() + cls.services = Services().services # Get Zone, Domain and templates - cls.domain = get_domain(cls.api_client, cls.services) - cls.zone = get_zone(cls.api_client, cls.services) - cls.pod = get_pod(cls.api_client, cls.zone.id, cls.services) + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) + cls.pod = get_pod(cls.api_client, cls.zone.id) cls.services['mode'] = cls.zone.networktype cls.services["domainid"] = cls.domain.id cls.services["zoneid"] = cls.zone.id http://git-wip-us.apache.org/repos/asf/cloudstack/blob/404ac549/test/integration/component/maint/test_redundant_router.py ---------------------------------------------------------------------- diff --git a/test/integration/component/maint/test_redundant_router.py b/test/integration/component/maint/test_redundant_router.py index 617a546..66bb477 100644 --- a/test/integration/component/maint/test_redundant_router.py +++ b/test/integration/component/maint/test_redundant_router.py @@ -16,9 +16,9 @@ # under the License. from nose.plugins.attrib import attr -from marvin.integration.lib.base import * -from marvin.integration.lib.utils import * -from marvin.integration.lib.common import * +from marvin.lib.base import * +from marvin.lib.utils import * +from marvin.lib.common import * #Import Local Modules from marvin.cloudstackTestCase import cloudstackTestCase @@ -137,14 +137,13 @@ class TestCreateRvRNetworkOffering(cloudstackTestCase): @classmethod def setUpClass(cls): - cls.api_client = super( - TestCreateRvRNetworkOffering, - cls - ).getClsTestClient().getApiClient() + cls.testClient = super(TestCreateRvRNetworkOffering, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + cls.services = Services().services # Get Zone, Domain and templates - cls.domain = get_domain(cls.api_client, cls.services) - cls.zone = get_zone(cls.api_client, cls.services) + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) cls._cleanup = [] return @@ -231,14 +230,13 @@ class TestCreateRvRNetwork(cloudstackTestCase): @classmethod def setUpClass(cls): - cls.api_client = super( - TestCreateRvRNetwork, - cls - ).getClsTestClient().getApiClient() + cls.testClient = super(TestCreateRvRNetwork, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + cls.services = Services().services # Get Zone, Domain and templates - cls.domain = get_domain(cls.api_client, cls.services) - cls.zone = get_zone(cls.api_client, cls.services) + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) cls.template = get_template( cls.api_client, cls.zone.id, @@ -433,14 +431,13 @@ class TestCreateRvRNetworkNonDefaultGuestCidr(cloudstackTestCase): @classmethod def setUpClass(cls): - cls.api_client = super( - TestCreateRvRNetworkNonDefaultGuestCidr, - cls - ).getClsTestClient().getApiClient() + cls.testClient = super(TestCreateRvRNetworkNonDefaultGuestCidr, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + cls.services = Services().services # Get Zone, Domain and templates - cls.domain = get_domain(cls.api_client, cls.services) - cls.zone = get_zone(cls.api_client, cls.services) + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) cls.template = get_template( cls.api_client, cls.zone.id, @@ -642,14 +639,13 @@ class TestRVRInternals(cloudstackTestCase): @classmethod def setUpClass(cls): - cls.api_client = super( - TestRVRInternals, - cls - ).getClsTestClient().getApiClient() + cls.testClient = super(TestRVRInternals, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + cls.services = Services().services # Get Zone, Domain and templates - cls.domain = get_domain(cls.api_client, cls.services) - cls.zone = get_zone(cls.api_client, cls.services) + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) cls.template = get_template( cls.api_client, cls.zone.id, @@ -685,6 +681,7 @@ class TestRVRInternals(cloudstackTestCase): def setUp(self): self.apiclient = self.testClient.getApiClient() + self.hypervisor = self.testClient.getHypervisorInfo() self.dbclient = self.testClient.getDbConnection() self.account = Account.create( self.apiclient, @@ -846,7 +843,7 @@ class TestRVRInternals(cloudstackTestCase): self.debug(master_router.linklocalip) # Check eth2 port for master router - if self.apiclient.hypervisor.lower() == 'vmware': + if self.hypervisor.lower() == 'vmware': result = get_process_status( self.apiclient.connection.mgtSvr, 22, @@ -854,7 +851,7 @@ class TestRVRInternals(cloudstackTestCase): self.apiclient.connection.passwd, master_router.linklocalip, 'ip addr show eth2', - hypervisor=self.apiclient.hypervisor + hypervisor=self.hypervisor ) else: result = get_process_status( @@ -882,7 +879,7 @@ class TestRVRInternals(cloudstackTestCase): ) # Check eth2 port for backup router - if self.apiclient.hypervisor.lower() == 'vmware': + if self.hypervisor.lower() == 'vmware': result = get_process_status( self.apiclient.connection.mgtSvr, 22, @@ -890,7 +887,7 @@ class TestRVRInternals(cloudstackTestCase): self.apiclient.connction.passwd, backup_router.linklocalip, 'ip addr show eth2', - hypervisor=self.apiclient.hypervisor + hypervisor=self.hypervisor ) else: result = get_process_status( @@ -945,14 +942,13 @@ class TestRvRRedundancy(cloudstackTestCase): @classmethod def setUpClass(cls): - cls.api_client = super( - TestRvRRedundancy, - cls - ).getClsTestClient().getApiClient() + cls.testClient = super(TestRvRRedundancy, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + cls.services = Services().services # Get Zone, Domain and templates - cls.domain = get_domain(cls.api_client, cls.services) - cls.zone = get_zone(cls.api_client, cls.services) + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) cls.template = get_template( cls.api_client, cls.zone.id, http://git-wip-us.apache.org/repos/asf/cloudstack/blob/404ac549/test/integration/component/maint/test_redundant_router_deployment_planning.py ---------------------------------------------------------------------- diff --git a/test/integration/component/maint/test_redundant_router_deployment_planning.py b/test/integration/component/maint/test_redundant_router_deployment_planning.py index 879a4da..b63cda9 100644 --- a/test/integration/component/maint/test_redundant_router_deployment_planning.py +++ b/test/integration/component/maint/test_redundant_router_deployment_planning.py @@ -16,9 +16,9 @@ # under the License. from nose.plugins.attrib import attr -from marvin.integration.lib.base import * -from marvin.integration.lib.utils import * -from marvin.integration.lib.common import * +from marvin.lib.base import * +from marvin.lib.utils import * +from marvin.lib.common import * #Import Local Modules from marvin.cloudstackTestCase import cloudstackTestCase @@ -136,14 +136,13 @@ class TestRvRDeploymentPlanning(cloudstackTestCase): @classmethod def setUpClass(cls): - cls.api_client = super( - TestRvRDeploymentPlanning, - cls - ).getClsTestClient().getApiClient() + cls.testClient = super(TestRvRDeploymentPlanning, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + cls.services = Services().services # Get Zone, Domain and templates - cls.domain = get_domain(cls.api_client, cls.services) - cls.zone = get_zone(cls.api_client, cls.services) + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) cls.template = get_template( cls.api_client, cls.zone.id, http://git-wip-us.apache.org/repos/asf/cloudstack/blob/404ac549/test/integration/component/maint/test_redundant_router_network_rules.py ---------------------------------------------------------------------- diff --git a/test/integration/component/maint/test_redundant_router_network_rules.py b/test/integration/component/maint/test_redundant_router_network_rules.py index 010aaaa..12c4d2c 100644 --- a/test/integration/component/maint/test_redundant_router_network_rules.py +++ b/test/integration/component/maint/test_redundant_router_network_rules.py @@ -16,9 +16,9 @@ # under the License. from nose.plugins.attrib import attr -from marvin.integration.lib.base import * -from marvin.integration.lib.utils import * -from marvin.integration.lib.common import * +from marvin.lib.base import * +from marvin.lib.utils import * +from marvin.lib.common import * #Import Local Modules from marvin.cloudstackTestCase import cloudstackTestCase @@ -137,14 +137,13 @@ class TestRedundantRouterRulesLifeCycle(cloudstackTestCase): @classmethod def setUpClass(cls): - cls.api_client = super( - TestRedundantRouterRulesLifeCycle, - cls - ).getClsTestClient().getApiClient() + cls.testClient = super(TestRedundantRouterRulesLifeCycle, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + cls.services = Services().services # Get Zone, Domain and templates - cls.domain = get_domain(cls.api_client, cls.services) - cls.zone = get_zone(cls.api_client, cls.services) + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) cls.template = get_template( cls.api_client, cls.zone.id, http://git-wip-us.apache.org/repos/asf/cloudstack/blob/404ac549/test/integration/component/maint/test_vpc_host_maintenance.py ---------------------------------------------------------------------- diff --git a/test/integration/component/maint/test_vpc_host_maintenance.py b/test/integration/component/maint/test_vpc_host_maintenance.py index 57dfb4b..83ba271 100644 --- a/test/integration/component/maint/test_vpc_host_maintenance.py +++ b/test/integration/component/maint/test_vpc_host_maintenance.py @@ -22,11 +22,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.sshClient import SshClient -import datetime +from marvin.lib.utils import * +from marvin.lib.base import * +from marvin.lib.common import * class Services: @@ -190,14 +188,13 @@ class TestVMLifeCycleHostmaintenance(cloudstackTestCase): @classmethod def setUpClass(cls): - cls.api_client = super( - TestVMLifeCycleHostmaintenance, - cls - ).getClsTestClient().getApiClient() + cls.testClient = super(TestVMLifeCycleHostmaintenance, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + cls.services = Services().services # Get Zone, Domain and templates - cls.domain = get_domain(cls.api_client, cls.services) - cls.zone = get_zone(cls.api_client, cls.services) + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) cls.template = get_template( cls.api_client, cls.zone.id, @@ -554,4 +551,4 @@ class TestVMLifeCycleHostmaintenance(cloudstackTestCase): "Router state should be running" ) # TODO: Check for the network connectivity - return \ No newline at end of file + return http://git-wip-us.apache.org/repos/asf/cloudstack/blob/404ac549/test/integration/component/maint/test_vpc_on_host_maintenance.py ---------------------------------------------------------------------- diff --git a/test/integration/component/maint/test_vpc_on_host_maintenance.py b/test/integration/component/maint/test_vpc_on_host_maintenance.py index 6630ee6..eb3360a 100644 --- a/test/integration/component/maint/test_vpc_on_host_maintenance.py +++ b/test/integration/component/maint/test_vpc_on_host_maintenance.py @@ -18,9 +18,9 @@ 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 * class Services: @@ -77,14 +77,13 @@ class TestVPCHostMaintenance(cloudstackTestCase): @classmethod def setUpClass(cls): - cls.api_client = super( - TestVPCHostMaintenance, - cls - ).getClsTestClient().getApiClient() + cls.testClient = super(TestVPCHostMaintenance, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + cls.services = Services().services # Get Zone, Domain and templates - cls.domain = get_domain(cls.api_client, cls.services) - cls.zone = get_zone(cls.api_client, cls.services) + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) cls.template = get_template( cls.api_client, cls.zone.id, http://git-wip-us.apache.org/repos/asf/cloudstack/blob/404ac549/test/integration/component/test_VirtualRouter_alerts.py ---------------------------------------------------------------------- diff --git a/test/integration/component/test_VirtualRouter_alerts.py b/test/integration/component/test_VirtualRouter_alerts.py index 4b53e3f..e6f0a82 100644 --- a/test/integration/component/test_VirtualRouter_alerts.py +++ b/test/integration/component/test_VirtualRouter_alerts.py @@ -20,10 +20,11 @@ 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 +from marvin.codes import FAILED import time @@ -96,12 +97,13 @@ class Services: class TestVRServiceFailureAlerting(cloudstackTestCase): @classmethod def setUpClass(cls): - cls.api_client = super(TestVRServiceFailureAlerting, cls).getClsTestClient().getApiClient() + cls.testClient = super(TestVRServiceFailureAlerting, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() cls.services = Services().services # Get Zone, Domain and templates - domain = get_domain(cls.api_client, cls.services) - cls.zone = get_zone(cls.api_client, cls.services) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) + domain = get_domain(cls.api_client) cls.services['mode'] = cls.zone.networktype template = get_template( @@ -109,6 +111,9 @@ class TestVRServiceFailureAlerting(cloudstackTestCase): cls.zone.id, cls.services["ostype"] ) + + if template == FAILED: + assert False, "get_template() failed to return template with description %s" % cls.services["ostype"] # Set Zones and disk offerings ?? cls.services["small"]["zoneid"] = cls.zone.id cls.services["small"]["template"] = template.id @@ -148,6 +153,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 +208,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 +216,7 @@ class TestVRServiceFailureAlerting(cloudstackTestCase): self.apiclient.connection.passwd, router.linklocalip, "service dnsmasq status", - hypervisor=self.apiclient.hypervisor + hypervisor=self.hypervisor ) else: try: http://git-wip-us.apache.org/repos/asf/cloudstack/blob/404ac549/test/integration/component/test_accounts.py ---------------------------------------------------------------------- diff --git a/test/integration/component/test_accounts.py b/test/integration/component/test_accounts.py index bee17fb..cf5f2b6 100644 --- a/test/integration/component/test_accounts.py +++ b/test/integration/component/test_accounts.py @@ -17,14 +17,32 @@ """ P1 tests for Account """ #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.sshClient import SshClient +from marvin.cloudstackTestCase import cloudstackTestCase +#from marvin.cloudstackAPI import * +from marvin.lib.utils import (random_gen, + cleanup_resources) +from marvin.lib.base import (Domain, + Account, + ServiceOffering, + VirtualMachine, + Network, + User, + NATRule, + Template, + PublicIPAddress) +from marvin.lib.common import (get_domain, + get_zone, + get_template, + list_accounts, + list_virtual_machines, + list_service_offering, + list_templates, + list_users, + get_builtin_template_info, + wait_for_cleanup) from nose.plugins.attrib import attr -from marvin.cloudstackException import cloudstackAPIException +from marvin.cloudstackException import CloudstackAPIException +import time class Services: """Test Account Services @@ -102,13 +120,11 @@ class TestAccounts(cloudstackTestCase): @classmethod def setUpClass(cls): - cls.api_client = super( - TestAccounts, - cls - ).getClsTestClient().getApiClient() + cls.testClient = super(TestAccounts, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + cls.services = Services().services - # Get Zone, Domain and templates - cls.zone = get_zone(cls.api_client, cls.services) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) cls.services['mode'] = cls.zone.networktype cls.template = get_template( cls.api_client, @@ -232,13 +248,11 @@ class TestRemoveUserFromAccount(cloudstackTestCase): @classmethod def setUpClass(cls): - cls.api_client = super( - TestRemoveUserFromAccount, - cls - ).getClsTestClient().getApiClient() + cls.testClient = super(TestRemoveUserFromAccount, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + cls.services = Services().services - # Get Zone, Domain and templates - cls.zone = get_zone(cls.api_client, cls.services) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) cls.services['mode'] = cls.zone.networktype cls.template = get_template( cls.api_client, @@ -392,13 +406,11 @@ class TestNonRootAdminsPrivileges(cloudstackTestCase): @classmethod def setUpClass(cls): - cls.api_client = super( - TestNonRootAdminsPrivileges, - cls - ).getClsTestClient().getApiClient() + cls.testClient = super(TestNonRootAdminsPrivileges, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + cls.services = Services().services - # Get Zone settings - cls.zone = get_zone(cls.api_client, cls.services) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) cls.services['mode'] = cls.zone.networktype # Create an account, domain etc cls.domain = Domain.create( @@ -726,12 +738,12 @@ class TestTemplateHierarchy(cloudstackTestCase): @classmethod def setUpClass(cls): - cls.api_client = super( - TestTemplateHierarchy, - cls).getClsTestClient().getApiClient() + cls.testClient = super(TestTemplateHierarchy, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + cls.hypervisor = cls.testClient.getHypervisorInfo() + cls.services = Services().services - # Get Zone settings - cls.zone = get_zone(cls.api_client, cls.services) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) cls.services['mode'] = cls.zone.networktype # Create domains, accounts and template @@ -772,7 +784,8 @@ class TestTemplateHierarchy(cloudstackTestCase): cls.services["template"], zoneid=cls.zone.id, account=cls.account_1.name, - domainid=cls.domain_1.id + domainid=cls.domain_1.id, + hypervisor=cls.hypervisor ) # Wait for template to download @@ -879,21 +892,12 @@ class TestAddVmToSubDomain(cloudstackTestCase): @classmethod def setUpClass(cls): - cls.api_client = super( - TestAddVmToSubDomain, - cls - ).getClsTestClient().getApiClient() - cls.services = Services().services + cls.testClient = super(TestAddVmToSubDomain, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() - # Setup working Environment- Create domain, zone, pod cluster etc. - cls.domain = get_domain( - cls.api_client, - cls.services - ) - cls.zone = get_zone( - cls.api_client, - cls.services, - ) + cls.services = Services().services + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) cls.services['mode'] = cls.zone.networktype cls.sub_domain = Domain.create( cls.api_client, @@ -1031,14 +1035,12 @@ class TestUserDetails(cloudstackTestCase): @classmethod def setUpClass(cls): - cls.api_client = super( - TestUserDetails, - cls - ).getClsTestClient().getApiClient() + cls.testClient = super(TestUserDetails, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + cls.services = Services().services - # Get Zone, Domain etc - cls.domain = get_domain(cls.api_client, cls.services) - cls.zone = get_zone(cls.api_client, cls.services) + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) cls.services['mode'] = cls.zone.networktype cls._cleanup = [] return @@ -1331,14 +1333,12 @@ class TestUserLogin(cloudstackTestCase): @classmethod def setUpClass(cls): - cls.api_client = super( - TestUserLogin, - cls - ).getClsTestClient().getApiClient() + cls.testClient = super(TestUserLogin, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + cls.services = Services().services - # Get Zone, Domain etc - cls.domain = get_domain(cls.api_client, cls.services) - cls.zone = get_zone(cls.api_client, cls.services) + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) cls.services['mode'] = cls.zone.networktype cls._cleanup = [] return @@ -1482,21 +1482,12 @@ class TestDomainForceRemove(cloudstackTestCase): @classmethod def setUpClass(cls): - cls.api_client = super( - TestDomainForceRemove, - cls - ).getClsTestClient().getApiClient() - cls.services = Services().services + cls.testClient = super(TestDomainForceRemove, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() - # Setup working Environment- Create domain, zone, pod cluster etc. - cls.domain = get_domain( - cls.api_client, - cls.services - ) - cls.zone = get_zone( - cls.api_client, - cls.services, - ) + cls.services = Services().services + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) cls.services['mode'] = cls.zone.networktype cls.template = get_template( @@ -1681,7 +1672,7 @@ class TestDomainForceRemove(cloudstackTestCase): " to cleanup any remaining resouces") # Sleep 3*account.gc to ensure that all resources are deleted wait_for_cleanup(self.apiclient, ["account.cleanup.interval"]*3) - with self.assertRaises(cloudstackAPIException): + with self.assertRaises(CloudstackAPIException): Domain.list( self.apiclient, id=domain.id, @@ -1689,7 +1680,7 @@ class TestDomainForceRemove(cloudstackTestCase): ) self.debug("Checking if the resources in domain are deleted") - with self.assertRaises(cloudstackAPIException): + with self.assertRaises(CloudstackAPIException): Account.list( self.apiclient, name=self.account_1.name, http://git-wip-us.apache.org/repos/asf/cloudstack/blob/404ac549/test/integration/component/test_add_remove_network.py ---------------------------------------------------------------------- diff --git a/test/integration/component/test_add_remove_network.py b/test/integration/component/test_add_remove_network.py index 4529ec7..3e0e78b 100644 --- a/test/integration/component/test_add_remove_network.py +++ b/test/integration/component/test_add_remove_network.py @@ -29,7 +29,7 @@ from nose.plugins.attrib import attr from marvin.cloudstackTestCase import cloudstackTestCase, unittest from ddt import ddt, data -from marvin.integration.lib.base import ( +from marvin.lib.base import ( Account, Domain, ServiceOffering, @@ -39,7 +39,7 @@ from marvin.integration.lib.base import ( VpcOffering, VPC ) -from marvin.integration.lib.common import (get_domain, +from marvin.lib.common import (get_domain, get_zone, get_template, list_virtual_machines, @@ -49,7 +49,7 @@ from marvin.integration.lib.common import (get_domain, update_resource_limit ) -from marvin.integration.lib.utils import (validateList, +from marvin.lib.utils import (validateList, random_gen, get_hypervisor_type, cleanup_resources) @@ -60,6 +60,7 @@ from marvin.cloudstackAPI import (addNicToVirtualMachine, from marvin.codes import PASS import random +import time class Services: """Test Add Remove Network Services @@ -67,7 +68,7 @@ class Services: def __init__(self): self.services = { - + "sleep": 60, "ostype": "CentOS 5.3 (64-bit)", # Cent OS 5.3 (64 bit) @@ -173,7 +174,10 @@ class TestAddNetworkToVirtualMachine(cloudstackTestCase): @classmethod def setUpClass(cls): - cls.api_client = super(TestAddNetworkToVirtualMachine, cls).getClsTestClient().getApiClient() + cls.testClient = super(TestAddNetworkToVirtualMachine, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + + cls.services = Services().services hypervisor = get_hypervisor_type(cls.api_client) if hypervisor.lower() not in ["xenserver","kvm"]: @@ -181,8 +185,8 @@ class TestAddNetworkToVirtualMachine(cloudstackTestCase): cls.services = Services().services # Get Zone, Domain and templates - cls.domain = get_domain(cls.api_client, cls.services) - cls.zone = get_zone(cls.api_client, cls.services) + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) template = get_template(cls.api_client, cls.zone.id, cls.services["ostype"]) # Set Zones and disk offerings @@ -392,8 +396,7 @@ class TestAddNetworkToVirtualMachine(cloudstackTestCase): # Trying to add same network to vm for the second time with self.assertRaises(Exception) as e: self.addNetworkToVm(network, self.virtual_machine) - - self.debug("Adding same network again failed with exception: %s" % e.exception) + self.debug("Adding same network again failed with exception: %s" % e.exception) return @@ -515,7 +518,7 @@ class TestAddNetworkToVirtualMachine(cloudstackTestCase): with self.assertRaises(Exception) as e: self.addNetworkToVm(self.shared_network, self.virtual_machine, ipaddress = ipaddress) - self.debug("API failed with exception: %s" % e.exception) + self.debug("API failed with exception: %s" % e.exception) return @@ -552,9 +555,7 @@ class TestAddNetworkToVirtualMachine(cloudstackTestCase): with self.assertRaises(Exception) as e: self.virtual_machine.add_nic(self.apiclient, network.id) - network.delete(self.apiclient) - - self.debug("Operation failed with exception %s" % e.exception) + self.debug("Operation failed with exception %s" % e.exception) return @@ -606,15 +607,13 @@ class TestAddNetworkToVirtualMachine(cloudstackTestCase): domainid=self.child_do_admin_2.domainid, serviceofferingid=self.service_offering.id, mode=self.zone.networktype) + time.sleep(self.services["sleep"]) self.debug("Trying to %s network in domain %s to a vm in domain %s, This should fail" % (network.type, self.child_domain_1.name, self.child_domain_2.name)) with self.assertRaises(Exception) as e: virtual_machine.add_nic(self.apiclient, network.id) - self.debug("Operation failed with exception %s" % e.exception) - - network.delete(self.apiclient) - + self.debug("Operation failed with exception %s" % e.exception) return @attr(tags = ["advanced"]) @@ -686,7 +685,7 @@ class TestAddNetworkToVirtualMachine(cloudstackTestCase): with self.assertRaises(Exception) as e: virtual_machine.add_nic(self.apiclient, network_2.id) - self.debug("Operation failed with exception %s" % e.exception) + self.debug("Operation failed with exception %s" % e.exception) return @@ -694,16 +693,18 @@ class TestRemoveNetworkFromVirtualMachine(cloudstackTestCase): @classmethod def setUpClass(cls): - cls.api_client = super(TestRemoveNetworkFromVirtualMachine, cls).getClsTestClient().getApiClient() + cls.testClient = super(TestRemoveNetworkFromVirtualMachine, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + + cls.services = Services().services hypervisor = get_hypervisor_type(cls.api_client) if hypervisor.lower() not in ["xenserver","kvm"]: raise unittest.SkipTest("This feature is supported only on XenServer and KVM") - cls.services = Services().services # Get Zone, Domain and templates - cls.domain = get_domain(cls.api_client, cls.services) - cls.zone = get_zone(cls.api_client, cls.services) + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) template = get_template(cls.api_client,cls.zone.id,cls.services["ostype"]) # Set Zones and disk offerings @@ -836,7 +837,7 @@ class TestRemoveNetworkFromVirtualMachine(cloudstackTestCase): self.virtual_machine.id) with self.assertRaises(Exception): self.virtual_machine.remove_nic(self.apiclient, vm_list[0].nic[0].id) - self.debug("Removing default nic of vm failed") + self.debug("Removing default nic of vm failed") return @attr(tags = ["advanced"]) @@ -867,23 +868,25 @@ class TestRemoveNetworkFromVirtualMachine(cloudstackTestCase): operation should fail") with self.assertRaises(Exception) as e: self.virtual_machine.remove_nic(self.apiclient, virtual_machine.nic[0].id) - self.debug("Operation failed with exception: %s" % e.exception) + self.debug("Operation failed with exception: %s" % e.exception) return class TestUpdateVirtualMachineNIC(cloudstackTestCase): @classmethod def setUpClass(cls): - cls.api_client = super(TestUpdateVirtualMachineNIC, cls).getClsTestClient().getApiClient() + cls.testClient = super(TestUpdateVirtualMachineNIC, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + + cls.services = Services().services hypervisor = get_hypervisor_type(cls.api_client) if hypervisor.lower() not in ["xenserver","kvm"]: raise unittest.SkipTest("This feature is supported only on XenServer and KVM") - cls.services = Services().services # Get Zone, Domain and templates - cls.domain = get_domain(cls.api_client, cls.services) - cls.zone = get_zone(cls.api_client, cls.services) + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) template = get_template(cls.api_client,cls.zone.id,cls.services["ostype"]) # Set Zones and disk offerings @@ -1045,7 +1048,7 @@ class TestUpdateVirtualMachineNIC(cloudstackTestCase): self.debug("Trying to set default nic again as default nic, This should fail") with self.assertRaises(Exception) as e: self.virtual_machine.update_default_nic(self.apiclient, nicId = defaultNicId) - self.debug("updateDefaultNic operation failed as expected with exception: %s" % + self.debug("updateDefaultNic operation failed as expected with exception: %s" % e.exception) return @@ -1070,15 +1073,16 @@ class TestUpdateVirtualMachineNIC(cloudstackTestCase): virtual_machine = VirtualMachine.create(self.apiclient,self.services["virtual_machine"], accountid=account.name,domainid=account.domainid, serviceofferingid=self.service_offering.id,mode=self.zone.networktype) + time.sleep(self.services["sleep"]) self.debug("Deployed virtual machine: %s" % virtual_machine.id) - + foreignNicId = virtual_machine.nic[0].id self.debug("Trying to set nic of new virtual machine as default nic of existing virtual machine, This \ operation should fail") with self.assertRaises(Exception) as e: self.virtual_machine.update_default_nic(self.apiclient, nicId = foreignNicId) - self.debug("updateDefaultNic operation failed as expected with exception: %s" % + self.debug("updateDefaultNic operation failed as expected with exception: %s" % e.exception) return @@ -1087,16 +1091,18 @@ class TestFailureScenariosAddNetworkToVM(cloudstackTestCase): @classmethod def setUpClass(cls): - cls.api_client = super(TestFailureScenariosAddNetworkToVM, cls).getClsTestClient().getApiClient() + cls.testClient = super(TestFailureScenariosAddNetworkToVM, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + + cls.services = Services().services hypervisor = get_hypervisor_type(cls.api_client) if hypervisor.lower() not in ["xenserver","kvm"]: raise unittest.SkipTest("This feature is supported only on XenServer and KVM") - cls.services = Services().services # Get Zone, Domain and templates - cls.domain = get_domain(cls.api_client, cls.services) - cls.zone = get_zone(cls.api_client, cls.services) + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) template = get_template(cls.api_client,cls.zone.id,cls.services["ostype"]) # Set Zones and disk offerings cls.services["virtual_machine"]["zoneid"] = cls.zone.id @@ -1224,6 +1230,7 @@ class TestFailureScenariosAddNetworkToVM(cloudstackTestCase): cmd.networkid = isolated_network.id with self.assertRaises(Exception) as e: + time.sleep(5) self.apiclient.addNicToVirtualMachine(cmd) self.debug("addNicToVirtualMachine API failed with exception: %s" % e.exception) @@ -1265,6 +1272,7 @@ class TestFailureScenariosAddNetworkToVM(cloudstackTestCase): virtual_machine = VirtualMachine.create(self.apiclient,self.services["virtual_machine"], serviceofferingid=self.service_offering.id, mode=basicZone.networktype) + time.sleep(self.services["sleep"]) self.debug("Deployed virtual machine %s: " % virtual_machine.id) cmd = addNicToVirtualMachine.addNicToVirtualMachineCmd() @@ -1274,6 +1282,7 @@ class TestFailureScenariosAddNetworkToVM(cloudstackTestCase): self.dedbug("Trying to add isolated network to VM (both in basic zone,\ this operation should fail") with self.assertRaises(Exception) as e: + time.sleep(5) self.apiclient.addNicToVirtualMachine(cmd) self.debug("addNicToVirtualMachine API failed with exception: %s" % e.exception) @@ -1300,12 +1309,13 @@ class TestFailureScenariosAddNetworkToVM(cloudstackTestCase): self.debug("Created account %s" % account.name) self.debug("creating user api client for account: %s" % account.name) - api_client = self.testClient.createUserApiClient(UserName=account.name, DomainName=self.account.domain) + api_client = self.testClient.getUserApiClient(UserName=account.name, DomainName=self.account.domain) self.debug("Trying to add network to vm with this api client, this should fail due to \ insufficient permission") with self.assertRaises(Exception) as e: + time.sleep(5) api_client.addNicToVirtualMachine(cmd) self.debug("addNicToVirtualMachine API failed with exception: %s" % e.exception) @@ -1315,16 +1325,18 @@ class TestFailureScenariosRemoveNicFromVM(cloudstackTestCase): @classmethod def setUpClass(cls): - cls.api_client = super(TestFailureScenariosRemoveNicFromVM, cls).getClsTestClient().getApiClient() + cls.testClient = super(TestFailureScenariosRemoveNicFromVM, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + + cls.services = Services().services hypervisor = get_hypervisor_type(cls.api_client) if hypervisor.lower() not in ["xenserver","kvm"]: raise unittest.SkipTest("This feature is supported only on XenServer and KVM") - cls.services = Services().services # Get Zone, Domain and templates - cls.domain = get_domain(cls.api_client, cls.services) - cls.zone = get_zone(cls.api_client, cls.services) + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) template = get_template(cls.api_client,cls.zone.id,cls.services["ostype"]) # Set Zones and disk offerings @@ -1372,7 +1384,7 @@ class TestFailureScenariosRemoveNicFromVM(cloudstackTestCase): def tearDownClass(cls): try: # Disable Network Offerings - #cls.isolated_network_offering.update(cls.api_client, state='Disabled') + cls.isolated_network_offering.update(cls.api_client, state='Disabled') # Cleanup resources used cleanup_resources(cls.api_client, cls._cleanup) @@ -1478,7 +1490,7 @@ class TestFailureScenariosRemoveNicFromVM(cloudstackTestCase): self.debug("Created account %s" % account.name) self.debug("creating user api client for account: %s" % account.name) - api_client = self.testClient.createUserApiClient(UserName=account.name, DomainName=self.account.domain) + api_client = self.testClient.getUserApiClient(UserName=account.name, DomainName=self.account.domain) self.debug("Trying to add network to vm with this api client, this should fail due to \ insufficient permission") @@ -1493,16 +1505,18 @@ class TestFailureScenariosUpdateVirtualMachineNIC(cloudstackTestCase): @classmethod def setUpClass(cls): - cls.api_client = super(TestFailureScenariosUpdateVirtualMachineNIC, cls).getClsTestClient().getApiClient() + cls.testClient = super(TestFailureScenariosUpdateVirtualMachineNIC, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + + cls.services = Services().services hypervisor = get_hypervisor_type(cls.api_client) if hypervisor.lower() not in ["xenserver","kvm"]: raise unittest.SkipTest("This feature is supported only on XenServer and KVM") - cls.services = Services().services # Get Zone, Domain and templates - cls.domain = get_domain(cls.api_client, cls.services) - cls.zone = get_zone(cls.api_client, cls.services) + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) template = get_template(cls.api_client, cls.zone.id, cls.services["ostype"]) # Set Zones and disk offerings @@ -1601,7 +1615,7 @@ class TestFailureScenariosUpdateVirtualMachineNIC(cloudstackTestCase): with self.assertRaises(Exception) as e: self.apiclient.updateDefaultNicForVirtualMachine(cmd) - self.debug("updateDefaultNicForVirtualMachine API failed with exception: %s" % + self.debug("updateDefaultNicForVirtualMachine API failed with exception: %s" % e.exception) return @@ -1647,7 +1661,7 @@ class TestFailureScenariosUpdateVirtualMachineNIC(cloudstackTestCase): with self.assertRaises(Exception) as e: self.apiclient.updateDefaultNicForVirtualMachine(cmd) - self.debug("updateDefaultNicForVirtualMachine API failed with exception: %s" % + self.debug("updateDefaultNicForVirtualMachine API failed with exception: %s" % e.exception) return @@ -1676,7 +1690,7 @@ class TestFailureScenariosUpdateVirtualMachineNIC(cloudstackTestCase): accountid=account.name,domainid=account.domainid, serviceofferingid=self.service_offering.id, mode=self.zone.networktype) - + time.sleep(self.services["sleep"]) self.debug("Created virtual machine %s" % virtual_machine.id) self.debug("Creating isolated network in account %s" % account.name) @@ -1729,7 +1743,7 @@ class TestFailureScenariosUpdateVirtualMachineNIC(cloudstackTestCase): with self.assertRaises(Exception) as e: self.apiclient.updateDefaultNicForVirtualMachine(cmd) - self.debug("updateDefaultNicForVirtualMachine API failed with exception: %s" % + self.debug("updateDefaultNicForVirtualMachine API failed with exception: %s" % e.exception) return @@ -1749,7 +1763,7 @@ class TestFailureScenariosUpdateVirtualMachineNIC(cloudstackTestCase): self.debug("Created account %s" % account.name) self.debug("creating user api client for account: %s" % account.name) - api_client = self.testClient.createUserApiClient(UserName=account.name, DomainName=self.account.domain) + api_client = self.testClient.getUserApiClient(UserName=account.name, DomainName=self.account.domain) self.debug("Listing virtual machine so that to retrive the list of non-default and default nic") vm_list = list_virtual_machines(self.apiclient, id=self.virtual_machine.id) @@ -1779,7 +1793,7 @@ class TestFailureScenariosUpdateVirtualMachineNIC(cloudstackTestCase): with self.assertRaises(Exception) as e: api_client.updateDefaultNicForVirtualMachine(cmd) - self.debug("updateDefaultNicForVirtualMachine API failed with exception: %s" % + self.debug("updateDefaultNicForVirtualMachine API failed with exception: %s" % e.exception) return http://git-wip-us.apache.org/repos/asf/cloudstack/blob/404ac549/test/integration/component/test_advancedsg_networks.py ---------------------------------------------------------------------- diff --git a/test/integration/component/test_advancedsg_networks.py b/test/integration/component/test_advancedsg_networks.py index 207659f..f9155ed 100644 --- a/test/integration/component/test_advancedsg_networks.py +++ b/test/integration/component/test_advancedsg_networks.py @@ -19,7 +19,7 @@ """ from marvin.cloudstackTestCase import cloudstackTestCase, unittest from ddt import ddt, data -from marvin.integration.lib.base import (Zone, +from marvin.lib.base import (Zone, ServiceOffering, Account, NetworkOffering, @@ -31,14 +31,14 @@ from marvin.integration.lib.base import (Zone, SecurityGroup, Host) -from marvin.integration.lib.common import (get_domain, +from marvin.lib.common import (get_domain, get_zone, get_template, get_free_vlan, list_virtual_machines, wait_for_cleanup) -from marvin.integration.lib.utils import (cleanup_resources, +from marvin.lib.utils import (cleanup_resources, random_gen, validateList) from marvin.cloudstackAPI import (authorizeSecurityGroupIngress, @@ -54,14 +54,12 @@ class TestCreateZoneSG(cloudstackTestCase): @classmethod def setUpClass(cls): - cloudstackTestClient = super(TestCreateZoneSG,cls).getClsTestClient() - cls.api_client = cloudstackTestClient.getApiClient() - - # Fill services from the external config file - cls.services = cloudstackTestClient.getConfigParser().parsedDict + cls.testClient = super(TestCreateZoneSG, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + cls.services = cls.testClient.getParsedTestDataConfig() # Get Zone, Domain and templates - cls.domain = get_domain(cls.api_client, cls.services) + cls.domain = get_domain(cls.api_client) cls._cleanup = [] return @@ -154,14 +152,13 @@ class TestNetworksInAdvancedSG(cloudstackTestCase): @classmethod def setUpClass(cls): - cloudstackTestClient = super(TestNetworksInAdvancedSG,cls).getClsTestClient() - cls.api_client = cloudstackTestClient.getApiClient() - - cls.services = cloudstackTestClient.getConfigParser().parsedDict + cls.testClient = super(TestNetworksInAdvancedSG, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + cls.services = cls.testClient.getParsedTestDataConfig() # Get Zone, Domain and templates - cls.domain = get_domain(cls.api_client, cls.services) - cls.zone = get_zone(cls.api_client, cls.services) + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) cls.template = get_template(cls.api_client, cls.zone.id, cls.services["ostype"]) @@ -1102,14 +1099,13 @@ class TestNetworksInAdvancedSG_VmOperations(cloudstackTestCase): @classmethod def setUpClass(cls): - cloudstackTestClient = super(TestNetworksInAdvancedSG_VmOperations,cls).getClsTestClient() - cls.api_client = cloudstackTestClient.getApiClient() - - cls.services = cloudstackTestClient.getConfigParser().parsedDict + cls.testClient = super(TestNetworksInAdvancedSG_VmOperations, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + cls.services = cls.testClient.getParsedTestDataConfig() # Get Zone, Domain and templates - cls.domain = get_domain(cls.api_client, cls.services) - cls.zone = get_zone(cls.api_client, cls.services) + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) cls.template = get_template(cls.api_client,cls.zone.id,cls.services["ostype"]) cls.services["virtual_machine"]["zoneid"] = cls.zone.id @@ -2086,14 +2082,13 @@ class TestSecurityGroups_BasicSanity(cloudstackTestCase): @classmethod def setUpClass(cls): - cloudstackTestClient = super(TestSecurityGroups_BasicSanity,cls).getClsTestClient() - cls.api_client = cloudstackTestClient.getApiClient() - - cls.services = cloudstackTestClient.getConfigParser().parsedDict + cls.testClient = super(TestSecurityGroups_BasicSanity, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + cls.services = cls.testClient.getParsedTestDataConfig() # Get Zone, Domain and templates - cls.domain = get_domain(cls.api_client, cls.services) - cls.zone = get_zone(cls.api_client, cls.services) + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) cls.template = get_template(cls.api_client,cls.zone.id,cls.services["ostype"]) cls.services["virtual_machine"]["zoneid"] = cls.zone.id @@ -2548,14 +2543,13 @@ class TestSharedNetworkOperations(cloudstackTestCase): @classmethod def setUpClass(cls): - cloudstackTestClient = super(TestSharedNetworkOperations,cls).getClsTestClient() - cls.api_client = cloudstackTestClient.getApiClient() - - cls.services = cloudstackTestClient.getConfigParser().parsedDict + cls.testClient = super(TestSharedNetworkOperations, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + cls.services = cls.testClient.getParsedTestDataConfig() # Get Zone, Domain and templates - cls.domain = get_domain(cls.api_client, cls.services) - cls.zone = get_zone(cls.api_client, cls.services) + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) cls.template = get_template(cls.api_client,cls.zone.id,cls.services["ostype"]) cls.services["virtual_machine"]["zoneid"] = cls.zone.id @@ -2815,14 +2809,13 @@ class TestAccountBasedIngressRules(cloudstackTestCase): @classmethod def setUpClass(cls): - cloudstackTestClient = super(TestAccountBasedIngressRules,cls).getClsTestClient() - cls.api_client = cloudstackTestClient.getApiClient() - - cls.services = cloudstackTestClient.getConfigParser().parsedDict + cls.testClient = super(TestAccountBasedIngressRules, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + cls.services = cls.testClient.getParsedTestDataConfig() # Get Zone, Domain and templates - cls.domain = get_domain(cls.api_client, cls.services) - cls.zone = get_zone(cls.api_client, cls.services) + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) cls.template = get_template(cls.api_client,cls.zone.id,cls.services["ostype"]) cls.services["virtual_machine"]["zoneid"] = cls.zone.id