Skip to content

Commit

Permalink
Merge branch 'main' into kjahed/rt6dot1
Browse files Browse the repository at this point in the history
  • Loading branch information
kjahed authored Jan 13, 2025
2 parents 6da3cc8 + a92713a commit 1a7a40e
Show file tree
Hide file tree
Showing 13 changed files with 1,631 additions and 1,207 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,6 @@ func bgpCreateNbr(t *testing.T, localAs, peerAs uint32, dut *ondatra.DUTDevice,
global := bgp.GetOrCreateGlobal()
global.RouterId = ygot.String(dutPort2.IPv4)
global.As = ygot.Uint32(localAs)
global.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).Enabled = ygot.Bool(true)
global.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST).Enabled = ygot.Bool(true)

// Note: we have to define the peer group even if we aren't setting any policy because it's
// invalid OC for the neighbor to be part of a peer group that doesn't exist.
Expand All @@ -155,50 +153,37 @@ func bgpCreateNbr(t *testing.T, localAs, peerAs uint32, dut *ondatra.DUTDevice,

switch afiSafiLevel {
case globalLevel:
pg1.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).Enabled = ygot.Bool(false)
pg1.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST).Enabled = ygot.Bool(false)
pg2.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).Enabled = ygot.Bool(false)
pg2.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST).Enabled = ygot.Bool(false)
if isV4Only {
if nbr.isV4 == true {
global.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).Enabled = ygot.Bool(true)
global.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST).Enabled = ygot.Bool(false)
nv4.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).Enabled = ygot.Bool(true)
nv4.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST).Enabled = ygot.Bool(false)
} else {
global.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).Enabled = ygot.Bool(false)
global.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST).Enabled = ygot.Bool(true)
nv4.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).Enabled = ygot.Bool(false)
nv4.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST).Enabled = ygot.Bool(true)
}
if deviations.BGPGlobalExtendedNextHopEncodingUnsupported(dut) {
global.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).Ipv4Unicast = nil
}
case nbrLevel:
if isV4Only {
nv4.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).Enabled = ygot.Bool(true)
nv4.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST).Enabled = ygot.Bool(false)
extNh := nv4.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).GetOrCreateIpv4Unicast()
if !deviations.BgpExtendedNextHopEncodingLeafUnsupported(dut) {
if !isV4Only {
if !deviations.BGPGlobalExtendedNextHopEncodingUnsupported(dut) {
extNh := global.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).GetOrCreateIpv4Unicast()
extNh.ExtendedNextHopEncoding = ygot.Bool(true)
}
}
case nbrLevel:
if nbr.isV4 == true {
af4 := nv4.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST)
af4.Enabled = ygot.Bool(true)
} else {
nv4.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).Enabled = ygot.Bool(false)
nv4.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST).Enabled = ygot.Bool(true)
af6 := nv4.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST)
af6.Enabled = ygot.Bool(true)
}
if deviations.BGPGlobalExtendedNextHopEncodingUnsupported(dut) {
nv4.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).Ipv4Unicast = nil
}
case peerGrpLevel:
if isV4Only {
pg1.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).Enabled = ygot.Bool(true)
pg1.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST).Enabled = ygot.Bool(false)
pg2.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).Enabled = ygot.Bool(true)
pg2.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST).Enabled = ygot.Bool(false)
// V4 peer group
if nbr.isV4 == true {
pg1af4 := pg1.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST)
pg1af4.Enabled = ygot.Bool(true)
} else {
pg1.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).Enabled = ygot.Bool(false)
pg1.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST).Enabled = ygot.Bool(true)
pg2.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).Enabled = ygot.Bool(false)
pg2.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST).Enabled = ygot.Bool(true)
// V6 peer group
pg2af6 := pg2.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST)
pg2af6.Enabled = ygot.Bool(true)
}
case afiSafiSetToFalse:
t.Log("AFI-SAFI is set to false")
Expand Down Expand Up @@ -332,7 +317,7 @@ func configureOTG(t *testing.T, otg *otg.OTG, otgPeerList []string) gosnappi.Con
}

