From 4ba773741b814a6c70cdbff760c51134f10d13ff Mon Sep 17 00:00:00 2001 From: basavarajnokia Date: Fri, 9 Aug 2024 13:04:50 +0530 Subject: [PATCH] Fixed gNMI1.27 (#3351) * - Corrected TestGNMISampleMode as per README - Added Deviation - Fixed testbed association in metadata.textproto "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\u2019s intellectual property are granted for any other purpose. This code is provided on an "as is" basis without any warranties of any kind." * - "gNMI-1.27" - Changed to Logf before config - Added Deviation - Fixed testbed association in metadata.textproto - Updated README with OC paths "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\u2019s intellectual property are granted for any other purpose. This code is provided on an "as is" basis without any warranties of any kind." * Removed lines 38-47 as per comment from Sergey Fomin as it is a no-op. --- .../tests/gnmi_sample_mode_test/README.md | 7 ++++++- .../gnmi_sample_mode_test.go | 15 +++------------ .../gnmi_sample_mode_test/metadata.textproto | 10 +++++++++- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/feature/gnmi/subscribe/tests/gnmi_sample_mode_test/README.md b/feature/gnmi/subscribe/tests/gnmi_sample_mode_test/README.md index efeacde8591..cc08bec8a9b 100644 --- a/feature/gnmi/subscribe/tests/gnmi_sample_mode_test/README.md +++ b/feature/gnmi/subscribe/tests/gnmi_sample_mode_test/README.md @@ -44,10 +44,15 @@ Test to validate basic gNMI streaming telemetry works with `SAMPLE` mode. The below yaml defines the OC paths intended to be covered by this test. OC paths used for test setup are not listed here. -TODO(OCPATHS): Add paths ```yaml + paths: +## Config Paths ## +/interfaces/interface/config/description: + +## State Paths ## +/interfaces/interface/state/description: rpcs: gnmi: diff --git a/feature/gnmi/subscribe/tests/gnmi_sample_mode_test/gnmi_sample_mode_test.go b/feature/gnmi/subscribe/tests/gnmi_sample_mode_test/gnmi_sample_mode_test.go index 1b31e0a73d4..e7f72c9e4ea 100644 --- a/feature/gnmi/subscribe/tests/gnmi_sample_mode_test/gnmi_sample_mode_test.go +++ b/feature/gnmi/subscribe/tests/gnmi_sample_mode_test/gnmi_sample_mode_test.go @@ -35,24 +35,14 @@ func TestGNMISampleMode(t *testing.T) { p1Stream := samplestream.New(t, dut, gnmi.OC().Interface(p1.Name()).Description().State(), 10*time.Second) defer p1Stream.Close() - desc := p1Stream.Next() - if desc == nil { - t.Errorf("Interface %q telemetry not received before config", p1.Name()) - } else { - v, ok := desc.Val() - if !ok { - t.Errorf("Interface %q telemetry empty before config", p1.Name()) - } - t.Logf("Description before config: %s", v) - } - gnmi.Replace(t, dut, gnmi.OC().Interface(p1.Name()).Config(), dutPort1.NewOCInterface(p1.Name(), dut)) - desc = p1Stream.Next() + desc := p1Stream.Next() if desc == nil { t.Errorf("Interface %q telemetry not received after config", p1.Name()) } else { v, ok := desc.Val() + t.Logf("Description from stream : %s", v) if !ok { t.Errorf("Interface %q telemetry empty after config", p1.Name()) } @@ -69,6 +59,7 @@ func TestGNMISampleMode(t *testing.T) { t.Errorf("Interface %q telemetry not received after description update", p1.Name()) } else { v, ok := desc.Val() + t.Logf("Description from stream : %s", v) if !ok { t.Errorf("Interface %q telemetry empty after description update", p1.Name()) } diff --git a/feature/gnmi/subscribe/tests/gnmi_sample_mode_test/metadata.textproto b/feature/gnmi/subscribe/tests/gnmi_sample_mode_test/metadata.textproto index 87d02fedf47..9f4c6a67ba7 100644 --- a/feature/gnmi/subscribe/tests/gnmi_sample_mode_test/metadata.textproto +++ b/feature/gnmi/subscribe/tests/gnmi_sample_mode_test/metadata.textproto @@ -4,7 +4,7 @@ uuid: "abcc6890-c3e1-4b0e-984e-749c85b54e5a" plan_id: "gNMI-1.27" description: "gNMI Sample Mode Test" -testbed: TESTBED_DUT +testbed: TESTBED_DUT_ATE_2LINKS platform_exceptions: { platform: { vendor: ARISTA @@ -18,3 +18,11 @@ platform_exceptions: { isis_interface_afi_unsupported: true } } +platform_exceptions: { + platform: { + vendor: NOKIA + } + deviations: { + explicit_interface_in_default_vrf: true + } +}