Skip to content

Commit d2a3391

Browse files
Merge branch 'main' into fpt_otg_CFM_1_1
2 parents 0e97418 + b343c7a commit d2a3391

File tree

88 files changed

+4463
-509
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+4463
-509
lines changed

.github/workflows/test_gap_analysis.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# .github/workflows/test_gap_analysis.yaml
21
name: FNT Gap Analysis
32

43
on:
@@ -10,29 +9,36 @@ permissions: {}
109
jobs:
1110
gap_analysis_test:
1211
runs-on: ubuntu-latest
12+
env:
13+
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
1314
permissions:
1415
contents: read
1516
pull-requests: read
1617
steps:
18+
- name: Show skip message
19+
if: ${{ env.GEMINI_API_KEY == '' }}
20+
run: echo "No access to Gemini, skipping test."
1721
- name: Checkout code
22+
if: ${{ env.GEMINI_API_KEY != '' }}
1823
uses: actions/checkout@v4
1924
with:
2025
fetch-depth: 0 # Needed for changed-files action to diff against base branch
2126

2227
- name: Set up Go
28+
if: ${{ env.GEMINI_API_KEY != '' }}
2329
uses: actions/setup-go@v5
2430
with:
2531
go-version: '1.21'
2632

2733
- name: Get changed files
34+
if: ${{ env.GEMINI_API_KEY != '' }}
2835
id: changed-files-pr
2936
uses: tj-actions/changed-files@v44
3037
with:
3138
separator: ','
3239

3340
- name: Run Gap Analysis Script
34-
env:
35-
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
41+
if: ${{ env.GEMINI_API_KEY != '' }}
3642
run: |
3743
echo "--- Building and Running FNT Gap Analysis ---"
3844
go build -o gap-analyzer tools/gap-analyzer/read_fnttests.go

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/afts/otg_tests/afts_atomic/afts_atomic_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,9 @@ func (tc *testCase) waitForISISAdjacency(t *testing.T) error {
241241
}
242242

243243
dutPort := tc.dut.Port(t, port1Name).Name()
244+
if deviations.InterfaceRefInterfaceIDFormat(tc.dut) {
245+
dutPort = dutPort + ".0"
246+
}
244247
adjPath := isisPath.Interface(dutPort).Level(2).AdjacencyAny()
245248
if _, ok := gnmi.WatchAll(t, tc.dut, adjPath.AdjacencyState().State(), gnmiTimeout, verifyAdjacencyState).Await(t); !ok {
246249
return fmt.Errorf("no ISIS adjacency formed for port1 (%s)", dutPort)

feature/afts/otg_tests/afts_atomic/metadata.textproto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ platform_exceptions: {
4141
isis_level_enabled: true
4242
multipath_unsupported_neighbor_or_afisafi: true
4343
explicit_interface_in_default_vrf: true
44+
interface_ref_interface_id_format: true
4445
}
4546
}
4647

feature/afts/otg_tests/afts_reboot/afts_reboot_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,9 @@ func (tc *testCase) waitForISISAdjacency(t *testing.T) error {
244244
return state == oc.Isis_IsisInterfaceAdjState_UP
245245
}
246246
dutPort := tc.dut.Port(t, port1Name).Name()
247+
if deviations.InterfaceRefInterfaceIDFormat(tc.dut) {
248+
dutPort = dutPort + ".0"
249+
}
247250
adjPath := isisPath.Interface(dutPort).Level(2).AdjacencyAny()
248251
if _, ok := gnmi.WatchAll(t, tc.dut, adjPath.AdjacencyState().State(), gnmiTimeout, verifyAdjacencyState).Await(t); !ok {
249252
return fmt.Errorf("no ISIS adjacency formed for port1 (%s)", dutPort)

feature/afts/otg_tests/afts_reboot/metadata.textproto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,6 @@ platform_exceptions: {
4141
isis_level_enabled: true
4242
multipath_unsupported_neighbor_or_afisafi: true
4343
explicit_interface_in_default_vrf: true
44+
interface_ref_interface_id_format: true
4445
}
4546
}

feature/bgp/ate_tests/bgp_long_lived_graceful_restart/bgp_long_lived_graceful_restart_test.go

