Skip to content

Commit

Permalink
Adding a new test under compliance
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulsy26 committed Jul 22, 2024
1 parent 502ee20 commit 81aae77
Showing 1 changed file with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ import (
"strings"
"testing"

"flag"

"github.com/open-traffic-generator/snappi/gosnappi"
"github.com/openconfig/featureprofiles/internal/attrs"
"github.com/openconfig/featureprofiles/internal/deviations"
Expand Down Expand Up @@ -177,6 +175,25 @@ func TestCompliance(t *testing.T) {
tt.In.Fn(c, t, opts...)
})
}

t.Run("Add IPv4 Entry with NHG which reference to NH to Down port", func(t *testing.T) {
c := fluent.NewClient()
c.Connection().WithStub(gribic)
t.Log("Setting port2 to down")
p := dut.Port(t, "port2")
setDUTInterfaceWithState(t, dut, p, false)
compliance.AddNHGReferencingToDownPort(c, fluent.InstalledInFIB, t, p.Name())
})
}

func setDUTInterfaceWithState(t testing.TB, dut *ondatra.DUTDevice, p *ondatra.Port, state bool) {
dc := gnmi.OC()
i := &oc.Interface{}
i.Enabled = ygot.Bool(state)
i.Type = oc.IETFInterfaces_InterfaceType_ethernetCsmacd
i.Name = ygot.String(p.Name())
gnmi.Update(t, dut, dc.Interface(p.Name()).Config(), i)

}

// configureDUT configures port1-3 on the DUT.
Expand Down

0 comments on commit 81aae77

Please sign in to comment.