// verifyBGPCapabilities is used to Verify BGP capabilities like route refresh as32 and mpbgp.
func verifyBgpCapabilities(t *testing.T, dut *ondatra.DUTDevice, afiSafiLevel string, nbrs []*bgpNeighbor, isV4Only bool) {
func verifyBgpCapabilities(t *testing.T, dut *ondatra.DUTDevice, afiSafiLevel string, nbrs []*bgpNeighbor) {
t.Helper()
t.Log("Verifying BGP AFI-SAFI capabilities.")

Expand Down Expand Up @@ -372,35 +357,18 @@ func verifyBgpCapabilities(t *testing.T, dut *ondatra.DUTDevice, afiSafiLevel st
}
t.Logf("Capabilities for peer %v are %v", nbr.neighborip, capabilities)
}

switch afiSafiLevel {
case nbrLevel:
case nbrLevel, peerGrpLevel, globalLevel:
if nbr.isV4 && capabilities[oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST] {
t.Errorf("AFI_SAFI_TYPE_IPV6_UNICAST should not be enabled for v4 Peer: %v, %v", capabilities, nbr.neighborip)
}
if !nbr.isV4 && capabilities[oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST] {
t.Errorf("AFI_SAFI_TYPE_IPV4_UNICAST should not be for v6 Peer: %v, %v", capabilities, nbr.neighborip)
}
t.Logf("Capabilities for peer %v are %v", nbr.neighborip, capabilities)
case peerGrpLevel:
if isV4Only && capabilities[oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST] == true {
t.Logf("Both V4 and V6 AFI-SAFI are inherited from peer-group level for peer: %v, %v", nbr.neighborip, capabilities)
} else if !isV4Only && capabilities[oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST] == true {
t.Logf("Both V4 and V6 AFI-SAFI are inherited from peer-group level for peer: %v, %v", nbr.neighborip, capabilities)
} else {
t.Errorf("Both V4 and V6 AFI-SAFI are not inherited from peer-group level for peer: %v, %v", nbr.neighborip, capabilities)
}
t.Logf("Capabilities for peer %v are %v", nbr.neighborip, capabilities)
case globalLevel:
if isV4Only && capabilities[oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST] == true {
t.Logf("Both V4 and V6 AFI-SAFI are inherited from global level for peer: %v, %v", nbr.neighborip, capabilities)
} else if !isV4Only && capabilities[oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST] == true {
t.Logf("Both V4 and V6 AFI-SAFI are inherited from global level for peer: %v, %v", nbr.neighborip, capabilities)
} else {
t.Errorf("Both V4 and V6 AFI-SAFI are not inherited from global level for peer: %v, %v", nbr.neighborip, capabilities)
}
t.Logf("Capabilities for peer %v are %v", nbr.neighborip, capabilities)
case afiSafiSetToFalse:
t.Logf("afiSafiSetToFalse capabilities: %v, v4 -> %v, v6 ->%v", isV4Only, capabilities[oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST], capabilities[oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST])
t.Logf("afiSafiSetToFalse capabilities: v4 -> %v, v6 ->%v", capabilities[oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST], capabilities[oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST])
if nbr.isV4 && capabilities[oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST] == true {
t.Errorf("AFI-SAFI are Active after disabling: %v, %v", capabilities, nbr.neighborip)
}
Expand Down Expand Up @@ -447,15 +415,7 @@ func TestAfiSafiOcDefaults(t *testing.T) {
configureDUT(t, dut)
})

t.Run("Configure DEFAULT network instance", func(t *testing.T) {
dutConfNIPath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut))
name := deviations.DefaultNetworkInstance(dut)
c := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut))
gnmi.Update(t, dut, c.Config(), &oc.NetworkInstance{
Name: ygot.String(name),
})
gnmi.Replace(t, dut, dutConfNIPath.Type().Config(), oc.NetworkInstanceTypes_NETWORK_INSTANCE_TYPE_DEFAULT_INSTANCE)
})
fptest.ConfigureDefaultNetworkInstance(t, dut)

dutConfPath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP")

Expand Down Expand Up @@ -525,7 +485,7 @@ func TestAfiSafiOcDefaults(t *testing.T) {
t.Run("Verify BGP telemetry", func(t *testing.T) {
verifyBgpTelemetry(t, dut, tc.nbrs)
verifyOtgBgpTelemetry(t, otg, otgConfig, tc.otgPeerList, "ESTABLISHED")
verifyBgpCapabilities(t, dut, tc.afiSafiLevel, tc.nbrs, tc.isV4Only)
verifyBgpCapabilities(t, dut, tc.afiSafiLevel, tc.nbrs)
})
})
}
Expand Down Expand Up @@ -592,7 +552,7 @@ func TestAfiSafiSetToFalse(t *testing.T) {
verifyBgpSession(t, dut, tc.nbrs)
})
t.Run("Verify BGP capabilities", func(t *testing.T) {
verifyBgpCapabilities(t, dut, tc.afiSafiLevel, tc.nbrs, tc.isV4Only)
verifyBgpCapabilities(t, dut, tc.afiSafiLevel, tc.nbrs)
})
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ functions.
* conditions/bgp-conditions/match-community-set/config/
* community-set: "regex-community"
* match-set-options: "ANY"
* actions/config/policy-result = "NEXT_STATEMENT"
* actions/config/policy-result = "ACCEPT_ROUTE"

