Skip to content

Commit

Permalink
Merge pull request #3716 from jcaamano/bad-expected-nat-egressip-ut-f…
Browse files Browse the repository at this point in the history
…lake

Fix bad expected NAT on egressip unit test flake
  • Loading branch information
trozet committed Jun 28, 2023
2 parents 8bd07ff + c089c2e commit f771f6b
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions go-controller/pkg/ovn/egressip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3101,6 +3101,19 @@ var _ = ginkgo.Describe("OVN master EgressIP Operations", func() {
gomega.Eventually(getEgressIPStatusLen(eIP.Name)).Should(gomega.Equal(1))

expectedNatLogicalPort := "k8s-node2"
expectedNAT := &nbdb.NAT{
UUID: "egressip-nat-UUID",
LogicalIP: podV6IP,
ExternalIP: egressIP.String(),
ExternalIDs: map[string]string{
"name": egressIPName,
},
Type: nbdb.NATTypeSNAT,
LogicalPort: &expectedNatLogicalPort,
Options: map[string]string{
"stateless": "false",
},
}
expectedDatabaseState := []libovsdbtest.TestData{
&nbdb.LogicalRouterPolicy{
Priority: types.EgressIPReroutePriority,
Expand All @@ -3122,19 +3135,7 @@ var _ = ginkgo.Describe("OVN master EgressIP Operations", func() {
Name: ovntypes.GWRouterToJoinSwitchPrefix + ovntypes.GWRouterPrefix + node2Name,
Networks: []string{nodeLogicalRouterIfAddrV6},
},
&nbdb.NAT{
UUID: "egressip-nat-UUID",
LogicalIP: podV6IP,
ExternalIP: egressIP.String(),
ExternalIDs: map[string]string{
"name": egressIPName,
},
Type: nbdb.NATTypeSNAT,
LogicalPort: &expectedNatLogicalPort,
Options: map[string]string{
"stateless": "false",
},
},
expectedNAT,
&nbdb.LogicalRouter{
Name: ovntypes.GWRouterPrefix + node1Name,
UUID: ovntypes.GWRouterPrefix + node1Name + "-UUID",
Expand Down Expand Up @@ -3169,6 +3170,8 @@ var _ = ginkgo.Describe("OVN master EgressIP Operations", func() {
_, err = fakeOvn.fakeClient.EgressIPClient.K8sV1().EgressIPs().Update(context.TODO(), eIPUpdate, metav1.UpdateOptions{})
gomega.Expect(err).ToNot(gomega.HaveOccurred())
fakeOvn.patchEgressIPObj(node2Name, updatedEgressIP.String())

expectedNAT.ExternalIP = updatedEgressIP.String()
gomega.Eventually(fakeOvn.nbClient).Should(libovsdbtest.HaveData(expectedDatabaseState))

gomega.Eventually(func() []string {
Expand Down

0 comments on commit f771f6b

Please sign in to comment.