Skip to content

Commit

Permalink
fix encap frr with reenap vrf test (#3361)
Browse files Browse the repository at this point in the history
  • Loading branch information
self-maurya authored Aug 5, 2024
1 parent 67c69e5 commit d76f4d4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package container_lifecycle
package container_lifecycle_test

import (
"context"
Expand Down
10 changes: 5 additions & 5 deletions feature/gribi/otg_tests/encap_frr/encap_frr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1196,15 +1196,15 @@ func TestEncapFrr(t *testing.T) {
if tc.TestID == "primaryBackupRoutingAll" {
args.client.Modify().AddEntry(t,
fluent.NextHopEntry().WithNetworkInstance(deviations.DefaultNetworkInstance(dut)).
WithIndex(1100).WithDecapsulateHeader(fluent.IPinIP).
WithIndex(1200).WithDecapsulateHeader(fluent.IPinIP).
WithNextHopNetworkInstance(deviations.DefaultNetworkInstance(dut)),
fluent.NextHopGroupEntry().WithNetworkInstance(deviations.DefaultNetworkInstance(dut)).
WithID(1000).AddNextHop(1100, 1),
fluent.NextHopEntry().WithNetworkInstance(deviations.DefaultNetworkInstance(dut)).
WithIndex(1101).WithDecapsulateHeader(fluent.IPinIP).
WithIndex(1201).WithDecapsulateHeader(fluent.IPinIP).
WithNextHopNetworkInstance(deviations.DefaultNetworkInstance(dut)),
fluent.NextHopGroupEntry().WithNetworkInstance(deviations.DefaultNetworkInstance(dut)).
WithID(1001).AddNextHop(1101, 1),
WithID(1000).AddNextHop(1200, 1),
fluent.NextHopGroupEntry().WithNetworkInstance(deviations.DefaultNetworkInstance(dut)).
WithID(1001).AddNextHop(1201, 1),
)
if err := awaitTimeout(ctx, t, args.client, time.Minute); err != nil {
t.Logf("Could not program entries via client, got err, check error codes: %v", err)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ func awaitTimeout(ctx context.Context, t testing.TB, c *fluent.GRIBIClient, time
}

type testArgs struct {
ctx context.Context
client *fluent.GRIBIClient
dut *ondatra.DUTDevice
ate *ondatra.ATEDevice
Expand Down Expand Up @@ -1111,18 +1110,17 @@ func TestEncapFrr(t *testing.T) {
if tc.TestID == "primaryBackupRoutingAll" {
args.client.Modify().AddEntry(t,
fluent.NextHopEntry().WithNetworkInstance(deviations.DefaultNetworkInstance(dut)).
WithIndex(1200).
WithIndex(1200).WithDecapsulateHeader(fluent.IPinIP).
WithNextHopNetworkInstance(deviations.DefaultNetworkInstance(dut)),
fluent.NextHopEntry().WithNetworkInstance(deviations.DefaultNetworkInstance(dut)).
WithIndex(1201).
WithIndex(1201).WithDecapsulateHeader(fluent.IPinIP).
WithNextHopNetworkInstance(deviations.DefaultNetworkInstance(dut)),

fluent.NextHopGroupEntry().WithNetworkInstance(deviations.DefaultNetworkInstance(dut)).
WithID(1000).AddNextHop(1200, 1),
fluent.NextHopGroupEntry().WithNetworkInstance(deviations.DefaultNetworkInstance(dut)).
WithID(1001).AddNextHop(1201, 1),
)
if err := awaitTimeout(args.ctx, t, args.client, 2*time.Minute); err != nil {
if err := awaitTimeout(ctx, t, args.client, 2*time.Minute); err != nil {
t.Logf("Could not program entries via client, got err, check error codes: %v", err)
}
}
Expand All @@ -1135,7 +1133,7 @@ func TestEncapFrr(t *testing.T) {
fluent.IPv4Entry().WithNetworkInstance(niEncapTeVrfA).
WithPrefix("0.0.0.0/0").WithNextHopGroup(1003).WithNextHopGroupNetworkInstance(deviations.DefaultNetworkInstance(dut)),
)
if err := awaitTimeout(args.ctx, t, args.client, 2*time.Minute); err != nil {
if err := awaitTimeout(ctx, t, args.client, 2*time.Minute); err != nil {
t.Logf("Could not program entries via client, got err, check error codes: %v", err)
}
createFlow(t, otgConfig, otg, noMatchEncapDest)
Expand All @@ -1154,7 +1152,7 @@ func TestEncapFrr(t *testing.T) {
fluent.NextHopGroupEntry().WithNetworkInstance(deviations.DefaultNetworkInstance(dut)).
WithID(1001).AddNextHop(1301, 1),
)
if err := awaitTimeout(args.ctx, t, args.client, 2*time.Minute); err != nil {
if err := awaitTimeout(ctx, t, args.client, 2*time.Minute); err != nil {
t.Logf("Could not program entries via client, got err, check error codes: %v", err)
}
}
Expand All @@ -1169,8 +1167,7 @@ func TestEncapFrr(t *testing.T) {
fluent.NextHopGroupEntry().WithNetworkInstance(deviations.DefaultNetworkInstance(dut)).
WithID(101).AddNextHop(201, 1).AddNextHop(202, 3).WithBackupNHG(2001),
)

if err := awaitTimeout(args.ctx, t, args.client, 2*time.Minute); err != nil {
if err := awaitTimeout(ctx, t, args.client, 2*time.Minute); err != nil {
t.Logf("Could not program entries via client, got err, check error codes: %v", err)
}
}
Expand Down

0 comments on commit d76f4d4

Please sign in to comment.