* Create policy-definitions/policy-definition/config/name = "multi_policy"
* statements/statement/config/name = "reject_route_community"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ const (
myCommunitySet = "my_community"
prefixSetName = "prefix-set-5"
myAsPathName = "my_aspath"
addComm60 = "add_comm_60"
addComm70 = "add_comm_70"
bgpActionMethod = oc.SetCommunity_Method_REFERENCE
bgpSetCommunityOptionType = oc.BgpPolicy_BgpSetCommunityOptionType_ADD
prefixSetNameSetOptions = oc.RoutingPolicy_MatchSetOptionsRestrictedType_ANY
Expand Down Expand Up @@ -128,9 +130,12 @@ func deleteBGPPolicy(t *testing.T, dut *ondatra.DUTDevice, nbrList []*bgpNbrList
bgpPath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP").Bgp()
for _, nbr := range nbrList {
nbrAfiSafiPath := bgpPath.Neighbor(nbr.nbrAddr).AfiSafi(nbr.afiSafi)
peerAfiSafiPath := bgpPath.PeerGroup(cfgplugins.BGPPeerGroup1).AfiSafi(nbr.afiSafi)
b := &gnmi.SetBatch{}
gnmi.BatchDelete(b, nbrAfiSafiPath.ApplyPolicy().ImportPolicy().Config())
gnmi.BatchDelete(b, nbrAfiSafiPath.ApplyPolicy().ExportPolicy().Config())
gnmi.BatchDelete(b, peerAfiSafiPath.ApplyPolicy().ImportPolicy().Config())
gnmi.BatchDelete(b, peerAfiSafiPath.ApplyPolicy().ExportPolicy().Config())
b.Set(t, dut)
}
}
Expand Down Expand Up @@ -180,6 +185,8 @@ func configureImportExportMultifacetMatchActionsBGPPolicy(t *testing.T, dut *ond
addCommunitiesRefs := []string{"40:1", "40:2"}
addCommunitiesSetRefsAction := []string{"add-communities"}
setCommunitySetRefs := []string{"add_comm_60", "add_comm_70"}
addComm60Refs := []string{"60:1"}
addComm70Refs := []string{"70:1"}
myCommunitySets := []string{"50:1"}
if deviations.BgpCommunityMemberIsAString(dut) {
regexCommunities = []string{"(^|\\s)30:[0-9]+($|\\s)"}
Expand Down Expand Up @@ -210,7 +217,9 @@ func configureImportExportMultifacetMatchActionsBGPPolicy(t *testing.T, dut *ond
}
}
communitySetRegex.SetCommunityMember(pd2cs1)
communitySetRegex.SetMatchSetOptions(matchAny)
if deviations.BGPConditionsMatchCommunitySetUnsupported(dut) {
communitySetRegex.SetMatchSetOptions(matchAny)
}
}

var communitySetCLIConfig string
Expand All @@ -228,10 +237,11 @@ func configureImportExportMultifacetMatchActionsBGPPolicy(t *testing.T, dut *ond
pd2stmt1.GetOrCreateConditions().GetOrCreateBgpConditions().SetCommunitySet(regexCommunitySet)
} else {
pd2stmt1.GetOrCreateConditions().GetOrCreateBgpConditions().GetOrCreateMatchCommunitySet().SetCommunitySet(regexCommunitySet)
pd2stmt1.GetOrCreateConditions().GetOrCreateBgpConditions().GetOrCreateMatchCommunitySet().SetMatchSetOptions(oc.E_RoutingPolicy_MatchSetOptionsType(matchAny))
}

if !deviations.SkipSettingStatementForPolicy(dut) {
pd2stmt1.GetOrCreateActions().SetPolicyResult(nextstatementResult)
pd2stmt1.GetOrCreateActions().SetPolicyResult(oc.RoutingPolicy_PolicyResultType_ACCEPT_ROUTE)
}

// Configure the parent policy multi_policy.
Expand All @@ -254,12 +264,15 @@ func configureImportExportMultifacetMatchActionsBGPPolicy(t *testing.T, dut *ond
}
}
communitySetReject.SetCommunityMember(cs1)
communitySetReject.SetMatchSetOptions(matchAny)
if deviations.BGPConditionsMatchCommunitySetUnsupported(dut) {
communitySetReject.SetMatchSetOptions(matchAny)
}

