Repository: cloudstack Updated Branches: refs/heads/marvin 38f400010 -> 47c5b6388
CLOUDSTACK-5674: Fixed all BVTs and some marvin functions Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/47c5b638 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/47c5b638 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/47c5b638 Branch: refs/heads/marvin Commit: 47c5b638817784c68c77e4f2dcbfb9ae5d3d6ae9 Parents: 38f4000 Author: Girish Shilamkar <gir...@clogeny.com> Authored: Wed Feb 19 16:33:42 2014 +0530 Committer: Girish Shilamkar <gir...@clogeny.com> Committed: Wed Feb 19 16:33:42 2014 +0530 ---------------------------------------------------------------------- test/integration/smoke/test_disk_offerings.py | 4 +-- test/integration/smoke/test_iso.py | 38 ++++++++++---------- test/integration/smoke/test_loadbalance.py | 14 ++++---- test/integration/smoke/test_network.py | 7 ++-- .../integration/smoke/test_portable_publicip.py | 2 +- test/integration/smoke/test_public_ip_range.py | 5 +-- .../smoke/test_reset_vm_on_reboot.py | 2 +- test/integration/smoke/test_snapshots.py | 2 +- test/integration/smoke/test_ssvm.py | 3 +- test/integration/smoke/test_templates.py | 2 +- test/integration/smoke/test_vm_life_cycle.py | 2 +- test/integration/smoke/test_vm_snapshots.py | 7 ++-- test/integration/smoke/test_vpc_vpn.py | 2 +- tools/marvin/marvin/config/test_data.py | 18 +++++++--- tools/marvin/marvin/lib/common.py | 8 +++-- 15 files changed, 65 insertions(+), 51 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/47c5b638/test/integration/smoke/test_disk_offerings.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_disk_offerings.py b/test/integration/smoke/test_disk_offerings.py index 9508971..8b4d6c4 100644 --- a/test/integration/smoke/test_disk_offerings.py +++ b/test/integration/smoke/test_disk_offerings.py @@ -110,8 +110,8 @@ class TestDiskOfferings(cloudstackTestCase): @classmethod def setUpClass(cls): testClient = super(TestDiskOfferings, cls).getClsTestClient() - self.apiclient = self.testClient.getApiClient() - self.services = self.testClient.getParsedTestDataConfig() + cls.apiclient = cls.testClient.getApiClient() + cls.services = cls.testClient.getParsedTestDataConfig() cls.disk_offering_1 = DiskOffering.create( cls.apiclient, http://git-wip-us.apache.org/repos/asf/cloudstack/blob/47c5b638/test/integration/smoke/test_iso.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_iso.py b/test/integration/smoke/test_iso.py index 72dc70d..b3c3181 100644 --- a/test/integration/smoke/test_iso.py +++ b/test/integration/smoke/test_iso.py @@ -42,7 +42,7 @@ class TestCreateIso(cloudstackTestCase): self.zone = get_zone(self.apiclient, self.testClient.getZoneForTests()) self.services['mode'] = self.zone.networktype self.services["domainid"] = self.domain.id - self.services["iso_2"]["zoneid"] = self.zone.id + self.services["iso2"]["zoneid"] = self.zone.id self.account = Account.create( self.apiclient, @@ -57,8 +57,8 @@ class TestCreateIso(cloudstackTestCase): if not isinstance(ostypes, list): raise unittest.SkipTest("OSTypeId for given description not found") - self.services["iso_1"]["ostypeid"] = ostypes[0].id - self.services["iso_2"]["ostypeid"] = ostypes[0].id + self.services["iso1"]["ostypeid"] = ostypes[0].id + self.services["iso2"]["ostypeid"] = ostypes[0].id self.services["ostypeid"] = ostypes[0].id self.cleanup = [self.account] @@ -87,7 +87,7 @@ class TestCreateIso(cloudstackTestCase): iso = Iso.create( self.apiclient, - self.services["iso_2"], + self.services["iso2"], account=self.account.name, domainid=self.account.domainid ) @@ -118,17 +118,17 @@ class TestCreateIso(cloudstackTestCase): self.assertEqual( iso_response.displaytext, - self.services["iso_2"]["displaytext"], + self.services["iso2"]["displaytext"], "Check display text of newly created ISO" ) self.assertEqual( iso_response.name, - self.services["iso_2"]["name"], + self.services["iso2"]["name"], "Check name of newly created ISO" ) self.assertEqual( iso_response.zoneid, - self.services["iso_2"]["zoneid"], + self.services["iso2"]["zoneid"], "Check zone ID of newly created ISO" ) return @@ -143,12 +143,12 @@ class TestISO(cloudstackTestCase): cls.services = testClient.getParsedTestDataConfig() # Get Zone, Domain and templates - cls.domain = get_domain(cls.apiclient, cls.getZoneForTests()) - cls.zone = get_zone(cls.apiclient, cls.getZoneForTests()) + cls.domain = get_domain(cls.apiclient, cls.testClient.getZoneForTests()) + cls.zone = get_zone(cls.apiclient, cls.testClient.getZoneForTests()) cls.services["domainid"] = cls.domain.id - cls.services["iso_1"]["zoneid"] = cls.zone.id - cls.services["iso_2"]["zoneid"] = cls.zone.id + cls.services["iso1"]["zoneid"] = cls.zone.id + cls.services["iso2"]["zoneid"] = cls.zone.id cls.services["sourcezoneid"] = cls.zone.id #populate second zone id for iso copy cmd = listZones.listZonesCmd() @@ -171,13 +171,13 @@ class TestISO(cloudstackTestCase): if not isinstance(ostypes, list): raise unittest.SkipTest("OSTypeId for given description not found") - cls.services["iso_1"]["ostypeid"] = ostypes[0].id - cls.services["iso_2"]["ostypeid"] = ostypes[0].id + cls.services["iso1"]["ostypeid"] = ostypes[0].id + cls.services["iso2"]["ostypeid"] = ostypes[0].id cls.services["ostypeid"] = ostypes[0].id cls.iso_1 = Iso.create( cls.apiclient, - cls.services["iso_1"], + cls.services["iso1"], account=cls.account.name, domainid=cls.account.domainid ) @@ -189,7 +189,7 @@ class TestISO(cloudstackTestCase): cls.iso_2 = Iso.create( cls.apiclient, - cls.services["iso_2"], + cls.services["iso2"], account=cls.account.name, domainid=cls.account.domainid ) @@ -336,8 +336,8 @@ class TestISO(cloudstackTestCase): cmd = extractIso.extractIsoCmd() cmd.id = self.iso_2.id - cmd.mode = self.services["iso_2"]["mode"] - cmd.zoneid = self.services["iso_2"]["zoneid"] + cmd.mode = self.services["iso2"]["mode"] + cmd.zoneid = self.services["iso2"]["zoneid"] list_extract_response = self.apiclient.extractIso(cmd) try: @@ -358,12 +358,12 @@ class TestISO(cloudstackTestCase): ) self.assertEqual( list_extract_response.extractMode, - self.services["iso_2"]["mode"], + self.services["iso2"]["mode"], "Check mode of extraction" ) self.assertEqual( list_extract_response.zoneid, - self.services["iso_2"]["zoneid"], + self.services["iso2"]["zoneid"], "Check zone ID of extraction" ) self.assertEqual( http://git-wip-us.apache.org/repos/asf/cloudstack/blob/47c5b638/test/integration/smoke/test_loadbalance.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_loadbalance.py b/test/integration/smoke/test_loadbalance.py index 600d9fb..cf87fcc 100644 --- a/test/integration/smoke/test_loadbalance.py +++ b/test/integration/smoke/test_loadbalance.py @@ -45,10 +45,10 @@ class TestLoadBalance(cloudstackTestCase): cls.zone.id, cls.services["ostype"] ) - if cls.template == FAILED: + if template == FAILED: assert False, "get_template() failed to return template with description %s" % cls.services["ostype"] - cls.services["server"]["zoneid"] = cls.zone.id + cls.services["virtual_machine"]["zoneid"] = cls.zone.id #Create an account, network, VM and IP addresses cls.account = Account.create( @@ -63,7 +63,7 @@ class TestLoadBalance(cloudstackTestCase): ) cls.vm_1 = VirtualMachine.create( cls.apiclient, - cls.services["server"], + cls.services["virtual_machine"], templateid=template.id, accountid=cls.account.name, domainid=cls.account.domainid, @@ -71,7 +71,7 @@ class TestLoadBalance(cloudstackTestCase): ) cls.vm_2 = VirtualMachine.create( cls.apiclient, - cls.services["server"], + cls.services["virtual_machine"], templateid=template.id, accountid=cls.account.name, domainid=cls.account.domainid, @@ -79,7 +79,7 @@ class TestLoadBalance(cloudstackTestCase): ) cls.vm_3 = VirtualMachine.create( cls.apiclient, - cls.services["server"], + cls.services["virtual_machine"], templateid=template.id, accountid=cls.account.name, domainid=cls.account.domainid, @@ -90,7 +90,7 @@ class TestLoadBalance(cloudstackTestCase): cls.account.name, cls.zone.id, cls.account.domainid, - cls.services["server"] + cls.services["virtual_machine"] ) # Open up firewall port for SSH cls.fw_rule = FireWallRule.create( @@ -140,7 +140,7 @@ class TestLoadBalance(cloudstackTestCase): except Exception as e: self.fail("%s: SSH failed for VM with IP Address: %s" % (e, ip_addr)) - time.sleep(self.services["lb_switch_wait"]) + time.sleep(10) return @attr(tags = ["advanced", "advancedns", "smoke"]) http://git-wip-us.apache.org/repos/asf/cloudstack/blob/47c5b638/test/integration/smoke/test_network.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_network.py b/test/integration/smoke/test_network.py index 37f132e..dc2e53e 100644 --- a/test/integration/smoke/test_network.py +++ b/test/integration/smoke/test_network.py @@ -37,7 +37,6 @@ class TestPublicIP(cloudstackTestCase): def setUp(self): self.apiclient = self.testClient.getApiClient() - self.services = Services().services @classmethod def setUpClass(cls): @@ -538,7 +537,7 @@ class TestRebootRouter(cloudstackTestCase): def setUp(self): self.apiclient = self.testClient.getApiClient() - self.services = self.testClient.testClient.getParsedTestDataConfig() + self.services = self.testClient.getParsedTestDataConfig() # Get Zone, Domain and templates self.domain = get_domain(self.apiclient) @@ -710,7 +709,7 @@ class TestReleaseIP(cloudstackTestCase): # Get Zone, Domain and templates self.domain = get_domain(self.apiclient) - self.zone = get_zone(self.apiclient, self.getZoneForTests()) + self.zone = get_zone(self.apiclient, self.testClient.getZoneForTests()) template = get_template( self.apiclient, self.zone.id, @@ -847,7 +846,7 @@ class TestDeleteAccount(cloudstackTestCase): # Get Zone, Domain and templates self.domain = get_domain(self.apiclient) - self.zone = get_zone(self.apiclient, self.getZoneForTests()) + self.zone = get_zone(self.apiclient, self.testClient.getZoneForTests()) template = get_template( self.apiclient, self.zone.id, http://git-wip-us.apache.org/repos/asf/cloudstack/blob/47c5b638/test/integration/smoke/test_portable_publicip.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_portable_publicip.py b/test/integration/smoke/test_portable_publicip.py index 48310a5..ca33c3e 100644 --- a/test/integration/smoke/test_portable_publicip.py +++ b/test/integration/smoke/test_portable_publicip.py @@ -107,7 +107,7 @@ class TestPortablePublicIPAcquire(cloudstackTestCase): # Get Zone, Domain cls.domain = get_domain(cls.apiclient) - cls.zone = get_zone(cls.apiclient, cls.getZoneForTests()) + cls.zone = get_zone(cls.apiclient, cls.testClient.getZoneForTests()) # Create Account cls.account = Account.create( cls.apiclient, http://git-wip-us.apache.org/repos/asf/cloudstack/blob/47c5b638/test/integration/smoke/test_public_ip_range.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_public_ip_range.py b/test/integration/smoke/test_public_ip_range.py index ae9b64b..50b0c9b 100644 --- a/test/integration/smoke/test_public_ip_range.py +++ b/test/integration/smoke/test_public_ip_range.py @@ -30,8 +30,9 @@ class TestDedicatePublicIPRange(cloudstackTestCase): @classmethod def setUpClass(cls): - cls.apiclient = super(TestDedicatePublicIPRange, cls).getClsTestClient().getApiClient() - cls.services = Services().services + cls.testClient = super(TestDedicatePublicIPRange, cls).getClsTestClient() + cls.apivlient = cls.testClient.getApiClient() + cls.services = cls.testClient.getParsedTestDataConfig() # Get Zone, Domain cls.domain = get_domain(cls.apiclient) cls.zone = get_zone(cls.apiclient, cls.getClsTestClient.getZoneForTests()) http://git-wip-us.apache.org/repos/asf/cloudstack/blob/47c5b638/test/integration/smoke/test_reset_vm_on_reboot.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_reset_vm_on_reboot.py b/test/integration/smoke/test_reset_vm_on_reboot.py index 0b5c416..662a0fb 100644 --- a/test/integration/smoke/test_reset_vm_on_reboot.py +++ b/test/integration/smoke/test_reset_vm_on_reboot.py @@ -46,7 +46,7 @@ class TestResetVmOnReboot(cloudstackTestCase): cls.services["ostype"] ) if template == FAILED: - assert False, "get_template() failed to return template with description %s" % cls.services["ostype"]) + assert False, "get_template() failed to return template with description %s" % cls.services["ostype"] # Set Zones and disk offerings ?? cls.services["small"]["zoneid"] = zone.id http://git-wip-us.apache.org/repos/asf/cloudstack/blob/47c5b638/test/integration/smoke/test_snapshots.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_snapshots.py b/test/integration/smoke/test_snapshots.py index 58c51dd..4a4e8c9 100644 --- a/test/integration/smoke/test_snapshots.py +++ b/test/integration/smoke/test_snapshots.py @@ -42,7 +42,7 @@ class TestSnapshotRootDisk(cloudstackTestCase): cls.services["ostype"] ) if template == FAILED: - self.assert "get_template() failed to return template with description %s" % cls.services["ostype"] + assert False, "get_template() failed to return template with description %s" % cls.services["ostype"] cls.services["domainid"] = cls.domain.id cls.services["server_without_disk"]["zoneid"] = cls.zone.id http://git-wip-us.apache.org/repos/asf/cloudstack/blob/47c5b638/test/integration/smoke/test_ssvm.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_ssvm.py b/test/integration/smoke/test_ssvm.py index 3ba7303..d67c55d 100644 --- a/test/integration/smoke/test_ssvm.py +++ b/test/integration/smoke/test_ssvm.py @@ -35,9 +35,10 @@ class TestSSVMs(cloudstackTestCase): def setUp(self): + self.testClient = super(TestSSVMs, cls).getClsTestClient() self.apiclient = self.testClient.getApiClient() self.cleanup = [] - self.services = Services().services + self.services = self.testClient.getParsedTestDataConfig() self.zone = get_zone(self.apiclient, self.testClient.getZoneForTests()) return http://git-wip-us.apache.org/repos/asf/cloudstack/blob/47c5b638/test/integration/smoke/test_templates.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_templates.py b/test/integration/smoke/test_templates.py index 8bda11d..b25359b 100644 --- a/test/integration/smoke/test_templates.py +++ b/test/integration/smoke/test_templates.py @@ -232,7 +232,7 @@ class TestTemplates(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.apiclient, cls.getZoneForTests()) - cls.zone = get_zone(cls.apiclient, cls.getZoneForTests()) + cls.zone = get_zone(cls.apiclient, cls.testClient.getZoneForTests()) cls.services['mode'] = cls.zone.networktype #populate second zone id for iso copy cmd = listZones.listZonesCmd() http://git-wip-us.apache.org/repos/asf/cloudstack/blob/47c5b638/test/integration/smoke/test_vm_life_cycle.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_vm_life_cycle.py b/test/integration/smoke/test_vm_life_cycle.py index 2ac83dc..18e4bb6 100644 --- a/test/integration/smoke/test_vm_life_cycle.py +++ b/test/integration/smoke/test_vm_life_cycle.py @@ -201,7 +201,7 @@ class TestVMLifeCycle(cloudstackTestCase): # Get Zone, Domain and templates domain = get_domain(cls.apiclient) - cls.zone = get_zone(cls.apiclient, cls.getZoneForTests()) + cls.zone = get_zone(cls.apiclient, cls.testClient.getZoneForTests()) cls.services['mode'] = cls.zone.networktype #if local storage is enabled, alter the offerings to use localstorage http://git-wip-us.apache.org/repos/asf/cloudstack/blob/47c5b638/test/integration/smoke/test_vm_snapshots.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_vm_snapshots.py b/test/integration/smoke/test_vm_snapshots.py index fd2a56e..4317d4d 100644 --- a/test/integration/smoke/test_vm_snapshots.py +++ b/test/integration/smoke/test_vm_snapshots.py @@ -29,11 +29,12 @@ class TestVmSnapshot(cloudstackTestCase): @classmethod def setUpClass(cls): - cls.apiclient = super(TestVmSnapshot, cls).getClsTestClient().getApiClient() - cls.services = Services().services + testClient = super(TestVmSnapshot, cls).getClsTestClient() + cls.apiclient = testClient.getApiClient() + cls.services = testClient.getParsedTestDataConfig() # Get Zone, Domain and templates cls.domain = get_domain(cls.apiclient) - cls.zone = get_zone(cls.apiclient, cls.getClsTestClient().getZoneForTests()) + cls.zone = get_zone(cls.apiclient, testClient.getZoneForTests()) template = get_template( cls.apiclient, http://git-wip-us.apache.org/repos/asf/cloudstack/blob/47c5b638/test/integration/smoke/test_vpc_vpn.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_vpc_vpn.py b/test/integration/smoke/test_vpc_vpn.py index 8aa1e4c..87a8cef 100644 --- a/test/integration/smoke/test_vpc_vpn.py +++ b/test/integration/smoke/test_vpc_vpn.py @@ -142,7 +142,7 @@ class TestVpcSite2SiteVpn(cloudstackTestCase): cls.apiclient = testClient.getApiClient() cls.services = testClient.getParsedTestDataConfig() - cls.zone = get_zone(cls.apiclient, cls.getZoneForTests()) + cls.zone = get_zone(cls.apiclient, testClient.getZoneForTests()) cls.domain = get_domain(cls.apiclient) cls.service_offering = ServiceOffering.create( cls.apiclient, http://git-wip-us.apache.org/repos/asf/cloudstack/blob/47c5b638/tools/marvin/marvin/config/test_data.py ---------------------------------------------------------------------- diff --git a/tools/marvin/marvin/config/test_data.py b/tools/marvin/marvin/config/test_data.py index 9f5770d..563bc07 100644 --- a/tools/marvin/marvin/config/test_data.py +++ b/tools/marvin/marvin/config/test_data.py @@ -6,7 +6,15 @@ test_data = { }, "zone": "NA", "domain": { "name": "domain" }, - + "email" : "t...@test.com", + "gateway" : "172.1.1.1", + "netmask" : "255.255.255.0", + "startip" : "172.1.1.10", + "endip" : "172.1.1.20", + "regionid" : "1", + "vlan" :"10", + "isportable" : "true", + "project": { "name": "Project", "displaytext": "Test project" @@ -307,7 +315,7 @@ test_data = { "isextractable": True, "isfeatured": True, "ispublic": True, - "ostype": "CentOS 5.3 (64-bit)", + "ostype": "CentOS 5.6 (64-bit)", }, "iso2": { "displaytext": "Test ISO 2", @@ -316,7 +324,7 @@ test_data = { "isextractable": True, "isfeatured": True, "ispublic": True, - "ostype": "CentOS 5.3 (64-bit)", + "ostype": "CentOS 5.6 (64-bit)", "mode": 'HTTP_DOWNLOAD', }, "isfeatured": True, @@ -333,7 +341,7 @@ test_data = { "template_2": { "displaytext": "Public Template", "name": "Public template", - "ostype": "CentOS 5.3 (64-bit)", + "ostype": "CentOS 5.6 (64-bit)", "isfeatured": True, "ispublic": True, "isextractable": True, @@ -348,7 +356,7 @@ test_data = { "endport": "22", "cidrlist": "0.0.0.0/0" }, - "ostype": "CentOS 5.3 (64-bit)", + "ostype": "CentOS 5.6 (64-bit)", "sleep": 90, "timeout": 10, "advanced_sg": { http://git-wip-us.apache.org/repos/asf/cloudstack/blob/47c5b638/tools/marvin/marvin/lib/common.py ---------------------------------------------------------------------- diff --git a/tools/marvin/marvin/lib/common.py b/tools/marvin/marvin/lib/common.py index cf6050c..77527ad 100644 --- a/tools/marvin/marvin/lib/common.py +++ b/tools/marvin/marvin/lib/common.py @@ -239,8 +239,12 @@ def get_pod(apiclient, zone_id=None, pod_id=None, pod_name=None): cmd_out = apiclient.listPods(cmd) - return FAILED if (validateList(cmd_out)[0] != PASS) else cmd_out - + if validateList(cmd_out)[0] != PASS: return FAILED + + if (pod_id is None and pod_name is None): + return cmd_out[0] + else: + return cmd_out def get_template(apiclient, zone_id=None, ostype_desc=None, template_filter="featured", template_type='BUILTIN', template_id=None, template_name=None, account=None, domain_id=None, project_id=None,