Skip to content

Commit

Permalink
Merge branch 'main' into DP1dot11
Browse files Browse the repository at this point in the history
  • Loading branch information
trathod1 authored Sep 15, 2023
2 parents f573880 + a937f79 commit 9d52a66
Show file tree
Hide file tree
Showing 52 changed files with 2,415 additions and 254 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ func buildNbrList(asN uint32) []*bgpNeighbor {
func bgpWithNbr(as uint32, nbrs []*bgpNeighbor, dut *ondatra.DUTDevice) *oc.NetworkInstance_Protocol {
d := &oc.Root{}
ni1 := d.GetOrCreateNetworkInstance(deviations.DefaultNetworkInstance(dut))
ni_proto := ni1.GetOrCreateProtocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP")
bgp := ni_proto.GetOrCreateBgp()
niProto := ni1.GetOrCreateProtocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP")
bgp := niProto.GetOrCreateBgp()

g := bgp.GetOrCreateGlobal()
g.As = ygot.Uint32(as)
Expand Down Expand Up @@ -246,7 +246,7 @@ func bgpWithNbr(as uint32, nbrs []*bgpNeighbor, dut *ondatra.DUTDevice) *oc.Netw
af4.Enabled = ygot.Bool(false)
}
}
return ni_proto
return niProto
}

func checkBgpStatus(t *testing.T, dut *ondatra.DUTDevice) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ func bgpCreateNbr(localAs, peerAs uint32, policy string, dut *ondatra.DUTDevice)

d := &oc.Root{}
ni1 := d.GetOrCreateNetworkInstance(deviations.DefaultNetworkInstance(dut))
ni_proto := ni1.GetOrCreateProtocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP")
bgp := ni_proto.GetOrCreateBgp()
niProto := ni1.GetOrCreateProtocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP")
bgp := niProto.GetOrCreateBgp()
global := bgp.GetOrCreateGlobal()
global.RouterId = ygot.String(dutDst.IPv4)
global.As = ygot.Uint32(localAs)
Expand Down Expand Up @@ -219,7 +219,7 @@ func bgpCreateNbr(localAs, peerAs uint32, policy string, dut *ondatra.DUTDevice)
}

}
return ni_proto
return niProto
}

// configureBGPPolicy configures a BGP routing policy to accept or reject routes based on prefix match conditions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ func bgpCreateNbr(localAs, peerAs uint32, policy string, dut *ondatra.DUTDevice)

d := &oc.Root{}
ni1 := d.GetOrCreateNetworkInstance(deviations.DefaultNetworkInstance(dut))
ni_proto := ni1.GetOrCreateProtocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP")
bgp := ni_proto.GetOrCreateBgp()
niProto := ni1.GetOrCreateProtocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP")
bgp := niProto.GetOrCreateBgp()
global := bgp.GetOrCreateGlobal()
global.RouterId = ygot.String(dutDst.IPv4)
global.As = ygot.Uint32(localAs)
Expand Down Expand Up @@ -226,7 +226,7 @@ func bgpCreateNbr(localAs, peerAs uint32, policy string, dut *ondatra.DUTDevice)
}

}
return ni_proto
return niProto
}

// configureBGPPolicy configures a BGP routing policy to accept or reject routes based on prefix match conditions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,8 @@ func createBGPNeighbor(localAs, peerAs, pLimit uint32, restartTime uint16, dut *

d := &oc.Root{}
ni1 := d.GetOrCreateNetworkInstance(deviations.DefaultNetworkInstance(dut))
ni_proto := ni1.GetOrCreateProtocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP")
bgp := ni_proto.GetOrCreateBgp()
niProto := ni1.GetOrCreateProtocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP")
bgp := niProto.GetOrCreateBgp()

global := bgp.GetOrCreateGlobal()
global.As = ygot.Uint32(localAs)
Expand Down Expand Up @@ -302,7 +302,7 @@ func createBGPNeighbor(localAs, peerAs, pLimit uint32, restartTime uint16, dut *
}
}
}
return ni_proto
return niProto
}

