You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by michaelandersen <gi...@git.apache.org> on 2015/11/03 13:29:55 UTC

[GitHub] cloudstack pull request: smoke/test_vpc_vpn: Add template wait & r...

GitHub user michaelandersen opened a pull request:

    https://github.com/apache/cloudstack/pull/1028

    smoke/test_vpc_vpn: Add template wait & refactor

    - Added a wait for template download as the test was failing in some environments
    - Removed debug timer in setup and teardown
    - Increased time.sleep before ssh connection from 10 to 20 seconds


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/michaelandersen/cloudstack fix/vpc_vpn

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cloudstack/pull/1028.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1028
    
----
commit d6ee8caf3e15727ce30405c02452dca90f8f8a99
Author: Michael Andersen <ma...@schubergphilis.com>
Date:   2015-11-03T12:25:35Z

    smoke/test_vpc_vpn: Add template wait & refactor

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: smoke/test_vpc_vpn: Add template wait & r...

Posted by remibergsma <gi...@git.apache.org>.
Github user remibergsma commented on the pull request:

    https://github.com/apache/cloudstack/pull/1028#issuecomment-153673706
  
    LGTM, test runs fine:
    
    ```
    [root@cs1 MarvinLogs]# less test_vpc_vpn_WK8870/results.txt 
    Test Remote Access VPN in VPC ... === TestName: test_vpc_remote_access_vpn | Status : SUCCESS ===
    ok
    Test VPN in VPC ... === TestName: test_vpc_site2site_vpn | Status : SUCCESS ===
    ok
    
    ----------------------------------------------------------------------
    Ran 2 tests in 1137.908s
    
    OK
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Re: [GitHub] cloudstack pull request: smoke/test_vpc_vpn: Add template wait & r...

Posted by Sanjeev N <sa...@apache.org>.
template.download will periodically check for the template download status.
I didn't test it but it is a small change. So LGTM!!

On Tue, Nov 3, 2015 at 7:16 PM, michaelandersen <gi...@git.apache.org> wrote:

> Github user michaelandersen commented on a diff in the pull request:
>
>     https://github.com/apache/cloudstack/pull/1028#discussion_r43748177
>
>     --- Diff: test/integration/smoke/test_vpc_vpn.py ---
>     @@ -570,127 +584,139 @@ def test_vpc_site2site_vpn(self):
>              finally:
>                  self.assertIsNotNone(ntwk2, "Network failed to create")
>
>     -        self.logger.debug("Network %s created in VPC %s" %(ntwk2.id,
> vpc2.id))
>     +        self.logger.debug("Network %s created in VPC %s" % (ntwk2.id,
> vpc2.id))
>
>              # Deploy a vm in network 2
>              try:
>                  vm1 = VirtualMachine.create(self.apiclient,
> services=self.services["virtual_machine"],
>     -                templateid=self.template.id,
>     -                zoneid=self.zone.id,
>     -                accountid=self.account.name,
>     -                domainid= self.account.domainid,
>     -                serviceofferingid=self.service_offering.id,
>     -                networkids=ntwk1.id,
>     -
> hypervisor=self.services["virtual_machine"]["hypervisor"]
>     -            )
>     +                                        templateid=self.template.id,
>     +                                        zoneid=self.zone.id,
>     +                                        accountid=self.account.name,
>     +
> domainid=self.account.domainid,
>     +                                        serviceofferingid=
> self.service_offering.id,
>     +                                        networkids=ntwk1.id,
>     +                                        hypervisor=self.services[
>     +
> "virtual_machine"]["hypervisor"]
>     +                                        )
>              except Exception as e:
>                  self.fail(e)
>              finally:
>                  self.assert_(vm1 is not None, "VM failed to deploy")
>                  self.assert_(vm1.state == 'Running', "VM is not running")
>
>     -        self.logger.debug("VM %s deployed in VPC %s" %(vm1.id,
> vpc1.id))
>     +        self.logger.debug("VM %s deployed in VPC %s" % (vm1.id,
> vpc1.id))
>
>              # Deploy a vm in network 2
>              try:
>                  vm2 = VirtualMachine.create(self.apiclient,
> services=self.services["virtual_machine"],
>     -                templateid=self.template.id,
>     -                zoneid=self.zone.id,
>     -                accountid=self.account.name,
>     -                domainid= self.account.domainid,
>     -                serviceofferingid=self.service_offering.id,
>     -                networkids=ntwk2.id,
>     -
> hypervisor=self.services["virtual_machine"]["hypervisor"]
>     -            )
>     +                                        templateid=self.template.id,
>     +                                        zoneid=self.zone.id,
>     +                                        accountid=self.account.name,
>     +
> domainid=self.account.domainid,
>     +                                        serviceofferingid=
> self.service_offering.id,
>     +                                        networkids=ntwk2.id,
>     +                                        hypervisor=self.services[
>     +
> "virtual_machine"]["hypervisor"]
>     +                                        )
>              except Exception as e:
>                  self.fail(e)
>              finally:
>                  self.assert_(vm2 is not None, "VM failed to deploy")
>                  self.assert_(vm2.state == 'Running', "VM is not running")
>
>     -        self.debug("VM %s deployed in VPC %s" %(vm2.id, vpc2.id))
>     +        self.debug("VM %s deployed in VPC %s" % (vm2.id, vpc2.id))
>
>              # 4) Enable Site-to-Site VPN for VPC
>              vpn1_response = Vpn.createVpnGateway(self.apiclient, vpc1.id)
>     -        self.assert_(vpn1_response is not None, "Failed to enable VPN
> Gateway 1")
>     +        self.assert_(
>     +            vpn1_response is not None, "Failed to enable VPN Gateway
> 1")
>              self.logger.debug("VPN gateway for VPC %s enabled" % vpc1.id)
>
>              vpn2_response = Vpn.createVpnGateway(self.apiclient, vpc2.id)
>     -        self.assert_(vpn2_response is not None, "Failed to enable VPN
> Gateway 2")
>     +        self.assert_(
>     +            vpn2_response is not None, "Failed to enable VPN Gateway
> 2")
>              self.logger.debug("VPN gateway for VPC %s enabled" % vpc2.id)
>
>              # 5) Add VPN Customer gateway info
>              src_nat_list = PublicIPAddress.list(
>     -                                        self.apiclient,
>     -                                        account=self.account.name,
>     -
> domainid=self.account.domainid,
>     -                                        listall=True,
>     -                                        issourcenat=True,
>     -                                        vpcid=vpc1.id
>     -                                        )
>     +            self.apiclient,
>     +            account=self.account.name,
>     +            domainid=self.account.domainid,
>     +            listall=True,
>     +            issourcenat=True,
>     +            vpcid=vpc1.id
>     +        )
>              ip1 = src_nat_list[0]
>              src_nat_list = PublicIPAddress.list(
>     -                                        self.apiclient,
>     -                                        account=self.account.name,
>     -
> domainid=self.account.domainid,
>     -                                        listall=True,
>     -                                        issourcenat=True,
>     -                                        vpcid=vpc2.id
>     -                                        )
>     +            self.apiclient,
>     +            account=self.account.name,
>     +            domainid=self.account.domainid,
>     +            listall=True,
>     +            issourcenat=True,
>     +            vpcid=vpc2.id
>     +        )
>              ip2 = src_nat_list[0]
>
>              services = self.services["vpncustomergateway"]
>     -        customer1_response =
> VpnCustomerGateway.create(self.apiclient, services, "Peer VPC1",
> ip1.ipaddress, vpc1.cidr, self.account.name, self.domain.id )
>     -        self.debug("VPN customer gateway added for VPC %s enabled" %
> vpc1.id )
>     +        customer1_response = VpnCustomerGateway.create(
>     +            self.apiclient, services, "Peer VPC1", ip1.ipaddress,
> vpc1.cidr, self.account.name, self.domain.id)
>     +        self.debug("VPN customer gateway added for VPC %s enabled" %
> vpc1.id)
>              self.logger.debug(vars(customer1_response))
>
>     -        customer2_response =
> VpnCustomerGateway.create(self.apiclient, services, "Peer VPC2",
> ip2.ipaddress, vpc2.cidr, self.account.name, self.domain.id )
>     -        self.debug("VPN customer gateway added for VPC %s enabled" %
> vpc2.id )
>     +        customer2_response = VpnCustomerGateway.create(
>     +            self.apiclient, services, "Peer VPC2", ip2.ipaddress,
> vpc2.cidr, self.account.name, self.domain.id)
>     +        self.debug("VPN customer gateway added for VPC %s enabled" %
> vpc2.id)
>              self.logger.debug(vars(customer2_response))
>
>              # 6) Connect two VPCs
>     -        vpnconn1_response = Vpn.createVpnConnection(self.apiclient,
> customer1_response.id, vpn2_response['id'], True)
>     +        vpnconn1_response = Vpn.createVpnConnection(
>     +            self.apiclient, customer1_response.id,
> vpn2_response['id'], True)
>              self.debug("VPN passive connection created for VPC %s" %
> vpc2.id)
>
>     -        vpnconn2_response = Vpn.createVpnConnection(self.apiclient,
> customer2_response.id, vpn1_response['id'])
>     +        vpnconn2_response = Vpn.createVpnConnection(
>     +            self.apiclient, customer2_response.id,
> vpn1_response['id'])
>              self.debug("VPN connection created for VPC %s" % vpc1.id)
>
>     -        self.assertEqual(vpnconn2_response['state'], "Connected",
> "Failed to connect between VPCs!")
>     +        self.assertEqual(
>     +            vpnconn2_response['state'], "Connected", "Failed to
> connect between VPCs!")
>
>              # acquire an extra ip address to use to ssh into vm2
>              try:
>                  vm2.public_ip = PublicIPAddress.create(
>     -                                    apiclient=self.apiclient,
>     -                                    accountid=self.account.name,
>     -                                    zoneid=self.zone.id,
>     -                                    domainid=self.account.domainid,
>     -                                    services=self.services,
>     -                                    networkid=ntwk2.id,
>     -                                    vpcid=vpc2.id)
>     +                apiclient=self.apiclient,
>     +                accountid=self.account.name,
>     +                zoneid=self.zone.id,
>     +                domainid=self.account.domainid,
>     +                services=self.services,
>     +                networkid=ntwk2.id,
>     +                vpcid=vpc2.id)
>              except Exception as e:
>                  self.fail(e)
>              finally:
>     -            self.assert_(vm2.public_ip is not None, "Failed to
> aqcuire public ip for vm2")
>     -
>     +            self.assert_(
>     +                vm2.public_ip is not None, "Failed to aqcuire public
> ip for vm2")
>
>              # Create port forward to be able to ssh into vm2
>              try:
>     -            natrule = self.create_natrule(vpc2, vm2, 22, 22,
> vm2.public_ip, ntwk2)
>     +            natrule = self.create_natrule(
>     +                vpc2, vm2, 22, 22, vm2.public_ip, ntwk2)
>              except Exception as e:
>                  self.fail(e)
>              finally:
>     -            self.assert_(natrule is not None, "Failed to create
> portforward for vm2")
>     -            time.sleep(10)
>     +            self.assert_(
>     +                natrule is not None, "Failed to create portforward
> for vm2")
>     +            time.sleep(20)
>     --- End diff --
>
>     nope not the essence of this change, that was the waiting for the
> template download which has been implemented using the template.download
> method.
>
>     the time sleep is to catch anything else that could be slow in certain
> environments, such as vm deployment.
>
>
> ---
> If your project is set up for it, you can reply to this email and have your
> reply appear on GitHub as well. If your project does not have this feature
> enabled and wishes so, or if the feature is enabled but not working, please
> contact infrastructure at infrastructure@apache.org or file a JIRA ticket
> with INFRA.
> ---
>

[GitHub] cloudstack pull request: smoke/test_vpc_vpn: Add template wait & r...

Posted by michaelandersen <gi...@git.apache.org>.
Github user michaelandersen commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1028#discussion_r43748177
  
    --- Diff: test/integration/smoke/test_vpc_vpn.py ---
    @@ -570,127 +584,139 @@ def test_vpc_site2site_vpn(self):
             finally:
                 self.assertIsNotNone(ntwk2, "Network failed to create")
     
    -        self.logger.debug("Network %s created in VPC %s" %(ntwk2.id, vpc2.id))
    +        self.logger.debug("Network %s created in VPC %s" % (ntwk2.id, vpc2.id))
     
             # Deploy a vm in network 2
             try:
                 vm1 = VirtualMachine.create(self.apiclient, services=self.services["virtual_machine"],
    -                templateid=self.template.id,
    -                zoneid=self.zone.id,
    -                accountid=self.account.name,
    -                domainid= self.account.domainid,
    -                serviceofferingid=self.service_offering.id,
    -                networkids=ntwk1.id,
    -                hypervisor=self.services["virtual_machine"]["hypervisor"]
    -            )
    +                                        templateid=self.template.id,
    +                                        zoneid=self.zone.id,
    +                                        accountid=self.account.name,
    +                                        domainid=self.account.domainid,
    +                                        serviceofferingid=self.service_offering.id,
    +                                        networkids=ntwk1.id,
    +                                        hypervisor=self.services[
    +                                            "virtual_machine"]["hypervisor"]
    +                                        )
             except Exception as e:
                 self.fail(e)
             finally:
                 self.assert_(vm1 is not None, "VM failed to deploy")
                 self.assert_(vm1.state == 'Running', "VM is not running")
     
    -        self.logger.debug("VM %s deployed in VPC %s" %(vm1.id, vpc1.id))
    +        self.logger.debug("VM %s deployed in VPC %s" % (vm1.id, vpc1.id))
     
             # Deploy a vm in network 2
             try:
                 vm2 = VirtualMachine.create(self.apiclient, services=self.services["virtual_machine"],
    -                templateid=self.template.id,
    -                zoneid=self.zone.id,
    -                accountid=self.account.name,
    -                domainid= self.account.domainid,
    -                serviceofferingid=self.service_offering.id,
    -                networkids=ntwk2.id,
    -                hypervisor=self.services["virtual_machine"]["hypervisor"]
    -            )
    +                                        templateid=self.template.id,
    +                                        zoneid=self.zone.id,
    +                                        accountid=self.account.name,
    +                                        domainid=self.account.domainid,
    +                                        serviceofferingid=self.service_offering.id,
    +                                        networkids=ntwk2.id,
    +                                        hypervisor=self.services[
    +                                            "virtual_machine"]["hypervisor"]
    +                                        )
             except Exception as e:
                 self.fail(e)
             finally:
                 self.assert_(vm2 is not None, "VM failed to deploy")
                 self.assert_(vm2.state == 'Running', "VM is not running")
     
    -        self.debug("VM %s deployed in VPC %s" %(vm2.id, vpc2.id))
    +        self.debug("VM %s deployed in VPC %s" % (vm2.id, vpc2.id))
     
             # 4) Enable Site-to-Site VPN for VPC
             vpn1_response = Vpn.createVpnGateway(self.apiclient, vpc1.id)
    -        self.assert_(vpn1_response is not None, "Failed to enable VPN Gateway 1")
    +        self.assert_(
    +            vpn1_response is not None, "Failed to enable VPN Gateway 1")
             self.logger.debug("VPN gateway for VPC %s enabled" % vpc1.id)
     
             vpn2_response = Vpn.createVpnGateway(self.apiclient, vpc2.id)
    -        self.assert_(vpn2_response is not None, "Failed to enable VPN Gateway 2")
    +        self.assert_(
    +            vpn2_response is not None, "Failed to enable VPN Gateway 2")
             self.logger.debug("VPN gateway for VPC %s enabled" % vpc2.id)
     
             # 5) Add VPN Customer gateway info
             src_nat_list = PublicIPAddress.list(
    -                                        self.apiclient,
    -                                        account=self.account.name,
    -                                        domainid=self.account.domainid,
    -                                        listall=True,
    -                                        issourcenat=True,
    -                                        vpcid=vpc1.id
    -                                        )
    +            self.apiclient,
    +            account=self.account.name,
    +            domainid=self.account.domainid,
    +            listall=True,
    +            issourcenat=True,
    +            vpcid=vpc1.id
    +        )
             ip1 = src_nat_list[0]
             src_nat_list = PublicIPAddress.list(
    -                                        self.apiclient,
    -                                        account=self.account.name,
    -                                        domainid=self.account.domainid,
    -                                        listall=True,
    -                                        issourcenat=True,
    -                                        vpcid=vpc2.id
    -                                        )
    +            self.apiclient,
    +            account=self.account.name,
    +            domainid=self.account.domainid,
    +            listall=True,
    +            issourcenat=True,
    +            vpcid=vpc2.id
    +        )
             ip2 = src_nat_list[0]
     
             services = self.services["vpncustomergateway"]
    -        customer1_response = VpnCustomerGateway.create(self.apiclient, services, "Peer VPC1", ip1.ipaddress, vpc1.cidr, self.account.name, self.domain.id )
    -        self.debug("VPN customer gateway added for VPC %s enabled" % vpc1.id )
    +        customer1_response = VpnCustomerGateway.create(
    +            self.apiclient, services, "Peer VPC1", ip1.ipaddress, vpc1.cidr, self.account.name, self.domain.id)
    +        self.debug("VPN customer gateway added for VPC %s enabled" % vpc1.id)
             self.logger.debug(vars(customer1_response))
     
    -        customer2_response = VpnCustomerGateway.create(self.apiclient, services, "Peer VPC2", ip2.ipaddress, vpc2.cidr, self.account.name, self.domain.id )
    -        self.debug("VPN customer gateway added for VPC %s enabled" % vpc2.id )
    +        customer2_response = VpnCustomerGateway.create(
    +            self.apiclient, services, "Peer VPC2", ip2.ipaddress, vpc2.cidr, self.account.name, self.domain.id)
    +        self.debug("VPN customer gateway added for VPC %s enabled" % vpc2.id)
             self.logger.debug(vars(customer2_response))
     
             # 6) Connect two VPCs
    -        vpnconn1_response = Vpn.createVpnConnection(self.apiclient, customer1_response.id, vpn2_response['id'], True)
    +        vpnconn1_response = Vpn.createVpnConnection(
    +            self.apiclient, customer1_response.id, vpn2_response['id'], True)
             self.debug("VPN passive connection created for VPC %s" % vpc2.id)
     
    -        vpnconn2_response = Vpn.createVpnConnection(self.apiclient, customer2_response.id, vpn1_response['id'])
    +        vpnconn2_response = Vpn.createVpnConnection(
    +            self.apiclient, customer2_response.id, vpn1_response['id'])
             self.debug("VPN connection created for VPC %s" % vpc1.id)
     
    -        self.assertEqual(vpnconn2_response['state'], "Connected", "Failed to connect between VPCs!")
    +        self.assertEqual(
    +            vpnconn2_response['state'], "Connected", "Failed to connect between VPCs!")
     
             # acquire an extra ip address to use to ssh into vm2
             try:
                 vm2.public_ip = PublicIPAddress.create(
    -                                    apiclient=self.apiclient,
    -                                    accountid=self.account.name,
    -                                    zoneid=self.zone.id,
    -                                    domainid=self.account.domainid,
    -                                    services=self.services,
    -                                    networkid=ntwk2.id,
    -                                    vpcid=vpc2.id)
    +                apiclient=self.apiclient,
    +                accountid=self.account.name,
    +                zoneid=self.zone.id,
    +                domainid=self.account.domainid,
    +                services=self.services,
    +                networkid=ntwk2.id,
    +                vpcid=vpc2.id)
             except Exception as e:
                 self.fail(e)
             finally:
    -            self.assert_(vm2.public_ip is not None, "Failed to aqcuire public ip for vm2")
    -
    +            self.assert_(
    +                vm2.public_ip is not None, "Failed to aqcuire public ip for vm2")
     
             # Create port forward to be able to ssh into vm2
             try:
    -            natrule = self.create_natrule(vpc2, vm2, 22, 22, vm2.public_ip, ntwk2)
    +            natrule = self.create_natrule(
    +                vpc2, vm2, 22, 22, vm2.public_ip, ntwk2)
             except Exception as e:
                 self.fail(e)
             finally:
    -            self.assert_(natrule is not None, "Failed to create portforward for vm2")
    -            time.sleep(10)
    +            self.assert_(
    +                natrule is not None, "Failed to create portforward for vm2")
    +            time.sleep(20)
    --- End diff --
    
    nope not the essence of this change, that was the waiting for the template download which has been implemented using the template.download method.
    
    the time sleep is to catch anything else that could be slow in certain environments, such as vm deployment. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: smoke/test_vpc_vpn: Add template wait & r...

Posted by michaelandersen <gi...@git.apache.org>.
Github user michaelandersen commented on the pull request:

    https://github.com/apache/cloudstack/pull/1028#issuecomment-153338894
  
    executed tests with: 
    nosetests --with-marvin --marvin-config=./mct-zone1-kvm1.cfg -a tags=advanced  test_vpc_vpn.py



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: smoke/test_vpc_vpn: Add template wait & r...

Posted by michaelandersen <gi...@git.apache.org>.
Github user michaelandersen commented on the pull request:

    https://github.com/apache/cloudstack/pull/1028#issuecomment-153604321
  
    changed the required_hardware tag to true and rebased to master and retested:
    nosetests --with-marvin --marvin-config=../../../mct-zone1-kvm1.cfg -a tags=advanced,required_hardware=true  test_vpc_vpn.py
    
    Test Remote Access VPN in VPC ... === TestName: test_vpc_remote_access_vpn | Status : SUCCESS ===
    ok
    Test VPN in VPC ... === TestName: test_vpc_site2site_vpn | Status : SUCCESS ===
    ok
    
    ----------------------------------------------------------------------
    Ran 2 tests in 1056.887s
    
    OK
    
    nosetests --with-marvin --marvin-config=../../../mct-zone1-kvm1.cfg -a tags=advanced,required_hardware=false  test_vpc_vpn.py
    
    ----------------------------------------------------------------------
    Ran 0 tests in 0.000s
    
    OK



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: smoke/test_vpc_vpn: Add template wait & r...

Posted by DaanHoogland <gi...@git.apache.org>.
Github user DaanHoogland commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1028#discussion_r43742770
  
    --- Diff: test/integration/smoke/test_vpc_vpn.py ---
    @@ -570,127 +584,139 @@ def test_vpc_site2site_vpn(self):
             finally:
                 self.assertIsNotNone(ntwk2, "Network failed to create")
     
    -        self.logger.debug("Network %s created in VPC %s" %(ntwk2.id, vpc2.id))
    +        self.logger.debug("Network %s created in VPC %s" % (ntwk2.id, vpc2.id))
     
             # Deploy a vm in network 2
             try:
                 vm1 = VirtualMachine.create(self.apiclient, services=self.services["virtual_machine"],
    -                templateid=self.template.id,
    -                zoneid=self.zone.id,
    -                accountid=self.account.name,
    -                domainid= self.account.domainid,
    -                serviceofferingid=self.service_offering.id,
    -                networkids=ntwk1.id,
    -                hypervisor=self.services["virtual_machine"]["hypervisor"]
    -            )
    +                                        templateid=self.template.id,
    +                                        zoneid=self.zone.id,
    +                                        accountid=self.account.name,
    +                                        domainid=self.account.domainid,
    +                                        serviceofferingid=self.service_offering.id,
    +                                        networkids=ntwk1.id,
    +                                        hypervisor=self.services[
    +                                            "virtual_machine"]["hypervisor"]
    +                                        )
             except Exception as e:
                 self.fail(e)
             finally:
                 self.assert_(vm1 is not None, "VM failed to deploy")
                 self.assert_(vm1.state == 'Running', "VM is not running")
     
    -        self.logger.debug("VM %s deployed in VPC %s" %(vm1.id, vpc1.id))
    +        self.logger.debug("VM %s deployed in VPC %s" % (vm1.id, vpc1.id))
     
             # Deploy a vm in network 2
             try:
                 vm2 = VirtualMachine.create(self.apiclient, services=self.services["virtual_machine"],
    -                templateid=self.template.id,
    -                zoneid=self.zone.id,
    -                accountid=self.account.name,
    -                domainid= self.account.domainid,
    -                serviceofferingid=self.service_offering.id,
    -                networkids=ntwk2.id,
    -                hypervisor=self.services["virtual_machine"]["hypervisor"]
    -            )
    +                                        templateid=self.template.id,
    +                                        zoneid=self.zone.id,
    +                                        accountid=self.account.name,
    +                                        domainid=self.account.domainid,
    +                                        serviceofferingid=self.service_offering.id,
    +                                        networkids=ntwk2.id,
    +                                        hypervisor=self.services[
    +                                            "virtual_machine"]["hypervisor"]
    +                                        )
             except Exception as e:
                 self.fail(e)
             finally:
                 self.assert_(vm2 is not None, "VM failed to deploy")
                 self.assert_(vm2.state == 'Running', "VM is not running")
     
    -        self.debug("VM %s deployed in VPC %s" %(vm2.id, vpc2.id))
    +        self.debug("VM %s deployed in VPC %s" % (vm2.id, vpc2.id))
     
             # 4) Enable Site-to-Site VPN for VPC
             vpn1_response = Vpn.createVpnGateway(self.apiclient, vpc1.id)
    -        self.assert_(vpn1_response is not None, "Failed to enable VPN Gateway 1")
    +        self.assert_(
    +            vpn1_response is not None, "Failed to enable VPN Gateway 1")
             self.logger.debug("VPN gateway for VPC %s enabled" % vpc1.id)
     
             vpn2_response = Vpn.createVpnGateway(self.apiclient, vpc2.id)
    -        self.assert_(vpn2_response is not None, "Failed to enable VPN Gateway 2")
    +        self.assert_(
    +            vpn2_response is not None, "Failed to enable VPN Gateway 2")
             self.logger.debug("VPN gateway for VPC %s enabled" % vpc2.id)
     
             # 5) Add VPN Customer gateway info
             src_nat_list = PublicIPAddress.list(
    -                                        self.apiclient,
    -                                        account=self.account.name,
    -                                        domainid=self.account.domainid,
    -                                        listall=True,
    -                                        issourcenat=True,
    -                                        vpcid=vpc1.id
    -                                        )
    +            self.apiclient,
    +            account=self.account.name,
    +            domainid=self.account.domainid,
    +            listall=True,
    +            issourcenat=True,
    +            vpcid=vpc1.id
    +        )
             ip1 = src_nat_list[0]
             src_nat_list = PublicIPAddress.list(
    -                                        self.apiclient,
    -                                        account=self.account.name,
    -                                        domainid=self.account.domainid,
    -                                        listall=True,
    -                                        issourcenat=True,
    -                                        vpcid=vpc2.id
    -                                        )
    +            self.apiclient,
    +            account=self.account.name,
    +            domainid=self.account.domainid,
    +            listall=True,
    +            issourcenat=True,
    +            vpcid=vpc2.id
    +        )
             ip2 = src_nat_list[0]
     
             services = self.services["vpncustomergateway"]
    -        customer1_response = VpnCustomerGateway.create(self.apiclient, services, "Peer VPC1", ip1.ipaddress, vpc1.cidr, self.account.name, self.domain.id )
    -        self.debug("VPN customer gateway added for VPC %s enabled" % vpc1.id )
    +        customer1_response = VpnCustomerGateway.create(
    +            self.apiclient, services, "Peer VPC1", ip1.ipaddress, vpc1.cidr, self.account.name, self.domain.id)
    +        self.debug("VPN customer gateway added for VPC %s enabled" % vpc1.id)
             self.logger.debug(vars(customer1_response))
     
    -        customer2_response = VpnCustomerGateway.create(self.apiclient, services, "Peer VPC2", ip2.ipaddress, vpc2.cidr, self.account.name, self.domain.id )
    -        self.debug("VPN customer gateway added for VPC %s enabled" % vpc2.id )
    +        customer2_response = VpnCustomerGateway.create(
    +            self.apiclient, services, "Peer VPC2", ip2.ipaddress, vpc2.cidr, self.account.name, self.domain.id)
    +        self.debug("VPN customer gateway added for VPC %s enabled" % vpc2.id)
             self.logger.debug(vars(customer2_response))
     
             # 6) Connect two VPCs
    -        vpnconn1_response = Vpn.createVpnConnection(self.apiclient, customer1_response.id, vpn2_response['id'], True)
    +        vpnconn1_response = Vpn.createVpnConnection(
    +            self.apiclient, customer1_response.id, vpn2_response['id'], True)
             self.debug("VPN passive connection created for VPC %s" % vpc2.id)
     
    -        vpnconn2_response = Vpn.createVpnConnection(self.apiclient, customer2_response.id, vpn1_response['id'])
    +        vpnconn2_response = Vpn.createVpnConnection(
    +            self.apiclient, customer2_response.id, vpn1_response['id'])
             self.debug("VPN connection created for VPC %s" % vpc1.id)
     
    -        self.assertEqual(vpnconn2_response['state'], "Connected", "Failed to connect between VPCs!")
    +        self.assertEqual(
    +            vpnconn2_response['state'], "Connected", "Failed to connect between VPCs!")
     
             # acquire an extra ip address to use to ssh into vm2
             try:
                 vm2.public_ip = PublicIPAddress.create(
    -                                    apiclient=self.apiclient,
    -                                    accountid=self.account.name,
    -                                    zoneid=self.zone.id,
    -                                    domainid=self.account.domainid,
    -                                    services=self.services,
    -                                    networkid=ntwk2.id,
    -                                    vpcid=vpc2.id)
    +                apiclient=self.apiclient,
    +                accountid=self.account.name,
    +                zoneid=self.zone.id,
    +                domainid=self.account.domainid,
    +                services=self.services,
    +                networkid=ntwk2.id,
    +                vpcid=vpc2.id)
             except Exception as e:
                 self.fail(e)
             finally:
    -            self.assert_(vm2.public_ip is not None, "Failed to aqcuire public ip for vm2")
    -
    +            self.assert_(
    +                vm2.public_ip is not None, "Failed to aqcuire public ip for vm2")
     
             # Create port forward to be able to ssh into vm2
             try:
    -            natrule = self.create_natrule(vpc2, vm2, 22, 22, vm2.public_ip, ntwk2)
    +            natrule = self.create_natrule(
    +                vpc2, vm2, 22, 22, vm2.public_ip, ntwk2)
             except Exception as e:
                 self.fail(e)
             finally:
    -            self.assert_(natrule is not None, "Failed to create portforward for vm2")
    -            time.sleep(10)
    +            self.assert_(
    +                natrule is not None, "Failed to create portforward for vm2")
    +            time.sleep(20)
    --- End diff --
    
    Is this the essence of this change , @michaelandersen ? seems like it is postponement of execution. Isn't there a condition to check for instead?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: smoke/test_vpc_vpn: Add template wait & r...

Posted by michaelandersen <gi...@git.apache.org>.
Github user michaelandersen commented on the pull request:

    https://github.com/apache/cloudstack/pull/1028#issuecomment-153338103
  
    @sanjeevneelarapu please review once build checks are completed


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: smoke/test_vpc_vpn: Add template wait & r...

Posted by michaelandersen <gi...@git.apache.org>.
Github user michaelandersen commented on the pull request:

    https://github.com/apache/cloudstack/pull/1028#issuecomment-153338369
  
    Tested change on a KVM hypervisor:
    
    Test Remote Access VPN in VPC ... === TestName: test_vpc_remote_access_vpn | Status : SUCCESS ===
    ok
    Test VPN in VPC ... === TestName: test_vpc_site2site_vpn | Status : SUCCESS ===
    ok
    
    ----------------------------------------------------------------------
    Ran 2 tests in 1084.378s
    
    OK



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: smoke/test_vpc_vpn: Add template wait & r...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/cloudstack/pull/1028


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---