From 08ad546790034c1579c03dc142a9552578b92ec6 Mon Sep 17 00:00:00 2001 From: snaragund <168457653+snaragund@users.noreply.github.com> Date: Thu, 2 Jan 2025 12:40:57 +0530 Subject: [PATCH] RT2.12: Minor infrastructure fix (#3671) - Removed deviation func configEnableTbNative, it is now defined & imported from fptest/tableconnection.go - Removed unwanted state passed in function. "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." --- .../static_route_isis_redistribution_test.go | 43 +------------------ 1 file changed, 1 insertion(+), 42 deletions(-) diff --git a/feature/isis/otg_tests/static_route_isis_redistribution/static_route_isis_redistribution_test.go b/feature/isis/otg_tests/static_route_isis_redistribution/static_route_isis_redistribution_test.go index 9bbc947d8d3..346641df6eb 100644 --- a/feature/isis/otg_tests/static_route_isis_redistribution/static_route_isis_redistribution_test.go +++ b/feature/isis/otg_tests/static_route_isis_redistribution/static_route_isis_redistribution_test.go @@ -173,8 +173,7 @@ func isisImportPolicyConfig(t *testing.T, dut *ondatra.DUTDevice, policyName str tableConn.SetDisableMetricPropagation(metricPropagation) } if deviations.EnableTableConnections(dut) { - state := "enable" - configEnableTbNative(t, dut, state) + fptest.ConfigEnableTbNative(t, dut) } gnmi.BatchReplace(batchSet, gnmi.OC().NetworkInstance(dni).TableConnection(srcProto, dstProto, addfmly).Config(), tableConn) @@ -375,46 +374,6 @@ func getTagSetName(dut *ondatra.DUTDevice, policyName, stmtName, afStr string) s return fmt.Sprintf("tag-set-%s", afStr) } -func configEnableTbNative(t testing.TB, d *ondatra.DUTDevice, state string) { - t.Helper() - switch d.Vendor() { - case ondatra.NOKIA: - adminEnable, err := json.Marshal(state) - if err != nil { - t.Fatalf("Error with json Marshal: %v", err) - } - - gpbSetRequest := &gpb.SetRequest{ - Prefix: &gpb.Path{ - Origin: "native", - }, - Update: []*gpb.Update{ - { - Path: &gpb.Path{ - Elem: []*gpb.PathElem{ - {Name: "network-instance", Key: map[string]string{"name": "DEFAULT"}}, - {Name: "table-connections"}, - {Name: "admin-state"}, - }, - }, - Val: &gpb.TypedValue{ - Value: &gpb.TypedValue_JsonIetfVal{ - JsonIetfVal: adminEnable, - }, - }, - }, - }, - } - - gnmiClient := d.RawAPIs().GNMI(t) - if _, err := gnmiClient.Set(context.Background(), gpbSetRequest); err != nil { - t.Fatalf("Unexpected error updating SRL static-route tag-set: %v", err) - } - default: - t.Fatalf("Unsupported vendor %s for deviation 'EnableTableConnections'", d.Vendor()) - } -} - func TestStaticToISISRedistribution(t *testing.T) { var ts *isissession.TestSession