Skip to content

Commit

Permalink
DP-1.14: Adding test support for Nokia (openconfig#2026)
Browse files Browse the repository at this point in the history
* DP-1.14: Adding test support for Nokia
  Following changes are made in this PR -
    1. Updating deviations in metadata file
    2. Updating test script to support Nokia
    3. Adding function (SetForwardingGroupWithFabricPriority) to configure ForwardingGroup with Fabric-priority in qoscfg.go

"This code is a Contribution to the OpenConfig Feature Profiles project ("Work") made under the Google Software Grant and Corporate Contributor License Agreement ("CLA") and governed by the Apache License 2.0. No other rights or licenses in or to any of Nokia's intellectual property are granted for any other purpose. This code is provided on an "as is" basis without any warranties of any kind."

Co-authored-by: Krishna Bovilla <[email protected]>

* Replacing fabric-priority configuration with queue-id as discussed in b/297188157

"This code is a Contribution to the OpenConfig Feature Profiles project ("Work") made under the Google Software Grant and Corporate Contributor License Agreement ("CLA") and governed by the Apache License 2.0. No other rights or licenses in or to any of Nokia's intellectual property are granted for any other purpose. This code is provided on an "as is" basis without any warranties of any kind."

---------

Co-authored-by: Krishna Bovilla <[email protected]>
Co-authored-by: Sergey Fomin <[email protected]>
  • Loading branch information
3 people authored Sep 8, 2023
1 parent d6f1ba2 commit 3277670
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 6 deletions.
4 changes: 3 additions & 1 deletion feature/qos/ate_tests/qos_basic_test/metadata.textproto
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ platform_exceptions: {
vendor: NOKIA
}
deviations: {
explicit_interface_ref_definition: true
interface_enabled: true
explicit_port_speed: true
explicit_interface_in_default_vrf: true
qos_octets: true
}
}
platform_exceptions: {
Expand Down
26 changes: 26 additions & 0 deletions feature/qos/ate_tests/qos_basic_test/qos_basic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,14 @@ func ConfigureDUTIntf(t *testing.T, dut *ondatra.DUTDevice) {
a := s.GetOrCreateAddress(intf.ipAddr)
a.PrefixLength = ygot.Uint8(intf.prefixLen)
gnmi.Replace(t, dut, gnmi.OC().Interface(intf.intfName).Config(), i)
if deviations.ExplicitInterfaceInDefaultVRF(dut) {
fptest.AssignToNetworkInstance(t, dut, intf.intfName, deviations.DefaultNetworkInstance(dut), 0)
}
}
if deviations.ExplicitPortSpeed(dut) {
fptest.SetPortSpeed(t, dp1)
fptest.SetPortSpeed(t, dp2)
fptest.SetPortSpeed(t, dp3)
}
}

Expand All @@ -525,6 +533,15 @@ func ConfigureQoS(t *testing.T, dut *ondatra.DUTDevice) {
q := d.GetOrCreateQos()
queues := netutil.CommonTrafficQueues(t, dut)

if dut.Vendor() == ondatra.NOKIA {
queueNames := []string{queues.NC1, queues.AF4, queues.AF3, queues.AF2, queues.AF1, queues.BE0, queues.BE1}
for i, queue := range queueNames {
q1 := q.GetOrCreateQueue(queue)
q1.Name = ygot.String(queue)
queueid := len(queueNames) - i
q1.QueueId = ygot.Uint8(uint8(queueid))
}
}
t.Logf("Create qos forwarding groups and queue name config")
forwardingGroups := []struct {
desc string
Expand Down Expand Up @@ -893,19 +910,28 @@ func ConfigureQoS(t *testing.T, dut *ondatra.DUTDevice) {
ecnProfile: "ECNProfile",
}}

maxBurstSize := uint32(268435456)
t.Logf("qos output interface config: %v", schedulerIntfs)
for _, tc := range schedulerIntfs {
i := q.GetOrCreateInterface(dp3.Name())
i.SetInterfaceId(dp3.Name())
i.GetOrCreateInterfaceRef().Interface = ygot.String(dp3.Name())
output := i.GetOrCreateOutput()
schedulerPolicy := output.GetOrCreateSchedulerPolicy()
schedulerPolicy.SetName(tc.scheduler)
queue := output.GetOrCreateQueue(tc.queueName)
queue.SetName(tc.queueName)
queue.SetQueueManagementProfile(tc.ecnProfile)
if dut.Vendor() == ondatra.NOKIA {
bufferAllocation := q.GetOrCreateBufferAllocationProfile("ballocprofile")
bq := bufferAllocation.GetOrCreateQueue(tc.queueName)
bq.SetStaticSharedBufferLimit(maxBurstSize)
output.SetBufferAllocationProfile("ballocprofile")
}
gnmi.Replace(t, dut, gnmi.OC().Qos().Config(), q)
}
}