Lines changed: 139 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ const (
8888
setALLOWPolicy = "ALLOW"
8989
bgpMED = 25
9090
aclStatement3 = "30"
91+
gnmiRetryCount = 3
92+
gnmiDeleteRetryCount = 3
93+
gnmiSleepDuration = 30 * time.Second
9194
)
9295

9396
var (
@@ -202,7 +205,7 @@ func configureRoutePolicy(t *testing.T, dut *ondatra.DUTDevice, name string, pr
202205
t.Fatal(err)
203206
}
204207
st.GetOrCreateActions().PolicyResult = pr
205-
gnmi.Replace(t, dut, gnmi.OC().RoutingPolicy().Config(), rp)
208+
gnmi.Update(t, dut, gnmi.OC().RoutingPolicy().Config(), rp)
206209
}
207210

208211
func configInterfaceDUT(t *testing.T, i *oc.Interface, me *attrs.Attributes, subIntfIndex uint32, vlan uint16, dut *ondatra.DUTDevice) {
@@ -280,8 +283,13 @@ func configureDUT(t *testing.T, dut *ondatra.DUTDevice) {
280283
fptest.SetPortSpeed(t, dut.Port(t, "port2"))
281284
}
282285
if deviations.ExplicitInterfaceInDefaultVRF(dut) {
283-
fptest.AssignToNetworkInstance(t, dut, i1.GetName(), deviations.DefaultNetworkInstance(dut), 0)
284286
fptest.AssignToNetworkInstance(t, dut, i2.GetName(), deviations.DefaultNetworkInstance(dut), 0)
287+
if deviations.RequireRoutedSubinterface0(dut) {
288+
fptest.AssignToNetworkInstance(t, dut, i1.GetName(), deviations.DefaultNetworkInstance(dut), 0)
289+
}
290+
for _, subIntf := range []uint32{10, 20, 30, 40, 50, 60} {
291+
fptest.AssignToNetworkInstance(t, dut, i1.GetName(), deviations.DefaultNetworkInstance(dut), subIntf)
292+
}
285293
}
286294
}
287295

@@ -638,7 +646,7 @@ func removeNewPeers(t *testing.T, dut *ondatra.DUTDevice, nbrs []*bgpNeighbor) {
638646
t.Helper()
639647
dutConfPath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP").Bgp()
640648
for _, nbr := range nbrs {
641-
gnmi.Delete(t, dut, dutConfPath.Neighbor(nbr.neighborip).Config())
649+
deleteWithRetry(t, dut, dutConfPath.Neighbor(nbr.neighborip).Config())
642650
}
643651
fptest.LogQuery(t, "DUT BGP Config", dutConfPath.Config(), gnmi.Get(t, dut, dutConfPath.Config()))
644652
}
@@ -658,20 +666,20 @@ func setBgpPolicy(t *testing.T, dut *ondatra.DUTDevice, d *oc.Root) {
658666
actions5.GetOrCreateBgpActions().SetMedAction = oc.BgpPolicy_BgpSetMedAction_SET
659667
}
660668
actions5.GetOrCreateBgpActions().SetLocalPref = ygot.Uint32(100)
661-
gnmi.Update(t, dut, gnmi.OC().RoutingPolicy().Config(), rp)
669+
updateWithRetry(t, dut, gnmi.OC().RoutingPolicy().Config(), rp)
662670

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

