Skip to content

Commit

Permalink
RT2.12: Minor infrastructure fix (#3671)
Browse files Browse the repository at this point in the history
- 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."
  • Loading branch information
snaragund authored Jan 2, 2025
1 parent 66afa80 commit 08ad546
Showing 1 changed file with 1 addition and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 08ad546

Please sign in to comment.