Skip to content

Commit

Permalink
fix ovn-vpc-nat-gw e2e failed
Browse files Browse the repository at this point in the history
Signed-off-by: zcq98 <[email protected]>
  • Loading branch information
zcq98 authored and bobz965 committed Dec 8, 2023
1 parent 079e6c8 commit 61ef8b0
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions test/e2e/ovn-vpc-nat-gw/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ var _ = framework.Describe("[group:ovn-vpc-nat-gw]", func() {
var dockerNetwork, dockerExtraNetwork *dockertypes.NetworkResource
var nodeNames, gwNodeNames, providerBridgeIps, extraProviderBridgeIps []string
var clusterName, providerNetworkName, vlanName, underlaySubnetName, noBfdVpcName, bfdVpcName, noBfdSubnetName, bfdSubnetName string
var providerExtraNetworkName, underlayExtraSubnetName, noBfdExtraSubnetName string
var providerExtraNetworkName, vlanExtraName, underlayExtraSubnetName, noBfdExtraSubnetName string
var linkMap, extraLinkMap map[string]*iproute.Link
var providerNetworkClient *framework.ProviderNetworkClient
var vlanClient *framework.VlanClient
Expand Down Expand Up @@ -158,6 +158,7 @@ var _ = framework.Describe("[group:ovn-vpc-nat-gw]", func() {
providerNetworkName = "external"
providerExtraNetworkName = "extra"
vlanName = "vlan-" + framework.RandomSuffix()
vlanExtraName = "vlan-extra" + framework.RandomSuffix()
underlaySubnetName = "external"
underlayExtraSubnetName = "extra"

Expand Down Expand Up @@ -469,6 +470,8 @@ var _ = framework.Describe("[group:ovn-vpc-nat-gw]", func() {

ginkgo.By("Deleting vlan " + vlanName)
vlanClient.Delete(vlanName, metav1.DeleteOptions{})
ginkgo.By("Deleting extra vlan " + vlanExtraName)
vlanClient.Delete(vlanExtraName, metav1.DeleteOptions{})

ginkgo.By("Deleting provider network " + providerNetworkName)
providerNetworkClient.DeleteSync(providerNetworkName)
Expand Down Expand Up @@ -692,6 +695,10 @@ var _ = framework.Describe("[group:ovn-vpc-nat-gw]", func() {
framework.ExpectNoError(err, "getting extra docker network "+dockerExtraNetworkName)
itFn(exchangeLinkName, providerExtraNetworkName, extraLinkMap, &extraProviderBridgeIps)

ginkgo.By("Creating underlay extra vlan " + vlanExtraName)
vlan = framework.MakeVlan(vlanExtraName, providerExtraNetworkName, 0)
_ = vlanClient.Create(vlan)

ginkgo.By("Creating extra underlay subnet " + underlayExtraSubnetName)
extracidr := make([]string, 0, 2)
extragateway := make([]string, 0, 2)
Expand Down Expand Up @@ -722,11 +729,11 @@ var _ = framework.Describe("[group:ovn-vpc-nat-gw]", func() {
}
extraVlanSubnetCidr := strings.Join(extracidr, ",")
extraVlanSubnetGw := strings.Join(extragateway, ",")
underlayExtraSubnet := framework.MakeSubnet(underlayExtraSubnetName, vlanName, extraVlanSubnetCidr, extraVlanSubnetGw, "", "", extraExcludeIPs, nil, nil)
underlayExtraSubnet := framework.MakeSubnet(underlayExtraSubnetName, vlanExtraName, extraVlanSubnetCidr, extraVlanSubnetGw, "", "", extraExcludeIPs, nil, nil)
_ = subnetClient.CreateSync(underlayExtraSubnet)
vlanExtraSubnet := subnetClient.Get(underlayExtraSubnetName)
ginkgo.By("Checking extra underlay vlan " + vlanExtraSubnet.Name)
framework.ExpectEqual(vlanExtraSubnet.Spec.Vlan, vlanName)
framework.ExpectEqual(vlanExtraSubnet.Spec.Vlan, vlanExtraName)
framework.ExpectNotEqual(vlanExtraSubnet.Spec.CIDRBlock, "")

ginkgo.By("1.3 Test custom vpc nats using extra centralized external gw")
Expand Down

0 comments on commit 61ef8b0

Please sign in to comment.