Skip to content

Commit f00d67a

Browse files
RT-7.5 Ext Community fix for Cisco (openconfig#4687)
* Ext Community fix for Cisco * Add sleep timer before making gnmi OTG calls * Add Deviation for import policy * Add Deviation for import policy * enhance name * renamed deviation * Remove Sleep() * conflicts * static errors' fix * fix conflicts * static fix --------- Co-authored-by: Karthikeya Remilla <karthikeya.remilla@gmail.com>
1 parent e72caa3 commit f00d67a

File tree

7 files changed

+88
-41
lines changed

7 files changed

+88
-41
lines changed

feature/acl/otg_tests/acl_large_scale/acl_large_scale_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,7 @@ func testv4AddressScale(t *testing.T, dut *ondatra.DUTDevice, ate *ondatra.ATEDe
918918
}
919919

920920
for _, acl := range aclConfigs {
921-
if deviations.ConfigAclOcUnsupported(dut) {
921+
if deviations.ConfigACLOcUnsupported(dut) {
922922
switch dut.Vendor() {
923923
case ondatra.ARISTA:
924924
aclTarfficPolicy := cfgplugins.ACLTrafficPolicyParams{
@@ -945,7 +945,7 @@ func testv4AddressScale(t *testing.T, dut *ondatra.DUTDevice, ate *ondatra.ATEDe
945945
}
946946

947947
// Verification of ACL on interfaces as Ingress & Egress
948-
if !deviations.ConfigAclOcUnsupported(dut) {
948+
if !deviations.ConfigACLOcUnsupported(dut) {
949949
var expectedACLs = []struct {
950950
Name string
951951
Ingress bool
@@ -1152,7 +1152,7 @@ func testv6AddressScale(t *testing.T, dut *ondatra.DUTDevice, ate *ondatra.ATEDe
11521152
}
11531153

11541154
for _, acl := range aclConfigs {
1155-
if deviations.ConfigAclOcUnsupported(dut) {
1155+
if deviations.ConfigACLOcUnsupported(dut) {
11561156
switch dut.Vendor() {
11571157
case ondatra.ARISTA:
11581158
aclTarfficPolicy := cfgplugins.ACLTrafficPolicyParams{
@@ -1179,7 +1179,7 @@ func testv6AddressScale(t *testing.T, dut *ondatra.DUTDevice, ate *ondatra.ATEDe
11791179
}
11801180

11811181
// Verify ACL is applied on the interfaces
1182-
if !deviations.ConfigAclOcUnsupported(dut) {
1182+
if !deviations.ConfigACLOcUnsupported(dut) {
11831183
var expectedACLs = []struct {
11841184
Name string
11851185
Ingress bool
@@ -1317,7 +1317,7 @@ func testv6AddressScale(t *testing.T, dut *ondatra.DUTDevice, ate *ondatra.ATEDe
13171317
}
13181318

13191319
func testv4PrefixList(t *testing.T, dut *ondatra.DUTDevice, ate *ondatra.ATEDevice, otgConfig *otg.OTG, config gosnappi.Config) {
1320-
if !deviations.ConfigAclOcUnsupported(dut) {
1320+
if !deviations.ConfigACLOcUnsupported(dut) {
13211321
// Remove the ACL configs from interface
13221322
removeAClOnInterface(t, dut, "port1")
13231323
removeAClOnInterface(t, dut, "port2")

feature/bgp/policybase/otg_tests/link_bandwidth_test/link_bandwidth_test.go

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -277,11 +277,14 @@ func enableExtCommunityCLIConfig(t *testing.T, dut *ondatra.DUTDevice) {
277277
var extCommunityEnableCLIConfig string
278278
switch dut.Vendor() {
279279
case ondatra.CISCO:
280-
extCommunityEnableCLIConfig = fmt.Sprintf("router bgp %v instance BGP neighbor-group %v \n ebgp-recv-extcommunity-dmz \n ebgp-send-extcommunity-dmz\n", dutAS, cfgplugins.BGPPeerGroup1)
280+
extCommunityEnableCLIConfig = fmt.Sprintf("router bgp %v instance BGP neighbor %v \n ebgp-recv-extcommunity-dmz \n ebgp-send-extcommunity-dmz\n", dutAS, atePort1.IPv4)
281+
helpers.GnmiCLIConfig(t, dut, extCommunityEnableCLIConfig)
282+
time.Sleep(10 * time.Second)
283+
extCommunityEnableCLIConfig = fmt.Sprintf("router bgp %v instance BGP neighbor %v \n ebgp-recv-extcommunity-dmz \n ebgp-send-extcommunity-dmz\n", dutAS, atePort1.IPv6)
284+
helpers.GnmiCLIConfig(t, dut, extCommunityEnableCLIConfig)
281285
default:
282286
t.Fatalf("Unsupported vendor %s for deviation 'BgpExplicitExtendedCommunityEnable'", dut.Vendor())
283287
}
284-
helpers.GnmiCLIConfig(t, dut, extCommunityEnableCLIConfig)
285288
}
286289
}
287290

@@ -333,6 +336,9 @@ func applyExportPolicyDut(t *testing.T, dut *ondatra.DUTDevice, policyName strin
333336
root := &oc.Root{}
334337
dni := deviations.DefaultNetworkInstance(dut)
335338
removeImportAndExportPolicy(t, dut)
339+
if deviations.ExplicitlyApplyAllowAllImportPolicy(dut) {
340+
applyImportPolicyDut(t, dut, "allow-all")
341+
}
336342

337343
// Apply ipv4 policy to bgp neighbour.
338344
path := gnmi.OC().NetworkInstance(dni).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, bgpName).Bgp().Neighbor(atePort2.IPv4).AfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).ApplyPolicy()
@@ -361,7 +367,7 @@ func applyExportPolicyDut(t *testing.T, dut *ondatra.DUTDevice, policyName strin
361367
func validateImportPolicyDut(t *testing.T, dut *ondatra.DUTDevice, td testData, policyName string) {
362368
dni := deviations.DefaultNetworkInstance(dut)
363369
path := gnmi.OC().NetworkInstance(dni).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, bgpName).Bgp().Neighbor(atePort1.IPv4).AfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).ApplyPolicy()
364-
_, ok := gnmi.Watch(t, dut, path.State(), 30*time.Second, func(v *ygnmi.Value[*oc.NetworkInstance_Protocol_Bgp_Neighbor_AfiSafi_ApplyPolicy]) bool {
370+
_, ok := gnmi.Watch(t, dut, path.State(), 2*time.Minute, func(v *ygnmi.Value[*oc.NetworkInstance_Protocol_Bgp_Neighbor_AfiSafi_ApplyPolicy]) bool {
365371
value, ok := v.Val()
366372
if !ok {
367373
return false
@@ -376,15 +382,21 @@ func validateImportPolicyDut(t *testing.T, dut *ondatra.DUTDevice, td testData,
376382
t.Fatalf("invalid import policy")
377383
}
378384
// Validating if OTG has learnt 3 prefixes with subnet 203.0.0.0/16 on which policy applied
385+
receivedPrefixes := map[string]bool{}
386+
var bgpPrefixes []*otgtelemetry.BgpPeer_UnicastIpv4Prefix
379387
_, pok := gnmi.WatchAll(t, td.ate.OTG(), gnmi.OTG().BgpPeer(td.otgP2.Name()+".BGP4.peer").UnicastIpv4PrefixAny().State(), 2*time.Minute, func(v *ygnmi.Value[*otgtelemetry.BgpPeer_UnicastIpv4Prefix]) bool {
380-
_, present := v.Val()
381-
return present
388+
prefix, present := v.Val()
389+
if !present {
390+
return false
391+
}
392+
receivedPrefixes[prefix.GetAddress()] = true
393+
bgpPrefixes = append(bgpPrefixes, prefix)
394+
return len(receivedPrefixes) == 3
382395
}).Await(t)
383396
if !pok {
384-
t.Fatalf("Prefixes not installed on OTG port 2")
397+
t.Fatalf("Prefixes not installed on OTG port 2, got: %v", receivedPrefixes)
385398
}
386399
found := 0
387-
bgpPrefixes := gnmi.GetAll(t, td.ate.OTG(), gnmi.OTG().BgpPeer(td.otgP2.Name()+".BGP4.peer").UnicastIpv4PrefixAny().State())
388400
for _, bgpPrefix := range bgpPrefixes {
389401
_, ok := gnmi.Watch(t, td.ate.OTG(), gnmi.OTG().BgpPeer(td.otgP2.Name()+".BGP4.peer").UnicastIpv4Prefix(bgpPrefix.GetAddress(), bgpPrefix.GetPrefixLength(), bgpPrefix.GetOrigin(), bgpPrefix.GetPathId()).State(), 10*time.Second, func(v *ygnmi.Value[*otgtelemetry.BgpPeer_UnicastIpv4Prefix]) bool {
390402
if !v.IsPresent() {
@@ -817,7 +829,20 @@ func configureExtCommunityRoutingPolicy(t *testing.T, dut *ondatra.DUTDevice) {
817829
case ondatra.CISCO:
818830
var communityCLIConfig string
819831
communityCLIConfig = fmt.Sprintf("community-set %v\n dfa-regex '%v', \n match invert \n end-set", "regex_match_comm100", communitySet["regex_match_comm100"])
820-
policySetCLIConfig := fmt.Sprintf("route-policy %v \n #statement-1 1-megabit-match \n if community is-empty then \n pass \n elseif community in %v then \n set extcommunity bandwidth %v \n endif \n pass \n #statement-2 accept_all_routes \n done \n end-policy", "not_match_100_set_linkbw_1M", "regex_match_comm100", "linkbw_1M")
832+
policySetCLIConfig := fmt.Sprintf(
833+
"route-policy %v \n"+
834+
" #statement-1 1-megabit-match \n"+
835+
" if community in %v then \n"+
836+
" set extcommunity bandwidth %v \n"+
837+
" endif \n"+
838+
" pass \n"+
839+
" #statement-2 accept_all_routes \n"+
840+
" done \n"+
841+
"end-policy",
842+
"not_match_100_set_linkbw_1M",
843+
"regex_match_comm100",
844+
"linkbw_1M",
845+
)
821846
helpers.GnmiCLIConfig(t, dut, communityCLIConfig)
822847
helpers.GnmiCLIConfig(t, dut, policySetCLIConfig)
823848
default:

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ platform_exceptions: {
3333
bgp_extended_community_index_unsupported: true
3434
bgp_conditions_match_community_set_unsupported: true
3535
bgp_explicit_extended_community_enable: true
36+
explicitly_apply_allow_all_import_policy: true
3637
}
3738
}
3839
platform_exceptions: {

feature/system/health/tests/system_generic_health_check/system_generic_health_check_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ func TestControllerCardsNoHighCPUSpike(t *testing.T) {
224224
if len(controllerCards) == 0 || len(cpuCards) == 0 {
225225
t.Errorf("ERROR: No controllerCard or cpuCard has been found.")
226226
}
227-
if deviations.CpuUtilizationQueryAgainstBaseControllerCardComponent(dut) {
227+
if deviations.CPUUtilizationQueryAgainstBaseControllerCardComponent(dut) {
228228
for _, cpu := range controllerCards {
229229
t.Run(cpu, func(t *testing.T) {
230230
ts := time.Now().Round(time.Second)
@@ -285,7 +285,7 @@ func TestLineCardsNoHighCPUSpike(t *testing.T) {
285285
cpuCards := components.FindComponentsByType(t, dut, cpuType)
286286
chassisLineCards := make([]string, 0)
287287

288-
if deviations.CpuUtilizationQueryAgainstBaseLinecardComponent(dut) {
288+
if deviations.CPUUtilizationQueryAgainstBaseLinecardComponent(dut) {
289289
// Cisco reports CPU utilization on the base linecard component (e.g. 0/0/CPU0)
290290
var baseLCs []string
291291
for _, cpu := range cpuCards {

internal/deviations/deviations.go

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1805,8 +1805,8 @@ func ConfigACLValueAnyOcUnsupported(dut *ondatra.DUTDevice) bool {
18051805
return lookupDUTDeviations(dut).GetConfigAclValueAnyOcUnsupported()
18061806
}
18071807

1808-
// ConfigAclOcUnsupported returns true if OC for configuring parameter in ACL with OC is not supported
1809-
func ConfigAclOcUnsupported(dut *ondatra.DUTDevice) bool {
1808+
// ConfigACLOcUnsupported returns true if OC for configuring parameter in ACL with OC is not supported
1809+
func ConfigACLOcUnsupported(dut *ondatra.DUTDevice) bool {
18101810
return lookupDUTDeviations(dut).GetConfigAclOcUnsupported()
18111811
}
18121812

@@ -1878,15 +1878,15 @@ func TemperatureSensorCheck(dut *ondatra.DUTDevice) bool {
18781878
return lookupDUTDeviations(dut).GetTemperatureSensorCheck()
18791879
}
18801880

1881-
// CpuUtilizationQueryAgainstBaseControllerCardComponent returns true if the device reports Controller CPU utilization against the base controller card component
1881+
// CPUUtilizationQueryAgainstBaseControllerCardComponent returns true if the device reports Controller CPU utilization against the base controller card component
18821882
// example: against "0/RP0/CPU0" and not "0/RP00/CPU0-Broadwell-DE (D-1573N)"
1883-
func CpuUtilizationQueryAgainstBaseControllerCardComponent(dut *ondatra.DUTDevice) bool {
1883+
func CPUUtilizationQueryAgainstBaseControllerCardComponent(dut *ondatra.DUTDevice) bool {
18841884
return lookupDUTDeviations(dut).GetCpuUtilizationQueryAgainstBaseControllerCardComponent()
18851885
}
18861886

1887-
// CpuUtilizationQueryAgainstBaseLinecardComponent returns true if the device reports linecard CPU utilization against the base linecard component
1887+
// CPUUtilizationQueryAgainstBaseLinecardComponent returns true if the device reports linecard CPU utilization against the base linecard component
18881888
// example: against "0/0/CPU0" and not "0/0/CPU0-Broadwell-DE (D-1573N)"
1889-
func CpuUtilizationQueryAgainstBaseLinecardComponent(dut *ondatra.DUTDevice) bool {
1889+
func CPUUtilizationQueryAgainstBaseLinecardComponent(dut *ondatra.DUTDevice) bool {
18901890
return lookupDUTDeviations(dut).GetCpuUtilizationQueryAgainstBaseLinecardComponent()
18911891
}
18921892

@@ -1983,3 +1983,9 @@ func BgpRplDirectlyUnderPeerGroupUnsupported(dut *ondatra.DUTDevice) bool {
19831983
func WecmpSetWeightUnsupported(dut *ondatra.DUTDevice) bool {
19841984
return lookupDUTDeviations(dut).GetWecmpSetWeightUnsupported()
19851985
}
1986+
1987+
// ExplicitlyApplyAllowAllImportPolicy returns true if we need to explicitly apply "allow-all" import policy on the device
1988+
// Cisco: https://partnerissuetracker.corp.google.com/issues/479056256
1989+
func ExplicitlyApplyAllowAllImportPolicy(dut *ondatra.DUTDevice) bool {
1990+
return lookupDUTDeviations(dut).GetExplicitlyApplyAllowAllImportPolicy()
1991+
}

proto/metadata.proto

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ message Metadata {
409409
// Skip setting isis-actions set-metric-style-type while configuring
410410
// routing-policy statement action
411411
// Cisco b/456075095
412-
bool skip_isis_set_metric_style_type = 145;
412+
bool skip_isis_set_metric_style_type = 145;
413413
// Skip setting disable-metric-propagation while configuring
414414
// table-connection
415415
bool skip_setting_disable_metric_propagation = 147;
@@ -666,7 +666,7 @@ message Metadata {
666666
// Arista does not support ETHChannel rate-class
667667
bool channel_assignment_rate_class_parameters_unsupported = 247;
668668

669-
// Arista: b/346557012
669+
// Arista: b/346557012
670670
// Devices that do not support qos scheduler ingress policer.
671671
bool qos_scheduler_ingress_policer_unsupported = 248;
672672

@@ -715,14 +715,14 @@ message Metadata {
715715
bool sr_igp_config_unsupported = 260;
716716

717717
// Cisco: b/404301960
718-
// Devices that block one IS-IS level specific authentication config attribute for P2P links.
718+
// Devices that block one IS-IS level specific authentication config attribute for P2P links.
719719
// The same leafs can be set directly under ISIS Interface authentication /network-instances/network-instance/protocols/protocol/isis/interfaces/interface/authentication.
720720
bool set_isis_auth_with_interface_authentication_container = 261;
721721

722722
// Devices that do not support GRE/GUE tunnel interface oc.
723723
// Juniper b/398171114
724724
bool gre_gue_tunnel_interface_oc_unsupported = 262;
725-
725+
726726
// Devices that do not support load-interval configuration
727727
bool load_interval_not_supported = 263;
728728

@@ -815,7 +815,7 @@ message Metadata {
815815
// issues/404301960
816816
bool use_old_oc_path_static_lsp_nh = 290;
817817

818-
// Create/Replace config leaf required
818+
// Create/Replace config leaf required
819819
// Juniper b/419536104
820820
bool config_leaf_create_required = 291;
821821

@@ -845,7 +845,7 @@ message Metadata {
845845

846846
// Skip setting send-community-type in bgp peer-group config
847847
bool skip_bgp_peer_group_send_community_type = 299;
848-
848+
849849
// Devices that need explicit swap_src_dst_mac set with loopback_mode
850850
// Nokia b/430183279
851851
bool explicit_swap_src_dst_mac_needed_for_loopback_mode = 301;
@@ -856,7 +856,7 @@ message Metadata {
856856

857857
// low_scale_aft returns true if device requires low scale AFT.
858858
bool low_scale_aft = 303;
859-
859+
860860
// Devices that do not support system-description config path
861861
// Nokia b/431929861
862862
bool missing_system_description_config_path = 304;
@@ -897,15 +897,15 @@ message Metadata {
897897
// Devices that do not support policy forwarding encapsulate gre action
898898
// Arista: b/409347274
899899
bool policy_forwarding_gre_encapsulation_oc_unsupported = 315;
900-
900+
901901
// policy rule based counters unsupported
902902
// Arista : https://partnerissuetracker.corp.google.com/issues/425628787
903903
bool policy_rule_counters_oc_unsupported = 316;
904904

905905
// Devices that must have OTN to ETH assignment.
906906
// Arista : https://partnerissuetracker.corp.google.com/issues/434922681
907907
bool otn_to_eth_assignment = 317;
908-
908+
909909
// Devices that do not support import export policies configured in network instance
910910
bool network_instance_import_export_policy_oc_unsupported = 318;
911911

@@ -937,14 +937,14 @@ message Metadata {
937937
// Arista: https://partnerissuetracker.corp.google.com/issues/442749011
938938
bool qos_two_rate_three_color_policer_oc_unsupported = 325;
939939

940-
// Devices that do not support load balance policies
940+
// Devices that do not support load balance policies
941941
// Arista: https://partnerissuetracker.corp.google.com/issues/445043741
942942
bool load_balance_policy_oc_unsupported = 326;
943943

944944
// Devices that do not support gribi records
945945
// Cisco: https://partnerissuetracker.corp.google.com/issues/445304668
946946
bool gribi_records_unsupported = 327;
947-
947+
948948
// Devices without breakout mode support for full rate.
949949
// Nokia: b/435502032
950950
bool breakout_mode_unsupported_for_eight_hundred_gb = 328;
@@ -983,7 +983,7 @@ message Metadata {
983983
// Devices that do not support transceiver config enable leaf
984984
// Nokia b/414842051
985985
bool transceiver_config_enable_unsupported = 336;
986-
986+
987987
// Devices that do not support aft summary oc path
988988
// Cisco: https://issuetracker.google.com/450898206
989989
bool aft_summary_oc_unsupported = 337;
@@ -1003,7 +1003,7 @@ message Metadata {
10031003
// Juniper does not support localhost yet
10041004
// b/448173472
10051005
bool localhost_for_containerz = 341;
1006-
1006+
10071007
// Juniper: b/434633267
10081008
// Devices that do not support oc path for aggregate bandwidth policy
10091009
// action.
@@ -1108,7 +1108,7 @@ message Metadata {
11081108
// Check if transceiver subcomponent should look for the temperature sensor
11091109
// Cisco: https://partnerissuetracker.corp.google.com/issues/475715208
11101110
bool temperature_sensor_check = 367;
1111-
1111+
11121112
// Cisco https://partnerissuetracker.corp.google.com/issues/475101800
11131113
// Devices that report controller CPU utilization against base controller card component
11141114
bool cpu_utilization_query_against_base_controller_card_component = 368;
@@ -1152,7 +1152,7 @@ message Metadata {
11521152
bool terminal_device_channel_admin_state_unsupported = 379;
11531153

11541154
// Device that requires explicit config to support BGP RIB streaming
1155-
// Arista: https://partnerissuetracker.corp.google.com/issues/471971235
1155+
// Arista: https://partnerissuetracker.corp.google.com/issues/471971235
11561156
bool bgp_rib_streaming_config_required = 380;
11571157

11581158
// Device does not support enabling ACL counters through OC
@@ -1187,6 +1187,10 @@ message Metadata {
11871187
// Juniper b/450154047
11881188
bool wecmp_set_weight_unsupported = 388;
11891189

1190+
// Device does not support default import policy so we need to explicitly apply "allow-all" import policy
1191+
// Cisco: https://partnerissuetracker.corp.google.com/issues/479056256
1192+
bool explicitly_apply_allow_all_import_policy = 389;
1193+
11901194
// Reserved field numbers and identifiers.
11911195
reserved 84, 9, 28, 20, 38, 43, 90, 97, 55, 89, 19, 36, 35, 40, 113, 131, 141, 173, 234, 254, 231, 300, 241;
11921196
}

0 commit comments

Comments
 (0)