From 530b9a3483f837eeb82f6cfde8beb3b38dc15ceb Mon Sep 17 00:00:00 2001 From: yini101 <86263319+yini101@users.noreply.github.com> Date: Wed, 7 Aug 2024 23:04:14 -0700 Subject: [PATCH 1/7] RT-7.11: Remove deviation skip_prefix_set_mode (#3311) RT-7.11: Remove deviation skip_prefix_set_mode --- .../otg_tests/import_export_multi_test/metadata.textproto | 1 - 1 file changed, 1 deletion(-) diff --git a/feature/bgp/policybase/otg_tests/import_export_multi_test/metadata.textproto b/feature/bgp/policybase/otg_tests/import_export_multi_test/metadata.textproto index 64ea71ae4e6..ec09b76414c 100644 --- a/feature/bgp/policybase/otg_tests/import_export_multi_test/metadata.textproto +++ b/feature/bgp/policybase/otg_tests/import_export_multi_test/metadata.textproto @@ -19,7 +19,6 @@ platform_exceptions: { skip_set_rp_match_set_options: true bgp_community_set_refs_unsupported: true bgp_conditions_match_community_set_unsupported: true - skip_prefix_set_mode: true bgp_community_member_is_a_string: true skip_bgp_send_community_type: true } From 38aa9ad9849237fe84a6b740953c3ba929beec91 Mon Sep 17 00:00:00 2001 From: bkreddy143 <127771656+bkreddy143@users.noreply.github.com> Date: Fri, 9 Aug 2024 02:43:33 -0400 Subject: [PATCH 2/7] Added missing deviation and resource name for Nokia (#3305) * Adding missign deviations for nokia 1. Modifed to verify utilization status for all active Integrate Circuits 2. Added deviations required for Nokia 3. update Nokia Fib resource name "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." * Removed speed deviation * corrected error messages --- .../utilization_test/metadata.textproto | 9 +++++ .../utilization_test/utilization_test.go | 34 ++++--------------- internal/components/components.go | 22 ++++++++++++ 3 files changed, 37 insertions(+), 28 deletions(-) diff --git a/feature/platform/integrated_circuit/otg_tests/utilization_test/metadata.textproto b/feature/platform/integrated_circuit/otg_tests/utilization_test/metadata.textproto index 1fe40a1b24b..45d28a4dcdf 100644 --- a/feature/platform/integrated_circuit/otg_tests/utilization_test/metadata.textproto +++ b/feature/platform/integrated_circuit/otg_tests/utilization_test/metadata.textproto @@ -17,4 +17,13 @@ platform_exceptions: { missing_hardware_resource_telemetry_before_config: true } } +platform_exceptions: { + platform: { + vendor: NOKIA + } + deviations: { + explicit_interface_in_default_vrf: true + interface_enabled: true + } +} tags: TAGS_TRANSIT diff --git a/feature/platform/integrated_circuit/otg_tests/utilization_test/utilization_test.go b/feature/platform/integrated_circuit/otg_tests/utilization_test/utilization_test.go index c0cbe08e166..db1719b5c3f 100644 --- a/feature/platform/integrated_circuit/otg_tests/utilization_test/utilization_test.go +++ b/feature/platform/integrated_circuit/otg_tests/utilization_test/utilization_test.go @@ -20,6 +20,7 @@ import ( "github.com/open-traffic-generator/snappi/gosnappi" "github.com/openconfig/featureprofiles/internal/attrs" + "github.com/openconfig/featureprofiles/internal/components" "github.com/openconfig/featureprofiles/internal/deviations" "github.com/openconfig/featureprofiles/internal/fptest" "github.com/openconfig/featureprofiles/internal/otgutils" @@ -45,6 +46,7 @@ const ( var ( fibResource = map[ondatra.Vendor]string{ ondatra.ARISTA: "Routing/Resource6", + ondatra.NOKIA: "ip-lpm-routes", } dutPort1 = attrs.Attributes{ Desc: "dutPort1", @@ -105,46 +107,22 @@ func TestResourceUtilization(t *testing.T) { otgV6Peer, otgPort1, otgConfig := configureOTG(t, otg) verifyBgpTelemetry(t, dut) - - val, ok := gnmi.Watch(t, dut, gnmi.OC().System().Utilization().Resource(fibResource[dut.Vendor()]).ActiveComponentList().State(), time.Minute, func(v *ygnmi.Value[[]string]) bool { - cs, present := v.Val() - return present && len(cs) > 0 - }).Await(t) - if !ok { - switch { - case deviations.MissingHardwareResourceTelemetryBeforeConfig(dut): - t.Log("FIB resource is not active in any available components") - default: - t.Fatalf("FIB resource is not active in any available components") - } - } - comps, _ := val.Val() - gnmi.Replace(t, dut, gnmi.OC().System().Utilization().Resource(fibResource[dut.Vendor()]).Config(), &oc.System_Utilization_Resource{ Name: ygot.String(fibResource[dut.Vendor()]), UsedThresholdUpper: ygot.Uint8(usedThresholdUpper), UsedThresholdUpperClear: ygot.Uint8(usedThresholdUpperClear), }) - - val, ok = gnmi.Watch(t, dut, gnmi.OC().System().Utilization().Resource(fibResource[dut.Vendor()]).ActiveComponentList().State(), time.Minute, func(v *ygnmi.Value[[]string]) bool { - cs, present := v.Val() - return present && len(cs) > 0 - }).Await(t) - if !ok { - t.Fatalf("FIB resource is not active in any available components") - } - comps, _ = val.Val() - + comps := components.FindActiveComponentsByType(t, dut, oc.PlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_INTEGRATED_CIRCUIT) beforeUtzs := componentUtilizations(t, dut, comps) if len(beforeUtzs) != len(comps) { - t.Fatalf("Couldn't retrieve Utilization information for all Components in active-component-list") + t.Fatalf("Couldn't retrieve Utilization information for all Active Components") } injectBGPRoutes(t, otg, otgV6Peer, otgPort1, otgConfig) afterUtzs := componentUtilizations(t, dut, comps) if len(afterUtzs) != len(comps) { - t.Fatalf("Couldn't retrieve Utilization information for all Components in active-component-list") + t.Fatalf("Couldn't retrieve Utilization information for all Active Components") } t.Run("Utilization after BGP route installation", func(t *testing.T) { @@ -162,7 +140,7 @@ func TestResourceUtilization(t *testing.T) { afterClearUtzs := componentUtilizations(t, dut, comps) if len(afterClearUtzs) != len(comps) { - t.Fatalf("Couldn't retrieve Utilization information for all Components in active-component-list") + t.Fatalf("Couldn't retrieve Utilization information for all Active Components") } t.Run("Utilization after BGP route clear", func(t *testing.T) { diff --git a/internal/components/components.go b/internal/components/components.go index a3d6b90a304..6878df539d0 100644 --- a/internal/components/components.go +++ b/internal/components/components.go @@ -58,6 +58,28 @@ func FindComponentsByType(t *testing.T, dut *ondatra.DUTDevice, cType oc.E_Platf return s } +// FindActiveComponentsByType finds the list of active components based on hardware type. +func FindActiveComponentsByType(t *testing.T, dut *ondatra.DUTDevice, cType oc.E_PlatformTypes_OPENCONFIG_HARDWARE_COMPONENT) []string { + components := gnmi.GetAll[*oc.Component](t, dut, gnmi.OC().ComponentAny().State()) + var s []string + for _, c := range components { + if c.GetType() == nil { + t.Logf("Component %s type is missing from telemetry", c.GetName()) + continue + } + t.Logf("Component %s has type: %v", c.GetName(), c.GetType()) + switch v := c.GetType().(type) { + case oc.E_PlatformTypes_OPENCONFIG_HARDWARE_COMPONENT: + if v == cType && c.OperStatus == oc.PlatformTypes_COMPONENT_OPER_STATUS_ACTIVE { + s = append(s, c.GetName()) + } + default: + t.Logf("Detected non-hardware component: (%T, %v)", c.GetType(), c.GetType()) + } + } + return s +} + // FindSWComponentsByType finds the list of SW components based on a type. func FindSWComponentsByType(t *testing.T, dut *ondatra.DUTDevice, cType oc.E_PlatformTypes_OPENCONFIG_SOFTWARE_COMPONENT) []string { components := gnmi.GetAll[*oc.Component](t, dut, gnmi.OC().ComponentAny().State()) From 85f4edf958ed8f350b2a8739c454d6b8a278c237 Mon Sep 17 00:00:00 2001 From: basavarajnokia Date: Fri, 9 Aug 2024 13:04:50 +0530 Subject: [PATCH 3/7] 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 + } +} From 5d1cfeb0fb965da3e18aba550ef97ed4e1c7b11b Mon Sep 17 00:00:00 2001 From: Marc Charlebois <105758144+MarcCharlebois@users.noreply.github.com> Date: Fri, 9 Aug 2024 03:02:44 -0700 Subject: [PATCH 4/7] RT-1.53 fix (#3327) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - delete pfx2 from var as it was never "replaced" - add deviation --- 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. --- .../otg_tests/prefix_set_test/metadata.textproto | 8 ++++++++ .../otg_tests/prefix_set_test/prefix_set_test.go | 15 ++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/feature/experimental/policy/otg_tests/prefix_set_test/metadata.textproto b/feature/experimental/policy/otg_tests/prefix_set_test/metadata.textproto index e9f4e28871f..b47a1749263 100644 --- a/feature/experimental/policy/otg_tests/prefix_set_test/metadata.textproto +++ b/feature/experimental/policy/otg_tests/prefix_set_test/metadata.textproto @@ -5,3 +5,11 @@ uuid: "619040ac-21a0-403f-b38e-6d5d0aed433a" plan_id: "RT-1.53" description: "prefix-list test" testbed: TESTBED_DUT +platform_exceptions: { + platform: { + vendor: NOKIA + } + deviations: { + skip_prefix_set_mode: true + } + } \ No newline at end of file diff --git a/feature/experimental/policy/otg_tests/prefix_set_test/prefix_set_test.go b/feature/experimental/policy/otg_tests/prefix_set_test/prefix_set_test.go index 9d77d9e1a59..7dab71b0d34 100644 --- a/feature/experimental/policy/otg_tests/prefix_set_test/prefix_set_test.go +++ b/feature/experimental/policy/otg_tests/prefix_set_test/prefix_set_test.go @@ -18,6 +18,7 @@ import ( "context" "testing" + "github.com/openconfig/featureprofiles/internal/deviations" "github.com/openconfig/featureprofiles/internal/fptest" "github.com/openconfig/featureprofiles/internal/helpers" "github.com/openconfig/ondatra" @@ -47,7 +48,9 @@ func TestPrefixSet(t *testing.T) { // create a prefix-set with 2 prefixes v4PrefixSet := ds.GetOrCreatePrefixSet(prefixSetA) - v4PrefixSet.SetMode(oc.PrefixSet_Mode_IPV4) + if !deviations.SkipPrefixSetMode(dut) { + v4PrefixSet.SetMode(oc.PrefixSet_Mode_IPV4) + } v4PrefixSet.GetOrCreatePrefix(pfx1, mskLen) v4PrefixSet.GetOrCreatePrefix(pfx2, mskLen) @@ -64,9 +67,12 @@ func TestPrefixSet(t *testing.T) { // replace the prefix-set by replacing an existing prefix with new prefix v4PrefixSet = ds.GetOrCreatePrefixSet(prefixSetA) - v4PrefixSet.SetMode(oc.PrefixSet_Mode_IPV4) + if !deviations.SkipPrefixSetMode(dut) { + v4PrefixSet.SetMode(oc.PrefixSet_Mode_IPV4) + } v4PrefixSet.GetOrCreatePrefix(pfx1, mskLen) v4PrefixSet.GetOrCreatePrefix(pfx3, mskLen) + v4PrefixSet.DeletePrefix(pfx2, mskLen) gnmi.Replace(t, dut, gnmi.OC().RoutingPolicy().DefinedSets().PrefixSet(prefixSetA).Config(), v4PrefixSet) prefixSet = gnmi.Get[*oc.RoutingPolicy_DefinedSets_PrefixSet](t, dut, gnmi.OC().RoutingPolicy().DefinedSets().PrefixSet(prefixSetA).State()) @@ -81,10 +87,13 @@ func TestPrefixSet(t *testing.T) { // replace the prefix-set with 2 existing and a new prefix v4PrefixSet = ds.GetOrCreatePrefixSet(prefixSetA) - v4PrefixSet.SetMode(oc.PrefixSet_Mode_IPV4) + if !deviations.SkipPrefixSetMode(dut) { + v4PrefixSet.SetMode(oc.PrefixSet_Mode_IPV4) + } v4PrefixSet.GetOrCreatePrefix(pfx1, mskLen) v4PrefixSet.GetOrCreatePrefix(pfx3, mskLen) v4PrefixSet.GetOrCreatePrefix(pfx4, mskLen) + v4PrefixSet.DeletePrefix(pfx2, mskLen) gnmi.Replace(t, dut, gnmi.OC().RoutingPolicy().DefinedSets().PrefixSet(prefixSetA).Config(), v4PrefixSet) prefixSet = gnmi.Get[*oc.RoutingPolicy_DefinedSets_PrefixSet](t, dut, gnmi.OC().RoutingPolicy().DefinedSets().PrefixSet(prefixSetA).State()) From 2b9dff20ea62cece2e7bcc57a109d613706a81f9 Mon Sep 17 00:00:00 2001 From: Tushar Rathod <111466464+trathod1@users.noreply.github.com> Date: Fri, 9 Aug 2024 07:57:54 -0400 Subject: [PATCH 5/7] GNMI1dot18: Skipping power-admin configuration for empty fabric slot (#2974) "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." --- .../sampled_backplane_capacity_counters_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/feature/platform/fabric/otg_tests/sampled_backplane_capacity_counters_test/sampled_backplane_capacity_counters_test.go b/feature/platform/fabric/otg_tests/sampled_backplane_capacity_counters_test/sampled_backplane_capacity_counters_test.go index 3e7f39995df..33dcb791517 100644 --- a/feature/platform/fabric/otg_tests/sampled_backplane_capacity_counters_test/sampled_backplane_capacity_counters_test.go +++ b/feature/platform/fabric/otg_tests/sampled_backplane_capacity_counters_test/sampled_backplane_capacity_counters_test.go @@ -126,6 +126,11 @@ func TestOnChangeBackplaneCapacityCounters(t *testing.T) { fc := (len(fabrics) / 2) + 1 for _, f := range fabrics[:fc] { + empty, ok := gnmi.Lookup(t, dut, gnmi.OC().Component(f).Empty().State()).Val() + if ok && empty { + t.Logf("Fabric Component %s is empty, hence skipping", f) + continue + } gnmi.Replace(t, dut, gnmi.OC().Component(f).Fabric().PowerAdminState().Config(), oc.Platform_ComponentPowerType_POWER_DISABLED) gnmi.Await(t, dut, gnmi.OC().Component(f).Fabric().PowerAdminState().State(), time.Minute, oc.Platform_ComponentPowerType_POWER_DISABLED) } @@ -134,6 +139,11 @@ func TestOnChangeBackplaneCapacityCounters(t *testing.T) { ts2, tocs2, apct2 := getBackplaneCapacityCounters(t, dut, ics) for _, f := range fabrics[:fc] { + empty, ok := gnmi.Lookup(t, dut, gnmi.OC().Component(f).Empty().State()).Val() + if ok && empty { + t.Logf("Fabric Component %s is empty, hence skipping", f) + continue + } gnmi.Replace(t, dut, gnmi.OC().Component(f).Fabric().PowerAdminState().Config(), oc.Platform_ComponentPowerType_POWER_ENABLED) if deviations.MissingValueForDefaults(dut) { time.Sleep(time.Minute) From dc7c060c36310cfc2d415ae8cd2a0993f164f644 Mon Sep 17 00:00:00 2001 From: bkreddy143 <127771656+bkreddy143@users.noreply.github.com> Date: Mon, 12 Aug 2024 06:04:11 -0400 Subject: [PATCH 6/7] Fixed error in NH addition (#3370) Next-hop needs to be either interface-ref + MAC or IP , it cant be interface-ref+IP "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." --- .../gribigo_compliance_test/gribigo_compliance_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feature/gribi/otg_tests/gribigo_compliance_test/gribigo_compliance_test.go b/feature/gribi/otg_tests/gribigo_compliance_test/gribigo_compliance_test.go index d886e79bc47..1792e620550 100644 --- a/feature/gribi/otg_tests/gribigo_compliance_test/gribigo_compliance_test.go +++ b/feature/gribi/otg_tests/gribigo_compliance_test/gribigo_compliance_test.go @@ -331,7 +331,7 @@ func addNHGReferencingToDownPort(tcArgs *testArgs, wantACK fluent.ProgrammingRes tcArgs.client.Modify().AddEntry(t, fluent.NextHopEntry().WithNetworkInstance(deviations.DefaultNetworkInstance(tcArgs.dut)). - WithIndex(2000).WithInterfaceRef(p.Name()).WithIPAddress(atePort2.IPv4), + WithIndex(2000).WithIPAddress(atePort2.IPv4), fluent.NextHopGroupEntry().WithNetworkInstance(deviations.DefaultNetworkInstance(tcArgs.dut)). WithID(2000).AddNextHop(2000, 1), fluent.IPv4Entry().WithNetworkInstance(deviations.DefaultNetworkInstance(tcArgs.dut)). From 67b67817e13b6c2bfb664f042b4788172b20d47c Mon Sep 17 00:00:00 2001 From: bkreddy143 <127771656+bkreddy143@users.noreply.github.com> Date: Mon, 12 Aug 2024 07:26:50 -0400 Subject: [PATCH 7/7] corrected deviation usage and isis await timeout (#3304) * corrected deviaiton usage,isis await time increase 1. Added additional check to verify no adjancies presence when state information missing after session timedout 2. Corrected use of deviaiton as per PR 3. Modified Await timeout to 90 seconds to accomidated 3 hello packets drop time "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." * update to test get MAC from ATE arp --- ...ggregate_all_not_forwarding_viable_test.go | 24 ++++++++++++------- .../metadata.textproto | 2 +- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/feature/interface/aggregate/otg_tests/aggregate_all_not_viable_test/aggregate_all_not_forwarding_viable_test.go b/feature/interface/aggregate/otg_tests/aggregate_all_not_viable_test/aggregate_all_not_forwarding_viable_test.go index 81157a8e260..48cacf68dd8 100644 --- a/feature/interface/aggregate/otg_tests/aggregate_all_not_viable_test/aggregate_all_not_forwarding_viable_test.go +++ b/feature/interface/aggregate/otg_tests/aggregate_all_not_viable_test/aggregate_all_not_forwarding_viable_test.go @@ -176,13 +176,15 @@ func TestAggregateAllNotForwardingViable(t *testing.T) { changeMetric(t, dut, aggIDs[2], 30) top := configureATE(t, ate) installGRIBIRoutes(t, dut, ate, top) - flows := createFlows(t, dut, top, aggIDs) ate.OTG().PushConfig(t, top) ate.OTG().StartProtocols(t) for _, aggID := range aggIDs { - gnmi.Await(t, dut, gnmi.OC().Interface(aggID).OperStatus().State(), 30*time.Second, oc.Interface_OperStatus_UP) + gnmi.Await(t, dut, gnmi.OC().Interface(aggID).OperStatus().State(), 60*time.Second, oc.Interface_OperStatus_UP) } + flows := createFlows(t, ate, top) + ate.OTG().PushConfig(t, top) + ate.OTG().StartProtocols(t) for _, agg := range []*aggPortData{agg1, agg2, agg3} { bgpPath := ocpath.Root().NetworkInstance(deviations.DefaultNetworkInstance(dut)).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP").Bgp() gnmi.Await(t, dut, bgpPath.Neighbor(agg.ateIPv4).SessionState().State(), time.Minute, oc.Bgp_Neighbor_SessionState_ESTABLISHED) @@ -215,7 +217,9 @@ func TestAggregateAllNotForwardingViable(t *testing.T) { // Ensure ISIS Adjacency is Down on LAG_2 if ok := awaitAdjacency(t, dut, aggIDs[1], oc.Isis_IsisInterfaceAdjState_DOWN); !ok { - t.Fatal("ISIS Adjacency is Established on LAG_2") + if presence := gnmi.LookupAll(t, dut, ocpath.Root().NetworkInstance(deviations.DefaultNetworkInstance(dut)).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_ISIS, isisInstance).Isis().Interface(aggIDs[1]).LevelAny().AdjacencyAny().AdjacencyState().State()); len(presence) > 0 { + t.Fatalf("ISIS Adjacency is Established on LAG_2 ") + } } startTraffic(t, dut, ate, top) if err := confirmNonViableForwardingTraffic(t, dut, ate, atePortList[1:agg2.ateLagCount+1], dutPortList[1:agg2.ateLagCount+1]); err != nil { @@ -292,7 +296,9 @@ func TestAggregateAllNotForwardingViable(t *testing.T) { configForwardingViable(t, dut, dutPortList[1:2], false) // Ensure ISIS Adjacency is Down on LAG_2 if ok := awaitAdjacency(t, dut, aggIDs[1], oc.Isis_IsisInterfaceAdjState_DOWN); !ok { - t.Fatal("ISIS Adjacency is Established on LAG_2") + if presence := gnmi.LookupAll(t, dut, ocpath.Root().NetworkInstance(deviations.DefaultNetworkInstance(dut)).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_ISIS, isisInstance).Isis().Interface(aggIDs[1]).LevelAny().AdjacencyAny().AdjacencyState().State()); len(presence) > 0 { + t.Fatalf("ISIS Adjacency is Established on LAG_2") + } } startTraffic(t, dut, ate, top) if err := confirmNonViableForwardingTraffic(t, dut, ate, atePortList[1:(agg2.ateLagCount+1)], dutPortList[1:(agg2.ateLagCount+1)]); err != nil { @@ -394,7 +400,7 @@ func configureDUT(t *testing.T, dut *ondatra.DUTDevice) []string { configureRoutingPolicy(t, dut) configureDUTISIS(t, dut, aggIDs) - if deviations.MaxEcmpPaths(dut) { + if !deviations.MaxEcmpPaths(dut) { isisPath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_ISIS, isisInstance).Isis() gnmi.Update(t, dut, isisPath.Global().MaxEcmpPaths().Config(), 2) } @@ -805,9 +811,9 @@ func incrementMAC(mac string, i int) (string, error) { return newMac.String(), nil } -func createFlows(t *testing.T, dut *ondatra.DUTDevice, top gosnappi.Config, aggIDs []string) []gosnappi.Flow { - for _, aggID := range aggIDs { - dutAggMac = append(dutAggMac, gnmi.Get(t, dut, gnmi.OC().Lacp().Interface(aggID).SystemIdMac().State())) +func createFlows(t *testing.T, ate *ondatra.ATEDevice, top gosnappi.Config) []gosnappi.Flow { + for _, aggID := range []*aggPortData{agg1, agg2, agg3} { + dutAggMac = append(dutAggMac, gnmi.Get(t, ate.OTG(), gnmi.OTG().Interface(aggID.ateAggName+".Eth").Ipv4Neighbor(aggID.dutIPv4).LinkLayerAddress().State())) } f1V4 := configureFlows(t, top, pfx1AdvV4, pfx2AdvV4, "pfx1ToPfx2_3", agg1, []*aggPortData{agg2, agg3}, dutAggMac[0], ipRange[1]) f2V4 := configureFlows(t, top, pfx1AdvV4, pfx4AdvV4, "pfx1ToPfx4", agg1, []*aggPortData{agg2, agg3}, dutAggMac[0], ipRange[0]) @@ -958,7 +964,7 @@ func awaitAdjacency(t *testing.T, dut *ondatra.DUTDevice, intfName string, state isisPath := ocpath.Root().NetworkInstance(deviations.DefaultNetworkInstance(dut)).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_ISIS, isisInstance).Isis() intf := isisPath.Interface(intfName) query := intf.LevelAny().AdjacencyAny().AdjacencyState().State() - _, ok := gnmi.WatchAll(t, dut, query, time.Minute, func(val *ygnmi.Value[oc.E_Isis_IsisInterfaceAdjState]) bool { + _, ok := gnmi.WatchAll(t, dut, query, 90*time.Second, func(val *ygnmi.Value[oc.E_Isis_IsisInterfaceAdjState]) bool { v, ok := val.Val() return v == state && ok }).Await(t) diff --git a/feature/interface/aggregate/otg_tests/aggregate_all_not_viable_test/metadata.textproto b/feature/interface/aggregate/otg_tests/aggregate_all_not_viable_test/metadata.textproto index 71c189d4df0..0896d869a61 100644 --- a/feature/interface/aggregate/otg_tests/aggregate_all_not_viable_test/metadata.textproto +++ b/feature/interface/aggregate/otg_tests/aggregate_all_not_viable_test/metadata.textproto @@ -36,7 +36,7 @@ platform_exceptions: { static_protocol_name: "STATIC" aggregate_atomic_update: true missing_value_for_defaults: true - max_ecmp_paths: false + max_ecmp_paths: true explicit_interface_in_default_vrf: false } }