This repository has been archived by the owner on Nov 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Management vpn. API create method. unit test. integration test (#200)
- Loading branch information
1 parent
0a38068
commit 646fb03
Showing
9 changed files
with
395 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
catalystwan/integration_tests/feature_profile/sdwan/test_transport.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
from ipaddress import IPv4Address, IPv6Address | ||
|
||
from catalystwan.api.configuration_groups.parcel import as_global | ||
from catalystwan.integration_tests.feature_profile.sdwan.base import TestFeatureProfileModels | ||
from catalystwan.models.configuration.feature_profile.sdwan.transport.vpn_management import ( | ||
DnsIpv4, | ||
DnsIpv6, | ||
Ipv4RouteItem, | ||
Ipv6RouteItem, | ||
ManagementVpn, | ||
NewHostMappingItem, | ||
NextHopItem, | ||
OneOfIpRouteNull0, | ||
Prefix, | ||
SubnetMask, | ||
) | ||
|
||
|
||
class TestTransportFeatureProfileModels(TestFeatureProfileModels): | ||
@classmethod | ||
def setUpClass(cls) -> None: | ||
super().setUpClass() | ||
cls.api = cls.session.api.sdwan_feature_profiles.transport | ||
cls.profile_uuid = cls.api.create_profile("TestProfileService", "Description").id | ||
|
||
def test_when_fully_specified_management_vpn_parcel_expect_successful_post(self): | ||
# Arrange | ||
management_vpn_parcel = ManagementVpn( | ||
parcel_name="FullySpecifiedManagementVpnParcel", | ||
description="Description", | ||
dns_ipv6=DnsIpv6( | ||
primary_dns_address_ipv6=as_global(IPv6Address("67ca:c2df:edfe:c8ec:b6cb:f9f4:eab0:ece6")), | ||
secondary_dns_address_ipv6=as_global(IPv6Address("8989:8d33:c00a:4d13:324d:8b23:8d77:a289")), | ||
), | ||
dns_ipv4=DnsIpv4( | ||
primary_dns_address_ipv4=as_global(IPv4Address("68.138.29.222")), | ||
secondary_dns_address_ipv4=as_global(IPv4Address("122.89.114.112")), | ||
), | ||
new_host_mapping=[ | ||
NewHostMappingItem( | ||
host_name=as_global("FullySpecifiedHost"), | ||
list_of_ip=as_global( | ||
[ | ||
"165.16.181.116", | ||
"7a4c:1d87:8587:a6ec:21a6:48a7:00e8:1fef", | ||
] | ||
), | ||
) | ||
], | ||
ipv6_route=[ | ||
Ipv6RouteItem( | ||
prefix=as_global("0::/16"), | ||
one_of_ip_route=OneOfIpRouteNull0(), | ||
) | ||
], | ||
ipv4_route=[ | ||
Ipv4RouteItem( | ||
prefix=Prefix( | ||
ip_address=as_global(IPv4Address("202.153.165.234")), | ||
subnet_mask=as_global("255.255.255.0", SubnetMask), | ||
), | ||
next_hop=[ | ||
NextHopItem( | ||
address=as_global(IPv4Address("1.1.1.1")), | ||
) | ||
], | ||
) | ||
], | ||
) | ||
# Act | ||
parcel_id = self.api.create_parcel(self.profile_uuid, management_vpn_parcel).id | ||
# Assert | ||
assert parcel_id | ||
|
||
@classmethod | ||
def tearDownClass(cls) -> None: | ||
cls.api.delete_profile(cls.profile_uuid) | ||
super().tearDownClass() |
26 changes: 0 additions & 26 deletions
26
catalystwan/models/configuration/feature_profile/sdwan/management/vpn.py
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.