PEP8 of integration/smoke/test_vpc_vpn
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/ecc8cc0b Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/ecc8cc0b Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/ecc8cc0b Branch: refs/heads/master Commit: ecc8cc0bc958e40b37a4fb7794d6a49deebe3e9b Parents: a42b046 Author: Michael Andersen <[email protected]> Authored: Tue Dec 22 12:29:44 2015 +0100 Committer: Michael Andersen <[email protected]> Committed: Tue Jan 12 11:24:35 2016 +0100 ---------------------------------------------------------------------- test/integration/smoke/test_vpc_vpn.py | 50 ++++++++++++++++------------- 1 file changed, 28 insertions(+), 22 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ecc8cc0b/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 a8195dc..af74e6f 100644 --- a/test/integration/smoke/test_vpc_vpn.py +++ b/test/integration/smoke/test_vpc_vpn.py @@ -19,7 +19,8 @@ # Import Local Modules from marvin.codes import PASS, FAILED from marvin.cloudstackTestCase import cloudstackTestCase -from marvin.lib.utils import (cleanup_resources, +from marvin.lib.utils import (validateList, + cleanup_resources, get_process_status) from marvin.lib.base import (Domain, @@ -259,7 +260,6 @@ class Services: } - class TestVpcRemoteAccessVpn(cloudstackTestCase): @classmethod @@ -286,8 +286,10 @@ class TestVpcRemoteAccessVpn(cloudstackTestCase): cls.hypervisor = testClient.getHypervisorInfo() - cls.logger.debug("Downloading Template: %s from: %s" %(cls.services["template"][cls.hypervisor.lower()], cls.services["template"][cls.hypervisor.lower()]["url"])) - cls.template = Template.register(cls.apiclient, cls.services["template"][cls.hypervisor.lower()], cls.zone.id, hypervisor=cls.hypervisor.lower(), account=cls.account.name, domainid=cls.domain.id) + cls.logger.debug("Downloading Template: %s from: %s" % (cls.services["template"][ + cls.hypervisor.lower()], cls.services["template"][cls.hypervisor.lower()]["url"])) + cls.template = Template.register(cls.apiclient, cls.services["template"][cls.hypervisor.lower( + )], cls.zone.id, hypervisor=cls.hypervisor.lower(), account=cls.account.name, domainid=cls.domain.id) cls.template.download(cls.apiclient) if cls.template == FAILED: @@ -463,8 +465,10 @@ class TestVpcSite2SiteVpn(cloudstackTestCase): cls.hypervisor = testClient.getHypervisorInfo() - cls.logger.debug("Downloading Template: %s from: %s" %(cls.services["template"][cls.hypervisor.lower()], cls.services["template"][cls.hypervisor.lower()]["url"])) - cls.template = Template.register(cls.apiclient, cls.services["template"][cls.hypervisor.lower()], cls.zone.id, hypervisor=cls.hypervisor.lower(), account=cls.account.name, domainid=cls.domain.id) + cls.logger.debug("Downloading Template: %s from: %s" % (cls.services["template"][ + cls.hypervisor.lower()], cls.services["template"][cls.hypervisor.lower()]["url"])) + cls.template = Template.register(cls.apiclient, cls.services["template"][cls.hypervisor.lower( + )], cls.zone.id, hypervisor=cls.hypervisor.lower(), account=cls.account.name, domainid=cls.domain.id) cls.template.download(cls.apiclient) if cls.template == FAILED: @@ -530,11 +534,11 @@ class TestVpcSite2SiteVpn(cloudstackTestCase): self.apiclient, id=vpc_offering.id ) - self.assertEqual( - isinstance(vpc_offs, list), - True, - "List VPC offerings should return a valid list" - ) + offering_list = validateList(vpc_offs) + self.assertEqual(offering_list[0], + PASS, + "List VPC offerings should return a valid list" + ) self.assertEqual( vpc_offering.name, vpc_offs[0].name, @@ -824,8 +828,10 @@ class TestRVPCSite2SiteVpn(cloudstackTestCase): cls.hypervisor = testClient.getHypervisorInfo() - cls.logger.debug("Downloading Template: %s from: %s" %(cls.services["template"][cls.hypervisor.lower()], cls.services["template"][cls.hypervisor.lower()]["url"])) - cls.template = Template.register(cls.apiclient, cls.services["template"][cls.hypervisor.lower()], cls.zone.id, hypervisor=cls.hypervisor.lower(), account=cls.account.name, domainid=cls.domain.id) + cls.logger.debug("Downloading Template: %s from: %s" % (cls.services["template"][ + cls.hypervisor.lower()], cls.services["template"][cls.hypervisor.lower()]["url"])) + cls.template = Template.register(cls.apiclient, cls.services["template"][cls.hypervisor.lower( + )], cls.zone.id, hypervisor=cls.hypervisor.lower(), account=cls.account.name, domainid=cls.domain.id) cls.template.download(cls.apiclient) if cls.template == FAILED: @@ -845,11 +851,11 @@ class TestRVPCSite2SiteVpn(cloudstackTestCase): self.apiclient, id=vpc_offering.id ) - self.assertEqual( - isinstance(vpc_offs, list), - True, - "List VPC offerings should return a valid list" - ) + offering_list = validateList(vpc_offs) + self.assertEqual(offering_list[0], + PASS, + "List VPC offerings should return a valid list" + ) self.assertEqual( vpc_offering.name, vpc_offs[0].name, @@ -876,7 +882,6 @@ class TestRVPCSite2SiteVpn(cloudstackTestCase): return vpc_off - def _get_ssh_client(self, virtual_machine, services, retries): """ Setup ssh client connection and return connection vm requires attributes public_ip, public_port, username, password """ @@ -923,7 +928,6 @@ class TestRVPCSite2SiteVpn(cloudstackTestCase): vm.public_port = int(public_port) return nat_rule - @attr(tags=["advanced"], required_hardware="true") def test_01_redundant_vpc_site2site_vpn(self): """Test Site 2 Site VPN Across redundant VPCs""" @@ -936,8 +940,10 @@ class TestRVPCSite2SiteVpn(cloudstackTestCase): networkOffering) > 0, "No VPC based network offering") # Create and enable redundant VPC offering - redundant_vpc_offering = self._create_vpc_offering('redundant_vpc_offering') - self.assert_(redundant_vpc_offering is not None, "Failed to create redundant VPC Offering") + redundant_vpc_offering = self._create_vpc_offering( + 'redundant_vpc_offering') + self.assert_(redundant_vpc_offering is not None, + "Failed to create redundant VPC Offering") redundant_vpc_offering.update(self.apiclient, state='Enabled')
