Skip to content

Commit 3a3b703

Browse files
authored
Rt 1.8 - Update code fixes (#5237)
* Update route_reflector_scale_test.go * Update metadata.textproto * Update metadata.proto * Update deviations.go * Update route_reflector_scale_test.go * Update metadata.textproto * make metadata.pb.go * gofmt * Resolve conflict * Resolve conflict
1 parent 9e33957 commit 3a3b703

File tree

5 files changed

+66
-21
lines changed

5 files changed

+66
-21
lines changed

feature/bgp/routereflector/otg_tests/route_reflector_scale/metadata.textproto

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ platform_exceptions: {
1818
isis_instance_enabled_required: true
1919
bgp_default_policy_unsupported: true
2020
isis_require_same_l1_metric_with_l2_metric: true
21+
default_bgp_instance_name: "BGP"
2122
}
2223
}
2324
platform_exceptions: {
@@ -27,5 +28,23 @@ platform_exceptions: {
2728
deviations: {
2829
isis_level_enabled: true
2930
interface_ref_interface_id_format: true
31+
default_bgp_instance_name: "BGP"
32+
}
33+
}
34+
platform_exceptions: {
35+
platform: {
36+
vendor: CISCO
37+
}
38+
deviations: {
39+
prefix_limit_config_unsupported: true
40+
default_bgp_instance_name: "default"
41+
}
42+
}
43+
platform_exceptions: {
44+
platform: {
45+
vendor: NOKIA
46+
}
47+
deviations: {
48+
default_bgp_instance_name: "BGP"
3049
}
3150
}

feature/bgp/routereflector/otg_tests/route_reflector_scale/route_reflector_scale_test.go

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func TestRouteReflector(t *testing.T) {
7575
true,
7676
)
7777
dni := deviations.DefaultNetworkInstance(bs.DUT)
78-
bgp := bs.DUTConf.GetOrCreateNetworkInstance(dni).GetOrCreateProtocol(cfgplugins.PTBGP, "BGP").GetOrCreateBgp().GetOrCreateGlobal()
78+
bgp := bs.DUTConf.GetOrCreateNetworkInstance(dni).GetOrCreateProtocol(cfgplugins.PTBGP, deviations.DefaultBgpInstanceName(bs.DUT)).GetOrCreateBgp().GetOrCreateGlobal()
7979
bgp.SetRouterId(dutLoopback.IPv4)
8080

8181
configureDUT(t, bs)
@@ -152,23 +152,28 @@ func configureDUT(t *testing.T, bs *cfgplugins.BGPSession) *cfgplugins.BGPSessio
152152
t.Helper()
153153

154154
dni := deviations.DefaultNetworkInstance(bs.DUT)
155-
bgp := bs.DUTConf.GetOrCreateNetworkInstance(dni).GetOrCreateProtocol(cfgplugins.PTBGP, "BGP").GetOrCreateBgp()
155+
bgp := bs.DUTConf.GetOrCreateNetworkInstance(dni).GetOrCreateProtocol(cfgplugins.PTBGP, deviations.DefaultBgpInstanceName(bs.DUT)).GetOrCreateBgp()
156156

157157
// Increase the received and accepted prefix limits.
158-
afiSafiV4 := bgp.GetOrCreatePeerGroup(cfgplugins.BGPPeerGroup1).GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST)
159-
afiSafiV4.GetOrCreateIpv4Unicast().GetOrCreatePrefixLimitReceived().MaxPrefixes = ygot.Uint32(10000000)
160-
afiSafiV4.GetOrCreateIpv4Unicast().GetOrCreatePrefixLimit().MaxPrefixes = ygot.Uint32(2000000)
161-
afiSafiV6 := bgp.GetOrCreatePeerGroup(cfgplugins.BGPPeerGroup1).GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST)
162-
afiSafiV6.GetOrCreateIpv6Unicast().GetOrCreatePrefixLimitReceived().MaxPrefixes = ygot.Uint32(10000000)
163-
afiSafiV6.GetOrCreateIpv6Unicast().GetOrCreatePrefixLimit().MaxPrefixes = ygot.Uint32(2000000)
164-
158+
if !deviations.PrefixLimitConfigUnsupported(bs.DUT) {
159+
afiSafiV4 := bgp.GetOrCreatePeerGroup(cfgplugins.BGPPeerGroup1).GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST)
160+
afiSafiV4.GetOrCreateIpv4Unicast().GetOrCreatePrefixLimitReceived().MaxPrefixes = ygot.Uint32(10000000)
161+
afiSafiV4.GetOrCreateIpv4Unicast().GetOrCreatePrefixLimit().MaxPrefixes = ygot.Uint32(2000000)
162+
afiSafiV6 := bgp.GetOrCreatePeerGroup(cfgplugins.BGPPeerGroup1).GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST)
163+
afiSafiV6.GetOrCreateIpv6Unicast().GetOrCreatePrefixLimitReceived().MaxPrefixes = ygot.Uint32(10000000)
164+
afiSafiV6.GetOrCreateIpv6Unicast().GetOrCreatePrefixLimit().MaxPrefixes = ygot.Uint32(2000000)
165+
}
166+
localAddressLeaf := dutLoopback.IPv4
167+
if bs.DUT.Vendor() == ondatra.CISCO {
168+
localAddressLeaf = lb
169+
}
165170
// dutPort2 -> atePort2 peer (ibgp session)
166171
ateIBGPN2IPv4 := bgp.GetOrCreateNeighbor(otgIsisPort2LoopV4)
167172
ateIBGPN2IPv4.PeerGroup = ygot.String(cfgplugins.BGPPeerGroup1)
168173
ateIBGPN2IPv4.PeerAs = ygot.Uint32(cfgplugins.DutAS)
169174
ateIBGPN2IPv4.Enabled = ygot.Bool(true)
170175
bgpNbrT := ateIBGPN2IPv4.GetOrCreateTransport()
171-
bgpNbrT.LocalAddress = ygot.String(dutLoopback.IPv4)
176+
bgpNbrT.LocalAddress = ygot.String(localAddressLeaf)
172177
routeReflector := ateIBGPN2IPv4.GetOrCreateRouteReflector()
173178
routeReflector.RouteReflectorClient = ygot.Bool(true)
174179
// routeReflector.RouteReflectorClusterId = oc.UnionString(dutLoopback.IPv4)
@@ -201,7 +206,7 @@ func configureDUT(t *testing.T, bs *cfgplugins.BGPSession) *cfgplugins.BGPSessio
201206
ateIBGPN3IPv4.PeerAs = ygot.Uint32(cfgplugins.DutAS)
202207
ateIBGPN3IPv4.Enabled = ygot.Bool(true)
203208
bgpNbrT = ateIBGPN3IPv4.GetOrCreateTransport()
204-
bgpNbrT.LocalAddress = ygot.String(dutLoopback.IPv4)
209+
bgpNbrT.LocalAddress = ygot.String(localAddressLeaf)
205210
routeReflector = ateIBGPN3IPv4.GetOrCreateRouteReflector()
206211
routeReflector.RouteReflectorClient = ygot.Bool(true)
207212
// routeReflector.RouteReflectorClusterId = oc.UnionString(dutLoopback.IPv4)
@@ -388,7 +393,7 @@ func verifyBgpTelemetry(t *testing.T, bs *cfgplugins.BGPSession) {
388393

389394
var nbrIP = []string{bs.ATEPorts[0].IPv4, bs.ATEPorts[0].IPv6, otgIsisPort2LoopV4, otgIsisPort2LoopV6, otgIsisPort3LoopV4, otgIsisPort3LoopV6}
390395
t.Logf("Verifying BGP state.")
391-
bgpPath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(bs.DUT)).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP").Bgp()
396+
bgpPath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(bs.DUT)).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, deviations.DefaultBgpInstanceName(bs.DUT)).Bgp()
392397

