Skip to content

Commit 5498170

Browse files
committed
Merge pull request #1308 from sanju1010/vpncgw
Test to create vpn customer gateway with hostnameWhile adding vpn customer gateway for site to site vpn connection, cs should also accept host name apart from gateway ip address. It should not be restricted to just ip address. * pr/1308: Added few validation steps after adding vpncustomer gateway with hostname Changes are as per review comments in PR#1308 Test to verify CS-45057 Bug-Id: CS-45057 Reviewed-by: Self Signed-off-by: Will Stevens <[email protected]>
2 parents bebaea3 + 4497c60 commit 5498170

File tree

1 file changed

+45
-2
lines changed

1 file changed

+45
-2
lines changed

test/integration/component/test_vpc.py

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from marvin.cloudstackTestCase import cloudstackTestCase
2323
from marvin.cloudstackException import CloudstackAPIException
2424
from marvin.cloudstackAPI import updateZone
25-
from marvin.lib.utils import cleanup_resources
25+
from marvin.lib.utils import cleanup_resources, validateList
2626
from marvin.lib.base import (Account,
2727
VPC,
2828
VpcOffering,
@@ -36,11 +36,13 @@
3636
NetworkACL,
3737
NATRule,
3838
Zone,
39-
StaticNATRule)
39+
StaticNATRule,
40+
VpnCustomerGateway)
4041
from marvin.lib.common import (get_domain,
4142
get_zone,
4243
get_template,
4344
list_configurations)
45+
from marvin.codes import PASS
4446
import time
4547

4648

@@ -182,6 +184,13 @@ def __init__(self):
182184
"domain": {
183185
"name": "TestDomain"
184186
},
187+
"vpn_customer_gw": {
188+
"ipsecpsk": "s2svpn",
189+
"ikepolicy": "3des-md5",
190+
"ikelifetime": "86400",
191+
"esppolicy": "3des-md5",
192+
"esplifetime": "3600",
193+
},
185194
"ostype": 'CentOS 5.3 (64-bit)',
186195
# Cent OS 5.3 (64 bit)
187196
"sleep": 60,
@@ -2490,3 +2499,37 @@ def test_21_deploy_vm_with_gateway_ip(self):
24902499
"Failed to create VM with first ip address in the CIDR as the vm ip"
24912500
)
24922501
return
2502+
2503+
@attr(tags=["advanced", "intervlan"], required_hardware="false")
2504+
def test_22_vpn_customer_gw_with_hostname(self):
2505+
"""
2506+
Test to create vpn customer gateway with hostname
2507+
instead of gateway ip address
2508+
"""
2509+
try:
2510+
vpnGw = VpnCustomerGateway.create(
2511+
self.apiclient,
2512+
self.services["vpn_customer_gw"],
2513+
name="test_vpn_customer_gw",
2514+
gateway="GwWithHostName",
2515+
cidrlist="10.1.0.0/16"
2516+
)
2517+
self.cleanup.append(vpnGw)
2518+
except Exception as e:
2519+
self.fail("Creating vpn customer gateway with hostname\
2520+
Failed with error :%s" % e)
2521+
vpn_cgw_res = VpnCustomerGateway.list(
2522+
self.apiclient,
2523+
id=vpnGw.id
2524+
)
2525+
self.assertEqual(
2526+
validateList(vpn_cgw_res)[0],
2527+
PASS,
2528+
"Invalid response for list vpncustomer gateways"
2529+
)
2530+
self.assertEqual(
2531+
vpnGw.gateway,
2532+
vpn_cgw_res[0].gateway,
2533+
"Mismatch in vpn customer gateway names"
2534+
)
2535+
return

0 commit comments

Comments
 (0)