Skip to content

Commit 4d02a9e

Browse files
authored
Merge branch 'main' into sudhir-gnmi-1.24
2 parents 746eac6 + 3a3b703 commit 4d02a9e

File tree

8 files changed

+154
-20
lines changed

8 files changed

+154
-20
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

feature/interface/staticarp/otg_tests/static_arp_test/metadata.textproto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ platform_exceptions: {
1111
}
1212
deviations: {
1313
ipv4_missing_enabled: true
14+
arp_ft: "ciscoxr-arp-ft"
1415
}
1516
}
1617
platform_exceptions: {

feature/interface/staticarp/otg_tests/static_arp_test/static_arp_test.go

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import (
2929
"github.com/openconfig/ondatra"
3030
"github.com/openconfig/ondatra/gnmi"
3131
"github.com/openconfig/ondatra/gnmi/oc"
32+
"github.com/openconfig/ygnmi/ygnmi"
3233
)
3334

3435
func TestMain(m *testing.M) {
@@ -292,6 +293,38 @@ func testFlow(
292293
}
293294
}
294295

296+
func verifyNeighborMAC(t *testing.T, dut *ondatra.DUTDevice, expectedMAC string) {
297+
t.Helper()
298+
port1 := dut.Port(t, "port1")
299+
opts := fptest.GetOptsForFunctionalTranslator(t, deviations.ArpFT(dut))
300+
301+
cases := []struct {
302+
desc string
303+
ip string
304+
telemetry ygnmi.SingletonQuery[string]
305+
}{
306+
{
307+
desc: "IPv4",
308+
ip: ateSrc.IPv4,
309+
telemetry: gnmi.OC().Interface(port1.Name()).Subinterface(0).Ipv4().Neighbor(ateSrc.IPv4).LinkLayerAddress().State(),
310+
},
311+
{
312+
desc: "IPv6",
313+
ip: ateSrc.IPv6,
314+
telemetry: gnmi.OC().Interface(port1.Name()).Subinterface(0).Ipv6().Neighbor(ateSrc.IPv6).LinkLayerAddress().State(),
315+
},
316+
}
317+
318+
for _, tc := range cases {
319+
t.Run(tc.desc, func(t *testing.T) {
320+
actualMAC := gnmi.Get(t, dut.GNMIOpts().WithYGNMIOpts(opts...), tc.telemetry)
321+
if !strings.EqualFold(actualMAC, expectedMAC) {
322+
t.Errorf("Actual MAC for %s got %q, want %q", tc.ip, actualMAC, expectedMAC)
323+
}
324+
})
325+
}
326+
}
327+
295328
func TestStaticARP(t *testing.T) {
296329
// Configure the DUT with dynamic ARP.
297330
configureDUT(t, noStaticMAC)
@@ -304,6 +337,10 @@ func TestStaticARP(t *testing.T) {
304337
dstMac := gnmi.Get(t, ate.OTG(), gnmi.OTG().Interface(ateSrc.Name+".Eth").Ipv4Neighbor(dutSrc.IPv4).LinkLayerAddress().State())
305338

306339
t.Run("NotPoisoned", func(t *testing.T) {
340+
t.Run("TelemetryCheck", func(t *testing.T) {
341+
dut := ondatra.DUT(t, "dut")
342+
verifyNeighborMAC(t, dut, ateSrc.MAC)
343+
})
307344
t.Run("IPv4", func(t *testing.T) {
308345
testFlow(t, ate, config, "IPv4", dstMac, false)
309346
})
@@ -316,6 +353,10 @@ func TestStaticARP(t *testing.T) {
316353
configureDUT(t, poisonedMAC)
317354

318355
t.Run("Poisoned", func(t *testing.T) {
356+
t.Run("TelemetryCheck", func(t *testing.T) {
357+
dut := ondatra.DUT(t, "dut")
358+
verifyNeighborMAC(t, dut, poisonedMAC)
359+
})
319360
t.Run("IPv4", func(t *testing.T) {
320361
testFlow(t, ate, config, "IPv4", dstMac, true)
321362
})

internal/deviations/deviations.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1999,3 +1999,15 @@ func QosFt(dut *ondatra.DUTDevice) string {
19991999
func SystemMountPointStateFt(dut *ondatra.DUTDevice) string {
20002000
return lookupDUTDeviations(dut).GetSystemMountPointStateFt()
20012001
}
2002+
2003+
// ArpFT returns the functional translator name for devices with neighbor link-layer-address paths unsupported.
2004+
// Cisco: https://partnerissuetracker.corp.google.com/issues/429137958
2005+
func ArpFT(dut *ondatra.DUTDevice) string {
2006+
return lookupDUTDeviations(dut).GetArpFt()
2007+
}
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: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1200,6 +1200,14 @@ message Metadata {
12001200
// Functional Translator name for devices with mount point state paths unsupported.
12011201
string system_mount_point_state_ft = 391;
12021202

1203+
// Cisco: https://partnerissuetracker.corp.google.com/issues/429137958
1204+
// Functional Translator name for devices with neighbor link-layer-address paths unsupported.
1205+
string arp_ft = 392;
1206+
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+
12031211
// Reserved field numbers and identifiers.
12041212
reserved 84, 9, 28, 20, 38, 43, 90, 97, 55, 89, 19, 36, 35, 40, 113, 131, 141, 173, 234, 254, 231, 300, 241;
12051213
}

proto/metadata_go_proto/metadata.pb.go

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

proto/nosimage.proto

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@ syntax = "proto3";
1919

2020
package openconfig.profiles.nosimage;
2121

22+
import "github.com/openconfig/featureprofiles/proto/testregistry.proto";
23+
import "github.com/openconfig/featureprofiles/proto/metadata.proto";
2224
import "github.com/openconfig/featureprofiles/proto/ocpaths.proto";
2325
import "github.com/openconfig/featureprofiles/proto/ocrpcs.proto";
26+
2427
import "github.com/openconfig/ondatra/proto/testbed.proto";
2528
import "google/protobuf/timestamp.proto";
2629

@@ -54,4 +57,27 @@ message NOSImageProfile {
5457

5558
// OpenConfig RPCs supported by the network operating system.
5659
openconfig.ocrpcs.OCRPCs ocrpcs = 6;
60+
61+
// featureprofile_test_result contains a list of tests which
62+
// were executed on the NOS software was tested against
63+
repeated FeatureProfileTestResult featureprofile_test_result = 8;
64+
65+
}
66+
67+
message FeatureProfileTestResult {
68+
// The unique identifier for a featureprofiles test plan. This string must match
69+
// the Metadata plan_id defined for the referenced test.
70+
string plan_id = 1;
71+
72+
// The git commit hash for the featureprofiles repository containing the referenced test
73+
string commit = 2;
74+
75+
// result identifies if the test was executed and its outcome
76+
enum Result {
77+
UNKNOWN = 0;
78+
PASSED = 1;
79+
FAILED = 2;
80+
NOT_EXECUTED = 3;
81+
}
82+
Result result = 3;
5783
}

0 commit comments

Comments
 (0)