Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RT-2.12 Fixed with deviations & minor changes #3513

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
15b7df7
RT-2.12 Fixed with deviations & minor changes
snaragund Oct 11, 2024
20f8160
- Added dut.vendor switch for enable_table_connection deviation.
snaragund Oct 15, 2024
70e69ec
Merge branch 'main' into SN-RT2dot12
snaragund Oct 15, 2024
5b0eff7
-Minor change
snaragund Oct 15, 2024
c9dfdae
Merge branch 'SN-RT2dot12' of https://github.com/nokia/featureprofile…
snaragund Oct 15, 2024
883041c
Merge remote-tracking branch 'upstream/main' into SN-RT2dot12
snaragund Oct 22, 2024
1924016
Merge branch 'main' into SN-RT2dot12
snaragund Oct 22, 2024
01e7192
Merge remote-tracking branch 'upstream/main' into SN-RT2dot12
snaragund Oct 22, 2024
5bc5dd1
Merge remote-tracking branch 'upstream/main' into SN-RT2dot12
snaragund Nov 5, 2024
53316ad
O
snaragund Nov 5, 2024
713258b
Merge branch 'main' into SN-RT2dot12
snaragund Nov 11, 2024
94b046c
Conflicts resolved
snaragund Nov 14, 2024
a7f9b47
Merge branch 'SN-RT2dot12' of https://github.com/nokia/featureprofile…
snaragund Nov 14, 2024
0e96ca3
Merge branch 'main' into SN-RT2dot12
snaragund Nov 16, 2024
6ba4881
Update feature/isis/otg_tests/static_route_isis_redistribution/static…
snaragund Nov 16, 2024
181f50a
Update feature/isis/otg_tests/static_route_isis_redistribution/static…
snaragund Nov 16, 2024
ec2b90a
-Resolving conflicts
snaragund Nov 22, 2024
ea947b6
Merge branch 'SN-RT2dot12' of https://github.com/nokia/featureprofile…
snaragund Nov 22, 2024
5061eff
Merge remote-tracking branch 'upstream/main' into SN-RT2dot12
snaragund Nov 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,15 @@ platform_exceptions: {
match_tag_set_condition_unsupported: true
}
}
platform_exceptions: {
platform: {
vendor: NOKIA
}
deviations: {
explicit_interface_in_default_vrf: true
interface_enabled: true
static_protocol_name: "static"
skip_prefix_set_mode: true
enable_table_connections: true
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ const (
protoDst = oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_ISIS
dummyV6 = "2001:db8::192:0:2:d"
dummyMAC = "00:1A:11:00:0A:BC"
tagValue = 100
V4tagValue = 40
V6tagValue = 60
)

var (
Expand Down Expand Up @@ -113,7 +114,7 @@ func getAndVerifyIsisImportPolicy(t *testing.T,
if err != nil {
t.Fatalf("failed due to %v", err)
}
t.Log(getResponse)
t.Log("Recieved parameters of table connections")
snaragund marked this conversation as resolved.
Show resolved Hide resolved

t.Log("Verify Get outputs ")
for _, notification := range getResponse.Notification {
Expand Down Expand Up @@ -142,9 +143,9 @@ func getAndVerifyIsisImportPolicy(t *testing.T,
t.Fatalf("import-policy is not set to %s as expected", RplName)
}
}
t.Logf("Table Connection Details:"+
t.Logf("Table Connection Details:\n"+
"SRC PROTO GOT %v WANT STATIC\n"+
"DST PRTO GOT %v WANT ISIS\n"+
"DST PROTO GOT %v WANT ISIS\n"+
"ADDRESS FAMILY GOT %v WANT %v\n"+
"DISABLEMETRICPROPAGATION GOT %v WANT %v\n", config.SrcProtocol,
config.DstProtocol, config.AddressFamily, addressFamily,
Expand All @@ -171,6 +172,10 @@ func isisImportPolicyConfig(t *testing.T, dut *ondatra.DUTDevice, policyName str
if !deviations.SkipSettingDisableMetricPropagation(dut) {
tableConn.SetDisableMetricPropagation(metricPropagation)
}
if deviations.EnableTableConnections(dut) {
state := "enable"
configEnableTbNative(t, dut, state)
}
gnmi.BatchReplace(batchSet, gnmi.OC().NetworkInstance(dni).TableConnection(srcProto, dstProto, addfmly).Config(), tableConn)

if deviations.SamePolicyAttachedToAllAfis(dut) {
Expand Down Expand Up @@ -206,7 +211,9 @@ func configureRoutePolicy(dut *ondatra.DUTDevice, rplName string, statement stri
v4Prefix := v4Route + "/" + strconv.FormatUint(uint64(v4RoutePrefix), 10)
pset := rp.GetOrCreateDefinedSets().GetOrCreatePrefixSet(v4PrefixSet)
pset.GetOrCreatePrefix(v4Prefix, prefixMatch)
pset.SetMode(oc.PrefixSet_Mode_IPV4)
if !deviations.SkipPrefixSetMode(dut) {
pset.SetMode(oc.PrefixSet_Mode_IPV4)
}
stmt1.GetOrCreateConditions().GetOrCreateMatchPrefixSet().SetPrefixSet(v4PrefixSet)
stmt1.GetOrCreateActions().SetPolicyResult(rplType)

Expand All @@ -217,7 +224,9 @@ func configureRoutePolicy(dut *ondatra.DUTDevice, rplName string, statement stri
v6Prefix := v6Route + "/" + strconv.FormatUint(uint64(v6RoutePrefix), 10)
pset = rp.GetOrCreateDefinedSets().GetOrCreatePrefixSet(v6PrefixSet)
pset.GetOrCreatePrefix(v6Prefix, prefixMatch)
pset.SetMode(oc.PrefixSet_Mode_IPV6)
if !deviations.SkipPrefixSetMode(dut) {
pset.SetMode(oc.PrefixSet_Mode_IPV6)
}
stmt2.GetOrCreateConditions().GetOrCreateMatchPrefixSet().SetPrefixSet(v6PrefixSet)
stmt2.GetOrCreateActions().SetPolicyResult(rplType)
} else if tagSetCond {
Expand All @@ -228,7 +237,7 @@ func configureRoutePolicy(dut *ondatra.DUTDevice, rplName string, statement stri
}
v4tagSet := getTagSetName(dut, rplName, v4Statement, "v4")
tagSet1 := rp.GetOrCreateDefinedSets().GetOrCreateTagSet(v4tagSet)
tagSet1.SetTagValue([]oc.RoutingPolicy_DefinedSets_TagSet_TagValue_Union{oc.UnionUint32(tagValue)})
tagSet1.SetTagValue([]oc.RoutingPolicy_DefinedSets_TagSet_TagValue_Union{oc.UnionUint32(V4tagValue)})
stmt1.GetOrCreateConditions().GetOrCreateMatchTagSet().SetTagSet(v4tagSet)
stmt1.GetOrCreateActions().SetPolicyResult(rplType)

Expand All @@ -238,7 +247,7 @@ func configureRoutePolicy(dut *ondatra.DUTDevice, rplName string, statement stri
}
v6tagSet := getTagSetName(dut, rplName, v6Statement, "v6")
tagSet2 := rp.GetOrCreateDefinedSets().GetOrCreateTagSet(v6tagSet)
tagSet2.SetTagValue([]oc.RoutingPolicy_DefinedSets_TagSet_TagValue_Union{oc.UnionUint32(tagValue)})
tagSet2.SetTagValue([]oc.RoutingPolicy_DefinedSets_TagSet_TagValue_Union{oc.UnionUint32(V6tagValue)})
stmt2.GetOrCreateConditions().GetOrCreateMatchTagSet().SetTagSet(v6tagSet)
stmt2.GetOrCreateActions().SetPolicyResult(rplType)
} else {
Expand Down Expand Up @@ -366,6 +375,46 @@ 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 'UseVendorNativeACLConfiguration'", d.Vendor())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
t.Fatalf("Unsupported vendor %s for deviation 'UseVendorNativeACLConfiguration'", d.Vendor())
t.Fatalf("Unsupported vendor %s for deviation 'EnableTableConnections'", d.Vendor())

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated as per comments.

}
}

func TestStaticToISISRedistribution(t *testing.T) {
var ts *isissession.TestSession

Expand Down Expand Up @@ -462,6 +511,7 @@ func TestStaticToISISRedistribution(t *testing.T) {
desc: "RT-2.12.8: Redistribute IPv6 static route to IS-IS matching a prefix using a route-policy",
protoAf: oc.Types_ADDRESS_FAMILY_IPV6,
RplName: v6RoutePolicy,
metricPropogation: true,
policyStmtType: oc.RoutingPolicy_PolicyResultType_ACCEPT_ROUTE,
verifyTrafficStats: true,
trafficFlows: []string{v6Flow},
Expand Down Expand Up @@ -497,8 +547,8 @@ func TestStaticToISISRedistribution(t *testing.T) {

if tc.TagSetCondition {
t.Run("Verify Configuration for RPL TagSet", func(t *testing.T) {
verifyRplConfig(t, ts.DUT, getTagSetName(ts.DUT, tc.RplName, v4Statement, "v4"), oc.UnionUint32(tagValue))
verifyRplConfig(t, ts.DUT, getTagSetName(ts.DUT, tc.RplName, v6Statement, "v6"), oc.UnionUint32(tagValue))
verifyRplConfig(t, ts.DUT, getTagSetName(ts.DUT, tc.RplName, v4Statement, "v4"), oc.UnionUint32(V4tagValue))
verifyRplConfig(t, ts.DUT, getTagSetName(ts.DUT, tc.RplName, v6Statement, "v6"), oc.UnionUint32(V6tagValue))
})
}

Expand Down
5 changes: 5 additions & 0 deletions internal/deviations/deviations.go
Original file line number Diff line number Diff line change
Expand Up @@ -1207,3 +1207,8 @@
func BgpAllowownasDiffDefaultValue(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetBgpAllowownasDiffDefaultValue()
}

// Admin Enable Table Connections in SRL native

Check failure on line 1211 in internal/deviations/deviations.go

View workflow job for this annotation

GitHub Actions / Static Analysis

comment on exported function EnableTableConnections should be of the form "EnableTableConnections ..."
func EnableTableConnections(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetEnableTableConnections()
}
2 changes: 2 additions & 0 deletions proto/metadata.proto
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,8 @@ message Metadata {
// Device have different default value for allow own as.
// Juniper : b/373559004
bool bgp_allowownas_diff_default_value = 231;
// Nokia; b/304493065 comment#7 SRL native admin_enable for table-connections
bool enable_table_connections = 232;

// Reserved field numbers and identifiers.
reserved 84, 9, 28, 20, 90, 97, 55, 89, 19, 36, 35, 40, 173;
Expand Down
Loading
Loading