Skip to content

Commit

Permalink
Merge branch 'main' into DP-1.14
Browse files Browse the repository at this point in the history
  • Loading branch information
lvaish05 authored Feb 26, 2025
2 parents 15f0fc7 + 84ffc46 commit b7829d2
Show file tree
Hide file tree
Showing 25 changed files with 697 additions and 240 deletions.
5 changes: 2 additions & 3 deletions feature/bgp/otg_tests/bgp_afi_safi_defaults/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ BGP AFI SAFI OC DEFAULTS TEST
"IPv6-unicast enabled" boolean is left to OC default for the IPv4 peer".
* Ensure that only IPv6-Unicast enabled boolean is made "true" for IPv6 neighbor.
"IPv4-unicast enabled" boolean is left to OC default for the IPv6 peer".
* Ensure that there are no AFI-SAFI configurations at the global and peer-group levels.
* Ensure that there are no AFI-SAFI configurations at peer-group levels.
* On the ATE side ensure that IPv4-unicast and IPv6-unicast AFI-SAFI are enabled==true for
IPv4 and IPv6 neighbors.
* Ensure that there is extended-next-hop encoding feature is configured via OC path and the
Expand All @@ -46,7 +46,7 @@ BGP AFI SAFI OC DEFAULTS TEST

* Configuration at the neighbor level is same as in [Test case-1] except for IPv4-unicast and
IPv6-unicast being enabled at the peer-group level
* No configuration should be made at the global AFI-SAFI level
* No configuration should be made at the neighbor AFI-SAFI level

* Verification:
* For IPv4 neighbor, ensure that the IPv4 neighborship is up and both IPv4-unicast and
Expand Down Expand Up @@ -78,7 +78,6 @@ BGP AFI SAFI OC DEFAULTS TEST
* For IPv6 neighbor ensure that the IPv6 neighborship is not ESTABLISHED and
IPv6-unicast capabilities are set to FALSE.


## OpenConfig Path and RPC Coverage

The below yaml defines the OC paths intended to be covered by this test. OC paths used for test setup are not listed here.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,10 @@ func bgpCreateNbr(t *testing.T, localAs, peerAs uint32, dut *ondatra.DUTDevice,
case globalLevel:
if nbr.isV4 == true {
global.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).Enabled = ygot.Bool(true)
nv4.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).Enabled = ygot.Bool(true)
} else {
global.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST).Enabled = ygot.Bool(true)
nv4.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST).Enabled = ygot.Bool(true)
}
if !isV4Only {
if !deviations.BGPGlobalExtendedNextHopEncodingUnsupported(dut) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ func bgpCreateNbr(t *testing.T, dut *ondatra.DUTDevice, authPwd, routerID string
global := bgp.GetOrCreateGlobal()
global.RouterId = ygot.String(routerID)
global.As = ygot.Uint32(localAs)
global.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).Enabled = ygot.Bool(true)
global.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST).Enabled = ygot.Bool(true)

