Skip to content

Commit

Permalink
Removing deviations (#2975)
Browse files Browse the repository at this point in the history
* removing deviations

* fix static errors

* update

* update

* update

* fix static error

* fix deviations

* update

* update

* update

* fix deviation

* try fix
  • Loading branch information
charantejag504 authored Oct 17, 2024
1 parent e31c3a8 commit 18512bb
Show file tree
Hide file tree
Showing 27 changed files with 597 additions and 240 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -328,18 +328,17 @@ func TestQoSCounters(t *testing.T) {
path: qosQueuePath + "dropped-pkts",
counters: gnmi.LookupAll(t, dut, queues.DroppedPkts().State()),
}}
if !deviations.QOSDroppedOctets(dut) {
cases = append(cases,
struct {
desc string
path string
counters []*ygnmi.Value[uint64]
}{
desc: "DroppedOctets",
path: qosQueuePath + "dropped-octets",
counters: gnmi.LookupAll(t, dut, queues.DroppedOctets().State()),
})
}
cases = append(cases,
struct {
desc string
path string
counters []*ygnmi.Value[uint64]
}{
desc: "DroppedOctets",
path: qosQueuePath + "dropped-octets",
counters: gnmi.LookupAll(t, dut, queues.DroppedOctets().State()),
})

for _, tc := range cases {
t.Run(tc.desc, func(t *testing.T) {

Expand Down
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 @@ -32,7 +32,6 @@ platform_exceptions: {
}
deviations: {
no_mix_of_tagged_and_untagged_subinterfaces: true
explicit_interface_ref_definition: true
}
}
platform_exceptions: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,22 @@ rpcs:
## Minimum DUT platform requirement
vRX
## 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.
```yaml
paths:
## Config paths: N/A

## State paths:
/network-instances/network-instance/afts/next-hop-groups/next-hop-group/next-hops/next-hop/state/weight:

rpcs:
gribi:
gRIBI.Get:
gRIBI.Modify:
gRIBI.Flush:
```
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ platform_exceptions: {
ipv4_missing_enabled: true
interface_ref_interface_id_format: true
pf_require_match_default_rule: true
pf_require_sequential_order_pbr_rules: true
pf_require_sequential_order_pbr_rules: true
}
}
platform_exceptions: {
Expand All @@ -23,7 +23,6 @@ platform_exceptions: {
}
deviations: {
hierarchical_weight_resolution_tolerance: 0.4
explicit_interface_ref_definition: true
}
}
platform_exceptions: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,21 @@ rpcs:
* vRX - virtual router device
## 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.
```yaml
paths:
## Config paths: N/A

## State paths:
/network-instances/network-instance/afts/next-hop-groups/next-hop-group/next-hops/next-hop/state/weight:

rpcs:
gribi:
gRIBI.Get:
gRIBI.Modify:
gRIBI.Flush:
```
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ platform_exceptions: {
}
deviations: {
hierarchical_weight_resolution_tolerance: 0.4
explicit_interface_ref_definition: true
}
}
platform_exceptions: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,24 @@ rpcs:
## Required DUT platform
* MFF
## 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.
```yaml
paths:
## Config paths:
/interfaces/interface/config/enabled:
/interfaces/interface/subinterfaces/subinterface/ipv4/config/enabled:
/interfaces/interface/subinterfaces/subinterface/ipv6/config/enabled:
/components/component/fabric/config/power-admin-state:

## State paths: N/A

rpcs:
gnmi:
gNMI.Set:
Replace:
```
48 changes: 17 additions & 31 deletions feature/qos/otg_tests/bursty_traffic_test/bursty_traffic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -371,22 +371,12 @@ func TestBurstyTraffic(t *testing.T) {
var counterNames []string
counters := make(map[string]map[string]uint64)

if !deviations.QOSDroppedOctets(dut) {
counterNames = []string{

"ateOutPkts", "ateInPkts", "dutQosPktsBeforeTraffic", "dutQosOctetsBeforeTraffic",
"dutQosPktsAfterTraffic", "dutQosOctetsAfterTraffic", "dutQosDroppedPktsBeforeTraffic",
"dutQosDroppedOctetsBeforeTraffic", "dutQosDroppedPktsAfterTraffic",
"dutQosDroppedOctetsAfterTraffic",
}
} else {
counterNames = []string{

"ateOutPkts", "ateInPkts", "dutQosPktsBeforeTraffic", "dutQosOctetsBeforeTraffic",
"dutQosPktsAfterTraffic", "dutQosOctetsAfterTraffic", "dutQosDroppedPktsBeforeTraffic",
"dutQosDroppedPktsAfterTraffic",
}
counterNames = []string{

"ateOutPkts", "ateInPkts", "dutQosPktsBeforeTraffic", "dutQosOctetsBeforeTraffic",
"dutQosPktsAfterTraffic", "dutQosOctetsAfterTraffic", "dutQosDroppedPktsBeforeTraffic",
"dutQosDroppedOctetsBeforeTraffic", "dutQosDroppedPktsAfterTraffic",
"dutQosDroppedOctetsAfterTraffic",
}

for _, name := range counterNames {
Expand Down Expand Up @@ -420,13 +410,12 @@ func TestBurstyTraffic(t *testing.T) {
}
counters["dutQosDroppedPktsBeforeTraffic"][data.queue], _ = count.Val()

if !deviations.QOSDroppedOctets(dut) {
count, ok = gnmi.Watch(t, dut, gnmi.OC().Qos().Interface(dp3.Name()).Output().Queue(data.queue).DroppedOctets().State(), timeout, isPresent).Await(t)
if !ok {
t.Errorf("DroppedOctets count for queue %q on interface %q not available within %v", dp3.Name(), data.queue, timeout)
}
counters["dutQosDroppedOctetsBeforeTraffic"][data.queue], _ = count.Val()
count, ok = gnmi.Watch(t, dut, gnmi.OC().Qos().Interface(dp3.Name()).Output().Queue(data.queue).DroppedOctets().State(), timeout, isPresent).Await(t)
if !ok {
t.Errorf("DroppedOctets count for queue %q on interface %q not available within %v", dp3.Name(), data.queue, timeout)
}
counters["dutQosDroppedOctetsBeforeTraffic"][data.queue], _ = count.Val()

}

t.Logf("Running traffic 1 on DUT interfaces: %s => %s ", dp1.Name(), dp3.Name())
Expand All @@ -448,9 +437,8 @@ func TestBurstyTraffic(t *testing.T) {
counters["dutQosPktsAfterTraffic"][data.queue] = gnmi.Get(t, dut, gnmi.OC().Qos().Interface(dp3.Name()).Output().Queue(data.queue).TransmitPkts().State())
counters["dutQosOctetsAfterTraffic"][data.queue] = gnmi.Get(t, dut, gnmi.OC().Qos().Interface(dp3.Name()).Output().Queue(data.queue).TransmitOctets().State())
counters["dutQosDroppedPktsAfterTraffic"][data.queue] = gnmi.Get(t, dut, gnmi.OC().Qos().Interface(dp3.Name()).Output().Queue(data.queue).DroppedPkts().State())
if !deviations.QOSDroppedOctets(dut) {
counters["dutQosDroppedOctetsAfterTraffic"][data.queue] = gnmi.Get(t, dut, gnmi.OC().Qos().Interface(dp3.Name()).Output().Queue(data.queue).DroppedOctets().State())
}
counters["dutQosDroppedOctetsAfterTraffic"][data.queue] = gnmi.Get(t, dut, gnmi.OC().Qos().Interface(dp3.Name()).Output().Queue(data.queue).DroppedOctets().State())

t.Logf("ateInPkts: %v, txPkts %v, Queue: %v", counters["ateInPkts"][data.queue], counters["dutQosPktsAfterTraffic"][data.queue], data.queue)
if ateTxPkts == 0 {
t.Fatalf("TxPkts == 0, want >0.")
Expand Down Expand Up @@ -490,13 +478,11 @@ func TestBurstyTraffic(t *testing.T) {
}
}

if !deviations.QOSDroppedOctets(dut) {
ateDropOctetCounterDiff := (counters["ateOutPkts"][data.queue] - counters["ateInPkts"][data.queue]) * uint64(data.frameSize)
dutDropOctetCounterDiff := counters["dutQosDroppedOctetsAfterTraffic"][data.queue] - counters["dutQosDroppedOctetsBeforeTraffic"][data.queue]
t.Logf("Queue %q: ateDropOctetCounterDiff: %v dutDropOctetCounterDiff: %v", data.queue, ateDropOctetCounterDiff, dutDropOctetCounterDiff)
if dutDropOctetCounterDiff < ateDropOctetCounterDiff {
t.Errorf("Get dutDropOctetCounterDiff for queue %q: got %v, want >= %v", data.queue, dutDropOctetCounterDiff, ateDropOctetCounterDiff)
}
ateDropOctetCounterDiff := (counters["ateOutPkts"][data.queue] - counters["ateInPkts"][data.queue]) * uint64(data.frameSize)
dutDropOctetCounterDiff := counters["dutQosDroppedOctetsAfterTraffic"][data.queue] - counters["dutQosDroppedOctetsBeforeTraffic"][data.queue]
t.Logf("Queue %q: ateDropOctetCounterDiff: %v dutDropOctetCounterDiff: %v", data.queue, ateDropOctetCounterDiff, dutDropOctetCounterDiff)
if dutDropOctetCounterDiff < ateDropOctetCounterDiff {
t.Errorf("Get dutDropOctetCounterDiff for queue %q: got %v, want >= %v", data.queue, dutDropOctetCounterDiff, ateDropOctetCounterDiff)
}

}
Expand Down
4 changes: 0 additions & 4 deletions feature/qos/otg_tests/bursty_traffic_test/metadata.textproto
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ platform_exceptions: {
platform: {
vendor: JUNIPER
}
deviations: {
explicit_interface_ref_definition: true
qos_dropped_octets: true
}
}
platform_exceptions: {
platform: {
Expand Down
56 changes: 56 additions & 0 deletions feature/qos/otg_tests/mixed_sp_wrr_traffic_test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,59 @@ forwards AF3, AF2, AF1, BE1 and BE0 based on weight.
* /qos/interfaces/interface/output/queues/queue/state/transmit-octets
* /qos/interfaces/interface/output/queues/queue/state/dropped-pkts
* /qos/interfaces/interface/output/queues/queue/state/dropped-octets

## 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.

```yaml
paths:
## Config paths:
/qos/forwarding-groups/forwarding-group/config/name:
/qos/forwarding-groups/forwarding-group/config/output-queue:
/qos/queues/queue/config/name:
/qos/classifiers/classifier/config/name:
/qos/classifiers/classifier/config/type:
/qos/classifiers/classifier/terms/term/actions/config/target-group:
/qos/classifiers/classifier/terms/term/conditions/ipv4/config/dscp-set:
/qos/classifiers/classifier/terms/term/conditions/ipv6/config/dscp-set:
/qos/classifiers/classifier/terms/term/config/id:
/qos/interfaces/interface/output/queues/queue/config/name:
/qos/interfaces/interface/input/classifiers/classifier/config/name:
/qos/interfaces/interface/output/scheduler-policy/config/name:
/qos/scheduler-policies/scheduler-policy/config/name:
/qos/scheduler-policies/scheduler-policy/schedulers/scheduler/config/priority:
/qos/scheduler-policies/scheduler-policy/schedulers/scheduler/config/sequence:
/qos/scheduler-policies/scheduler-policy/schedulers/scheduler/config/type:
/qos/scheduler-policies/scheduler-policy/schedulers/scheduler/inputs/input/config/id:
/qos/scheduler-policies/scheduler-policy/schedulers/scheduler/inputs/input/config/input-type:
/qos/scheduler-policies/scheduler-policy/schedulers/scheduler/inputs/input/config/queue:
/qos/scheduler-policies/scheduler-policy/schedulers/scheduler/inputs/input/config/weight:

## State paths:
/qos/forwarding-groups/forwarding-group/state/name:
/qos/forwarding-groups/forwarding-group/state/output-queue:
/qos/queues/queue/state/name:
/qos/classifiers/classifier/state/name:
/qos/classifiers/classifier/state/type:
/qos/classifiers/classifier/terms/term/actions/state/target-group:
/qos/classifiers/classifier/terms/term/conditions/ipv4/state/dscp-set:
/qos/classifiers/classifier/terms/term/conditions/ipv6/state/dscp-set:
/qos/classifiers/classifier/terms/term/state/id:
/qos/interfaces/interface/output/queues/queue/state/name:
/qos/interfaces/interface/input/classifiers/classifier/state/name:
/qos/interfaces/interface/output/scheduler-policy/state/name:
/qos/scheduler-policies/scheduler-policy/state/name:
/qos/scheduler-policies/scheduler-policy/schedulers/scheduler/state/priority:
/qos/scheduler-policies/scheduler-policy/schedulers/scheduler/state/sequence:
/qos/scheduler-policies/scheduler-policy/schedulers/scheduler/state/type:
/qos/scheduler-policies/scheduler-policy/schedulers/scheduler/inputs/input/state/id:
/qos/scheduler-policies/scheduler-policy/schedulers/scheduler/inputs/input/state/input-type:
/qos/scheduler-policies/scheduler-policy/schedulers/scheduler/inputs/input/state/queue:
/qos/scheduler-policies/scheduler-policy/schedulers/scheduler/inputs/input/state/weight:

rpcs:
gnmi:
gNMI.Set:
Replace:
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ platform_exceptions: {
vendor: JUNIPER
}
deviations: {
explicit_interface_ref_definition: true
qos_dropped_octets: true
scheduler_input_weight_limit: true
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -530,19 +530,11 @@ func TestMixedSPWrrTraffic(t *testing.T) {
var counterNames []string
counters := make(map[string]map[string]uint64)

if !deviations.QOSDroppedOctets(dut) {
counterNames = []string{
"ateOutPkts", "ateInPkts", "dutQosPktsBeforeTraffic", "dutQosOctetsBeforeTraffic",
"dutQosPktsAfterTraffic", "dutQosOctetsAfterTraffic", "dutQosDroppedPktsBeforeTraffic",
"dutQosDroppedOctetsBeforeTraffic", "dutQosDroppedPktsAfterTraffic",
"dutQosDroppedOctetsAfterTraffic",
}
} else {
counterNames = []string{
"ateOutPkts", "ateInPkts", "dutQosPktsBeforeTraffic", "dutQosOctetsBeforeTraffic",
"dutQosPktsAfterTraffic", "dutQosOctetsAfterTraffic", "dutQosDroppedPktsBeforeTraffic",
"dutQosDroppedPktsAfterTraffic",
}
counterNames = []string{
"ateOutPkts", "ateInPkts", "dutQosPktsBeforeTraffic", "dutQosOctetsBeforeTraffic",
"dutQosPktsAfterTraffic", "dutQosOctetsAfterTraffic", "dutQosDroppedPktsBeforeTraffic",
"dutQosDroppedOctetsBeforeTraffic", "dutQosDroppedPktsAfterTraffic",
"dutQosDroppedOctetsAfterTraffic",
}

for _, name := range counterNames {
Expand Down Expand Up @@ -576,13 +568,11 @@ func TestMixedSPWrrTraffic(t *testing.T) {
}
counters["dutQosDroppedPktsBeforeTraffic"][data.queue], _ = count.Val()

if !deviations.QOSDroppedOctets(dut) {
count, ok = gnmi.Watch(t, dut, gnmi.OC().Qos().Interface(dp3.Name()).Output().Queue(data.queue).DroppedOctets().State(), timeout, isPresent).Await(t)
if !ok {
t.Errorf("DroppedOctets count for queue %q on interface %q not available within %v", dp3.Name(), data.queue, timeout)
}
counters["dutQosDroppedOctetsBeforeTraffic"][data.queue], _ = count.Val()
count, ok = gnmi.Watch(t, dut, gnmi.OC().Qos().Interface(dp3.Name()).Output().Queue(data.queue).DroppedOctets().State(), timeout, isPresent).Await(t)
if !ok {
t.Errorf("DroppedOctets count for queue %q on interface %q not available within %v", dp3.Name(), data.queue, timeout)
}
counters["dutQosDroppedOctetsBeforeTraffic"][data.queue], _ = count.Val()
}

t.Logf("Running traffic 1 on DUT interfaces: %s => %s ", dp1.Name(), dp3.Name())
Expand All @@ -601,9 +591,7 @@ func TestMixedSPWrrTraffic(t *testing.T) {
counters["dutQosPktsAfterTraffic"][data.queue] = gnmi.Get(t, dut, gnmi.OC().Qos().Interface(dp3.Name()).Output().Queue(data.queue).TransmitPkts().State())
counters["dutQosOctetsAfterTraffic"][data.queue] = gnmi.Get(t, dut, gnmi.OC().Qos().Interface(dp3.Name()).Output().Queue(data.queue).TransmitOctets().State())
counters["dutQosDroppedPktsAfterTraffic"][data.queue] = gnmi.Get(t, dut, gnmi.OC().Qos().Interface(dp3.Name()).Output().Queue(data.queue).DroppedPkts().State())
if !deviations.QOSDroppedOctets(dut) {
counters["dutQosDroppedOctetsAfterTraffic"][data.queue] = gnmi.Get(t, dut, gnmi.OC().Qos().Interface(dp3.Name()).Output().Queue(data.queue).DroppedOctets().State())
}
counters["dutQosDroppedOctetsAfterTraffic"][data.queue] = gnmi.Get(t, dut, gnmi.OC().Qos().Interface(dp3.Name()).Output().Queue(data.queue).DroppedOctets().State())
t.Logf("ateInPkts: %v, txPkts %v, Queue: %v", counters["ateInPkts"][data.queue], counters["dutQosPktsAfterTraffic"][data.queue], data.queue)

// Calculate aggregated throughput:
Expand Down Expand Up @@ -666,14 +654,12 @@ func TestMixedSPWrrTraffic(t *testing.T) {
}
}

if !deviations.QOSDroppedOctets(dut) {
ateDropOctetCounterDiff := (counters["ateOutPkts"][data.queue] - counters["ateInPkts"][data.queue]) * uint64(data.frameSize)
dutDropOctetCounterDiff := counters["dutQosDroppedOctetsAfterTraffic"][data.queue] - counters["dutQosDroppedOctetsBeforeTraffic"][data.queue]
t.Logf("Queue %q: ateDropOctetCounterDiff: %v dutDropOctetCounterDiff: %v", data.queue, ateDropOctetCounterDiff, dutDropOctetCounterDiff)
if dutDropOctetCounterDiff < ateDropOctetCounterDiff {
if !deviations.DequeueDeleteNotCountedAsDrops(dut) {
t.Errorf("Get dutDropOctetCounterDiff for queue %q: got %v, want >= %v", data.queue, dutDropOctetCounterDiff, ateDropOctetCounterDiff)
}
ateDropOctetCounterDiff := (counters["ateOutPkts"][data.queue] - counters["ateInPkts"][data.queue]) * uint64(data.frameSize)
dutDropOctetCounterDiff := counters["dutQosDroppedOctetsAfterTraffic"][data.queue] - counters["dutQosDroppedOctetsBeforeTraffic"][data.queue]
t.Logf("Queue %q: ateDropOctetCounterDiff: %v dutDropOctetCounterDiff: %v", data.queue, ateDropOctetCounterDiff, dutDropOctetCounterDiff)
if dutDropOctetCounterDiff < ateDropOctetCounterDiff {
if !deviations.DequeueDeleteNotCountedAsDrops(dut) {
t.Errorf("Get dutDropOctetCounterDiff for queue %q: got %v, want >= %v", data.queue, dutDropOctetCounterDiff, ateDropOctetCounterDiff)
}
}

Expand Down
Loading

0 comments on commit 18512bb

Please sign in to comment.