665673
if deviations.RoutePolicyUnderAFIUnsupported(dut) {
666-
gnmi.Update(t, dut, dutConfPath.PeerGroup(peerv4GrpName).ApplyPolicy().ExportPolicy().Config(), []string{"ALLOW", setMEDPolicy})
667-
gnmi.Update(t, dut, dutConfPath.PeerGroup(peerv4GrpName).ApplyPolicy().ImportPolicy().Config(), []string{"ALLOW", setMEDPolicy})
668-
gnmi.Update(t, dut, dutConfPath.PeerGroup(peerv6GrpName).ApplyPolicy().ExportPolicy().Config(), []string{"ALLOW", setMEDPolicy})
669-
gnmi.Update(t, dut, dutConfPath.PeerGroup(peerv6GrpName).ApplyPolicy().ImportPolicy().Config(), []string{"ALLOW", setMEDPolicy})
674+
updateWithRetry(t, dut, dutConfPath.PeerGroup(peerv4GrpName).ApplyPolicy().ExportPolicy().Config(), []string{"ALLOW", setMEDPolicy})
675+
updateWithRetry(t, dut, dutConfPath.PeerGroup(peerv4GrpName).ApplyPolicy().ImportPolicy().Config(), []string{"ALLOW", setMEDPolicy})
676+
updateWithRetry(t, dut, dutConfPath.PeerGroup(peerv6GrpName).ApplyPolicy().ExportPolicy().Config(), []string{"ALLOW", setMEDPolicy})
677+
updateWithRetry(t, dut, dutConfPath.PeerGroup(peerv6GrpName).ApplyPolicy().ImportPolicy().Config(), []string{"ALLOW", setMEDPolicy})
670678
} else {
671-
gnmi.Update(t, dut, dutConfPath.PeerGroup(peerv4GrpName).AfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).ApplyPolicy().ImportPolicy().Config(), []string{"ALLOW", setMEDPolicy})
672-
gnmi.Update(t, dut, dutConfPath.PeerGroup(peerv4GrpName).AfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).ApplyPolicy().ExportPolicy().Config(), []string{"ALLOW", setMEDPolicy})
673-
gnmi.Update(t, dut, dutConfPath.PeerGroup(peerv6GrpName).AfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST).ApplyPolicy().ImportPolicy().Config(), []string{"ALLOW", setMEDPolicy})
674-
gnmi.Update(t, dut, dutConfPath.PeerGroup(peerv6GrpName).AfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST).ApplyPolicy().ExportPolicy().Config(), []string{"ALLOW", setMEDPolicy})
679+
updateWithRetry(t, dut, dutConfPath.PeerGroup(peerv4GrpName).AfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).ApplyPolicy().ImportPolicy().Config(), []string{"ALLOW", setMEDPolicy})
680+
updateWithRetry(t, dut, dutConfPath.PeerGroup(peerv4GrpName).AfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).ApplyPolicy().ExportPolicy().Config(), []string{"ALLOW", setMEDPolicy})
681+
updateWithRetry(t, dut, dutConfPath.PeerGroup(peerv6GrpName).AfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST).ApplyPolicy().ImportPolicy().Config(), []string{"ALLOW", setMEDPolicy})
682+
updateWithRetry(t, dut, dutConfPath.PeerGroup(peerv6GrpName).AfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST).ApplyPolicy().ExportPolicy().Config(), []string{"ALLOW", setMEDPolicy})
675683
}
676684
}
677685

@@ -699,7 +707,7 @@ func configureDUTNewPeers(t *testing.T, dut *ondatra.DUTDevice, nbrs []*bgpNeigh
699707
af6 := nv4.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST)
700708
af6.Enabled = ygot.Bool(false)
701709
}
702-
gnmi.Update(t, dut, dutConfPath.Config(), niProto)
710+
updateWithRetry(t, dut, dutConfPath.Config(), niProto)
703711
fptest.LogQuery(t, "DUT BGP Config", dutConfPath.Config(), gnmi.Get(t, dut, dutConfPath.Config()))
704712
}
705713

@@ -751,26 +759,56 @@ func verifyGracefulRestart(t *testing.T, dut *ondatra.DUTDevice) {
751759
t.Errorf("Expected Graceful restart timer: got %v, want %v", grTimerVal, grRestartTime)
752760
}
753761

