Skip to content

Commit

Permalink
Merge branch 'main' into RT7dot4
Browse files Browse the repository at this point in the history
  • Loading branch information
trathod1 authored Dec 11, 2024
2 parents 387081c + 3a7bdec commit bed0bc1
Show file tree
Hide file tree
Showing 9 changed files with 135 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,15 @@ func TestBGPSetup(t *testing.T) {
dni := deviations.DefaultNetworkInstance(bs.DUT)
bgp := bs.DUTConf.GetOrCreateNetworkInstance(dni).GetOrCreateProtocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP").GetOrCreateBgp()
gEBGP := bgp.GetOrCreateGlobal().GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).GetOrCreateUseMultiplePaths().GetOrCreateEbgp()
pgUseMulitplePaths := bgp.GetOrCreatePeerGroup(cfgplugins.BGPPeerGroup1).GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).GetOrCreateUseMultiplePaths()
if tc.enableMultipath {
t.Logf("Enable Multipath")
pgUseMulitplePaths.Enabled = ygot.Bool(true)
switch bs.DUT.Vendor() {
case ondatra.NOKIA:
//BGP multipath enable/disable at the peer-group level not required b/376799583
t.Logf("BGP Multipath enable/disable not required under Peer-group by %s hence skipping", bs.DUT.Vendor())
default:
bgp.GetOrCreatePeerGroup(cfgplugins.BGPPeerGroup1).GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).GetOrCreateUseMultiplePaths().Enabled = ygot.Bool(true)
}
t.Logf("Enable Maximum Paths")
if deviations.EnableMultipathUnderAfiSafi(bs.DUT) {
gEBGP.MaximumPaths = ygot.Uint32(maxPaths)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ platform_exceptions: {
vendor: NOKIA
}
deviations: {
explicit_port_speed: true
enable_multipath_under_afi_safi: true
explicit_interface_in_default_vrf: true
interface_enabled: true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,10 @@ platform_exceptions: {
vendor: NOKIA
}
deviations: {
explicit_port_speed: true
explicit_interface_in_default_vrf: true
interface_enabled: true
bgp_conditions_match_community_set_unsupported: true
bgp_actions_set_community_method_unsupported: true
skip_bgp_send_community_type: true
bgp_community_set_refs_unsupported: true
}
}
platform_exceptions: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ platform_exceptions: {
ipv4_missing_enabled: true
gribi_mac_override_with_static_arp: true
interface_ref_interface_id_format: true
ttl_copy_unsupported: true
pf_require_match_default_rule: true
pf_require_sequential_order_pbr_rules: true
}
Expand Down
1 change: 1 addition & 0 deletions feature/qos/otg_tests/qos_basic_test/metadata.textproto
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ platform_exceptions: {
}
deviations: {
ecn_profile_required_definition: true
no_zero_suppression: true
}
}
platform_exceptions: {
Expand Down
54 changes: 54 additions & 0 deletions feature/qos/otg_tests/qos_basic_test/qos_basic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package qos_basic_test

import (
"context"
"testing"
"time"

Expand Down Expand Up @@ -114,6 +115,10 @@ func TestBasicConfigWithTraffic(t *testing.T) {
ConfigureQoS(t, dut)
}

if deviations.NoZeroSuppression(dut) {
configureNoZeroSuppression(t, dut)
}

// Configure ATE interfaces.
ate := ondatra.ATE(t, "ate")
ap1 := ate.Port(t, "port1")
Expand Down Expand Up @@ -1744,3 +1749,52 @@ func gnmiOpts(t *testing.T, dut *ondatra.DUTDevice, interval time.Duration) *gnm
ygnmi.WithSampleInterval(interval),
)
}
func configureNoZeroSuppression(t *testing.T, dut *ondatra.DUTDevice) {
// Disable Zero suppression
t.Logf("Disable zero suppression:\n%s", dut.Vendor())
var config string
switch dut.Vendor() {
case ondatra.JUNIPER:
config = disableZeroSuppression()
t.Logf("Push the CLI config:\n%s", config)

default:
t.Errorf("Invalid configuration")
}
gnmiClient := dut.RawAPIs().GNMI(t)
gpbSetRequest := buildCliConfigRequest(config)

t.Log("gnmiClient Set CLI config")
if _, err := gnmiClient.Set(context.Background(), gpbSetRequest); err != nil {
t.Fatalf("gnmiClient.Set() with unexpected error: %v", err)
}
}

func buildCliConfigRequest(config string) *gpb.SetRequest {
// Build config with Origin set to cli and Ascii encoded config.
gpbSetRequest := &gpb.SetRequest{
Update: []*gpb.Update{{
Path: &gpb.Path{
Origin: "cli",
Elem: []*gpb.PathElem{},
},
Val: &gpb.TypedValue{
Value: &gpb.TypedValue_AsciiVal{
AsciiVal: config,
},
},
}},
}
return gpbSetRequest
}

func disableZeroSuppression() string {
return (`
services {
analytics {
zero-suppression {
no-zero-suppression;
}
}
}`)
}
5 changes: 5 additions & 0 deletions internal/deviations/deviations.go
Original file line number Diff line number Diff line change
Expand Up @@ -1238,3 +1238,8 @@ func BgpAfiSafiWildcardNotSupported(dut *ondatra.DUTDevice) bool {
func EnableTableConnections(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetEnableTableConnections()
}

// NoZeroSuppression returns true if device wants to remove zero suppression
func NoZeroSuppression(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetNoZeroSuppression()
}
5 changes: 4 additions & 1 deletion proto/metadata.proto
Original file line number Diff line number Diff line change
Expand Up @@ -651,10 +651,13 @@ message Metadata {
// Cisco: b/377433951
bool bgp_extended_next_hop_encoding_leaf_unsupported = 234;
// Device does not support bgp afi safi wildcard.
// Cisco: b/379863985
// Cisco: b/379863985
bool bgp_afi_safi_wildcard_not_supported = 235;
// Nokia; b/304493065 comment#7 SRL native admin_enable for table-connections
bool enable_table_connections = 236;
// Device has default zero suppression.
// Juniper : b/378646018
bool no_zero_suppression = 237;
// Reserved field numbers and identifiers.
reserved 84, 9, 28, 20, 90, 97, 55, 89, 19, 36, 35, 40, 173;
}
Expand Down
112 changes: 63 additions & 49 deletions proto/metadata_go_proto/metadata.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bed0bc1

Please sign in to comment.