Skip to content

Commit

Permalink
fix network instance (openconfig#3332)
Browse files Browse the repository at this point in the history
* fix network instance

* fixed vet errors
  • Loading branch information
ram-mac authored and ANISH-GOTTAPU committed Nov 28, 2024
1 parent 54cb50a commit 311cb72
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions feature/gribi/otg_tests/static_lsp_test/static_lsp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,18 @@ func configureOTG(t *testing.T) gosnappi.Config {
// configureStaticLSP configures a static MPLS LSP with the provided parameters.
func configureStaticLSP(t *testing.T, dut *ondatra.DUTDevice, lspName string, incomingLabel uint32, nextHopIP string) {
d := &oc.Root{}
mplsCfg := d.GetOrCreateNetworkInstance(deviations.DefaultNetworkInstance(dut)).GetOrCreateMpls()
dni := deviations.DefaultNetworkInstance(dut)
defPath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut))
gnmi.Update(t, dut, defPath.Config(), &oc.NetworkInstance{
Name: ygot.String(deviations.DefaultNetworkInstance(dut)),
Type: oc.NetworkInstanceTypes_NETWORK_INSTANCE_TYPE_DEFAULT_INSTANCE,
})
mplsCfg := d.GetOrCreateNetworkInstance(dni).GetOrCreateMpls()
staticMplsCfg := mplsCfg.GetOrCreateLsps().GetOrCreateStaticLsp(lspName)
staticMplsCfg.GetOrCreateEgress().SetIncomingLabel(oc.UnionUint32(incomingLabel))
staticMplsCfg.GetOrCreateEgress().SetNextHop(nextHopIP)
staticMplsCfg.GetOrCreateEgress().SetPushLabel(oc.Egress_PushLabel_IMPLICIT_NULL)

gnmi.Update(t, dut, gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).Mpls().Config(), mplsCfg)

}

func createTrafficFlow(t *testing.T,
Expand Down

0 comments on commit 311cb72

Please sign in to comment.