Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DP-1.14: Adding deviation for no zero suppression #3624

Merged
merged 5 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -1234,7 +1234,12 @@
return lookupDUTDeviations(dut).GetBgpAfiSafiWildcardNotSupported()
}

// Admin Enable Table Connections in SRL native

Check failure on line 1237 in internal/deviations/deviations.go

View workflow job for this annotation

GitHub Actions / Static Analysis

comment on exported function EnableTableConnections should be of the form "EnableTableConnections ..."
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.

Loading