From 42d28b435383f5dd3b6f9c8d34b9948dbd1d7fa8 Mon Sep 17 00:00:00 2001 From: Matthew Starkey <157065700+mastarkey@users.noreply.github.com> Date: Mon, 10 Jun 2024 22:58:53 -0700 Subject: [PATCH] Added changes for RT5.6 as to set loopback mode to TERMINAL mode under deviation (#3015) * updated from loopback mode FACILITY to TERMINAL * updated readme to new supported yaml --- .../interface_loopback_aggregate/README.md | 41 ++++++++++--------- .../interface_loopback_aggregate_test.go | 39 ++---------------- 2 files changed, 24 insertions(+), 56 deletions(-) diff --git a/feature/experimental/interface/interface_loopback_aggregate/otg_tests/interface_loopback_aggregate/README.md b/feature/experimental/interface/interface_loopback_aggregate/otg_tests/interface_loopback_aggregate/README.md index c3996d72bcf..aea9ddcf069 100644 --- a/feature/experimental/interface/interface_loopback_aggregate/otg_tests/interface_loopback_aggregate/README.md +++ b/feature/experimental/interface/interface_loopback_aggregate/otg_tests/interface_loopback_aggregate/README.md @@ -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: diff --git a/feature/experimental/interface/interface_loopback_aggregate/otg_tests/interface_loopback_aggregate/interface_loopback_aggregate_test.go b/feature/experimental/interface/interface_loopback_aggregate/otg_tests/interface_loopback_aggregate/interface_loopback_aggregate_test.go index 7b5eb91c7ea..8e31b1550d0 100644 --- a/feature/experimental/interface/interface_loopback_aggregate/otg_tests/interface_loopback_aggregate/interface_loopback_aggregate_test.go +++ b/feature/experimental/interface/interface_loopback_aggregate/otg_tests/interface_loopback_aggregate/interface_loopback_aggregate_test.go @@ -15,7 +15,6 @@ package interface_loopback_aggregate_test import ( - "context" "fmt" "testing" "time" @@ -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" @@ -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)