Skip to content

Commit

Permalink
Dynamic: fix smoke test on VPC
Browse files Browse the repository at this point in the history
  • Loading branch information
weizhouapache committed Jul 24, 2024
1 parent 9dc7c2e commit 1426940
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1221,7 +1221,7 @@ public Vpc createVpc(final long zoneId, final long vpcOffId, final long vpcOwner
Vpc newVpc = createVpc(displayVpc, vpc);
// assign Ipv4 subnet to Routed VPC
if (routedIpv4Manager.isRoutedVpc(vpc)) {
routedIpv4Manager.assignIpv4SubnetToVpc(cidr, newVpc.getId());
routedIpv4Manager.assignIpv4SubnetToVpc(newVpc.getCidr(), newVpc.getId());
}
if (CollectionUtils.isNotEmpty(bgpPeerIds)) {
routedIpv4Manager.persistBgpPeersForVpc(newVpc.getId(), bgpPeerIds);
Expand Down
21 changes: 19 additions & 2 deletions test/integration/smoke/test_ipv4_routing.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,15 @@
}
}

VPC_OFFERING_DYNAMIC = {
"name": "Test VPC offering - Routed mode",
"displaytext": "Test VPC offering - Routed mode",
"networkmode": "ROUTED",
"routingmode": "Dynamic",
"supportedservices":
"Dhcp,Dns,UserData,NetworkACL"
}

VPC_NETWORK_OFFERING_DYNAMIC = {
"name": "Test VPC Network offering - Dynamic Routed mode",
"displaytext": "Test VPC Network offering - Dynamic Routed mode",
Expand Down Expand Up @@ -1379,11 +1388,19 @@ def test_12_vpc_and_tier_with_dynamic_routed_mode(self):
)
self.cleanup.append(bgppeer_2)

# 2. Create VPC
# 2.1 VPC offering for static routing
vpc_offering_dynamic = VpcOffering.create(
self.apiclient,
VPC_OFFERING_DYNAMIC
)
self.cleanup.append(vpc_offering_dynamic)
vpc_offering_dynamic.update(self.apiclient, state='Enabled')

# 2.2 Create VPC
self.services["vpc"]["cidr"] = VPC_CIDR_PREFIX + ".8.0/22"
test_vpc_dynamic = VPC.create(self.apiclient,
self.services["vpc"],
vpcofferingid=self.vpc_offering.id,
vpcofferingid=vpc_offering_dynamic.id,
zoneid=self.zone.id,
domainid=self.sub_domain.id,
account=self.regular_user.name,
Expand Down
2 changes: 2 additions & 0 deletions tools/marvin/marvin/lib/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5107,6 +5107,8 @@ def create(cls, apiclient, services):
cmd.internetprotocol = services["internetprotocol"]
if "networkmode" in services:
cmd.networkmode = services["networkmode"]
if "routingmode" in services:
cmd.routingmode = services["routingmode"]
return VpcOffering(apiclient.createVPCOffering(cmd).__dict__)

def update(self, apiclient, name=None, displaytext=None, state=None):
Expand Down

0 comments on commit 1426940

Please sign in to comment.