pg1 := bgp.GetOrCreatePeerGroup(peerGrpName1)
pg1.PeerAs = ygot.Uint32(ateAS1)
Expand Down
10 changes: 0 additions & 10 deletions feature/gribi/otg_tests/gribi_scaling/gribi_scaling_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,6 @@ func incrementMAC(mac string, i int) (string, error) {

func TestScaling(t *testing.T) {
dut := ondatra.DUT(t, "dut")
overrideScaleParams(dut)
ate := ondatra.ATE(t, "ate")

ctx := context.Background()
Expand Down Expand Up @@ -399,12 +398,3 @@ func checkTraffic(t *testing.T, ate *ondatra.ATEDevice, top gosnappi.Config) {
t.Errorf("FAIL- Got %v%% packet loss for %s ; expected < 1%%", lossPct, "flow")
}
}

// overrideScaleParams allows to override the default scale parameters based on the DUT vendor.
func overrideScaleParams(dut *ondatra.DUTDevice) {
if deviations.OverrideDefaultNhScale(dut) {
if dut.Vendor() == ondatra.CISCO {
*fpargs.V4TunnelCount = 3328
}
}
}
1 change: 0 additions & 1 deletion feature/gribi/otg_tests/gribi_scaling/metadata.textproto
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ platform_exceptions: {
deviations: {
ipv4_missing_enabled: true
interface_ref_interface_id_format: true
override_default_nh_scale: true
}
}
platform_exceptions: {
Expand Down
29 changes: 23 additions & 6 deletions feature/gribi/otg_tests/ipv4_entry_test/ipv4_entry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,12 @@ func TestMain(m *testing.M) {

func staticARPWithMagicUniversalIP(t *testing.T, dut *ondatra.DUTDevice) {
t.Helper()
dummyIPCIDR1 := nh1IpAddr + "/32"
dummyIPCIDR2 := nh2IpAddr + "/32"
p2 := dut.Port(t, "port2")
p3 := dut.Port(t, "port3")
s2 := &oc.NetworkInstance_Protocol_Static{
Prefix: ygot.String(nh1IpAddr + "/32"),
Prefix: ygot.String(dummyIPCIDR1),
NextHop: map[string]*oc.NetworkInstance_Protocol_Static_NextHop{
strconv.Itoa(nh1ID): {
Index: ygot.String(strconv.Itoa(nh1ID)),
Expand All @@ -131,7 +133,7 @@ func staticARPWithMagicUniversalIP(t *testing.T, dut *ondatra.DUTDevice) {
},
}
s3 := &oc.NetworkInstance_Protocol_Static{
Prefix: ygot.String(nh2IpAddr + "/32"),
Prefix: ygot.String(dummyIPCIDR2),
NextHop: map[string]*oc.NetworkInstance_Protocol_Static_NextHop{
strconv.Itoa(nh2ID): {
Index: ygot.String(strconv.Itoa(nh2ID)),
Expand All @@ -141,9 +143,24 @@ func staticARPWithMagicUniversalIP(t *testing.T, dut *ondatra.DUTDevice) {
},
},
}
static1 := &oc.NetworkInstance_Protocol{
Identifier: oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_STATIC,
Name: ygot.String(deviations.StaticProtocolName(dut)),
Static: map[string]*oc.NetworkInstance_Protocol_Static{
dummyIPCIDR1: s2,
},
}
static2 := &oc.NetworkInstance_Protocol{
Identifier: oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_STATIC,
Name: ygot.String(deviations.StaticProtocolName(dut)),
Static: map[string]*oc.NetworkInstance_Protocol_Static{
dummyIPCIDR2: s3,
},
}
fptest.ConfigureDefaultNetworkInstance(t, dut)
sp := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_STATIC, deviations.StaticProtocolName(dut))
gnmi.Replace(t, dut, sp.Static(nh1IpAddr+"/32").Config(), s2)
gnmi.Replace(t, dut, sp.Static(nh2IpAddr+"/32").Config(), s3)
gnmi.Update(t, dut, sp.Config(), static1)
gnmi.Update(t, dut, sp.Config(), static2)
gnmi.Update(t, dut, gnmi.OC().Interface(p2.Name()).Config(), configStaticArp(p2, nh1IpAddr, staticDstMAC))
gnmi.Update(t, dut, gnmi.OC().Interface(p3.Name()).Config(), configStaticArp(p3, nh2IpAddr, staticDstMAC))
}
Expand Down Expand Up @@ -349,7 +366,7 @@ func TestIPv4Entry(t *testing.T) {
if tc.gribiMACOverrideWithStaticARPStaticRoute {
staticARPWithMagicUniversalIP(t, dut)
} else if tc.gribiMACOverrideWithStaticARP {
//Creating a Static ARP entry for staticDstMAC
// Creating a Static ARP entry for staticDstMAC
d := gnmi.OC()
p2 := dut.Port(t, "port2")
p3 := dut.Port(t, "port3")
Expand All @@ -359,7 +376,7 @@ func TestIPv4Entry(t *testing.T) {
gnmi.Update(t, dut, d.Interface(p3.Name()).Config(), configStaticArp(p3, nh2IpAddr, staticDstMAC))
}
if tc.gribiMACOverrideWithStaticARP || tc.gribiMACOverrideWithStaticARPStaticRoute {
//Programming a gRIBI flow with above IP/mac-address as the next-hop entry
// Programming a gRIBI flow with above IP/mac-address as the next-hop entry
tc.entries = []fluent.GRIBIEntry{
fluent.NextHopEntry().WithNetworkInstance(deviations.DefaultNetworkInstance(dut)).
WithIndex(nh1ID).WithInterfaceRef(dut.Port(t, "port2").Name()).WithIPAddress(nh1IpAddr).WithMacAddress(staticDstMAC),
Expand Down
9 changes: 0 additions & 9 deletions feature/gribi/otg_tests/static_lsp_test/metadata.textproto
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,3 @@ platform_exceptions: {
ipv4_missing_enabled: true
}
}

platform_exceptions: {
platform: {
vendor: JUNIPER
}
deviations: {
static_lsp_unsupported: true
}
}
64 changes: 9 additions & 55 deletions feature/gribi/otg_tests/static_lsp_test/static_lsp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
"github.com/openconfig/featureprofiles/internal/attrs"
"github.com/openconfig/featureprofiles/internal/deviations"
"github.com/openconfig/featureprofiles/internal/fptest"
"github.com/openconfig/featureprofiles/internal/helpers"
"github.com/openconfig/featureprofiles/internal/otgutils"
"github.com/openconfig/ondatra"
"github.com/openconfig/ondatra/gnmi"
Expand Down Expand Up @@ -142,60 +141,15 @@ 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) {
if deviations.StaticLspConfigUnsupported(dut) {
t.Logf("Push config via native CLI:%s", dut.Vendor())
switch dut.Vendor() {
case ondatra.JUNIPER:
config := juniperMplsLSPConfig(t, dut, lspName, incomingLabel, nextHopIP)
helpers.GnmiCLIConfig(t, dut, config)
default:
t.Fatalf("StaticLspConfigUnsupported deviation needs cli configuration for vendor %s which is not defined", dut.Vendor())
}
} else {
d := &oc.Root{}
// ConfigureDefaultNetworkInstance configures the default network instance name and type.
fptest.ConfigureDefaultNetworkInstance(t, dut)
mplsCfg := d.GetOrCreateNetworkInstance(deviations.DefaultNetworkInstance(dut)).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)
}
}

// juniperMplsLSPConfig is used to configure mpls lsp configuration via native cli as an alternative to below xpaths.
// /network-instances/network-instance/mpls/lsps/static-lsps/static-lsp/egress/config/next-hop
// /network-instances/network-instance/mpls/lsps/static-lsps/static-lsp/egress/config/incoming-label
// /network-instances/network-instance/mpls/lsps/static-lsps/static-lsp/egress/config/push-label
func juniperMplsLSPConfig(t *testing.T, dut *ondatra.DUTDevice, lspName string, incomingLabel uint32, nextHopIP string) string {
p1 := dut.Port(t, "port1").Name()
p2 := dut.Port(t, "port2").Name()
return fmt.Sprintf(`
interfaces {
%s {
unit %d {
family mpls;
}
}
%s {
unit %d {
family mpls;
}
}
}
protocols {
mpls {
interface %s;
interface %s;
static-label-switched-path %s {
transit %d {
next-hop %s;
pop;
}
}
}
}`, p1, 0, p2, 0, p1, p2, lspName, incomingLabel, nextHopIP)
d := &oc.Root{}
// ConfigureDefaultNetworkInstance configures the default network instance name and type.
fptest.ConfigureDefaultNetworkInstance(t, dut)
mplsCfg := d.GetOrCreateNetworkInstance(deviations.DefaultNetworkInstance(dut)).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
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,6 @@ func TestAuthentication(t *testing.T) {
ts := isissession.MustNew(t).WithISIS()
ts.ConfigISIS(func(isis *oc.NetworkInstance_Protocol_Isis) {
level := isis.GetOrCreateLevel(2)
level.Enabled = ygot.Bool(true)
auth := level.GetOrCreateAuthentication()
auth.Enabled = ygot.Bool(true)
auth.AuthMode = tc.mode
Expand Down
7 changes: 7 additions & 0 deletions feature/isis/otg_tests/isis_drain_test/isis_drain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,10 @@ func configureISISDUT(t *testing.T, dut *ondatra.DUTDevice, intfs []string) {
isis := prot.GetOrCreateIsis()

globalISIS := isis.GetOrCreateGlobal()
// Explicit Disable the default igp-ldp-sync enabled global leaf
isismpls := prot.GetOrCreateIsis().GetOrCreateGlobal().GetOrCreateMpls()
isismplsldpsync := isismpls.GetOrCreateIgpLdpSync()
isismplsldpsync.Enabled = ygot.Bool(false)
if deviations.ISISInstanceEnabledRequired(dut) {
globalISIS.Instance = ygot.String(isisInstance)
}
Expand All @@ -257,6 +261,9 @@ func configureISISDUT(t *testing.T, dut *ondatra.DUTDevice, intfs []string) {
}
for _, intfName := range intfs {
isisIntf := isis.GetOrCreateInterface(intfName)
// Explicit Disable the default igp-ldp-sync enabled interface level leaf
isisintfmplsldpsync := isisIntf.GetOrCreateMpls().GetOrCreateIgpLdpSync()
isisintfmplsldpsync.Enabled = ygot.Bool(false)
isisIntf.GetOrCreateInterfaceRef().Interface = ygot.String(intfName)
isisIntf.GetOrCreateInterfaceRef().Subinterface = ygot.Uint32(0)
if deviations.InterfaceRefConfigUnsupported(dut) {
Expand Down
2 changes: 1 addition & 1 deletion feature/isis/otg_tests/isis_drain_test/metadata.textproto
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ platform_exceptions: {
}
deviations: {
ipv4_missing_enabled: true
missing_isis_interface_afi_safi_enable: true
interface_ref_config_unsupported: true
}
}
platform_exceptions: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func TestFabricPowerAdmin(t *testing.T) {

powerDownUp(t, dut, f, oc.PlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_FABRIC, 3*time.Minute)

helpers.ValidateOperStatusUPIntfs(t, dut, before, 5*time.Minute)
helpers.ValidateOperStatusUPIntfs(t, dut, before, 8*time.Minute)
})
}
}
Expand Down Expand Up @@ -76,7 +76,7 @@ func TestLinecardPowerAdmin(t *testing.T) {

powerDownUp(t, dut, l, oc.PlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_LINECARD, 20*time.Minute)

helpers.ValidateOperStatusUPIntfs(t, dut, before, 5*time.Minute)
helpers.ValidateOperStatusUPIntfs(t, dut, before, 8*time.Minute)
})
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ platform_exceptions: {
vendor: JUNIPER
}
deviations: {
linecard_cpu_utilization_unsupported: true
consistent_component_names_unsupported: true
controller_card_cpu_utilization_unsupported: true
fabric_drop_counter_unsupported: true
linecard_memory_utilization_unsupported: true
qos_voq_drop_counter_unsupported: true
qos_inqueue_drop_counter_unsupported: true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,22 @@ func TestComponentStatus(t *testing.T) {
controllerCards := components.FindComponentsByType(t, dut, controllerCardType)
lineCards := components.FindComponentsByType(t, dut, lineCardType)
fabricCards := components.FindComponentsByType(t, dut, fabricCardType)
fabrics := make([]string, 0)
for _, f := range fabricCards {
compMtyVal, ok := gnmi.Lookup(t, dut, gnmi.OC().Component(f).Empty().State()).Val()
if !compMtyVal && ok {
fabrics = append(fabrics, f)
}
}
fabricCards = fabrics
chassisLineCards := make([]string, 0)
for _, lc := range lineCards {
compMtyVal, ok := gnmi.Lookup(t, dut, gnmi.OC().Component(lc).Empty().State()).Val()
if !compMtyVal && ok {
chassisLineCards = append(chassisLineCards, lc)
}
}
lineCards = chassisLineCards
checkComponents := append(controllerCards, lineCards...)
checkComponents = append(checkComponents, fabricCards...)
if len(checkComponents) == 0 {
Expand Down Expand Up @@ -246,6 +262,20 @@ func TestLineCardsNoHighCPUSpike(t *testing.T) {

lineCards := components.FindComponentsByType(t, dut, lineCardType)
cpuCards := components.FindComponentsByType(t, dut, cpuType)
chassisLineCards := make([]string, 0)
for _, lc := range lineCards {
compMtyVal, ok := gnmi.Lookup(t, dut, gnmi.OC().Component(lc).Empty().State()).Val()
if !compMtyVal && ok {
chassisLineCards = append(chassisLineCards, lc)
}
}

for _, lc := range chassisLineCards {
if !gnmi.Get(t, dut, gnmi.OC().Component(lc).Removable().State()) {
t.Skipf("Skip the test on non-removable linecard.")
}
}
lineCards = chassisLineCards
if len(lineCards) == 0 || len(cpuCards) == 0 {
t.Errorf("ERROR: No controllerCard or cpuCard has been found.")
}
Expand Down Expand Up @@ -288,10 +318,19 @@ func TestComponentsNoHighMemoryUtilization(t *testing.T) {

controllerCards := components.FindComponentsByType(t, dut, controllerCardType)
lineCards := components.FindComponentsByType(t, dut, lineCardType)
chassisLineCards := make([]string, 0)
for _, lc := range lineCards {
compMtyVal, ok := gnmi.Lookup(t, dut, gnmi.OC().Component(lc).Empty().State()).Val()
if !compMtyVal && ok {
chassisLineCards = append(chassisLineCards, lc)
}
}
lineCards = chassisLineCards
cardList := append(controllerCards, lineCards...)
if len(cardList) == 0 {
t.Errorf("ERROR: No card has been found.")
}

for _, component := range cardList {
t.Run(component, func(t *testing.T) {
query := gnmi.OC().Component(component).State()
Expand All @@ -301,7 +340,9 @@ func TestComponentsNoHighMemoryUtilization(t *testing.T) {
if componentType == lineCardType && deviations.LinecardMemoryUtilizationUnsupported(dut) {
t.Skipf("INFO: Skipping test for linecard component %s due to deviation linecard_memory_utilization_unsupported", component)
}

if componentType == lineCardType && !gnmi.Get(t, dut, gnmi.OC().Component(component).Removable().State()) {
t.Skipf("Skip the test on non-removable linecard.")
}
memoryState := componentState.GetMemory()
if memoryState == nil {
t.Errorf("ERROR: %s - Device: %s - %s: %-40s - Type: %-20s - Memory data not available",
Expand Down
Loading

0 comments on commit b7829d2

Please sign in to comment.