Skip to content

Commit

Permalink
RT-1.5 bgp_prefix_limit_test.go (openconfig#2511)
Browse files Browse the repository at this point in the history
* Added deviation

* Update deviations.go

* Resolving conflicts

* Resolved conflicts

---------

Co-authored-by: Arul Kumar Sekar <[email protected]>
  • Loading branch information
cprabha and arulkumarsekar authored Jan 19, 2024
1 parent 8feef4b commit 9395982
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -428,16 +428,20 @@ func verifyPrefixLimitTelemetry(t *testing.T, dut *ondatra.DUTDevice, neighbor *
if maxPrefix != prefixLimit {
t.Errorf("PrefixLimit max-prefixes v4 mismatch: got %d, want %d", maxPrefix, prefixLimit)
}
if (wantEstablished && limitExceeded) || (!wantEstablished && !limitExceeded) {
t.Errorf("PrefixLimitExceeded v4 mismatch: got %t, want %t", limitExceeded, !wantEstablished)
if !deviations.PrefixLimitExceededTelemetryUnsupported(dut) {
if (wantEstablished && limitExceeded) || (!wantEstablished && !limitExceeded) {
t.Errorf("PrefixLimitExceeded v4 mismatch: got %t, want %t", limitExceeded, !wantEstablished)
}
}
} else if *neighbor.NeighborAddress == ateDst.IPv6 {
maxPrefix, limitExceeded := getPrefixLimitv6(dut, neighbor)
if maxPrefix != prefixLimit {
t.Errorf("PrefixLimit max-prefixes v6 mismatch: got %d, want %d", maxPrefix, prefixLimit)
}
if (wantEstablished && limitExceeded) || (!wantEstablished && !limitExceeded) {
t.Errorf("PrefixLimitExceeded v6 mismatch: got %t, want %t", limitExceeded, !wantEstablished)
if !deviations.PrefixLimitExceededTelemetryUnsupported(dut) {
if (wantEstablished && limitExceeded) || (!wantEstablished && !limitExceeded) {
t.Errorf("PrefixLimitExceeded v6 mismatch: got %t, want %t", limitExceeded, !wantEstablished)
}
}
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ platform_exceptions: {
ipv4_missing_enabled: true
}
}
platform_exceptions: {
platform: {
vendor: JUNIPER
}
deviations: {
prefix_limit_exceeded_telemetry_unsupported: true
}
}
platform_exceptions: {
platform: {
vendor: NOKIA
Expand Down
5 changes: 5 additions & 0 deletions internal/deviations/deviations.go
Original file line number Diff line number Diff line change
Expand Up @@ -740,3 +740,8 @@ func EnableFlowctrlFlag(dut *ondatra.DUTDevice) bool {
func Ipv6RouterAdvertisementConfigUnsupported(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetIpv6RouterAdvertisementConfigUnsupported()
}

// PrefixLimitExceededTelemetryUnsupported is to skip checking prefix limit telemetry flag.
func PrefixLimitExceededTelemetryUnsupported(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetPrefixLimitExceededTelemetryUnsupported()
}
3 changes: 3 additions & 0 deletions proto/metadata.proto
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,9 @@ message Metadata {
// Device doesn't support router advertisement enable and mode config
// Juniper: b/316173974
bool ipv6_router_advertisement_config_unsupported = 138;
// Devices does not support setting prefix limit exceeded flag.
// Juniper : b/317181227
bool prefix_limit_exceeded_telemetry_unsupported = 139;

// Reserved field numbers and identifiers.
reserved 84, 9, 28, 20, 90, 97, 55, 89, 19;
Expand Down
90 changes: 53 additions & 37 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 9395982

Please sign in to comment.