if deviations.BGPConditionsMatchCommunitySetUnsupported(dut) {
stmt1.GetOrCreateConditions().GetOrCreateBgpConditions().SetCommunitySet(rejectCommunitySet)
} else {
stmt1.GetOrCreateConditions().GetOrCreateBgpConditions().GetOrCreateMatchCommunitySet().SetCommunitySet(rejectCommunitySet)
stmt1.GetOrCreateConditions().GetOrCreateBgpConditions().GetOrCreateMatchCommunitySet().SetMatchSetOptions(oc.E_RoutingPolicy_MatchSetOptionsType(matchAny))
}

stmt1.GetOrCreateActions().SetPolicyResult(rejectResult)
Expand All @@ -286,12 +299,15 @@ func configureImportExportMultifacetMatchActionsBGPPolicy(t *testing.T, dut *ond
}
}
communitySetNestedReject.SetCommunityMember(cs2)
communitySetNestedReject.SetMatchSetOptions(matchInvert)
if deviations.BGPConditionsMatchCommunitySetUnsupported(dut) {
communitySetNestedReject.SetMatchSetOptions(matchInvert)
}

if deviations.BGPConditionsMatchCommunitySetUnsupported(dut) {
stmt2.GetOrCreateConditions().GetOrCreateBgpConditions().SetCommunitySet(nestedRejectCommunitySet)
} else {
stmt2.GetOrCreateConditions().GetOrCreateBgpConditions().GetOrCreateMatchCommunitySet().SetCommunitySet(nestedRejectCommunitySet)
stmt2.GetOrCreateConditions().GetOrCreateBgpConditions().GetOrCreateMatchCommunitySet().SetMatchSetOptions(oc.E_RoutingPolicy_MatchSetOptionsType(matchInvert))
}

stmt2.GetOrCreateActions().SetPolicyResult(rejectResult)
Expand All @@ -313,7 +329,9 @@ func configureImportExportMultifacetMatchActionsBGPPolicy(t *testing.T, dut *ond
}
}
communitySetRefsAddCommunities.SetCommunityMember(cs3)
communitySetRefsAddCommunities.SetMatchSetOptions(matchInvert)
if deviations.BGPConditionsMatchCommunitySetUnsupported(dut) {
communitySetRefsAddCommunities.SetMatchSetOptions(matchInvert)
}

if deviations.BGPConditionsMatchCommunitySetUnsupported(dut) {
stmt3.GetOrCreateConditions().GetOrCreateBgpConditions().SetCommunitySet(addCommunitiesSetRefs)
Expand Down Expand Up @@ -346,7 +364,9 @@ func configureImportExportMultifacetMatchActionsBGPPolicy(t *testing.T, dut *ond
}
}
communitySetMatchCommPrefixAddCommu.SetCommunityMember(cs4)
communitySetMatchCommPrefixAddCommu.SetMatchSetOptions(matchAny)
if deviations.BGPConditionsMatchCommunitySetUnsupported(dut) {
communitySetMatchCommPrefixAddCommu.SetMatchSetOptions(matchAny)
}

// Configure multi_policy:STATEMENT4: match_comm_and_prefix_add_2_community_sets statement

Expand All @@ -365,6 +385,8 @@ func configureImportExportMultifacetMatchActionsBGPPolicy(t *testing.T, dut *ond
} else {
stmt4.GetOrCreateConditions().GetOrCreateBgpConditions().GetOrCreateMatchCommunitySet().SetCommunitySet(myCommunitySet)
stmt6.GetOrCreateConditions().GetOrCreateBgpConditions().GetOrCreateMatchCommunitySet().SetCommunitySet(myCommunitySet)
stmt4.GetOrCreateConditions().GetOrCreateBgpConditions().GetOrCreateMatchCommunitySet().SetMatchSetOptions(oc.E_RoutingPolicy_MatchSetOptionsType(matchAny))
stmt6.GetOrCreateConditions().GetOrCreateBgpConditions().GetOrCreateMatchCommunitySet().SetMatchSetOptions(oc.E_RoutingPolicy_MatchSetOptionsType(matchAny))
}

