From 88327b99f755f4d8710515cd3b5169d3becd9b5b Mon Sep 17 00:00:00 2001 From: sanjeevn Date: Mon, 4 Jan 2016 18:14:24 +0530 Subject: [PATCH 1/2] Test to verify CS-45057 Bug-Id: CS-45057 Reviewed-by: Self --- test/integration/component/test_vpc.py | 30 +++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/test/integration/component/test_vpc.py b/test/integration/component/test_vpc.py index f81f53f5d29..0cde535f850 100644 --- a/test/integration/component/test_vpc.py +++ b/test/integration/component/test_vpc.py @@ -36,7 +36,8 @@ from marvin.lib.base import (Account, NetworkACL, NATRule, Zone, - StaticNATRule) + StaticNATRule, + VpnCustomerGateway) from marvin.lib.common import (get_domain, get_zone, get_template, @@ -182,6 +183,13 @@ class Services: "domain": { "name": "TestDomain" }, + "vpn_customer_gw": { + "ipsecpsk": "s2svpn", + "ikepolicy": "3des-md5", + "ikelifetime": "86400", + "esppolicy": "3des-md5", + "esplifetime": "3600", + }, "ostype": 'CentOS 5.3 (64-bit)', # Cent OS 5.3 (64 bit) "sleep": 60, @@ -2490,3 +2498,23 @@ class TestVPC(cloudstackTestCase): "Failed to create VM with first ip address in the CIDR as the vm ip" ) return + + @attr(tags=["advanced", "intervlan"], required_hardware="false") + def test_22_vpn_customer_gw_with_hostname(self): + """ + Test to create vpn customer gateway with hostname + instead of gateway ip address + """ + try: + vpnGw = VpnCustomerGateway.create( + self.apiclient, + self.services["vpn_customer_gw"], + name="test_vpn_customer_gw", + gateway="GwWithHostName", + cidrlist="10.1.0.0/16" + ) + self.cleanup.append(vpnGw) + except Exception as e: + self.fail("Creating vpn customer gateway with hostname\ + Failed with error :%s" % e) + return From 4497c6064aad5603ccd5c09e651294a2a4e6b542 Mon Sep 17 00:00:00 2001 From: sanjeevn Date: Thu, 7 Jan 2016 14:34:05 +0530 Subject: [PATCH 2/2] Added few validation steps after adding vpncustomer gateway with hostname Changes are as per review comments in PR#1308 --- test/integration/component/test_vpc.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/test/integration/component/test_vpc.py b/test/integration/component/test_vpc.py index 0cde535f850..5f7ea98b5fa 100644 --- a/test/integration/component/test_vpc.py +++ b/test/integration/component/test_vpc.py @@ -22,7 +22,7 @@ from nose.plugins.attrib import attr from marvin.cloudstackTestCase import cloudstackTestCase from marvin.cloudstackException import CloudstackAPIException from marvin.cloudstackAPI import updateZone -from marvin.lib.utils import cleanup_resources +from marvin.lib.utils import cleanup_resources, validateList from marvin.lib.base import (Account, VPC, VpcOffering, @@ -42,6 +42,7 @@ from marvin.lib.common import (get_domain, get_zone, get_template, list_configurations) +from marvin.codes import PASS import time @@ -2517,4 +2518,18 @@ class TestVPC(cloudstackTestCase): except Exception as e: self.fail("Creating vpn customer gateway with hostname\ Failed with error :%s" % e) + vpn_cgw_res = VpnCustomerGateway.list( + self.apiclient, + id=vpnGw.id + ) + self.assertEqual( + validateList(vpn_cgw_res)[0], + PASS, + "Invalid response for list vpncustomer gateways" + ) + self.assertEqual( + vpnGw.gateway, + vpn_cgw_res[0].gateway, + "Mismatch in vpn customer gateway names" + ) return