754-
if llgrTimer := gnmi.Get(t, dut, nbrPath.GracefulRestart().StaleRoutesTime().State()); llgrTimer != grStaleRouteTime {
755-
t.Errorf("LLGR timer is incorrect, want %v, got %v", grStaleRouteTime, llgrTimer)
756-
}
757-
if grState := gnmi.Get(t, dut, nbrPath.GracefulRestart().Enabled().State()); grState != true {
758-
t.Errorf("Graceful restart enabled state is incorrect, want true, got %v", grState)
759-
}
760-
if peerRestartTime := gnmi.Get(t, dut, nbrPath.GracefulRestart().PeerRestartTime().State()); peerRestartTime != 0 {
761-
t.Errorf("Peer restart time is incorrect, want 0, got %v", peerRestartTime)
762+
if !deviations.BgpLlgrOcUndefined(dut) {
763+
if llgrTimer := gnmi.Get(t, dut, nbrPath.GracefulRestart().StaleRoutesTime().State()); llgrTimer != grStaleRouteTime {
764+
t.Errorf("LLGR timer is incorrect, want %v, got %v", grStaleRouteTime, llgrTimer)
765+
}
762766
}
763-
if peerRestartState := gnmi.Get(t, dut, nbrPath.GracefulRestart().PeerRestarting().State()); peerRestartState != true {
764-
t.Errorf("Peer restart state is incorrect, want true , got %v", peerRestartState)
767+
grState, present := gnmi.Lookup(t, dut, nbrPath.GracefulRestart().Enabled().State()).Val()
768+
if !present && deviations.MissingValueForDefaults(dut) {
769+
grState = true
770+
} else if !present {
771+
t.Errorf("Graceful restart enabled state is not present")
765772
}
766-
if localRestartState := gnmi.Get(t, dut, nbrPath.GracefulRestart().LocalRestarting().State()); localRestartState != false {
767-
t.Errorf("Local restart state is incorrect, want false, got %v", localRestartState)
773+
if grState != true {
774+
t.Errorf("Graceful restart enabled state is incorrect, want true, got %v", grState)
768775
}
769-
if grMode := gnmi.Get(t, dut, nbrPath.GracefulRestart().Mode().State()); grMode != oc.GracefulRestart_Mode_HELPER_ONLY {
770-
t.Errorf("Graceful restart mode is incorrect, want oc.GracefulRestart_Mode_HELPER_ONLY, got %v", grMode)
776+
if !deviations.BgpLlgrOcUndefined(dut) {
777+
peerRestartState, present := gnmi.Lookup(t, dut, nbrPath.GracefulRestart().PeerRestarting().State()).Val()
778+
if !present && deviations.MissingValueForDefaults(dut) {
779+
peerRestartState = true
780+
} else if !present {
781+
t.Errorf("Graceful restart peer-restarting state is not present")
782+
}
783+
if peerRestartState != true {
784+
peerRestartTime, present := gnmi.Lookup(t, dut, nbrPath.GracefulRestart().PeerRestartTime().State()).Val()
785+
if !present && deviations.MissingValueForDefaults(dut) {
786+
peerRestartTime = 0
787+
} else if !present {
788+
t.Errorf("Peer restart time is not present")
789+
}
790+
if peerRestartTime != 0 {
791+
t.Errorf("Peer restart time is incorrect, want 0, got %v", peerRestartTime)
792+
}
793+
t.Errorf("Peer restart state is incorrect, want true, got %v", peerRestartState)
794+
}
795+
if localRestartState := gnmi.Get(t, dut, nbrPath.GracefulRestart().LocalRestarting().State()); localRestartState != false {
796+
t.Errorf("Local restart state is incorrect, want false, got %v", localRestartState)
797+
}
798+
if grMode := gnmi.Get(t, dut, nbrPath.GracefulRestart().Mode().State()); grMode != oc.GracefulRestart_Mode_HELPER_ONLY && grMode != oc.GracefulRestart_Mode_BILATERAL {
799+
t.Errorf("Graceful restart mode is incorrect, want %v or %v, got %v", oc.GracefulRestart_Mode_HELPER_ONLY, oc.GracefulRestart_Mode_BILATERAL, grMode)
800+
}
771801
}
772-
if nbrAfiSafiGrState := gnmi.Get(t, dut, nbrPath.AfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).GracefulRestart().Enabled().State()); nbrAfiSafiGrState != true {
773-
t.Errorf("Neighbor AFI-SAFI graceful restart state is incorrect, want true, got %v", nbrAfiSafiGrState)
802+
if !deviations.BgpGracefulRestartUnderAfiSafiUnsupported(dut) {
803+
nbrAfiSafiGrState, present := gnmi.Lookup(t, dut, nbrPath.AfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).GracefulRestart().Enabled().State()).Val()
804+
if !present && deviations.MissingValueForDefaults(dut) {
805+
nbrAfiSafiGrState = true
806+
} else if !present {
807+
t.Errorf("Neighbor AFI-SAFI Graceful restart enabled state is not present")
808+
}
809+
if nbrAfiSafiGrState != true {
810+
t.Errorf("Neighbor AFI-SAFI Graceful restart status: got %v, want Enabled", nbrAfiSafiGrState)
811+
}
774812
}
775813
}
776814

@@ -791,6 +829,58 @@ func buildCliConfigRequest(config string) *gpb.SetRequest {
791829
return gpbSetRequest
792830
}
793831

832+
func replaceWithRetry[T any](t *testing.T, dut *ondatra.DUTDevice, q ygnmi.ConfigQuery[T], val T) {
833+
t.Helper()
834+
gnmiOperationWithRetry(t, "Replace", gnmiRetryCount, func() error {
835+
gnmiClient := dut.RawAPIs().GNMI(t)
836+
c, err := ygnmi.NewClient(gnmiClient, ygnmi.WithTarget(dut.Name()))
837+
if err != nil {
838+
return fmt.Errorf("failed to create ygnmi client: %w", err)
839+
}
840+
_, err = ygnmi.Replace(context.Background(), c, q, val)
841+
return err
842+
})
843+
}
844+
845+
func updateWithRetry[T any](t *testing.T, dut *ondatra.DUTDevice, q ygnmi.ConfigQuery[T], val T) {
846+
t.Helper()
847+
gnmiOperationWithRetry(t, "Update", gnmiRetryCount, func() error {
848+
gnmiClient := dut.RawAPIs().GNMI(t)
849+
c, err := ygnmi.NewClient(gnmiClient, ygnmi.WithTarget(dut.Name()))
850+
if err != nil {
851+
return fmt.Errorf("failed to create ygnmi client: %w", err)
852+
}
853+
_, err = ygnmi.Update(context.Background(), c, q, val)
854+
return err
855+
})
856+
}
857+
858+
func deleteWithRetry[T any](t *testing.T, dut *ondatra.DUTDevice, q ygnmi.ConfigQuery[T]) {
859+
t.Helper()
860+
gnmiOperationWithRetry(t, "Delete", gnmiDeleteRetryCount, func() error {
861+
gnmiClient := dut.RawAPIs().GNMI(t)
862+
c, err := ygnmi.NewClient(gnmiClient, ygnmi.WithTarget(dut.Name()))
863+
if err != nil {
864+
return fmt.Errorf("failed to create ygnmi client: %w", err)
865+
}
866+
_, err = ygnmi.Delete(context.Background(), c, q)
867+
return err
868+
})
869+
}
870+
871+
func gnmiOperationWithRetry(t *testing.T, opName string, retryCount int, op func() error) {
872+
t.Helper()
873+
for i := 0; i < retryCount; i++ {
874+
err := op()
875+
if err == nil {
876+
return
877+
}
878+
t.Logf("%s failed, retrying... Attempt %d/%d. Error: %v", opName, i+1, retryCount, err)
879+
time.Sleep(gnmiSleepDuration)
880+
}
881+
t.Fatalf("%s failed after %d attempts", opName, retryCount)
882+
}
883+
794884
func TestTrafficWithGracefulRestartLLGR(t *testing.T) {
795885
dut := ondatra.DUT(t, "dut")
796886
ate := ondatra.ATE(t, "ate")
@@ -887,33 +977,45 @@ func TestTrafficWithGracefulRestartLLGR(t *testing.T) {
887977
})
888978

889979
t.Run("Restart routing", func(t *testing.T) {
980+
if deviations.RoutingRestartViaGnoiUnsupported(dut) {
981+
t.Skip("Skipping routing restart via gNOI due to deviation")
982+
}
890983
gnoi.KillProcess(t, dut, gnoi.ROUTING, gnoi.SigTerm, true, true)
891984
})
892985

893986
var bgpIxPeer []*ixnet.BGP
894987
t.Run("configure 5 more new BGP peers", func(t *testing.T) {
988+
if deviations.BgpConfigDuringGracefulRestartUnsupported(dut) {
989+
t.Skip("Skipping BGP Peer configuration during graceful restart due to deviation")
990+
}
895991
configureDUTNewPeers(t, dut, dutNbrs)
896992
bgpIxPeer = configureATENewPeers(t, topo, ateIntfList)
897993
})
898994

899995
t.Run("Remove newly added 5 BGP peers", func(t *testing.T) {
996+
if deviations.BgpConfigDuringGracefulRestartUnsupported(dut) {
997+
t.Skip("Skipping BGP Peer removal during graceful restart due to deviation")
998+
}
900999
removeNewPeers(t, dut, dutNbrs)
9011000
removeATENewPeers(t, topo, bgpIxPeer)
9021001
})
9031002

9041003
t.Run("Remove policy configured", func(t *testing.T) {
1004+
if deviations.BgpConfigDuringGracefulRestartUnsupported(dut) {
1005+
t.Skip("Skipping BGP Policy removal during graceful restart due to deviation")
1006+
}
9051007
dutBgpV4PeerGroupPath := dutConfPath.Bgp().PeerGroup(peerv4GrpName)
9061008
dutBgpV6PeerGroupPath := dutConfPath.Bgp().PeerGroup(peerv6GrpName)
9071009
if deviations.RoutePolicyUnderAFIUnsupported(dut) {
908-
gnmi.Replace(t, dut, dutBgpV4PeerGroupPath.ApplyPolicy().ExportPolicy().Config(), []string{"ALLOW"})
909-
gnmi.Replace(t, dut, dutBgpV4PeerGroupPath.ApplyPolicy().ImportPolicy().Config(), []string{"ALLOW"})
910-
gnmi.Replace(t, dut, dutBgpV6PeerGroupPath.ApplyPolicy().ExportPolicy().Config(), []string{"ALLOW"})
911-
gnmi.Replace(t, dut, dutBgpV6PeerGroupPath.ApplyPolicy().ImportPolicy().Config(), []string{"ALLOW"})
1010+
replaceWithRetry(t, dut, dutBgpV4PeerGroupPath.ApplyPolicy().ExportPolicy().Config(), []string{"ALLOW"})
1011+
replaceWithRetry(t, dut, dutBgpV4PeerGroupPath.ApplyPolicy().ImportPolicy().Config(), []string{"ALLOW"})
1012+
replaceWithRetry(t, dut, dutBgpV6PeerGroupPath.ApplyPolicy().ExportPolicy().Config(), []string{"ALLOW"})
1013+
replaceWithRetry(t, dut, dutBgpV6PeerGroupPath.ApplyPolicy().ImportPolicy().Config(), []string{"ALLOW"})
9121014
} else {
913-
gnmi.Replace(t, dut, dutBgpV4PeerGroupPath.AfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).ApplyPolicy().ImportPolicy().Config(), []string{"ALLOW"})
914-
gnmi.Replace(t, dut, dutBgpV4PeerGroupPath.AfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).ApplyPolicy().ExportPolicy().Config(), []string{"ALLOW"})
915-
gnmi.Replace(t, dut, dutBgpV6PeerGroupPath.AfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST).ApplyPolicy().ImportPolicy().Config(), []string{"ALLOW"})
916-
gnmi.Replace(t, dut, dutBgpV6PeerGroupPath.AfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST).ApplyPolicy().ExportPolicy().Config(), []string{"ALLOW"})
1015+
replaceWithRetry(t, dut, dutBgpV4PeerGroupPath.AfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).ApplyPolicy().ImportPolicy().Config(), []string{"ALLOW"})
1016+
replaceWithRetry(t, dut, dutBgpV4PeerGroupPath.AfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).ApplyPolicy().ExportPolicy().Config(), []string{"ALLOW"})
1017+
replaceWithRetry(t, dut, dutBgpV6PeerGroupPath.AfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST).ApplyPolicy().ImportPolicy().Config(), []string{"ALLOW"})
1018+
replaceWithRetry(t, dut, dutBgpV6PeerGroupPath.AfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST).ApplyPolicy().ExportPolicy().Config(), []string{"ALLOW"})
9171019
}
9181020
})
9191021
})

0 commit comments

Comments
 (0)