393398
for _, nbr := range nbrIP {
394399
nbrPath := bgpPath.Neighbor(nbr)
@@ -415,7 +420,7 @@ func verifyBGPCapabilities(t *testing.T, bs *cfgplugins.BGPSession) {
415420

416421
t.Log("Verifying BGP capabilities.")
417422
var nbrIP = []string{bs.ATEPorts[0].IPv4, bs.ATEPorts[0].IPv6, otgIsisPort2LoopV4, otgIsisPort2LoopV6, otgIsisPort3LoopV4, otgIsisPort3LoopV6}
418-
statePath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(bs.DUT)).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP").Bgp()
423+
statePath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(bs.DUT)).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, deviations.DefaultBgpInstanceName(bs.DUT)).Bgp()
419424
for _, nbr := range nbrIP {
420425
nbrPath := statePath.Neighbor(nbr)
421426
capabilities := map[oc.E_BgpTypes_BGP_CAPABILITY]bool{
@@ -517,7 +522,7 @@ func createInternetPrefixesV6(t *testing.T) []netip.Prefix {
517522

518523
func verifyPrefixesTelemetry(t *testing.T, dut *ondatra.DUTDevice, nbr string, wantSent uint32, isV4 bool) {
519524
t.Helper()
520-
statePath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP").Bgp()
525+
statePath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, deviations.DefaultBgpInstanceName(dut)).Bgp()
521526
t.Logf("Prefix telemetry on DUT for peer %v", nbr)
522527

523528
var prefixPath *netinstbgp.NetworkInstance_Protocol_Bgp_Neighbor_AfiSafi_PrefixesPath

internal/deviations/deviations.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2005,3 +2005,9 @@ func SystemMountPointStateFt(dut *ondatra.DUTDevice) string {
20052005
func ArpFT(dut *ondatra.DUTDevice) string {
20062006
return lookupDUTDeviations(dut).GetArpFt()
20072007
}
2008+
2009+
// PrefixLimitConfigUnsupported returns true if max prefix limit configuration is unsupported by the device
2010+
// Cisco: https://partnerissuetracker.corp.google.com/issues/447509237
2011+
func PrefixLimitConfigUnsupported(dut *ondatra.DUTDevice) bool {
2012+
return lookupDUTDeviations(dut).GetPrefixLimitConfigUnsupported()
2013+
}

proto/metadata.proto

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,6 +1204,10 @@ message Metadata {
12041204
// Functional Translator name for devices with neighbor link-layer-address paths unsupported.
12051205
string arp_ft = 392;
12061206

1207+
// Device does not support configuring prefix limit received paths through OC
1208+
// Cisco: https://partnerissuetracker.corp.google.com/issues/447509237
1209+
bool prefix_limit_config_unsupported = 393;
1210+
12071211
// Reserved field numbers and identifiers.
12081212
reserved 84, 9, 28, 20, 38, 43, 90, 97, 55, 89, 19, 36, 35, 40, 113, 131, 141, 173, 234, 254, 231, 300, 241;
12091213
}

proto/metadata_go_proto/metadata.pb.go

Lines changed: 18 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)