func configureRoutePolicy(t *testing.T, dut *ondatra.DUTDevice, name string, pr oc.E_RoutingPolicy_PolicyResultType) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,8 @@ func createBGPNeighbor(localAs, peerAs, pLimit uint32, restartTime uint16, dut *

d := &oc.Root{}
ni1 := d.GetOrCreateNetworkInstance(deviations.DefaultNetworkInstance(dut))
ni_proto := ni1.GetOrCreateProtocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP")
bgp := ni_proto.GetOrCreateBgp()
niProto := ni1.GetOrCreateProtocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP")
bgp := niProto.GetOrCreateBgp()

global := bgp.GetOrCreateGlobal()
global.As = ygot.Uint32(localAs)
Expand Down Expand Up @@ -334,7 +334,7 @@ func createBGPNeighbor(localAs, peerAs, pLimit uint32, restartTime uint16, dut *
}
}
}
return ni_proto
return niProto
}

func configureRoutePolicy(t *testing.T, dut *ondatra.DUTDevice, name string, pr oc.E_RoutingPolicy_PolicyResultType) {
Expand Down
47 changes: 47 additions & 0 deletions feature/bgp/routereflector/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# RT-1.8: BGP Route Reflector Test at scale
## Summary
* BGP route reflector capabilities check
* Ensure functionality of different OC paths for "supported-capabilities", "BGP peer-type", "BGP Neighbor details" and "BGP transport session parameters"

## Topology
ATE (Port1) <-EBGP-> (Port1) DUT (Port2) <-IS-IS/IBGP-> (Port2) ATE, DUT (Port3) <-IS-IS/IBGP-> (Port3) ATE
Connect ATE Port1 to DUT port1 (EBGP peering)
* Connect ATE Port2 to DUT port2 (For IS-IS adjacency and IBGP peer reachaility)
* Connect ATE Port3 to DUT port3 (For IS-IS adjacency and IBGP peer reachaility)

## Test Procedure
* Establish IS-IS adjacency between ATE Port2 <-> DUT Port2, ATE Port3 <-> DUT Port3.
* Establish BGP sessions as follows between ATE and DUT.
* ATE port2 and ATE port3 are emulating RR clients peered with the DUT acting as the RR server. DUT's loopback address should be used for the IBGP peering and "transport/config/local-address" OC path should be used on DUT to configure BGP transport address for IBGP peering. ATE addresses used for the IBGP peering (different from ATE Port1 and ATE Port2 addreses) and DUT loopback addresses should be reachable via IS-IS. Each of the ATEs should advertise 5M IPv4 and 2M IPv6 prefixes to the RR over the IBGP peering, with different path attributes like protocol next-hops, local-preference, communitiy and MED. Among these, 2M v4 and 1M v6 prefixes are unique. Among the 2M IPv4 prefixes as well, 1.5M are non RFC1918 or RFC6598 addresses and represent Internet prefixes. Similarly, 600k IPv6 prefixes will represent internet prefixes. These prefixes should be common between the 2xDUTs with different path-attributes for protocol next-hop, AS-Path and community. Balance 500k IPv4 and 400k IPv6 prefixes represent internal subnets and should include some prefixes that are unique to each of the ATEs. Remaining prefixes in the mix need to be common between the 2xATEs and should have identical path attributes except for the protocol next-hops.
* The DUT Port1 has eBGP peering with ATE Port 1 and is receiving 10M IPv4 and 3M IPv6 Internet routes with different path attributes like protocol next-hops, AS-Path, Origin, MED and communities. Out of these, only 1.5M IPv4 and 600k IPv6 prefixes are unique and will be programmed to the FIB.
* The 1.5M IPv4 and 600k IPv6 unique prefixes representing internet addresses should be the same as the ones learnt by the DUT over the IBGP peering but with different path attributes like protocol Next-hops, communities etc.
* The DUT should automatically determine the BGP transport source address based on the nearest interface. Hence, the OC path "transport/config/local-address" shouldnt be used.
* The DUT should advertise these EBGP learnt prefixes over the 2xIBGP peering. [*] Expectations are that the DUT will prefer EBGP learnt internet routes over the IBGP learnt routes. For the IBGP learnt internal prefixes, the DUT should advertise the same over the EBGP peering. [**] Expectations are that the DUT would advertise all internal IPv4 and IPv6 prefixes to the EBGP peers.
* Validate session state on ATE ports and DUT using telemetry.
* The check should also include accurately receiving values for the path "transport/state/local-address" for RRCs as well as for the EBGP peering.
* Validate accuracy of the peer-type leaf (neighbor/config/peer-type) for EBGP and IBGP peering.
* Validate session state and capabilities received on DUT using telemetry.
* For capabilities, just make sure that the length of the list "neighbor/state/supported-capabilities" is non-zero
* Validate route receipt.
* Ensure that the DUT advertises all the IBGP learnt routes to the EBGP peer. Pass expectation covered in context in [**] above
* Ensure that the DUT advertises all the EBGP learnt routes to the IBGP peers. Pass expectation covered in context in [*] above
* Ensure that the DUT as RR server advertises routes learnt from each of the RRC to the other.
* Validate BGP route/path attributes below for each of the EBGP and IBGP learnt routes
* Next-Hop
* Local Pref
* Communities
* AS-Path

## Config Parameter Coverage
* /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/route-reflector
* /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/route-reflector/config
* /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/route-reflector/config/route-reflector-cluster-id
* /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/route-reflector/config/route-reflector-client
* /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/config/peer-type
* /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/transport/config/local-address

## Telemetry Parameter Coverage
* /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/route-reflector/state/route-reflector-cluster-id
* /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/route-reflector/state/route-reflector-client
* /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/state/peer-type
* /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/state/supported-capabilities
6 changes: 3 additions & 3 deletions feature/bgp/tests/local_bgp_test/local_bgp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ func bgpWithNbr(as uint32, routerID string, nbr *oc.NetworkInstance_Protocol_Bgp

d := &oc.Root{}
ni1 := d.GetOrCreateNetworkInstance(deviations.DefaultNetworkInstance(dut))
ni_proto := ni1.GetOrCreateProtocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP")
bgp := ni_proto.GetOrCreateBgp()
niProto := ni1.GetOrCreateProtocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP")
bgp := niProto.GetOrCreateBgp()
bgp.GetOrCreateGlobal().As = ygot.Uint32(as)
bgp.GetOrCreateGlobal().GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).Enabled = ygot.Bool(true)

Expand All @@ -88,7 +88,7 @@ func bgpWithNbr(as uint32, routerID string, nbr *oc.NetworkInstance_Protocol_Bgp
}

bgp.AppendNeighbor(nbr)
return ni_proto
return niProto
}

func configureNIType(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ func TestDirectBackupNexthopGroup(t *testing.T) {

tcArgs.configureBackupNextHopGroup(t, false)

baselineFlow := tcArgs.createFlow("Baseline Path Flow", ateTop, &atePort2)
backupFlow := tcArgs.createFlow("Backup Path Flow", ateTop, &atePort3)
baselineFlow := tcArgs.createFlow("Baseline_Path_Flow", ateTop, &atePort2)
backupFlow := tcArgs.createFlow("Backup_Path_Flow", ateTop, &atePort3)
backupIPIPFlow := tcArgs.createIPIPFlow("Backup IP Over IP Path Flow", ateTop, &atePort3)
tcArgs.ate.OTG().PushConfig(t, ateTop)
tcArgs.ate.OTG().StartProtocols(t)
Expand All @@ -194,22 +194,34 @@ func TestDirectBackupNexthopGroup(t *testing.T) {
applyImpairmentFn func()
removeImpairmentFn func()
}{
// Disabling otg / kne ports has no effect
// {
// desc: "Disable ATE port-2",
// applyImpairmentFn: func() {
// ateP2 := ate.Port(t, "port2")
// dutP2 := dut.Port(t, "port2")
// ate.Actions().NewSetPortState().WithPort(ateP2).WithEnabled(false).Send(t)
// dut.Telemetry().Interface(dutP2.Name()).OperStatus().Await(t, time.Minute, telemetry.Interface_OperStatus_DOWN)
// },
// removeImpairmentFn: func() {
// ateP2 := ate.Port(t, "port2")
// dutP2 := dut.Port(t, "port2")
// ate.Actions().NewSetPortState().WithPort(ateP2).WithEnabled(true).Send(t)
// dut.Telemetry().Interface(dutP2.Name()).OperStatus().Await(t, time.Minute, telemetry.Interface_OperStatus_UP)
// },
// },
{
desc: "Disable ATE port-2",
applyImpairmentFn: func() {
ateP2 := ate.Port(t, "port2")
dutP2 := dut.Port(t, "port2")
if deviations.ATEPortLinkStateOperationsUnsupported(tcArgs.ate) {
gnmi.Replace(t, dut, gnmi.OC().Interface(dutP2.Name()).Enabled().Config(), false)
gnmi.Await(t, dut, gnmi.OC().Interface(dutP2.Name()).OperStatus().State(), time.Minute, oc.Interface_OperStatus_DOWN)
} else {
portStateAction := gosnappi.NewControlState()
portStateAction.Port().Link().SetPortNames([]string{ateP2.ID()}).SetState(gosnappi.StatePortLinkState.DOWN)
tcArgs.ate.OTG().SetControlState(t, portStateAction)
}
},
removeImpairmentFn: func() {
ateP2 := ate.Port(t, "port2")
dutP2 := dut.Port(t, "port2")
if deviations.ATEPortLinkStateOperationsUnsupported(tcArgs.ate) {
gnmi.Replace(t, dut, gnmi.OC().Interface(dutP2.Name()).Enabled().Config(), true)
gnmi.Await(t, dut, gnmi.OC().Interface(dutP2.Name()).OperStatus().State(), time.Minute, oc.Interface_OperStatus_UP)
} else {
portStateAction := gosnappi.NewControlState()
portStateAction.Port().Link().SetPortNames([]string{ateP2.ID()}).SetState(gosnappi.StatePortLinkState.UP)
tcArgs.ate.OTG().SetControlState(t, portStateAction)
otgutils.WaitForARP(t, ate.OTG(), tcArgs.ateTop, "IPv4")
}
},
},
{
desc: "Disable DUT port-2",
applyImpairmentFn: func() {
Expand Down Expand Up @@ -357,8 +369,7 @@ func configureNetworkInstance(t *testing.T, dut *ondatra.DUTDevice) {
// createFlow returns a flow from atePort1 to the dstPfx, expected to arrive on ATE interface dst.
func (a *testArgs) createFlow(name string, ateTop gosnappi.Config, dst *attrs.Attributes) string {

modName := strings.Replace(name, " ", "_", -1)
flowipv4 := ateTop.Flows().Add().SetName(modName)
flowipv4 := ateTop.Flows().Add().SetName(name)
flowipv4.Metrics().SetEnable(true)
e1 := flowipv4.Packet().Add().Ethernet()
e1.Src().SetValue(atePort1.MAC)
Expand All @@ -367,7 +378,7 @@ func (a *testArgs) createFlow(name string, ateTop gosnappi.Config, dst *attrs.At
v4.Src().SetValue(atePort1.IPv4)
v4.Dst().SetValue(dstPfx)

return modName
return flowipv4.Name()
}

// createIPIPFlow returns a flow from atePort1 to the dstPfx, expected to arrive on ATE interface dst.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ func configureATE(t *testing.T, ateParams *bgpNbr, connectionType string) *ondat
func createBgpNeighbor(nbr *bgpNbr, dut *ondatra.DUTDevice) *oc.NetworkInstance_Protocol {
d := &oc.Root{}
ni1 := d.GetOrCreateNetworkInstance(deviations.DefaultNetworkInstance(dut))
ni_proto := ni1.GetOrCreateProtocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP")
bgp := ni_proto.GetOrCreateBgp()
niProto := ni1.GetOrCreateProtocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP")
bgp := niProto.GetOrCreateBgp()

global := bgp.GetOrCreateGlobal()
global.As = ygot.Uint32(nbr.localAS)
Expand All @@ -244,5 +244,5 @@ func createBgpNeighbor(nbr *bgpNbr, dut *ondatra.DUTDevice) *oc.NetworkInstance_
afisafi6.Enabled = ygot.Bool(true)
neighbor.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).Enabled = ygot.Bool(false)
}
return ni_proto
return niProto
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# RT-1.20: BGP 2-Byte and 4-Byte ASN support with policy
# RT-1.24: BGP 2-Byte and 4-Byte ASN support with policy

## Summary

Expand Down Expand Up @@ -31,4 +31,4 @@ BGP 2-Byte and 4-Byte ASN support with policy

* /global/config/as
* /neighbors/neighbor/config/peer-as
* /neighbors/neighbor/config/local-as
* /neighbors/neighbor/config/local-as
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# proto-message: Metadata

uuid: "a993eb24-40f8-4b86-bc6b-02c19f6a0d53"
plan_id: "RT-1.20"
plan_id: "RT-1.24"
description: "BGP 2-Byte and 4-Byte ASN support with policy"
testbed: TESTBED_DUT_ATE_2LINKS
platform_exceptions: {
Expand All @@ -29,8 +29,7 @@ platform_exceptions: {
platform: {
vendor: JUNIPER
}
deviations: {
}
deviations: {}
}
platform_exceptions: {
platform: {
Expand All @@ -43,4 +42,3 @@ platform_exceptions: {
default_network_instance: "default"
}
}
tags: TAGS_EDGE
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ func bgpCreateNbr(localAs, peerAs uint32, dut *ondatra.DUTDevice) *oc.NetworkIns

dutOcRoot := &oc.Root{}
ni1 := dutOcRoot.GetOrCreateNetworkInstance(deviations.DefaultNetworkInstance(dut))
ni_proto := ni1.GetOrCreateProtocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP")
bgp := ni_proto.GetOrCreateBgp()
niProto := ni1.GetOrCreateProtocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP")
bgp := niProto.GetOrCreateBgp()
global := bgp.GetOrCreateGlobal()
global.RouterId = ygot.String(dutDst2.IPv4)
global.As = ygot.Uint32(localAs)
Expand Down Expand Up @@ -196,7 +196,7 @@ func bgpCreateNbr(localAs, peerAs uint32, dut *ondatra.DUTDevice) *oc.NetworkIns
af6.Enabled = ygot.Bool(false)
}
}
return ni_proto
return niProto
}

// verifyBgpTelemetry checks that the dut has an established BGP session with reasonable settings.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,8 @@ func buildNbrList(asN uint32) []*bgpNeighbor {
func bgpWithNbr(as uint32, nbrs []*bgpNeighbor, dut *ondatra.DUTDevice) *oc.NetworkInstance_Protocol {
d := &oc.Root{}
ni1 := d.GetOrCreateNetworkInstance(deviations.DefaultNetworkInstance(dut))
ni_proto := ni1.GetOrCreateProtocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP")
bgp := ni_proto.GetOrCreateBgp()
niProto := ni1.GetOrCreateProtocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP")
bgp := niProto.GetOrCreateBgp()

g := bgp.GetOrCreateGlobal()
g.As = ygot.Uint32(as)
Expand Down Expand Up @@ -382,7 +382,7 @@ func bgpWithNbr(as uint32, nbrs []*bgpNeighbor, dut *ondatra.DUTDevice) *oc.Netw
af4.Enabled = ygot.Bool(false)
}
}
return ni_proto
return niProto
}

func checkBgpStatus(t *testing.T, dut *ondatra.DUTDevice, nbrIP []*bgpNeighbor) {
Expand Down Expand Up @@ -950,8 +950,8 @@ func configureDUTNewPeers(t *testing.T, dut *ondatra.DUTDevice, nbrs []*bgpNeigh
d := &oc.Root{}
dutConfPath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP")
ni1 := d.GetOrCreateNetworkInstance(deviations.DefaultNetworkInstance(dut))
ni_proto := ni1.GetOrCreateProtocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP")
bgp := ni_proto.GetOrCreateBgp()
niProto := ni1.GetOrCreateProtocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP")
bgp := niProto.GetOrCreateBgp()

// Note: we have to define the peer group even if we aren't setting any policy because it's
// invalid OC for the neighbor to be part of a peer group that doesn't exist.
Expand All @@ -968,7 +968,7 @@ func configureDUTNewPeers(t *testing.T, dut *ondatra.DUTDevice, nbrs []*bgpNeigh
af6 := nv4.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST)
af6.Enabled = ygot.Bool(false)
}
gnmi.Update(t, dut, dutConfPath.Config(), ni_proto)
gnmi.Update(t, dut, dutConfPath.Config(), niProto)
fptest.LogQuery(t, "DUT BGP Config", dutConfPath.Config(), gnmi.GetConfig(t, dut, dutConfPath.Config()))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ func bgpCreateNbr(localAs, peerAs uint32, dut *ondatra.DUTDevice) *oc.NetworkIns

d := &oc.Root{}
ni1 := d.GetOrCreateNetworkInstance(deviations.DefaultNetworkInstance(dut))
ni_proto := ni1.GetOrCreateProtocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP")
bgp := ni_proto.GetOrCreateBgp()
niProto := ni1.GetOrCreateProtocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP")
bgp := niProto.GetOrCreateBgp()
global := bgp.GetOrCreateGlobal()
global.RouterId = ygot.String(dutDst.IPv4)
global.As = ygot.Uint32(localAs)
Expand Down Expand Up @@ -172,7 +172,7 @@ func bgpCreateNbr(localAs, peerAs uint32, dut *ondatra.DUTDevice) *oc.NetworkIns
af6 := nv4.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST)
af6.Enabled = ygot.Bool(false)
}
return ni_proto
return niProto
}

// verifyBGPTelemetry checks that the dut has an established BGP session with reasonable settings.
Expand Down
Loading

0 comments on commit 9d52a66

Please sign in to comment.