Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -81,6 +81,15 @@ func configureImportBGPPolicy(t *testing.T, dut *ondatra.DUTDevice, ipv4 string,
stmt1.GetOrCreateConditions().GetOrCreateBgpConditions().GetOrCreateMatchAsPathSet().SetMatchSetOptions(aspMatchSetOptions)
}

if deviations.RoutingPolicyAsPathSetEnableRegexMode(dut) {
switch dut.Vendor() {
case ondatra.ARISTA:
cfgplugins.DeviationAristaRoutingPolicyBGPAsPathMatchMode(t, dut)
default:
t.Errorf("RoutingPolicyAsPathSetEnableRegexMode deviation is not implemented for vendor %s", dut.Vendor())
}
}

pdAllow := rp.GetOrCreatePolicyDefinition(RPLPermitAll)
st, err := pdAllow.AppendNewStatement("id-1")
if err != nil {
Expand All @@ -104,9 +113,6 @@ func configureImportBGPPolicy(t *testing.T, dut *ondatra.DUTDevice, ipv4 string,
cs = append(cs, oc.UnionString(communityMatch))
}
communitySet.SetCommunityMember(cs)
if deviations.BGPConditionsMatchCommunitySetUnsupported(dut) {
communitySet.SetMatchSetOptions(commMatchSetOptions)
}
}

var communitySetCLIConfig string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ platform_exceptions: {
interface_enabled: true
default_network_instance: "default"
skip_setting_disable_metric_propagation: true
match_as_path_set_unsupported: true
routing_policy_as_path_set_enable_regex_mode: true
}
}

Expand Down
9 changes: 9 additions & 0 deletions feature/bgp/policybase/otg_tests/aspath_test/aspath_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,15 @@ func configureImportBGPPolicy(t *testing.T, dut *ondatra.DUTDevice, ipv4 string,
aspathSet := rp.GetOrCreateDefinedSets().GetOrCreateBgpDefinedSets().GetOrCreateAsPathSet(aspathSetName)
aspathSet.SetAsPathSetMember(aspathMatch)

if deviations.RoutingPolicyAsPathSetEnableRegexMode(dut) {
switch dut.Vendor() {
case ondatra.ARISTA:
cfgplugins.DeviationAristaRoutingPolicyBGPAsPathMatchMode(t, dut)
default:
t.Errorf("RoutingPolicyAsPathSetEnableRegexMode deviation is not implemented for vendor %s", dut.Vendor())
}
}

if !deviations.MatchAsPathSetUnsupported(dut) {
stmt1.GetOrCreateConditions().GetOrCreateBgpConditions().GetOrCreateMatchAsPathSet().SetAsPathSet(aspathSetName)
stmt1.GetOrCreateConditions().GetOrCreateBgpConditions().GetOrCreateMatchAsPathSet().SetMatchSetOptions(matchSetOptions)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ platform_exceptions: {
interface_enabled: true
default_network_instance: "default"
skip_setting_disable_metric_propagation: true
match_as_path_set_unsupported: true
routing_policy_as_path_set_enable_regex_mode: true
}
}
platform_exceptions: {
Expand Down
7 changes: 7 additions & 0 deletions internal/cfgplugins/bgp_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@ match as-path %s
helpers.GnmiCLIConfig(t, dut, config)
}

// DeviationAristaRoutingPolicyBGPAsPathMatchMode is used to enable POSIX regex matching for
// AS Path Sets
func DeviationAristaRoutingPolicyBGPAsPathMatchMode(t *testing.T, dut *ondatra.DUTDevice) {
config := "ip as-path regex-mode string"
helpers.GnmiCLIConfig(t, dut, config)
}

// DeviationCiscoRoutingPolicyBGPToISIS is used as an alternative for DUTs that don't support
// direct redistribution from BGP to ISIS using community match as condition.
// This deviation implements CLI to perform the equivalent function.
Expand Down
7 changes: 7 additions & 0 deletions internal/deviations/deviations.go
Original file line number Diff line number Diff line change
Expand Up @@ -1468,7 +1468,7 @@
return lookupDUTDeviations(dut).GetBgpSetMedActionUnsupported()
}

// reducedEcmpSetOnMixedEncapDecapNh returns true if mixed encap and decap next hops are not supported over ecmp.

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

View workflow job for this annotation

GitHub Actions / Static Analysis

comment on exported function ReducedEcmpSetOnMixedEncapDecapNh should be of the form "ReducedEcmpSetOnMixedEncapDecapNh ..."
// Nokia: b/459893133
func ReducedEcmpSetOnMixedEncapDecapNh(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetReducedEcmpSetOnMixedEncapDecapNh()
Expand Down Expand Up @@ -2011,3 +2011,10 @@
func PrefixLimitConfigUnsupported(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetPrefixLimitConfigUnsupported()
}

// RoutingPolicyAsPathSetEnableRegexMode returns true if the device needs to separately enable regex
// matching for as-path set members.
// Arista: https://issuetracker.google.com/issues/496260572
func RoutingPolicyAsPathSetEnableRegexMode(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetRoutingPolicyAsPathSetEnableRegexMode()
}
4 changes: 4 additions & 0 deletions proto/metadata.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1207,6 +1207,10 @@ message Metadata {
// Device does not support configuring prefix limit received paths through OC
// Cisco: https://partnerissuetracker.corp.google.com/issues/447509237
bool prefix_limit_config_unsupported = 393;

// Device requires additional configuration to enable as-path regex matching
// Arista: b/496260572
bool routing_policy_as_path_set_enable_regex_mode = 394;

// Reserved field numbers and identifiers.
reserved 84, 9, 28, 20, 38, 43, 90, 97, 55, 89, 19, 36, 35, 40, 113, 131, 141, 173, 234, 254, 231, 300, 241;
Expand Down
24 changes: 17 additions & 7 deletions proto/metadata_go_proto/metadata.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading