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

added deviation in bgp_2byte_4byte_asn_policy_test #3425

Merged
merged 2 commits into from
Dec 30, 2024
Merged
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 @@ -157,7 +157,7 @@ func TestBgpSession(t *testing.T) {
configureRegexPolicy(t, dut)

d := &oc.Root{}
rpl := configureBGPPolicy(t, d, tc.nbr.isV4)
rpl := configureBGPPolicy(t, d, tc.nbr.isV4, dut)
gnmi.Replace(t, dut, gnmi.OC().RoutingPolicy().Config(), rpl)

t.Log("Configure BGP on DUT")
Expand Down Expand Up @@ -259,7 +259,7 @@ func configureRegexPolicy(t *testing.T, dut *ondatra.DUTDevice) {

// configureBGPPolicy configures a BGP routing policy to accept or reject routes based on prefix match conditions
// Additonally, it also configures policy to match prefix based on community and regex for as path
func configureBGPPolicy(t *testing.T, d *oc.Root, isV4 bool) *oc.RoutingPolicy {
func configureBGPPolicy(t *testing.T, d *oc.Root, isV4 bool, dut *ondatra.DUTDevice) *oc.RoutingPolicy {
t.Helper()
rp := d.GetOrCreateRoutingPolicy()
pset := rp.GetOrCreateDefinedSets().GetOrCreatePrefixSet(rejectPrefix)
Expand Down Expand Up @@ -299,7 +299,11 @@ func configureBGPPolicy(t *testing.T, d *oc.Root, isV4 bool) *oc.RoutingPolicy {
t.Errorf("Error while creating new statement %v", err)
}
stmt50.GetOrCreateActions().PolicyResult = oc.RoutingPolicy_PolicyResultType_REJECT_ROUTE
stmt50.GetOrCreateConditions().GetOrCreateBgpConditions().CommunitySet = ygot.String(communitySet)
if deviations.BGPConditionsMatchCommunitySetUnsupported(dut) {
stmt50.GetOrCreateConditions().GetOrCreateBgpConditions().SetCommunitySet(communitySet)
} else {
stmt50.GetOrCreateConditions().GetOrCreateBgpConditions().GetOrCreateMatchCommunitySet().SetCommunitySet(communitySet)
}

stmt60, err := pdefComm.AppendNewStatement(aclStatement4)
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ platform_exceptions: {
}
deviations: {
ipv4_missing_enabled: true
bgp_conditions_match_community_set_unsupported: true
}
}
platform_exceptions: {
Expand All @@ -21,6 +22,7 @@ platform_exceptions: {
explicit_port_speed: true
explicit_interface_in_default_vrf: true
interface_enabled: true
bgp_conditions_match_community_set_unsupported: true
}
}
platform_exceptions: {
Expand Down
Loading