func ConfigureCiscoQos(t *testing.T, dut *ondatra.DUTDevice) {
t.Helper()
dp1 := dut.Port(t, "port1")
Expand Down
4 changes: 3 additions & 1 deletion feature/qos/otg_tests/qos_basic_test/metadata.textproto
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ platform_exceptions: {
vendor: NOKIA
}
deviations: {
explicit_interface_ref_definition: true
interface_enabled: true
explicit_port_speed: true
explicit_interface_in_default_vrf: true
qos_octets: true
}
}
platform_exceptions: {
Expand Down
29 changes: 25 additions & 4 deletions feature/qos/otg_tests/qos_basic_test/qos_basic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,14 @@ func ConfigureDUTIntf(t *testing.T, dut *ondatra.DUTDevice) {
a := s.GetOrCreateAddress(intf.ipAddr)
a.PrefixLength = ygot.Uint8(intf.prefixLen)
gnmi.Replace(t, dut, gnmi.OC().Interface(intf.intfName).Config(), i)
if deviations.ExplicitInterfaceInDefaultVRF(dut) {
fptest.AssignToNetworkInstance(t, dut, intf.intfName, deviations.DefaultNetworkInstance(dut), 0)
}
}
if deviations.ExplicitPortSpeed(dut) {
fptest.SetPortSpeed(t, dp1)
fptest.SetPortSpeed(t, dp2)
fptest.SetPortSpeed(t, dp3)
}
}

Expand All @@ -587,6 +595,15 @@ func ConfigureQoS(t *testing.T, dut *ondatra.DUTDevice) {
q := d.GetOrCreateQos()
queues := netutil.CommonTrafficQueues(t, dut)

if dut.Vendor() == ondatra.NOKIA {
queueNames := []string{queues.NC1, queues.AF4, queues.AF3, queues.AF2, queues.AF1, queues.BE0, queues.BE1}
for i, queue := range queueNames {
q1 := q.GetOrCreateQueue(queue)
q1.Name = ygot.String(queue)
queueid := len(queueNames) - i
q1.QueueId = ygot.Uint8(uint8(queueid))
}
}
t.Logf("Create qos forwarding groups and queue name config")
forwardingGroups := []struct {
desc string
Expand All @@ -596,10 +613,6 @@ func ConfigureQoS(t *testing.T, dut *ondatra.DUTDevice) {
desc: "forwarding-group-BE1",
queueName: queues.BE1,
targetGroup: "target-group-BE1",
}, {
desc: "forwarding-group-BE0",
queueName: queues.BE0,
targetGroup: "target-group-BE0",
}, {
desc: "forwarding-group-AF1",
queueName: queues.AF1,
Expand Down Expand Up @@ -955,16 +968,24 @@ func ConfigureQoS(t *testing.T, dut *ondatra.DUTDevice) {
ecnProfile: "ECNProfile",
}}

maxBurstSize := uint32(268435456)
t.Logf("qos output interface config: %v", schedulerIntfs)
for _, tc := range schedulerIntfs {
i := q.GetOrCreateInterface(dp3.Name())
i.SetInterfaceId(dp3.Name())
i.GetOrCreateInterfaceRef().Interface = ygot.String(dp3.Name())
output := i.GetOrCreateOutput()
schedulerPolicy := output.GetOrCreateSchedulerPolicy()
schedulerPolicy.SetName(tc.scheduler)
queue := output.GetOrCreateQueue(tc.queueName)
queue.SetName(tc.queueName)
queue.SetQueueManagementProfile(tc.ecnProfile)
if dut.Vendor() == ondatra.NOKIA {
bufferAllocation := q.GetOrCreateBufferAllocationProfile("ballocprofile")
bq := bufferAllocation.GetOrCreateQueue(tc.queueName)
bq.SetStaticSharedBufferLimit(maxBurstSize)
output.SetBufferAllocationProfile("ballocprofile")
}
gnmi.Replace(t, dut, gnmi.OC().Qos().Config(), q)
}
}
Expand Down

0 comments on commit 3277670

Please sign in to comment.