// configure match-prefix-set: prefix-set-5 to match_comm_and_prefix_add_2_community_sets statement
Expand All @@ -391,7 +413,34 @@ func configureImportExportMultifacetMatchActionsBGPPolicy(t *testing.T, dut *ond
if deviations.BgpCommunitySetRefsUnsupported(dut) {
t.Logf("TODO: community-set-refs not supported b/316833803")
} else {
// TODO: Add bgp-actions: community-set-refs to match_comm_and_prefix_add_2_community_sets statement
// Configure add_comm_60 [60:1] to match_comm_and_prefix_add_2_community_sets statement
addCommunity60 := rp.GetOrCreateDefinedSets().GetOrCreateBgpDefinedSets().GetOrCreateCommunitySet(addComm60)

cs5 := []oc.RoutingPolicy_DefinedSets_BgpDefinedSets_CommunitySet_CommunityMember_Union{}
for _, commMatch5 := range addComm60Refs {
if commMatch5 != "" {
cs5 = append(cs5, oc.UnionString(commMatch5))
}
}
addCommunity60.SetCommunityMember(cs5)
if deviations.BGPConditionsMatchCommunitySetUnsupported(dut) {
addCommunity60.SetMatchSetOptions(matchInvert)
}

// Configure add_comm_70 [70:1] to match_comm_and_prefix_add_2_community_sets statement
addCommunity70 := rp.GetOrCreateDefinedSets().GetOrCreateBgpDefinedSets().GetOrCreateCommunitySet(addComm70)

cs6 := []oc.RoutingPolicy_DefinedSets_BgpDefinedSets_CommunitySet_CommunityMember_Union{}
for _, commMatch6 := range addComm70Refs {
if commMatch6 != "" {
cs6 = append(cs6, oc.UnionString(commMatch6))
}
}
addCommunity70.SetCommunityMember(cs6)
if deviations.BGPConditionsMatchCommunitySetUnsupported(dut) {
addCommunity70.SetMatchSetOptions(matchInvert)
}
// Added bgp-actions: community-set-refs to match_comm_and_prefix_add_2_community_sets statement
stmt4.GetOrCreateActions().GetOrCreateBgpActions().GetOrCreateSetCommunity().GetOrCreateReference().SetCommunitySetRefs(setCommunitySetRefs)
stmt4.GetOrCreateActions().GetOrCreateBgpActions().GetOrCreateSetCommunity().SetMethod(oc.SetCommunity_Method_REFERENCE)
stmt4.GetOrCreateActions().GetOrCreateBgpActions().GetOrCreateSetCommunity().SetOptions(oc.BgpPolicy_BgpSetCommunityOptionType_ADD)
Expand Down Expand Up @@ -707,7 +756,7 @@ func validateOTGBgpPrefixV6AndASLocalPrefMED(t *testing.T, otg *otg.OTG, dut *on
if bgpPrefix.Address != nil && bgpPrefix.GetAddress() == ipAddr &&
bgpPrefix.PrefixLength != nil && bgpPrefix.GetPrefixLength() == prefixLen {
foundPrefix = true
t.Logf("Prefix recevied on OTG is correct, got prefix %v, want prefix %v", bgpPrefix, ipAddr)
t.Logf("Prefix recevied on OTG is correct, got prefix %v, want prefix %v", bgpPrefix.GetAddress(), ipAddr)
switch pathAttr {
case otgMED:
if bgpPrefix.GetMultiExitDiscriminator() != metric[0] {
Expand Down Expand Up @@ -847,6 +896,18 @@ func TestImportExportMultifacetMatchActionsBGPPolicy(t *testing.T) {
testResults := [6]bool{true, true, true, true, true, true}
verifyTrafficV4AndV6(t, bs, testResults)

// Delete routePolicy policy applied to neighbor
deleteBGPPolicy(t, dut, []*bgpNbrList{
{
nbrAddr: ipv4,
afiSafi: oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST,
},
{
nbrAddr: ipv6,
afiSafi: oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST,
},
})

configureImportExportMultifacetMatchActionsBGPPolicy(t, bs.DUT, ipv4, ipv6, ipv41, ipv61)
time.Sleep(time.Second * 120)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,14 @@ platform_exceptions: {
skip_bgp_send_community_type: true
}
}
platform_exceptions: {
platform: {
vendor: NOKIA
}
deviations: {
skip_prefix_set_mode: true
explicit_interface_in_default_vrf: true
interface_enabled: true
skip_bgp_send_community_type: true
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,18 @@ platform_exceptions: {
set_metric_as_preference: true
}
}
platform_exceptions: {
platform: {
vendor: CISCO
}
deviations: {
set_metric_as_preference: true
skip_bgp_send_community_type: true
bgp_community_set_refs_unsupported: true
tc_default_import_policy_unsupported: true
tc_metric_propagation_unsupported: true
tc_attribute_propagation_unsupported: true
tc_subscription_unsupported: true
default_bgp_instance_name: "default"
}
}
Loading

0 comments on commit 1a7a40e

Please sign in to comment.