Skip to content

Commit

Permalink
Added changes for RT5.6 as to set loopback mode to TERMINAL mode unde…
Browse files Browse the repository at this point in the history
…r deviation (openconfig#3015)

* updated from loopback mode FACILITY to TERMINAL

* updated readme to new supported yaml
  • Loading branch information
mastarkey authored Jun 11, 2024
1 parent bfba0f7 commit 42d28b4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,24 @@ Ensure Interface mode can be set to loopback mode and can be added as part of st
* Validate that port-1 operational status is “UP”.
* Validate on DUT that LAG interface status is “UP”.

## Config Parameter Coverage

* /interfaces/interface/config/loopback-mode
* /interfaces/interface/ethernet/config/port-speed
* /interfaces/interface/ethernet/config/duplex-mode
* /interfaces/interface/ethernet/config/aggregate-id
* /interfaces/interface/aggregation/config/lag-type
* /interfaces/interface/aggregation/config/min-links

## Telemetry Parameter Coverage

* /interfaces/interface/state/loopback-mode

## Protocol/RPC Parameter Coverage

None

## 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
openconfig_paths:
## Config paths
/interfaces/interface/config/loopback-mode:
/interfaces/interface/ethernet/config/port-speed:
/interfaces/interface/ethernet/config/duplex-mode:
/interfaces/interface/ethernet/config/aggregate-id:
/interfaces/interface/aggregation/config/lag-type:
/interfaces/interface/aggregation/config/min-links:

## Telemetry paths
/interfaces/interface/state/loopback-mode:

rpcs:
gnmi:
gNMI.Set:
gNMI.Subscribe:
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
package interface_loopback_aggregate_test

import (
"context"
"fmt"
"testing"
"time"
Expand All @@ -24,7 +23,6 @@ import (
"github.com/openconfig/featureprofiles/internal/attrs"
"github.com/openconfig/featureprofiles/internal/deviations"
"github.com/openconfig/featureprofiles/internal/fptest"
gpb "github.com/openconfig/gnmi/proto/gnmi"
"github.com/openconfig/ondatra"
"github.com/openconfig/ondatra/gnmi"
"github.com/openconfig/ondatra/gnmi/oc"
Expand Down Expand Up @@ -232,40 +230,9 @@ func TestInterfaceLoopbackMode(t *testing.T) {

t.Run("Configure interface loopback mode FACILITY on DUT AE interface", func(t *testing.T) {
if deviations.InterfaceLoopbackModeRawGnmi(dut) {
gpbSetRequest := &gpb.SetRequest{
Update: []*gpb.Update{{
Path: &gpb.Path{
Origin: "openconfig",
Elem: []*gpb.PathElem{
{
Name: "interfaces",
},
{
Name: "interface",
Key: map[string]string{
"name": dut.Port(t, "port1").Name(),
},
},
{
Name: "config",
},
{
Name: "loopback-mode",
},
},
},
Val: &gpb.TypedValue{
Value: &gpb.TypedValue_JsonIetfVal{
JsonIetfVal: []byte("true"),
},
},
}},
}
gnmiClient := dut.RawAPIs().GNMI(t)
_, err := gnmiClient.Set(context.Background(), gpbSetRequest)
if err != nil {
t.Errorf("Failed to update interface loopback mode")
}

gnmi.Update(t, dut, gnmi.OC().Interface(dutPort1.Name()).LoopbackMode().Config(), oc.Interfaces_LoopbackModeType_TERMINAL)

} else {
if deviations.MemberLinkLoopbackUnsupported(dut) {
gnmi.Update(t, dut, gnmi.OC().Interface(aggID).LoopbackMode().Config(), oc.Interfaces_LoopbackModeType_FACILITY)
Expand Down

0 comments on commit 42d28b4

Please sign in to comment.