Skip to content

Commit 57d4918

Browse files
committed
[RT-7.3/RT-7.4] Update as-path-set deviation for Arista
Arista now supports `match-as-path-set` so we can remove `match_as_path_set_unsupported` from the deviation. However, EOS requires `ip as-path regex-mode string` to match as-path-set members as POSIX regexes. Adding `routing_policy_as_path_set_enable_regex_mode` deviation which would configure that in the test.
1 parent 19b56cb commit 57d4918

File tree

8 files changed

+51
-12
lines changed

8 files changed

+51
-12
lines changed

feature/bgp/policybase/otg_tests/aspath_and_community_test/aspath_and_community_test.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,13 @@ func configureImportBGPPolicy(t *testing.T, dut *ondatra.DUTDevice, ipv4 string,
8181
stmt1.GetOrCreateConditions().GetOrCreateBgpConditions().GetOrCreateMatchAsPathSet().SetMatchSetOptions(aspMatchSetOptions)
8282
}
8383

84+
if deviations.RoutingPolicyAsPathSetEnableRegexMode(dut) {
85+
switch dut.Vendor() {
86+
case ondatra.ARISTA:
87+
cfgplugins.DeviationAristaRoutingPolicyBGPAsPathMatchMode(t, dut)
88+
}
89+
}
90+
8491
pdAllow := rp.GetOrCreatePolicyDefinition(RPLPermitAll)
8592
st, err := pdAllow.AppendNewStatement("id-1")
8693
if err != nil {
@@ -104,9 +111,6 @@ func configureImportBGPPolicy(t *testing.T, dut *ondatra.DUTDevice, ipv4 string,
104111
cs = append(cs, oc.UnionString(communityMatch))
105112
}
106113
communitySet.SetCommunityMember(cs)
107-
if deviations.BGPConditionsMatchCommunitySetUnsupported(dut) {
108-
communitySet.SetMatchSetOptions(commMatchSetOptions)
109-
}
110114
}
111115

112116
var communitySetCLIConfig string

feature/bgp/policybase/otg_tests/aspath_and_community_test/metadata.textproto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ platform_exceptions: {
1818
interface_enabled: true
1919
default_network_instance: "default"
2020
skip_setting_disable_metric_propagation: true
21-
match_as_path_set_unsupported: true
21+
routing_policy_as_path_set_enable_regex_mode: true
2222
}
2323
}
2424

feature/bgp/policybase/otg_tests/aspath_test/aspath_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,13 @@ func configureImportBGPPolicy(t *testing.T, dut *ondatra.DUTDevice, ipv4 string,
7474
aspathSet := rp.GetOrCreateDefinedSets().GetOrCreateBgpDefinedSets().GetOrCreateAsPathSet(aspathSetName)
7575
aspathSet.SetAsPathSetMember(aspathMatch)
7676

77+
if deviations.RoutingPolicyAsPathSetEnableRegexMode(dut) {
78+
switch dut.Vendor() {
79+
case ondatra.ARISTA:
80+
cfgplugins.DeviationAristaRoutingPolicyBGPAsPathMatchMode(t, dut)
81+
}
82+
}
83+
7784
if !deviations.MatchAsPathSetUnsupported(dut) {
7885
stmt1.GetOrCreateConditions().GetOrCreateBgpConditions().GetOrCreateMatchAsPathSet().SetAsPathSet(aspathSetName)
7986
stmt1.GetOrCreateConditions().GetOrCreateBgpConditions().GetOrCreateMatchAsPathSet().SetMatchSetOptions(matchSetOptions)

feature/bgp/policybase/otg_tests/aspath_test/metadata.textproto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ platform_exceptions: {
1616
interface_enabled: true
1717
default_network_instance: "default"
1818
skip_setting_disable_metric_propagation: true
19-
match_as_path_set_unsupported: true
19+
routing_policy_as_path_set_enable_regex_mode: true
2020
}
2121
}
2222
platform_exceptions: {

internal/cfgplugins/bgp_policy.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,13 @@ match as-path %s
9999
helpers.GnmiCLIConfig(t, dut, config)
100100
}
101101

102+
// DeviationsAristaRoutingPolicyBGPAsPathMatchMode is used to enable POSIX regex matching for
103+
// AS Path Sets
104+
func DeviationAristaRoutingPolicyBGPAsPathMatchMode(t *testing.T, dut *ondatra.DUTDevice) {
105+
config := "ip as-path regex-mode string"
106+
helpers.GnmiCLIConfig(t, dut, config)
107+
}
108+
102109
// DeviationCiscoRoutingPolicyBGPToISIS is used as an alternative for DUTs that don't support
103110
// direct redistribution from BGP to ISIS using community match as condition.
104111
// This deviation implements CLI to perform the equivalent function.

internal/deviations/deviations.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2011,3 +2011,10 @@ func ArpFT(dut *ondatra.DUTDevice) string {
20112011
func PrefixLimitConfigUnsupported(dut *ondatra.DUTDevice) bool {
20122012
return lookupDUTDeviations(dut).GetPrefixLimitConfigUnsupported()
20132013
}
2014+
2015+
// RoutingPolicyAsPathSetEnableRegexMode returns true if the device needs to separately enable regex
2016+
// matching for as-path set members.
2017+
// Arista: https://issuetracker.google.com/496260572
2018+
func RoutingPolicyAsPathSetEnableRegexMode(dut *ondatra.DUTDevice) bool {
2019+
return lookupDUTDeviations(dut).GetRoutingPolicyAsPathSetEnableRegexMode()
2020+
}

proto/metadata.proto

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,6 +1207,10 @@ message Metadata {
12071207
// Device does not support configuring prefix limit received paths through OC
12081208
// Cisco: https://partnerissuetracker.corp.google.com/issues/447509237
12091209
bool prefix_limit_config_unsupported = 393;
1210+
1211+
// Device requires additional configuration to enable as-path regex matching
1212+
// Arista: b/496260572
1213+
bool routing_policy_as_path_set_enable_regex_mode = 394;
12101214

12111215
// Reserved field numbers and identifiers.
12121216
reserved 84, 9, 28, 20, 38, 43, 90, 97, 55, 89, 19, 36, 35, 40, 113, 131, 141, 173, 234, 254, 231, 300, 241;

proto/metadata_go_proto/metadata.pb.go

Lines changed: 17 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)