Skip to content

Commit

Permalink
Merge branch 'main' into RT-1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
cprabha authored Jun 11, 2024
2 parents dc2b925 + ca686bc commit 845dcc1
Show file tree
Hide file tree
Showing 55 changed files with 2,153 additions and 1,137 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/wiki.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
path: featureprofiles
- name: Checkout wiki
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
repository: "openconfig/featureprofiles.wiki"
path: featureprofiles.wiki
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,11 @@ Validate BGP in multipath scenario

## OpenConfig Path and RPC Coverage


```yaml
rpcs:
gnmi:
gNMI.Get:
gNMI.Subscribe:

```
## Required DUT platform
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ func configureFlow(t *testing.T, bs *cfgplugins.BGPSession) {
e := flow.Packet().Add().Ethernet()
e.Src().SetValue(bs.ATEPorts[0].MAC)
v4 := flow.Packet().Add().Ipv4()
v4.Src().Increment().SetStart(bs.ATEPorts[0].IPv4).SetCount(prefixesCount)
v4.Dst().Increment().SetStart(prefixesStart).SetCount(prefixesCount)
v4.Src().Increment().SetCount(1000).SetStep("0.0.0.1").SetStart(bs.ATEPorts[0].IPv4)
v4.Dst().Increment().SetCount(4).SetStep("0.0.0.1").SetStart(prefixesStart)
udp := flow.Packet().Add().Udp()
udp.SrcPort().SetValues(randRange(t, 34525, 65535, 500))
udp.DstPort().SetValues(randRange(t, 49152, 65535, 500))
Expand All @@ -117,6 +117,7 @@ func configureFlow(t *testing.T, bs *cfgplugins.BGPSession) {
}

func verifyECMPLoadBalance(t *testing.T, ate *ondatra.ATEDevice, pc int, expectedLinks int) {
dut := ondatra.DUT(t, "dut")
framesTx := gnmi.Get(t, ate.OTG(), gnmi.OTG().Port(ate.Port(t, "port1").ID()).Counters().OutFrames().State())
expectedPerLinkFms := framesTx / uint64(expectedLinks)
t.Logf("Total packets %d flow through the %d links and expected per link packets %d", framesTx, expectedLinks, expectedPerLinkFms)
Expand All @@ -134,12 +135,15 @@ func verifyECMPLoadBalance(t *testing.T, ate *ondatra.ATEDevice, pc int, expecte
t.Logf("Traffic %d is in expected range: %d - %d, Load balance Test Passed", framesRx, min, max)
got++
} else {
t.Errorf("Traffic is expected in range %d - %d but got %d. Load balance Test Failed", min, max, framesRx)
if !deviations.BgpMaxMultipathPathsUnsupported(dut) {
t.Errorf("Traffic is expected in range %d - %d but got %d. Load balance Test Failed", min, max, framesRx)
}
}
}

if got != expectedLinks {
t.Errorf("invalid number of load balancing interfaces, got: %d want %d", got, expectedLinks)
if !deviations.BgpMaxMultipathPathsUnsupported(dut) {
if got != expectedLinks {
t.Errorf("invalid number of load balancing interfaces, got: %d want %d", got, expectedLinks)
}
}
}

Expand Down Expand Up @@ -223,8 +227,12 @@ func TestBGPSetup(t *testing.T) {
prefix := prefixesStart + "/" + strconv.Itoa(prefixP4Len)
ipv4Entry := gnmi.Get[*oc.NetworkInstance_Afts_Ipv4Entry](t, bs.DUT, aftsPath.Ipv4Entry(prefix).State())
hopGroup := gnmi.Get[*oc.NetworkInstance_Afts_NextHopGroup](t, bs.DUT, aftsPath.NextHopGroup(ipv4Entry.GetNextHopGroup()).State())
if got, want := len(hopGroup.NextHop), tc.expectedPaths; got != want {
t.Errorf("prefix: %s, found %d hops, want %d", ipv4Entry.GetPrefix(), got, want)
if deviations.BgpMaxMultipathPathsUnsupported(bs.DUT) {
tc.expectedPaths = 3
} else {
if got, want := len(hopGroup.NextHop), tc.expectedPaths; got != want {
t.Errorf("prefix: %s, found %d hops, want %d", ipv4Entry.GetPrefix(), got, want)
}
}

sleepTime := time.Duration(totalPackets/trafficPps) + 5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ platform_exceptions: {
skip_afi_safi_path_for_bgp_multiple_as: true
}
}
platform_exceptions: {
platform: {
vendor: JUNIPER
}
deviations: {
bgp_max_multipath_paths_unsupported: true
}
}
platform_exceptions: {
platform: {
vendor: NOKIA
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,14 @@ Validate BGP in multipath UCMP support with link bandwidth community
* /network-instances/network-instance/afts/next-hop-groups/next-hop-group[id=<id>]/state
* /network-instances/network-instance/afts/next-hop-groups/next-hop-group/next-hops

## Protocol/RPC Parameter Coverage

* gNMI
* Set
* Subscribe

## OpenConfig Path and RPC Coverage

```yaml
rpcs:
gnmi:
gNMI.Get:
gNMI.Subscribe:
```
## Required DUT platform
* FFF - Fixed Form Factor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ func configureOTG(t *testing.T, bs *cfgplugins.BGPSession) {
routeAddress.SetPrefix(prefixP4Len)
routeAddress.SetCount(prefixesCount)
bgp4PeerRoute.AddPath().SetPathId(pathID)
bgp4PeerRoute.ExtendedCommunities().Add().NonTransitive2OctetAsType().LinkBandwidthSubtype().SetBandwidth(float32(linkBw[i-2] * 1000))
bgpExtCom := bgp4PeerRoute.ExtendedCommunities().Add()
bgpExtCom.NonTransitive2OctetAsType().LinkBandwidthSubtype().SetBandwidth(float32(linkBw[i-2] * 1000))
}

configureFlow(bs)
Expand All @@ -79,7 +80,7 @@ func configureFlow(bs *cfgplugins.BGPSession) {
bs.ATETop.Flows().Clear()

var rxNames []string
for i := 1; i < len(bs.ATEPorts); i++ {
for i := 2; i < len(bs.ATEPorts); i++ {
rxNames = append(rxNames, bs.ATEPorts[i].Name+".BGP4.peer.rr4")
}
flow := bs.ATETop.Flows().Add().SetName("flow")
Expand All @@ -94,8 +95,8 @@ func configureFlow(bs *cfgplugins.BGPSession) {
e := flow.Packet().Add().Ethernet()
e.Src().SetValue(bs.ATEPorts[0].MAC)
v4 := flow.Packet().Add().Ipv4()
v4.Src().SetValue(bs.ATEPorts[0].IPv4)
v4.Dst().SetValue(prefixesStart)
v4.Src().Increment().SetCount(1000).SetStep("0.0.0.1").SetStart(bs.ATEPorts[0].IPv4)
v4.Dst().Increment().SetCount(3).SetStep("0.0.0.1").SetStart(prefixesStart)
}

func checkPacketLoss(t *testing.T, ate *ondatra.ATEDevice) {
Expand All @@ -115,8 +116,8 @@ func checkPacketLoss(t *testing.T, ate *ondatra.ATEDevice) {

func verifyECMPLoadBalance(t *testing.T, ate *ondatra.ATEDevice, pc int, expectedLinks int) {
framesTx := gnmi.Get(t, ate.OTG(), gnmi.OTG().Port(ate.Port(t, "port1").ID()).Counters().OutFrames().State())
expectedPerLinkFmsP3 := (linkBw[0] / (linkBw[0] + linkBw[1])) * int(framesTx)
expectedPerLinkFmsP4 := (linkBw[1] / (linkBw[0] + linkBw[1])) * int(framesTx)
expectedPerLinkFmsP3 := int(float32(linkBw[0]) / (float32(linkBw[0] + linkBw[1])) * float32(framesTx))
expectedPerLinkFmsP4 := int(float32(linkBw[1]) / (float32(linkBw[0] + linkBw[1])) * float32(framesTx))
t.Logf("Total packets %d flow through the %d links and expected per link packets: %d, %d", framesTx, expectedLinks, expectedPerLinkFmsP3, expectedPerLinkFmsP4)

p3Min := expectedPerLinkFmsP3 - (expectedPerLinkFmsP3 * lbToleranceFms / 100)
Expand Down Expand Up @@ -145,6 +146,10 @@ func TestBGPSetup(t *testing.T) {
bs.WithEBGP(t, []oc.E_BgpTypes_AFI_SAFI_TYPE{oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST}, []string{"port3", "port4"}, true, false)
dni := deviations.DefaultNetworkInstance(bs.DUT)
bgp := bs.DUTConf.GetOrCreateNetworkInstance(dni).GetOrCreateProtocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP").GetOrCreateBgp()
if deviations.MultipathUnsupportedNeighborOrAfisafi(bs.DUT) {
bgp.GetOrCreatePeerGroup(cfgplugins.BGPPeerGroup1).GetOrCreateUseMultiplePaths().Enabled = ygot.Bool(true)
bgp.GetOrCreatePeerGroup(cfgplugins.BGPPeerGroup1).GetOrCreateUseMultiplePaths().GetOrCreateEbgp().AllowMultipleAs = ygot.Bool(true)
}
gEBGP := bgp.GetOrCreateGlobal().GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).GetOrCreateUseMultiplePaths().GetOrCreateEbgp()
bgp.GetOrCreatePeerGroup(cfgplugins.BGPPeerGroup1).GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).GetOrCreateUseMultiplePaths().Enabled = ygot.Bool(true)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ platform_exceptions: {
ipv4_missing_enabled: true
}
}
platform_exceptions: {
platform: {
vendor: JUNIPER
}
deviations: {
multipath_unsupported_neighbor_or_afisafi: true
}
}
platform_exceptions: {
platform: {
vendor: NOKIA
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,36 +306,39 @@ For each section of configuration below, prepare a gnmi.SetBatch with all the c
* Validate that the ATE receives the prefix ```ipv4-network-2``` from DUT neighbor on ATE Port-1 and it has 11 ASN on as-path. First equal to ATE port-2 ASN and other 10 equal to ```23456``` ASN.
* Validate that the ATE receives the prefix ```ipv6-network-2``` from DUT neighbor on ATE Port-1 and it has 11 ASN on as-path. First equal to ATE port-2 ASN and other 10 equal to ```23456``` ASN.

## Config parameter coverage
## OpenConfig Path and RPC Coverage

* /network-instances/network-instance/protocols/protocol/bgp/global/afi-safis/afi-safi/config/
* /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/apply-policy/config/default-export-policy
* /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/apply-policy/config/default-import-policy
* /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/apply-policy/config/export-policy
* /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/apply-policy/config/import-policy
* /routing-policy/policy-definitions/policy-definition/config/name
* /routing-policy/policy-definitions/policy-definition/statements/statement/actions/bgp-actions/config/local-preference
* /routing-policy/policy-definitions/policy-definition/statements/statement/actions/bgp-actions/config/local-prefrence
* /routing-policy/policy-definitions/policy-definition/statements/statement/actions/bgp-actions/config/med
* /routing-policy/policy-definitions/policy-definition/statements/statement/actions/bgp-actions/prepend/config/asn
* /routing-policy/policy-definitions/policy-definition/statements/statement/actions/bgp-actions/prepend/config/repead-n
* /routing-policy/policy-definitions/policy-definition/statements/statement/actions/config/policy-result
* /routing-policy/policy-definitions/policy-definition/statements/statement/config/name
The below yaml defines the OC paths intended to be covered by this test.

## Telemetry parameter coverage
```yaml
paths:
## Config parameter coverage
/network-instances/network-instance/protocols/protocol/bgp/global/afi-safis/afi-safi/config/enabled:
/network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/apply-policy/config/default-export-policy:
/network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/apply-policy/config/default-import-policy:
/network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/apply-policy/config/export-policy:
/network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/apply-policy/config/import-policy:
/routing-policy/policy-definitions/policy-definition/config/name:
/routing-policy/policy-definitions/policy-definition/statements/statement/actions/bgp-actions/config/set-local-pref:
/routing-policy/policy-definitions/policy-definition/statements/statement/actions/bgp-actions/config/set-med:
/routing-policy/policy-definitions/policy-definition/statements/statement/actions/bgp-actions/set-as-path-prepend/config/asn:
/routing-policy/policy-definitions/policy-definition/statements/statement/actions/bgp-actions/set-as-path-prepend/config/repeat-n:
/routing-policy/policy-definitions/policy-definition/statements/statement/actions/config/policy-result:
/routing-policy/policy-definitions/policy-definition/statements/statement/config/name:

* /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/apply-policy/state/import-policy
* /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/apply-policy/state/export-policy
* /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/apply-policy/state/default-import-policy
* /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/apply-policy/state/default-export-policy
## Telemetry parameter coverage
/network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/apply-policy/state/import-policy:
/network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/apply-policy/state/export-policy:
/network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/apply-policy/state/default-import-policy:
/network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/apply-policy/state/default-export-policy:

## Protocol/RPC Parameter Coverage

* gNMI
* Subscribe (ONCE)
* Set (REPLACE)
## Protocol/RPC Parameter Coverage
rpcs:
gnmi:
gNMI.Subscribe:
gNMI.Set:
```
## Required DUT platform
* FFF

Loading

0 comments on commit 845dcc1

Please sign in to comment.