Skip to content

Commit

Permalink
clean rebase with main
Browse files Browse the repository at this point in the history
  • Loading branch information
fmolinar committed Mar 25, 2024
1 parent 78a50c2 commit a2bc02d
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 61 deletions.
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 @@ -11,6 +11,7 @@ platform_exceptions: {
}
deviations: {
ipv4_missing_enabled: true
skip_qos_sampling_counter: true
}
}
platform_exceptions: {
Expand Down
44 changes: 23 additions & 21 deletions feature/qos/otg_tests/qos_basic_test/qos_basic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -528,27 +528,29 @@ func TestBasicConfigWithTraffic(t *testing.T) {
}
}

// gnmi subscribe sample mode(10 and 15 seconds sample interval) for queue counters
subscribeTimeout := 30 * time.Second
for _, sampleInterval := range []time.Duration{10 * time.Second, 15 * time.Second} {
minWant := int(subscribeTimeout/sampleInterval) - 1
for _, data := range trafficFlows {
transmitPkts := gnmi.Collect(t, gnmiOpts(t, dut, sampleInterval), gnmi.OC().Qos().Interface(dp3.Name()).Output().Queue(data.queue).TransmitPkts().State(), subscribeTimeout).Await(t)
if len(transmitPkts) < minWant {
t.Errorf("TransmitPkts: got %d, want >= %d", len(transmitPkts), minWant)
}
transmitOctets := gnmi.Collect(t, gnmiOpts(t, dut, sampleInterval), gnmi.OC().Qos().Interface(dp3.Name()).Output().Queue(data.queue).TransmitOctets().State(), subscribeTimeout).Await(t)
if len(transmitOctets) < minWant {
t.Errorf("TransmitOctets: got %d, want >= %d", len(transmitOctets), minWant)
}
droppedPkts := gnmi.Collect(t, gnmiOpts(t, dut, sampleInterval), gnmi.OC().Qos().Interface(dp3.Name()).Output().Queue(data.queue).DroppedPkts().State(), subscribeTimeout).Await(t)
if len(droppedPkts) < minWant {
t.Errorf("DroppedPkts: got %d, want >= %d", len(droppedPkts), minWant)
}
if !deviations.QOSDroppedOctets(dut) {
droppedOctets := gnmi.Collect(t, gnmiOpts(t, dut, sampleInterval), gnmi.OC().Qos().Interface(dp3.Name()).Output().Queue(data.queue).DroppedOctets().State(), subscribeTimeout).Await(t)
if len(droppedOctets) < minWant {
t.Errorf("DroppedOctets: got %d, want >= %d", len(droppedOctets), minWant)
if !deviations.SkipQosSamplingCounter(dut) {
// gnmi subscribe sample mode(10 and 15 seconds sample interval) for queue counters
subscribeTimeout := 30 * time.Second
for _, sampleInterval := range []time.Duration{10 * time.Second, 15 * time.Second} {
minWant := int(subscribeTimeout/sampleInterval) - 1
for _, data := range trafficFlows {
transmitPkts := gnmi.Collect(t, gnmiOpts(t, dut, sampleInterval), gnmi.OC().Qos().Interface(dp3.Name()).Output().Queue(data.queue).TransmitPkts().State(), subscribeTimeout).Await(t)
if len(transmitPkts) < minWant {
t.Errorf("TransmitPkts: got %d, want >= %d", len(transmitPkts), minWant)
}
transmitOctets := gnmi.Collect(t, gnmiOpts(t, dut, sampleInterval), gnmi.OC().Qos().Interface(dp3.Name()).Output().Queue(data.queue).TransmitOctets().State(), subscribeTimeout).Await(t)
if len(transmitOctets) < minWant {
t.Errorf("TransmitOctets: got %d, want >= %d", len(transmitOctets), minWant)
}
droppedPkts := gnmi.Collect(t, gnmiOpts(t, dut, sampleInterval), gnmi.OC().Qos().Interface(dp3.Name()).Output().Queue(data.queue).DroppedPkts().State(), subscribeTimeout).Await(t)
if len(droppedPkts) < minWant {
t.Errorf("DroppedPkts: got %d, want >= %d", len(droppedPkts), minWant)
}
if !deviations.QOSDroppedOctets(dut) {
droppedOctets := gnmi.Collect(t, gnmiOpts(t, dut, sampleInterval), gnmi.OC().Qos().Interface(dp3.Name()).Output().Queue(data.queue).DroppedOctets().State(), subscribeTimeout).Await(t)
if len(droppedOctets) < minWant {
t.Errorf("DroppedOctets: got %d, want >= %d", len(droppedOctets), minWant)
}
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions internal/deviations/deviations.go
Original file line number Diff line number Diff line change
Expand Up @@ -848,3 +848,8 @@ func SetMetricAsPreference(dut *ondatra.DUTDevice) bool {
func IPv6StaticRouteWithIPv4NextHopRequiresStaticARP(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetIpv6StaticRouteWithIpv4NextHopRequiresStaticArp()
}

// SkipQosSamplingCounter returns true if device does not support qos counters sampling.
func SkipQosSamplingCounter(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetSkipQosSamplingCounter()
}
2 changes: 2 additions & 0 deletions proto/metadata.proto
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,8 @@ message Metadata {
// as next hop and requires configuring a static ARP entry.
// Arista: https://partnerissuetracker.corp.google.com/issues/316593298
bool ipv6_static_route_with_ipv4_next_hop_requires_static_arp = 158;
// skip_qos_sampling_counter returns true if qos sampling counter needs to be skipped.
bool skip_qos_sampling_counter = 159;

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

Please sign in to comment.