From f48bf369191dac5042c6312066c776c519a166b3 Mon Sep 17 00:00:00 2001 From: dipchauh <159579776+dipchauh@users.noreply.github.com> Date: Wed, 24 Apr 2024 12:35:55 -0400 Subject: [PATCH 1/5] Authz fixes (#2877) "This code is a Contribution to the OpenConfig Feature Profiles project ("Work") made under the Google Software Grant and Corporate Contributor License Agreement ("CLA") and governed by the Apache License 2.0. No other rights or licenses in or to any of Nokia's intellectual property are granted for any other purpose. This code is provided on an "as is" basis without any warranties of any kind." --- .../gnsi/authz/tests/authz/authz1_4_test.go | 49 ++++++++++--------- internal/security/gnxi/rpcexec.go | 2 +- 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/feature/security/gnsi/authz/tests/authz/authz1_4_test.go b/feature/security/gnsi/authz/tests/authz/authz1_4_test.go index 579a8c7710e..ec6f2008aa6 100644 --- a/feature/security/gnsi/authz/tests/authz/authz1_4_test.go +++ b/feature/security/gnsi/authz/tests/authz/authz1_4_test.go @@ -206,7 +206,7 @@ func TestAuthz1(t *testing.T) { // Pre-Test Section _, policyBefore := authz.Get(t, dut) t.Logf("Authz Policy of the Device %s before the Rotate Trigger is %s", dut.Name(), policyBefore.PrettyPrint(t)) - defer policyBefore.Rotate(t, dut, uint64(time.Now().UnixMilli()), fmt.Sprintf("v0.%v", (time.Now().UnixNano())), false) + defer policyBefore.Rotate(t, dut, uint64(time.Now().Unix()), fmt.Sprintf("v0.%v", (time.Now().UnixNano())), false) // Fetch the Desired Authorization Policy and Attach base Admin Policy Before Rotate newpolicy, ok := policyMap["policy-everyone-can-gnmi-not-gribi"] @@ -229,7 +229,7 @@ func TestAuthz1(t *testing.T) { // Pre-Test Section _, policyBefore := authz.Get(t, dut) t.Logf("Authz Policy of the Device %s before the Rotate Trigger is %s", dut.Name(), policyBefore.PrettyPrint(t)) - defer policyBefore.Rotate(t, dut, uint64(time.Now().UnixMilli()), fmt.Sprintf("v0.%v", (time.Now().UnixNano())), false) + defer policyBefore.Rotate(t, dut, uint64(time.Now().Unix()), fmt.Sprintf("v0.%v", (time.Now().UnixNano())), false) // Fetch the Desired Authorization Policy and Attach base Admin Policy Before Rotate newpolicy, ok := policyMap["policy-everyone-can-gribi-not-gnmi"] @@ -252,7 +252,7 @@ func TestAuthz1(t *testing.T) { dut := ondatra.DUT(t, "dut") _, policyBefore := authz.Get(t, dut) t.Logf("Authz Policy of the Device %s before the Rotate Trigger is %s", dut.Name(), policyBefore.PrettyPrint(t)) - defer policyBefore.Rotate(t, dut, uint64(time.Now().UnixMilli()), fmt.Sprintf("v0.%v", (time.Now().UnixNano())), false) + defer policyBefore.Rotate(t, dut, uint64(time.Now().Unix()), fmt.Sprintf("v0.%v", (time.Now().UnixNano())), false) // Fetch the Desired Authorization Policy and Attach base Admin Policy Before Rotate - 1 newpolicy, ok := policyMap["policy-gribi-get"] @@ -274,7 +274,7 @@ func TestAuthz1(t *testing.T) { } newpolicy.AddAllowRules("base", []string{*testInfraID}, []*gnxi.RPC{gnxi.RPCs.AllRPC}) // Rotate the policy. - newpolicy.Rotate(t, dut, uint64(time.Now().UnixMilli()), fmt.Sprintf("v0.%v", (time.Now().UnixNano())), false) + newpolicy.Rotate(t, dut, uint64(time.Now().Unix()), fmt.Sprintf("v0.%v", (time.Now().UnixNano())), false) // Verification of Policy for read-only to deny gRIBI Get and allow gNMI Get t.Run("Verification of Policy for read-only to deny gRIBI Get and allow gNMI Get", func(t *testing.T) { @@ -287,7 +287,7 @@ func TestAuthz1(t *testing.T) { // Pre-Test Section _, policyBefore := authz.Get(t, dut) t.Logf("Authz Policy of the Device %s before the Rotate Trigger is %s", dut.Name(), policyBefore.PrettyPrint(t)) - defer policyBefore.Rotate(t, dut, uint64(time.Now().UnixMilli()), fmt.Sprintf("v0.%v", (time.Now().UnixNano())), false) + defer policyBefore.Rotate(t, dut, uint64(time.Now().Unix()), fmt.Sprintf("v0.%v", (time.Now().UnixNano())), false) // Fetch the Desired Authorization Policy and Attach base Admin Policy Before Rotate newpolicy, ok := policyMap["policy-normal-1"] @@ -313,7 +313,7 @@ func TestAuthz2(t *testing.T) { // Pre-Test Section _, policyBefore := authz.Get(t, dut) t.Logf("Authz Policy of the Device %s before the Rotate Trigger is %s", dut.Name(), policyBefore.PrettyPrint(t)) - defer policyBefore.Rotate(t, dut, uint64(time.Now().UnixMilli()), fmt.Sprintf("v0.%v", (time.Now().UnixNano())), false) + defer policyBefore.Rotate(t, dut, uint64(time.Now().Unix()), fmt.Sprintf("v0.%v", (time.Now().UnixNano())), false) // Fetch the Desired Authorization Policy and Attach base Admin Policy Before Rotate newpolicy, ok := policyMap["policy-everyone-can-gnmi-not-gribi"] @@ -334,7 +334,7 @@ func TestAuthz2(t *testing.T) { autzRotateReq := &authzpb.RotateAuthzRequest_UploadRequest{ UploadRequest: &authzpb.UploadRequest{ Version: fmt.Sprintf("v0.%v", (time.Now().UnixNano())), - CreatedOn: uint64(time.Now().UnixMilli()), + CreatedOn: uint64(time.Now().Unix()), Policy: string(jsonPolicy), }, } @@ -348,9 +348,9 @@ func TestAuthz2(t *testing.T) { t.Fatalf("Error while receiving rotate request reply (client 1) %v", err) } // Rotate Request 2 - Before Finalizing the Request 1 - newpolicy, ok = policyMap["policy-everyone-can-gnmi-not-gribi"] + newpolicy, ok = policyMap["policy-everyone-can-gribi-not-gnmi"] if !ok { - t.Fatal("Policy policy-everyone-can-gnmi-not-gribi is not loaded from policy json file") + t.Fatal("Policy policy-everyone-can-gribi-not-gnmi is not loaded from policy json file") } newpolicy.AddAllowRules("base", []string{*testInfraID}, []*gnxi.RPC{gnxi.RPCs.AllRPC}) jsonPolicy, err = newpolicy.Marshal() @@ -365,7 +365,7 @@ func TestAuthz2(t *testing.T) { autzRotateReq = &authzpb.RotateAuthzRequest_UploadRequest{ UploadRequest: &authzpb.UploadRequest{ Version: fmt.Sprintf("v0.%v", (time.Now().UnixNano())), - CreatedOn: uint64(time.Now().UnixMilli()), + CreatedOn: uint64(time.Now().Unix()), Policy: string(jsonPolicy), }, } @@ -390,7 +390,7 @@ func TestAuthz2(t *testing.T) { // Pre-Test Section _, policyBefore := authz.Get(t, dut) t.Logf("Authz Policy of the Device %s before the Rotate Trigger is %s", dut.Name(), policyBefore.PrettyPrint(t)) - defer policyBefore.Rotate(t, dut, uint64(time.Now().UnixMilli()), fmt.Sprintf("v0.%v", (time.Now().UnixNano())), false) + defer policyBefore.Rotate(t, dut, uint64(time.Now().Unix()), fmt.Sprintf("v0.%v", (time.Now().UnixNano())), false) // Fetch the Desired Authorization Policy and Attach base Admin Policy Before Rotate newpolicy, ok := policyMap["policy-gribi-get"] @@ -399,7 +399,7 @@ func TestAuthz2(t *testing.T) { } newpolicy.AddAllowRules("base", []string{*testInfraID}, []*gnxi.RPC{gnxi.RPCs.AllRPC}) // Rotate the policy. - newpolicy.Rotate(t, dut, uint64(time.Now().UnixMilli()), fmt.Sprintf("v0.%v", (time.Now().UnixNano())), false) + newpolicy.Rotate(t, dut, uint64(time.Now().Unix()), fmt.Sprintf("v0.%v", (time.Now().UnixNano())), false) // Verification of Policy for read_only to allow gRIBI Get and to deny gNMI Get t.Run("Verification of Policy for read_only to allow gRIBI Get and to deny gNMI Get", func(t *testing.T) { @@ -425,7 +425,7 @@ func TestAuthz2(t *testing.T) { autzRotateReq := &authzpb.RotateAuthzRequest_UploadRequest{ UploadRequest: &authzpb.UploadRequest{ Version: fmt.Sprintf("v0.%v", (time.Now().UnixNano())), - CreatedOn: uint64(time.Now().UnixMilli()), + CreatedOn: uint64(time.Now().Unix()), Policy: string(jsonPolicy), }, } @@ -459,7 +459,7 @@ func TestAuthz2(t *testing.T) { // Pre-Test Section _, policyBefore := authz.Get(t, dut) t.Logf("Authz Policy of the Device %s before the Rotate Trigger is %s", dut.Name(), policyBefore.PrettyPrint(t)) - defer policyBefore.Rotate(t, dut, uint64(time.Now().UnixMilli()), fmt.Sprintf("v0.%v", (time.Now().UnixNano())), false) + defer policyBefore.Rotate(t, dut, uint64(time.Now().Unix()), fmt.Sprintf("v0.%v", (time.Now().UnixNano())), false) // Fetch the Desired Authorization Policy and Attach base Admin Policy Before Rotate newpolicy, ok := policyMap["policy-gribi-get"] @@ -468,7 +468,7 @@ func TestAuthz2(t *testing.T) { } newpolicy.AddAllowRules("base", []string{*testInfraID}, []*gnxi.RPC{gnxi.RPCs.AllRPC}) // Rotate the policy. - newpolicy.Rotate(t, dut, uint64(time.Now().UnixMilli()), fmt.Sprintf("v0.%v", (time.Now().UnixNano())), false) + newpolicy.Rotate(t, dut, uint64(time.Now().Unix()), fmt.Sprintf("v0.%v", (time.Now().UnixNano())), false) // Verification of Policy for read_only to allow gRIBI Get and to deny gNMI Get t.Run("Verification of Policy for read_only to allow gRIBI Get and to deny gNMI Get", func(t *testing.T) { @@ -495,7 +495,7 @@ func TestAuthz2(t *testing.T) { autzRotateReq := &authzpb.RotateAuthzRequest_UploadRequest{ UploadRequest: &authzpb.UploadRequest{ Version: fmt.Sprintf("v0.%v", (time.Now().UnixNano())), - CreatedOn: uint64(time.Now().UnixMilli()), + CreatedOn: uint64(time.Now().Unix()), Policy: string(jsonPolicy), }, } @@ -527,7 +527,7 @@ func TestAuthz2(t *testing.T) { // Pre-Test Section _, policyBefore := authz.Get(t, dut) t.Logf("Authz Policy of the Device %s before the Rotate Trigger is %s", dut.Name(), policyBefore.PrettyPrint(t)) - defer policyBefore.Rotate(t, dut, uint64(time.Now().UnixMilli()), fmt.Sprintf("v0.%v", (time.Now().UnixNano())), false) + defer policyBefore.Rotate(t, dut, uint64(time.Now().Unix()), fmt.Sprintf("v0.%v", (time.Now().UnixNano())), false) // Fetch the Desired Authorization Policy and Attach base Admin Policy Before Rotate newpolicy, ok := policyMap["policy-gribi-get"] @@ -537,7 +537,7 @@ func TestAuthz2(t *testing.T) { newpolicy.AddAllowRules("base", []string{*testInfraID}, []*gnxi.RPC{gnxi.RPCs.AllRPC}) // Rotate the policy. prevVersion := fmt.Sprintf("v0.%v", (time.Now().UnixNano())) - newpolicy.Rotate(t, dut, uint64(time.Now().UnixMilli()), prevVersion, false) + newpolicy.Rotate(t, dut, uint64(time.Now().Unix()), prevVersion, false) newpolicy, ok = policyMap["policy-gnmi-get"] if !ok { @@ -556,7 +556,7 @@ func TestAuthz2(t *testing.T) { autzRotateReq := &authzpb.RotateAuthzRequest_UploadRequest{ UploadRequest: &authzpb.UploadRequest{ Version: prevVersion, - CreatedOn: uint64(time.Now().UnixMilli()), + CreatedOn: uint64(time.Now().Unix()), Policy: string(jsonPolicy), }, } @@ -576,7 +576,7 @@ func TestAuthz2(t *testing.T) { }) t.Logf("Preforming Rotate with the same version with force overwrite\n") - newpolicy.Rotate(t, dut, uint64(time.Now().UnixMilli()), prevVersion, true) + newpolicy.Rotate(t, dut, uint64(time.Now().Unix()), prevVersion, true) // Verification of Policy for read_only to allow gRIBI Get and to deny gNMI Get t.Run("Verification of Policy for read_only to allow gRIBI Get and to deny gNMI Get after rotate wth force overwrite", func(t *testing.T) { authz.Verify(t, dut, spiffeCertReadOnly, gnxi.RPCs.GribiGet, &authz.ExceptDeny{}, &authz.HardVerify{}) @@ -593,7 +593,7 @@ func TestAuthz3(t *testing.T) { setUpBaseline(t, dut) _, policyBefore := authz.Get(t, dut) t.Logf("Authz Policy of the Device %s before the Rotate Trigger is %s", dut.Name(), policyBefore.PrettyPrint(t)) - defer policyBefore.Rotate(t, dut, uint64(time.Now().UnixMilli()), fmt.Sprintf("v0.%v", (time.Now().UnixNano())), false) + defer policyBefore.Rotate(t, dut, uint64(time.Now().Unix()), fmt.Sprintf("v0.%v", (time.Now().UnixNano())), false) // Fetch the Desired Authorization Policy object. newpolicy, ok := policyMap["policy-gribi-get"] @@ -603,7 +603,7 @@ func TestAuthz3(t *testing.T) { // Attach base Admin Policy // Rotate the policy. newpolicy.AddAllowRules("base", []string{*testInfraID}, []*gnxi.RPC{gnxi.RPCs.AllRPC}) - expCreatedOn := uint64(time.Now().UnixMilli()) + expCreatedOn := uint64(time.Now().Unix()) expVersion := fmt.Sprintf("v0.%v", (time.Now().UnixNano())) newpolicy.Rotate(t, dut, expCreatedOn, expVersion, false) t.Logf("New Rotated Authz Policy is %s", newpolicy.PrettyPrint(t)) @@ -635,9 +635,10 @@ func TestAuthz3(t *testing.T) { func TestAuthz4(t *testing.T) { // Pre-Test Section dut := ondatra.DUT(t, "dut") + setUpBaseline(t, dut) _, policyBefore := authz.Get(t, dut) t.Logf("Authz Policy of the Device %s before the Reboot Trigger is %s", dut.Name(), policyBefore.PrettyPrint(t)) - defer policyBefore.Rotate(t, dut, uint64(time.Now().UnixMilli()), fmt.Sprintf("v0.%v", (time.Now().UnixNano())), false) + defer policyBefore.Rotate(t, dut, uint64(time.Now().Unix()), fmt.Sprintf("v0.%v", (time.Now().UnixNano())), false) // Fetch the Desired Authorization Policy and Attach base Admin Policy Before Rotate newpolicy, ok := policyMap["policy-normal-1"] @@ -645,7 +646,7 @@ func TestAuthz4(t *testing.T) { t.Fatal("Policy policy-normal-1 is not loaded from policy json file") } newpolicy.AddAllowRules("base", []string{*testInfraID}, []*gnxi.RPC{gnxi.RPCs.AllRPC}) - expCreatedOn := uint64(time.Now().UnixMilli()) + expCreatedOn := uint64(time.Now().Unix()) expVersion := fmt.Sprintf("v0.%v", (time.Now().UnixNano())) t.Logf("New Authz Policy is %s", newpolicy.PrettyPrint(t)) newpolicy.Rotate(t, dut, expCreatedOn, expVersion, false) diff --git a/internal/security/gnxi/rpcexec.go b/internal/security/gnxi/rpcexec.go index 9cf326f7fd5..f91274b8633 100644 --- a/internal/security/gnxi/rpcexec.go +++ b/internal/security/gnxi/rpcexec.go @@ -507,7 +507,7 @@ func GnsiAuthzRotate(ctx context.Context, dut *ondatra.DUTDevice, opts []grpc.Di } _, err = gnsiCStream.Recv() // invalid policy is expected since the empty policy is not allowed - if strings.Contains(err.Error(), "invalid policy") { + if strings.Contains(err.Error(), "invalid policy") || status.Code(err) == codes.InvalidArgument { return nil } return err From 6ed7f418b28eb9e81a2261f7d0a987952a76fefd Mon Sep 17 00:00:00 2001 From: NishaSadhasivam-work Date: Wed, 24 Apr 2024 22:16:51 +0530 Subject: [PATCH 2/5] [NOKIA][FNT] Test is failing due to mac resolution on otg is failing (#2909) --- feature/qos/otg_tests/bursty_traffic_test/bursty_traffic_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/feature/qos/otg_tests/bursty_traffic_test/bursty_traffic_test.go b/feature/qos/otg_tests/bursty_traffic_test/bursty_traffic_test.go index ba98e083401..2e8e158c370 100644 --- a/feature/qos/otg_tests/bursty_traffic_test/bursty_traffic_test.go +++ b/feature/qos/otg_tests/bursty_traffic_test/bursty_traffic_test.go @@ -432,6 +432,7 @@ func TestBurstyTraffic(t *testing.T) { t.Logf("Running traffic 1 on DUT interfaces: %s => %s ", dp1.Name(), dp3.Name()) t.Logf("Running traffic 2 on DUT interfaces: %s => %s ", dp2.Name(), dp3.Name()) t.Logf("Sending traffic flows: \n%v\n\n", trafficFlows) + time.Sleep(30 * time.Second) ate.OTG().StartTraffic(t) time.Sleep(30 * time.Second) ate.OTG().StopTraffic(t) From a409b1405eb8b492d776654d29806919bd69ee6d Mon Sep 17 00:00:00 2001 From: jasdeep-hundal Date: Wed, 24 Apr 2024 11:05:25 -0700 Subject: [PATCH 3/5] Remove next set of converted ATE tests (#2917) All removed tests have had OTG versions merged/validated > 1 month ago. --- .../ate_tests/bgp_2byte_4byte_asn/README.md | 29 - .../bgp_2byte_4byte_asn_test.go | 253 --------- .../bgp_2byte_4byte_asn/metadata.textproto | 29 - .../bgp_2byte_4byte_asn_policy_test/README.md | 34 -- .../bgp_2byte_4byte_asn_policy_test.go | 499 ------------------ .../metadata.textproto | 38 -- .../ate_tests/bgp_remove_private_as/README.md | 41 -- .../bgp_remove_private_as_test.go | 394 -------------- .../bgp_remove_private_as/metadata.textproto | 24 - .../README.md | 55 -- ...configuration_convergence_time_bgp_test.go | 367 ------------- ...onfiguration_convergence_time_isis_test.go | 150 ------ .../metadata.textproto | 43 -- 13 files changed, 1956 deletions(-) delete mode 100644 feature/experimental/bgp/ate_tests/bgp_2byte_4byte_asn/README.md delete mode 100644 feature/experimental/bgp/ate_tests/bgp_2byte_4byte_asn/bgp_2byte_4byte_asn_test.go delete mode 100644 feature/experimental/bgp/ate_tests/bgp_2byte_4byte_asn/metadata.textproto delete mode 100644 feature/experimental/bgp/ate_tests/bgp_2byte_4byte_asn_policy_test/README.md delete mode 100644 feature/experimental/bgp/ate_tests/bgp_2byte_4byte_asn_policy_test/bgp_2byte_4byte_asn_policy_test.go delete mode 100644 feature/experimental/bgp/ate_tests/bgp_2byte_4byte_asn_policy_test/metadata.textproto delete mode 100644 feature/experimental/bgp/ate_tests/bgp_remove_private_as/README.md delete mode 100644 feature/experimental/bgp/ate_tests/bgp_remove_private_as/bgp_remove_private_as_test.go delete mode 100644 feature/experimental/bgp/ate_tests/bgp_remove_private_as/metadata.textproto delete mode 100644 feature/experimental/system/gnmi/benchmarking/ate_tests/drained_configuration_convergence_time/README.md delete mode 100644 feature/experimental/system/gnmi/benchmarking/ate_tests/drained_configuration_convergence_time/drained_configuration_convergence_time_bgp_test.go delete mode 100644 feature/experimental/system/gnmi/benchmarking/ate_tests/drained_configuration_convergence_time/drained_configuration_convergence_time_isis_test.go delete mode 100644 feature/experimental/system/gnmi/benchmarking/ate_tests/drained_configuration_convergence_time/metadata.textproto diff --git a/feature/experimental/bgp/ate_tests/bgp_2byte_4byte_asn/README.md b/feature/experimental/bgp/ate_tests/bgp_2byte_4byte_asn/README.md deleted file mode 100644 index 724e759f578..00000000000 --- a/feature/experimental/bgp/ate_tests/bgp_2byte_4byte_asn/README.md +++ /dev/null @@ -1,29 +0,0 @@ -# RT-1.19: BGP 2-Byte and 4-Byte ASN support - -## Summary - -BGP 2-Byte and 4-Byte ASN support - -## Procedure - -* Establish BGP sessions as follows and verify all the sessions are established - * ATE (2-byte) - DUT (4-byte) - eBGP IPv4 with ASN < 65535 on DUT side - * ATE (2-byte) - DUT (4-byte) - eBGP IPv6 with ASN < 65535 on DUT side - * ATE (4-byte) - DUT (4-byte) - eBGP IPv4 - * ATE (4-byte) - DUT (4-byte) - eBGP IPv6 - * ATE (2-byte) - DUT (4-byte) - iBGP IPv4 with ASN < 65535 on DUT side - * ATE (4-byte) - DUT (4-byte) - iBGP IPv6 with ASN < 65535 on DUT side - * ATE (4-byte) - DUT (4-byte) - iBGP IPv4 - * ATE (4-byte) - DUT (4-byte) - iBGP IPv6 - -## Config Parameter Coverage - -* /global/config/as -* /neighbors/neighbor/config/peer-as -* /neighbors/neighbor/config/local-as - -## Telemetry Parameter Coverage - -* /global/config/as -* /neighbors/neighbor/config/peer-as -* /neighbors/neighbor/config/local-as diff --git a/feature/experimental/bgp/ate_tests/bgp_2byte_4byte_asn/bgp_2byte_4byte_asn_test.go b/feature/experimental/bgp/ate_tests/bgp_2byte_4byte_asn/bgp_2byte_4byte_asn_test.go deleted file mode 100644 index af656255725..00000000000 --- a/feature/experimental/bgp/ate_tests/bgp_2byte_4byte_asn/bgp_2byte_4byte_asn_test.go +++ /dev/null @@ -1,253 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bgp_2byte_4byte_asn_test - -import ( - "testing" - "time" - - "github.com/openconfig/featureprofiles/internal/attrs" - "github.com/openconfig/featureprofiles/internal/deviations" - "github.com/openconfig/ondatra/gnmi/oc" - "github.com/openconfig/ygot/ygot" - - "github.com/openconfig/featureprofiles/internal/fptest" - "github.com/openconfig/ondatra" - "github.com/openconfig/ondatra/gnmi" -) - -const ( - connInternal = "INTERNAL" - connExternal = "EXTERNAL" -) - -var ( - dutSrc = attrs.Attributes{ - Desc: "DUT to ATE source", - IPv4: "192.0.2.1", - IPv6: "2001:db8::192:0:2:1", - IPv4Len: 30, - IPv6Len: 126, - } - ateSrc = attrs.Attributes{ - Name: "ateSrc", - IPv4: "192.0.2.2", - IPv6: "2001:db8::192:0:2:2", - IPv4Len: 30, - IPv6Len: 126, - } -) - -type bgpNbr struct { - globalAS, localAS, peerAS uint32 - peerIP string - isV4 bool -} - -func TestMain(m *testing.M) { - fptest.RunTests(m) -} - -func TestBgpSession(t *testing.T) { - t.Log("Configure DUT interface") - dut := ondatra.DUT(t, "dut") - dc := gnmi.OC() - i1 := dutSrc.NewOCInterface(dut.Port(t, "port1").Name(), dut) - gnmi.Replace(t, dut, dc.Interface(i1.GetName()).Config(), i1) - if deviations.ExplicitInterfaceInDefaultVRF(dut) { - fptest.AssignToNetworkInstance(t, dut, i1.GetName(), deviations.DefaultNetworkInstance(dut), 0) - } - - t.Log("Configure Network Instance") - dutConfNIPath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)) - gnmi.Replace(t, dut, dutConfNIPath.Type().Config(), oc.NetworkInstanceTypes_NETWORK_INSTANCE_TYPE_DEFAULT_INSTANCE) - - dutConfPath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP") - statePath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP").Bgp() - - cases := []struct { - name string - nbr *bgpNbr - dutConf *oc.NetworkInstance_Protocol - ateConf *ondatra.ATETopology - }{ - { - name: "Establish eBGP connection between ATE (2-byte) - DUT (4-byte < 65535) for ipv4 peers", - nbr: &bgpNbr{globalAS: 300, localAS: 100, peerIP: ateSrc.IPv4, peerAS: 200, isV4: true}, - dutConf: createBgpNeighbor(&bgpNbr{globalAS: 300, localAS: 100, peerIP: ateSrc.IPv4, peerAS: 200, isV4: true}, dut), - ateConf: configureATE(t, &bgpNbr{globalAS: 300, localAS: 200, peerIP: dutSrc.IPv4, peerAS: 100, isV4: true}, connExternal), - }, { - name: "Establish eBGP connection between ATE (2-byte) - DUT (4-byte < 65535) for ipv6 peers", - nbr: &bgpNbr{globalAS: 300, localAS: 100, peerIP: ateSrc.IPv6, peerAS: 200, isV4: false}, - dutConf: createBgpNeighbor(&bgpNbr{globalAS: 300, localAS: 100, peerIP: ateSrc.IPv6, peerAS: 200, isV4: false}, dut), - ateConf: configureATE(t, &bgpNbr{globalAS: 300, localAS: 200, peerIP: dutSrc.IPv6, peerAS: 100, isV4: false}, connExternal), - }, { - name: "Establish eBGP connection between ATE (4-byte) - DUT (4-byte) for ipv4 peers", - nbr: &bgpNbr{globalAS: 300, localAS: 70000, peerIP: ateSrc.IPv4, peerAS: 80000, isV4: true}, - dutConf: createBgpNeighbor(&bgpNbr{globalAS: 300, localAS: 70000, peerIP: ateSrc.IPv4, peerAS: 80000, isV4: true}, dut), - ateConf: configureATE(t, &bgpNbr{globalAS: 300, localAS: 80000, peerIP: dutSrc.IPv4, peerAS: 70000, isV4: true}, connExternal), - }, { - name: "Establish eBGP connection between ATE (4-byte) - DUT (4-byte) for ipv6 peers", - nbr: &bgpNbr{globalAS: 300, localAS: 70000, peerIP: ateSrc.IPv6, peerAS: 80000, isV4: true}, - dutConf: createBgpNeighbor(&bgpNbr{globalAS: 300, localAS: 70000, peerIP: ateSrc.IPv6, peerAS: 80000, isV4: false}, dut), - ateConf: configureATE(t, &bgpNbr{globalAS: 300, localAS: 80000, peerIP: dutSrc.IPv6, peerAS: 70000, isV4: false}, connExternal), - }, { - name: "Establish iBGP connection between ATE (2-byte) - DUT (4-byte < 65535) for ipv4 peers", - nbr: &bgpNbr{globalAS: 300, localAS: 200, peerIP: ateSrc.IPv4, peerAS: 200, isV4: true}, - dutConf: createBgpNeighbor(&bgpNbr{globalAS: 300, localAS: 200, peerIP: ateSrc.IPv4, peerAS: 200, isV4: true}, dut), - ateConf: configureATE(t, &bgpNbr{globalAS: 300, localAS: 200, peerIP: dutSrc.IPv4, peerAS: 200, isV4: true}, connInternal), - }, { - name: "Establish iBGP connection between ATE (4-byte) - DUT (4-byte < 65535) for ipv6 peers", - nbr: &bgpNbr{globalAS: 300, localAS: 200, peerIP: ateSrc.IPv6, peerAS: 200, isV4: false}, - dutConf: createBgpNeighbor(&bgpNbr{globalAS: 300, localAS: 200, peerIP: ateSrc.IPv6, peerAS: 200, isV4: false}, dut), - ateConf: configureATE(t, &bgpNbr{globalAS: 300, localAS: 200, peerIP: dutSrc.IPv6, peerAS: 200, isV4: false}, connInternal), - }, { - name: "Establish iBGP connection between ATE (4-byte) - DUT (4-byte) for ipv4 peers", - nbr: &bgpNbr{globalAS: 300, localAS: 80000, peerIP: ateSrc.IPv4, peerAS: 80000, isV4: true}, - dutConf: createBgpNeighbor(&bgpNbr{globalAS: 300, localAS: 80000, peerIP: ateSrc.IPv4, peerAS: 80000, isV4: true}, dut), - ateConf: configureATE(t, &bgpNbr{globalAS: 300, localAS: 80000, peerIP: dutSrc.IPv4, peerAS: 80000, isV4: true}, connInternal), - }, { - name: "Establish iBGP connection between ATE (4-byte) - DUT (4-byte) for ipv6 peers", - nbr: &bgpNbr{globalAS: 300, localAS: 80000, peerIP: ateSrc.IPv6, peerAS: 80000, isV4: false}, - dutConf: createBgpNeighbor(&bgpNbr{globalAS: 300, localAS: 80000, peerIP: ateSrc.IPv6, peerAS: 80000, isV4: false}, dut), - ateConf: configureATE(t, &bgpNbr{globalAS: 300, localAS: 80000, peerIP: dutSrc.IPv6, peerAS: 80000, isV4: false}, connInternal), - }, - } - - for _, tc := range cases { - t.Run(tc.name, func(t *testing.T) { - t.Log("Clear BGP Configs on DUT") - bgpClearConfig(t, dut) - - t.Log("Configure BGP on DUT") - gnmi.Replace(t, dut, dutConfPath.Config(), tc.dutConf) - - fptest.LogQuery(t, "DUT BGP Config ", dutConfPath.Config(), gnmi.Get(t, dut, dutConfPath.Config())) - t.Log("Configure BGP on ATE") - tc.ateConf.Push(t) - tc.ateConf.StartProtocols(t) - - t.Log("Verify BGP session state : ESTABLISHED") - nbrPath := statePath.Neighbor(tc.nbr.peerIP) - gnmi.Await(t, dut, nbrPath.SessionState().State(), time.Second*60, oc.Bgp_Neighbor_SessionState_ESTABLISHED) - - t.Log("Verify BGP AS numbers") - verifyPeer(t, tc.nbr, dut) - - t.Log("Clear BGP Configs on ATE") - tc.ateConf.StopProtocols(t) - }) - } -} - -// bgpClearConfig removes all BGP configuration from the DUT. -func bgpClearConfig(t *testing.T, dut *ondatra.DUTDevice) { - t.Helper() - resetBatch := &gnmi.SetBatch{} - gnmi.BatchDelete(resetBatch, gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP").Config()) - - if deviations.NetworkInstanceTableDeletionRequired(dut) { - tablePath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).TableAny() - for _, table := range gnmi.LookupAll(t, dut, tablePath.Config()) { - if val, ok := table.Val(); ok { - if val.GetProtocol() == oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP { - gnmi.BatchDelete(resetBatch, gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).Table(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, val.GetAddressFamily()).Config()) - } - } - } - } - resetBatch.Set(t, dut) -} - -func verifyPeer(t *testing.T, nbr *bgpNbr, dut *ondatra.DUTDevice) { - t.Helper() - statePath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP").Bgp() - nbrPath := statePath.Neighbor(nbr.peerIP) - glblPath := statePath.Global() - - // Check BGP peerAS from telemetry. - peerAS := gnmi.Get(t, dut, nbrPath.State()).GetPeerAs() - if peerAS != nbr.peerAS { - t.Errorf("BGP peerAs: got %v, want %v", peerAS, nbr.peerAS) - } - - // Check BGP localAS from telemetry. - localAS := gnmi.Get(t, dut, nbrPath.State()).GetLocalAs() - if localAS != nbr.localAS { - t.Errorf("BGP localAS: got %v, want %v", localAS, nbr.localAS) - } - - // Check BGP globalAS from telemetry. - globalAS := gnmi.Get(t, dut, glblPath.State()).GetAs() - if globalAS != nbr.globalAS { - t.Errorf("BGP globalAS: got %v, want %v", globalAS, nbr.globalAS) - } -} - -func configureATE(t *testing.T, ateParams *bgpNbr, connectionType string) *ondatra.ATETopology { - t.Helper() - t.Log("Configure ATE interface") - ate := ondatra.ATE(t, "ate") - port1 := ate.Port(t, "port1") - topo := ate.Topology().New() - - iDut1 := topo.AddInterface(ateSrc.Name).WithPort(port1) - iDut1.IPv4().WithAddress(ateSrc.IPv4CIDR()).WithDefaultGateway(dutSrc.IPv4) - iDut1.IPv6().WithAddress(ateSrc.IPv6CIDR()).WithDefaultGateway(dutSrc.IPv6) - - bgpDut1 := iDut1.BGP() - - peer := bgpDut1.AddPeer().WithPeerAddress(ateParams.peerIP).WithLocalASN(ateParams.localAS) - if connectionType == connInternal { - peer.WithTypeInternal() - } else { - peer.WithTypeExternal() - } - return topo -} - -func createBgpNeighbor(nbr *bgpNbr, dut *ondatra.DUTDevice) *oc.NetworkInstance_Protocol { - d := &oc.Root{} - ni1 := d.GetOrCreateNetworkInstance(deviations.DefaultNetworkInstance(dut)) - niProto := ni1.GetOrCreateProtocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP") - bgp := niProto.GetOrCreateBgp() - - global := bgp.GetOrCreateGlobal() - global.As = ygot.Uint32(nbr.globalAS) - global.RouterId = ygot.String(dutSrc.IPv4) - global.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).Enabled = ygot.Bool(true) - - pg := bgp.GetOrCreatePeerGroup("ATE") - pg.PeerAs = ygot.Uint32(nbr.peerAS) - pg.PeerGroupName = ygot.String("ATE") - - neighbor := bgp.GetOrCreateNeighbor(nbr.peerIP) - neighbor.PeerAs = ygot.Uint32(nbr.peerAS) - neighbor.Enabled = ygot.Bool(true) - neighbor.PeerGroup = ygot.String("ATE") - neighbor.LocalAs = ygot.Uint32(nbr.localAS) - neighbor.GetOrCreateTimers().RestartTime = ygot.Uint16(75) - - if nbr.isV4 { - afisafi := neighbor.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST) - afisafi.Enabled = ygot.Bool(true) - neighbor.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST).Enabled = ygot.Bool(false) - } else { - afisafi6 := neighbor.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST) - afisafi6.Enabled = ygot.Bool(true) - neighbor.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).Enabled = ygot.Bool(false) - } - return niProto -} diff --git a/feature/experimental/bgp/ate_tests/bgp_2byte_4byte_asn/metadata.textproto b/feature/experimental/bgp/ate_tests/bgp_2byte_4byte_asn/metadata.textproto deleted file mode 100644 index 18a90886ebd..00000000000 --- a/feature/experimental/bgp/ate_tests/bgp_2byte_4byte_asn/metadata.textproto +++ /dev/null @@ -1,29 +0,0 @@ -# proto-file: github.com/openconfig/featureprofiles/proto/metadata.proto -# proto-message: Metadata - -uuid: "b960ced4-2f59-49bf-b078-e53f169fac06" -plan_id: "RT-1.19" -description: "BGP 2-Byte and 4-Byte ASN support" -testbed: TESTBED_DUT_ATE_2LINKS -platform_exceptions: { - platform: { - vendor: ARISTA - } - deviations: { - route_policy_under_afi_unsupported: true - omit_l2_mtu: true - network_instance_table_deletion_required: true - interface_enabled: true - default_network_instance: "default" - } -} -platform_exceptions: { - platform: { - vendor: NOKIA - } - deviations: { - interface_enabled: true - explicit_interface_in_default_vrf: true - } -} -tags: TAGS_AGGREGATION diff --git a/feature/experimental/bgp/ate_tests/bgp_2byte_4byte_asn_policy_test/README.md b/feature/experimental/bgp/ate_tests/bgp_2byte_4byte_asn_policy_test/README.md deleted file mode 100644 index 51d125b5eb9..00000000000 --- a/feature/experimental/bgp/ate_tests/bgp_2byte_4byte_asn_policy_test/README.md +++ /dev/null @@ -1,34 +0,0 @@ -# RT-1.24: BGP 2-Byte and 4-Byte ASN support with policy - -## Summary - -BGP 2-Byte and 4-Byte ASN support with policy - -## Procedure - -* Establish BGP sessions as follows and verify all the sessions are established: - * ATE (2-byte) - DUT (4-byte) - eBGP IPv4 with ASN < 65535 on DUT side - * ATE (2-byte) - DUT (4-byte) - eBGP IPv6 with ASN < 65535 on DUT side - * ATE (4-byte) - DUT (4-byte) - eBGP IPv4 - * ATE (4-byte) - DUT (4-byte) - eBGP IPv6 - * ATE (2-byte) - DUT (4-byte) - iBGP IPv4 with ASN < 65535 on DUT side - * ATE (4-byte) - DUT (4-byte) - iBGP IPv6 with ASN < 65535 on DUT side - * ATE (4-byte) - DUT (4-byte) - iBGP IPv4 - * ATE (4-byte) - DUT (4-byte) - iBGP IPv6 - -* Configure below policies and verify prefix count: - * Policy to reject prefix with prefix filter - * Policy to reject prefix with community filter - * Policy to reject prefix with regex filter to match as-path - -## Config Parameter Coverage - -* /global/config/as -* /neighbors/neighbor/config/peer-as -* /neighbors/neighbor/config/local-as - -## Telemetry Parameter Coverage - -* /global/config/as -* /neighbors/neighbor/config/peer-as -* /neighbors/neighbor/config/local-as diff --git a/feature/experimental/bgp/ate_tests/bgp_2byte_4byte_asn_policy_test/bgp_2byte_4byte_asn_policy_test.go b/feature/experimental/bgp/ate_tests/bgp_2byte_4byte_asn_policy_test/bgp_2byte_4byte_asn_policy_test.go deleted file mode 100644 index 7ea95500983..00000000000 --- a/feature/experimental/bgp/ate_tests/bgp_2byte_4byte_asn_policy_test/bgp_2byte_4byte_asn_policy_test.go +++ /dev/null @@ -1,499 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bgp_2byte_4byte_asn_with_policy_test - -import ( - "context" - "fmt" - "testing" - "time" - - "github.com/openconfig/featureprofiles/internal/attrs" - "github.com/openconfig/featureprofiles/internal/deviations" - "github.com/openconfig/featureprofiles/internal/fptest" - gpb "github.com/openconfig/gnmi/proto/gnmi" - "github.com/openconfig/ondatra" - "github.com/openconfig/ondatra/gnmi" - "github.com/openconfig/ondatra/gnmi/oc" - "github.com/openconfig/ygot/ygot" -) - -const ( - connInternal = "INTERNAL" - connExternal = "EXTERNAL" - rejectPrefix = "REJECT-PREFIX" - communitySet = "COMM-SET" - rejectCommunity = "REJECT-COMMUNITY" - rejectAspath = "REJECT-AS-PATH" - aclStatement1 = "10" - aclStatement2 = "20" - aclStatement3 = "50" - aclStatement4 = "60" - prefixSubnetRangeV4 = "30..32" - prefixSubnetRangeV6 = "126..128" - globalAsNumber = 999 -) - -var prefixV4 = []string{"198.51.100.0/30", "198.51.100.4/30", "198.51.100.8/30"} -var prefixV6 = []string{"2001:DB8:1::0/126", "2001:DB8:1::4/126", "2001:DB8:1::8/126"} -var community = []string{"200:1"} - -var ( - dutSrc = attrs.Attributes{ - Desc: "DUT to ATE source", - IPv4: "192.0.2.1", - IPv6: "2001:db8::192:0:2:1", - IPv4Len: 30, - IPv6Len: 126, - } - ateSrc = attrs.Attributes{ - Name: "ateSrc", - IPv4: "192.0.2.2", - IPv6: "2001:db8::192:0:2:2", - IPv4Len: 30, - IPv6Len: 126, - } -) - -type bgpNbr struct { - localAS, peerAS uint32 - peerIP string - isV4 bool -} - -func TestMain(m *testing.M) { - fptest.RunTests(m) -} -func TestBgpSession(t *testing.T) { - t.Log("Configure DUT interface") - dut := ondatra.DUT(t, "dut") - dc := gnmi.OC() - i1 := dutSrc.NewOCInterface(dut.Port(t, "port1").Name(), dut) - gnmi.Replace(t, dut, dc.Interface(i1.GetName()).Config(), i1) - - t.Log("Configure Network Instance") - dutConfNIPath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)) - gnmi.Replace(t, dut, dutConfNIPath.Type().Config(), oc.NetworkInstanceTypes_NETWORK_INSTANCE_TYPE_DEFAULT_INSTANCE) - - dutConfPath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP") - statePath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP").Bgp() - - cases := []struct { - name string - nbr *bgpNbr - dutConf *oc.NetworkInstance_Protocol - ateConf *ondatra.ATETopology - }{ - { - name: "Establish eBGP connection between ATE (2-byte) - DUT (4-byte < 65535) for ipv4 peers", - nbr: &bgpNbr{localAS: 100, peerIP: ateSrc.IPv4, peerAS: 200, isV4: true}, - dutConf: createBgpNeighbor(&bgpNbr{localAS: 100, peerIP: ateSrc.IPv4, peerAS: 200, isV4: true}, dut), - ateConf: configureATE(t, &bgpNbr{localAS: 200, peerIP: dutSrc.IPv4, peerAS: 100, isV4: true}, connExternal, prefixV4), - }, { - name: "Establish eBGP connection between ATE (2-byte) - DUT (4-byte < 65535) for ipv6 peers", - nbr: &bgpNbr{localAS: 100, peerIP: ateSrc.IPv6, peerAS: 200, isV4: false}, - dutConf: createBgpNeighbor(&bgpNbr{localAS: 100, peerIP: ateSrc.IPv6, peerAS: 200, isV4: false}, dut), - ateConf: configureATE(t, &bgpNbr{localAS: 200, peerIP: dutSrc.IPv6, peerAS: 100, isV4: false}, connExternal, prefixV6), - }, { - name: "Establish eBGP connection between ATE (4-byte) - DUT (4-byte) for ipv4 peers", - nbr: &bgpNbr{localAS: 70000, peerIP: ateSrc.IPv4, peerAS: 80000, isV4: true}, - dutConf: createBgpNeighbor(&bgpNbr{localAS: 70000, peerIP: ateSrc.IPv4, peerAS: 80000, isV4: true}, dut), - ateConf: configureATE(t, &bgpNbr{localAS: 80000, peerIP: dutSrc.IPv4, peerAS: 70000, isV4: true}, connExternal, prefixV4), - }, { - name: "Establish eBGP connection between ATE (4-byte) - DUT (4-byte) for ipv6 peers", - nbr: &bgpNbr{localAS: 70000, peerIP: ateSrc.IPv6, peerAS: 80000, isV4: false}, - dutConf: createBgpNeighbor(&bgpNbr{localAS: 70000, peerIP: ateSrc.IPv6, peerAS: 80000, isV4: false}, dut), - ateConf: configureATE(t, &bgpNbr{localAS: 80000, peerIP: dutSrc.IPv6, peerAS: 70000, isV4: false}, connExternal, prefixV6), - }, { - name: "Establish iBGP connection between ATE (2-byte) - DUT (4-byte < 65535) for ipv4 peers", - nbr: &bgpNbr{localAS: 200, peerIP: ateSrc.IPv4, peerAS: 200, isV4: true}, - dutConf: createBgpNeighbor(&bgpNbr{localAS: 200, peerIP: ateSrc.IPv4, peerAS: 200, isV4: true}, dut), - ateConf: configureATE(t, &bgpNbr{localAS: 200, peerIP: dutSrc.IPv4, peerAS: 200, isV4: true}, connInternal, prefixV4), - }, { - name: "Establish iBGP connection between ATE (4-byte) - DUT (4-byte < 65535) for ipv6 peers", - nbr: &bgpNbr{localAS: 200, peerIP: ateSrc.IPv6, peerAS: 200, isV4: false}, - dutConf: createBgpNeighbor(&bgpNbr{localAS: 200, peerIP: ateSrc.IPv6, peerAS: 200, isV4: false}, dut), - ateConf: configureATE(t, &bgpNbr{localAS: 200, peerIP: dutSrc.IPv6, peerAS: 200, isV4: false}, connInternal, prefixV6), - }, { - name: "Establish iBGP connection between ATE (4-byte) - DUT (4-byte) for ipv4 peers", - nbr: &bgpNbr{localAS: 80000, peerIP: ateSrc.IPv4, peerAS: 80000, isV4: true}, - dutConf: createBgpNeighbor(&bgpNbr{localAS: 80000, peerIP: ateSrc.IPv4, peerAS: 80000, isV4: true}, dut), - ateConf: configureATE(t, &bgpNbr{localAS: 80000, peerIP: dutSrc.IPv4, peerAS: 80000, isV4: true}, connInternal, prefixV4), - }, { - name: "Establish iBGP connection between ATE (4-byte) - DUT (4-byte) for ipv6 peers", - nbr: &bgpNbr{localAS: 80000, peerIP: ateSrc.IPv6, peerAS: 80000, isV4: false}, - dutConf: createBgpNeighbor(&bgpNbr{localAS: 80000, peerIP: ateSrc.IPv6, peerAS: 80000, isV4: false}, dut), - ateConf: configureATE(t, &bgpNbr{localAS: 80000, peerIP: dutSrc.IPv6, peerAS: 80000, isV4: false}, connInternal, prefixV6), - }, - } - - for _, tc := range cases { - t.Run(tc.name, func(t *testing.T) { - t.Log("Clear BGP Configs on DUT") - bgpClearConfig(t, dut) - - configureRegexPolicy(t, dut) - - d := &oc.Root{} - rpl := configureBGPPolicy(t, d, tc.nbr.isV4) - gnmi.Replace(t, dut, gnmi.OC().RoutingPolicy().Config(), rpl) - - t.Log("Configure BGP on DUT") - gnmi.Replace(t, dut, dutConfPath.Config(), tc.dutConf) - - fptest.LogQuery(t, "DUT BGP Config ", dutConfPath.Config(), gnmi.Get(t, dut, dutConfPath.Config())) - t.Log("Configure BGP on ATE") - tc.ateConf.Push(t) - tc.ateConf.StartProtocols(t) - - t.Log("Verify BGP session state : ESTABLISHED") - nbrPath := statePath.Neighbor(tc.nbr.peerIP) - gnmi.Await(t, dut, nbrPath.SessionState().State(), time.Second*60, oc.Bgp_Neighbor_SessionState_ESTABLISHED) - - t.Log("Verify BGP AS numbers and prefix count") - verifyPeer(t, tc.nbr, dut) - - t.Log("Apply BGP policy for rejecting prefix") - pol := applyBgpPolicy(rejectPrefix, dut, tc.nbr.isV4) - gnmi.Update(t, dut, dutConfPath.Config(), pol) - verifyPrefixesTelemetry(t, dut, 2, tc.nbr.isV4) - deleteBgpPolicy(t, dut, tc.nbr.isV4) - verifyPrefixesTelemetry(t, dut, 3, tc.nbr.isV4) - - t.Log("Apply BGP policy for rejecting prefix with community filter") - pol = applyBgpPolicy(rejectCommunity, dut, tc.nbr.isV4) - gnmi.Update(t, dut, dutConfPath.Config(), pol) - verifyPrefixesTelemetry(t, dut, 2, tc.nbr.isV4) - deleteBgpPolicy(t, dut, tc.nbr.isV4) - verifyPrefixesTelemetry(t, dut, 3, tc.nbr.isV4) - - t.Log("Apply BGP policy for rejecting prefix with as-path regex filter") - pol = applyBgpPolicy(rejectAspath, dut, tc.nbr.isV4) - gnmi.Update(t, dut, dutConfPath.Config(), pol) - verifyPrefixesTelemetry(t, dut, 2, tc.nbr.isV4) - - t.Log("Clear BGP Configs on ATE") - tc.ateConf.StopProtocols(t) - }) - } -} - -// Build config with Origin set to cli and Ascii encoded config. -func buildCliConfigRequest(config string) (*gpb.SetRequest, error) { - gpbSetRequest := &gpb.SetRequest{ - Update: []*gpb.Update{{ - Path: &gpb.Path{ - Origin: "cli", - Elem: []*gpb.PathElem{}, - }, - Val: &gpb.TypedValue{ - Value: &gpb.TypedValue_AsciiVal{ - AsciiVal: config, - }, - }, - }}, - } - return gpbSetRequest, nil -} - -// juniperCLI returns Juniper CLI config statement. -func juniperCLI() string { - return fmt.Sprintf(` - policy-options { - policy-statement %s { - term term1 { - from as-path match-as-path; - then reject; - } - term term2 { - then accept; - } - } - as-path match-as-path ".* 4400 3300"; - }`, rejectAspath) -} - -// configureRegexPolicy is used to configure vendor specific config statement. -func configureRegexPolicy(t *testing.T, dut *ondatra.DUTDevice) { - t.Helper() - var config string - gnmiClient := dut.RawAPIs().GNMI(t) - - switch dut.Vendor() { - case ondatra.JUNIPER: - config = juniperCLI() - t.Logf("Push the CLI config:%s", dut.Vendor()) - } - - gpbSetRequest, err := buildCliConfigRequest(config) - if err != nil { - t.Fatalf("Cannot build a gNMI SetRequest: %v", err) - } - - if _, err = gnmiClient.Set(context.Background(), gpbSetRequest); err != nil { - t.Fatalf("gnmiClient.Set() with unexpected error: %v", err) - } -} - -// 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 { - t.Helper() - rp := d.GetOrCreateRoutingPolicy() - pset := rp.GetOrCreateDefinedSets().GetOrCreatePrefixSet(rejectPrefix) - - if isV4 { - pset.GetOrCreatePrefix(prefixV4[2], prefixSubnetRangeV4) - } else { - pset.GetOrCreatePrefix(prefixV6[2], prefixSubnetRangeV6) - } - pdef := rp.GetOrCreatePolicyDefinition(rejectPrefix) - - stmt10, err := pdef.AppendNewStatement(aclStatement1) - if err != nil { - t.Errorf("Error while creating new statement %v", err) - } - stmt10.GetOrCreateActions().PolicyResult = oc.RoutingPolicy_PolicyResultType_REJECT_ROUTE - stmt10.GetOrCreateConditions().GetOrCreateMatchPrefixSet().PrefixSet = ygot.String(rejectPrefix) - - stmt20, err := pdef.AppendNewStatement(aclStatement2) - if err != nil { - t.Errorf("Error while creating new statement %v", err) - } - stmt20.GetOrCreateActions().PolicyResult = oc.RoutingPolicy_PolicyResultType_ACCEPT_ROUTE - - commSet := rp.GetOrCreateDefinedSets().GetOrCreateBgpDefinedSets().GetOrCreateCommunitySet(communitySet) - commSet.CommunitySetName = ygot.String(communitySet) - var communityMembers []oc.RoutingPolicy_DefinedSets_BgpDefinedSets_CommunitySet_CommunityMember_Union - for _, member := range community { - communityMember, _ := commSet.To_RoutingPolicy_DefinedSets_BgpDefinedSets_CommunitySet_CommunityMember_Union(member) - communityMembers = append(communityMembers, communityMember) - } - commSet.SetCommunityMember(communityMembers) - pdefComm := rp.GetOrCreatePolicyDefinition(rejectCommunity) - - stmt50, err := pdefComm.AppendNewStatement(aclStatement3) - if err != nil { - t.Errorf("Error while creating new statement %v", err) - } - stmt50.GetOrCreateActions().PolicyResult = oc.RoutingPolicy_PolicyResultType_REJECT_ROUTE - stmt50.GetOrCreateConditions().GetOrCreateBgpConditions().CommunitySet = ygot.String(communitySet) - - stmt60, err := pdefComm.AppendNewStatement(aclStatement4) - if err != nil { - t.Errorf("Error while creating new statement %v", err) - } - stmt60.GetOrCreateActions().PolicyResult = oc.RoutingPolicy_PolicyResultType_ACCEPT_ROUTE - - return rp -} - -func verifyPrefixesTelemetry(t *testing.T, dut *ondatra.DUTDevice, wantInstalled uint32, isV4 bool) { - t.Helper() - t.Logf("Verify BGP prefix count") - if isV4 { - verifyPrefixesTelemetryV4(t, dut, wantInstalled) - } else { - verifyPrefixesTelemetryV6(t, dut, wantInstalled) - } -} - -// verifyPrefixesTelemetry confirms that the dut shows the correct numbers of installed, sent and -// received IPv4 prefixes -func verifyPrefixesTelemetryV4(t *testing.T, dut *ondatra.DUTDevice, wantInstalled uint32) { - t.Helper() - statePath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP").Bgp() - prefixesv4 := statePath.Neighbor(ateSrc.IPv4).AfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).Prefixes() - - if gotInstalled := gnmi.Get(t, dut, prefixesv4.Installed().State()); gotInstalled != wantInstalled { - t.Errorf("Installed prefixes mismatch: got %v, want %v", gotInstalled, wantInstalled) - } -} - -// verifyPrefixesTelemetryV6 confirms that the dut shows the correct numbers of installed, sent and -// received IPv6 prefixes -func verifyPrefixesTelemetryV6(t *testing.T, dut *ondatra.DUTDevice, wantInstalledv6 uint32) { - statePath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP").Bgp() - prefixesv6 := statePath.Neighbor(ateSrc.IPv6).AfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST).Prefixes() - - if gotInstalledv6 := gnmi.Get(t, dut, prefixesv6.Installed().State()); gotInstalledv6 != wantInstalledv6 { - t.Errorf("IPV6 Installed prefixes mismatch: got %v, want %v", gotInstalledv6, wantInstalledv6) - } -} - -// bgpClearConfig removes all BGP configuration from the DUT. -func bgpClearConfig(t *testing.T, dut *ondatra.DUTDevice) { - resetBatch := &gnmi.SetBatch{} - gnmi.BatchDelete(resetBatch, gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP").Config()) - - if deviations.NetworkInstanceTableDeletionRequired(dut) { - tablePath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).TableAny() - for _, table := range gnmi.LookupAll(t, dut, tablePath.Config()) { - if val, ok := table.Val(); ok { - if val.GetProtocol() == oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP { - gnmi.BatchDelete(resetBatch, gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).Table(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, val.GetAddressFamily()).Config()) - } - } - } - } - resetBatch.Set(t, dut) -} - -func verifyPeer(t *testing.T, nbr *bgpNbr, dut *ondatra.DUTDevice) { - statePath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP").Bgp() - nbrPath := statePath.Neighbor(nbr.peerIP) - glblPath := statePath.Global() - - // Check BGP peerAS from telemetry. - peerAS := gnmi.Get(t, dut, nbrPath.State()).GetPeerAs() - if peerAS != nbr.peerAS { - t.Errorf("BGP peerAs: got %v, want %v", peerAS, nbr.peerAS) - } - - // Check BGP localAS from telemetry. - localAS := gnmi.Get(t, dut, nbrPath.State()).GetLocalAs() - if localAS != nbr.localAS { - t.Errorf("BGP localAS: got %v, want %v", localAS, nbr.localAS) - } - - // Check BGP globalAS from telemetry. - globalAS := gnmi.Get(t, dut, glblPath.State()).GetAs() - if globalAS != globalAsNumber { - t.Errorf("BGP globalAS: got %v, want %v", globalAS, nbr.localAS) - } - - verifyPrefixesTelemetry(t, dut, 3, nbr.isV4) -} - -func configureATE(t *testing.T, ateParams *bgpNbr, connectionType string, prefixes []string) *ondatra.ATETopology { - t.Helper() - t.Log("Configure ATE interface") - ate := ondatra.ATE(t, "ate") - port1 := ate.Port(t, "port1") - topo := ate.Topology().New() - - iDut1 := topo.AddInterface(ateSrc.Name).WithPort(port1) - iDut1.IPv4().WithAddress(ateSrc.IPv4CIDR()).WithDefaultGateway(dutSrc.IPv4) - iDut1.IPv6().WithAddress(ateSrc.IPv6CIDR()).WithDefaultGateway(dutSrc.IPv6) - - bgpDut1 := iDut1.BGP() - peer := bgpDut1.AddPeer().WithPeerAddress(ateParams.peerIP).WithLocalASN(ateParams.localAS) - - if connectionType == connInternal { - peer.WithTypeInternal() - } else { - peer.WithTypeExternal() - } - - network1 := iDut1.AddNetwork("bgpNeti1") - network2 := iDut1.AddNetwork("bgpNeti2") - network3 := iDut1.AddNetwork("bgpNeti3") - - if ateParams.isV4 { - network1.IPv4().WithAddress(prefixes[0]).WithCount(1) - network1.BGP().WithNextHopAddress(ateSrc.IPv4).AddASPathSegment(55000, 4400, 3300) - - network2.IPv4().WithAddress(prefixes[1]).WithCount(1) - network2.BGP().WithNextHopAddress(ateSrc.IPv4).AddASPathSegment(55000, 7700) - network2.BGP().Communities().WithPrivateCommunities("200:1") - - network3.IPv4().WithAddress(prefixes[2]).WithCount(1) - network3.BGP().WithNextHopAddress(ateSrc.IPv4) - } else { - network1.IPv6().WithAddress(prefixes[0]).WithCount(1) - network1.BGP().WithNextHopAddress(ateSrc.IPv6).AddASPathSegment(55000, 4400, 3300) - - network2.IPv6().WithAddress(prefixes[1]).WithCount(1) - network2.BGP().WithNextHopAddress(ateSrc.IPv6).AddASPathSegment(55000, 7700) - network2.BGP().Communities().WithPrivateCommunities("200:1") - - network3.IPv6().WithAddress(prefixes[2]).WithCount(1) - network3.BGP().WithNextHopAddress(ateSrc.IPv6) - } - return topo -} - -func applyBgpPolicy(policyName string, dut *ondatra.DUTDevice, isV4 bool) *oc.NetworkInstance_Protocol { - d := &oc.Root{} - ni1 := d.GetOrCreateNetworkInstance(deviations.DefaultNetworkInstance(dut)) - niProto := ni1.GetOrCreateProtocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP") - bgp := niProto.GetOrCreateBgp() - - pg := bgp.GetOrCreatePeerGroup("ATE") - pg.PeerGroupName = ygot.String("ATE") - - if deviations.RoutePolicyUnderAFIUnsupported(dut) { - //policy under peer group - pg.GetOrCreateApplyPolicy().ImportPolicy = []string{policyName} - return niProto - } - - aftType := oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST - if isV4 { - aftType = oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST - } - - afisafi := pg.GetOrCreateAfiSafi(aftType) - afisafi.Enabled = ygot.Bool(true) - rpl := afisafi.GetOrCreateApplyPolicy() - rpl.SetImportPolicy([]string{policyName}) - - return niProto -} - -func deleteBgpPolicy(t *testing.T, dut *ondatra.DUTDevice, isV4 bool) { - t.Helper() - t.Logf("Delete BGP policy on DUT") - aftType := oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST - if isV4 { - aftType = oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST - } - - policyConfPath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP").Bgp().PeerGroup("ATE").AfiSafi(aftType).ApplyPolicy().Config() - gnmi.Delete(t, dut, policyConfPath) -} - -func createBgpNeighbor(nbr *bgpNbr, dut *ondatra.DUTDevice) *oc.NetworkInstance_Protocol { - d := &oc.Root{} - ni1 := d.GetOrCreateNetworkInstance(deviations.DefaultNetworkInstance(dut)) - niProto := ni1.GetOrCreateProtocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP") - bgp := niProto.GetOrCreateBgp() - - global := bgp.GetOrCreateGlobal() - global.As = ygot.Uint32(globalAsNumber) - global.RouterId = ygot.String(dutSrc.IPv4) - - pg := bgp.GetOrCreatePeerGroup("ATE") - pg.PeerAs = ygot.Uint32(nbr.peerAS) - pg.PeerGroupName = ygot.String("ATE") - - neighbor := bgp.GetOrCreateNeighbor(nbr.peerIP) - neighbor.PeerAs = ygot.Uint32(nbr.peerAS) - neighbor.LocalAs = ygot.Uint32(nbr.localAS) - neighbor.Enabled = ygot.Bool(true) - neighbor.PeerGroup = ygot.String("ATE") - neighbor.GetOrCreateTimers().RestartTime = ygot.Uint16(75) - - if nbr.isV4 { - afisafi := neighbor.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST) - afisafi.Enabled = ygot.Bool(true) - neighbor.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST).Enabled = ygot.Bool(false) - } else { - afisafi6 := neighbor.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST) - afisafi6.Enabled = ygot.Bool(true) - neighbor.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).Enabled = ygot.Bool(false) - } - return niProto -} diff --git a/feature/experimental/bgp/ate_tests/bgp_2byte_4byte_asn_policy_test/metadata.textproto b/feature/experimental/bgp/ate_tests/bgp_2byte_4byte_asn_policy_test/metadata.textproto deleted file mode 100644 index bc335a7ac99..00000000000 --- a/feature/experimental/bgp/ate_tests/bgp_2byte_4byte_asn_policy_test/metadata.textproto +++ /dev/null @@ -1,38 +0,0 @@ -# proto-file: github.com/openconfig/featureprofiles/proto/metadata.proto -# proto-message: Metadata - -uuid: "a993eb24-40f8-4b86-bc6b-02c19f6a0d53" -plan_id: "RT-1.24" -description: "BGP 2-Byte and 4-Byte ASN support with policy" -testbed: TESTBED_DUT_ATE_2LINKS -platform_exceptions: { - platform: { - vendor: CISCO - } - deviations: { - ipv4_missing_enabled: true - } -} -platform_exceptions: { - platform: { - vendor: NOKIA - } - deviations: { - use_vendor_native_acl_config: true - explicit_port_speed: true - explicit_interface_in_default_vrf: true - interface_enabled: true - } -} -platform_exceptions: { - platform: { - vendor: ARISTA - } - deviations: { - route_policy_under_afi_unsupported: true - omit_l2_mtu: true - interface_enabled: true - default_network_instance: "default" - } -} -tags: TAGS_AGGREGATION diff --git a/feature/experimental/bgp/ate_tests/bgp_remove_private_as/README.md b/feature/experimental/bgp/ate_tests/bgp_remove_private_as/README.md deleted file mode 100644 index 3cf8f73d886..00000000000 --- a/feature/experimental/bgp/ate_tests/bgp_remove_private_as/README.md +++ /dev/null @@ -1,41 +0,0 @@ -# RT-1.11: BGP remove private ASĀ  - -## Summary - -BGP remove private AS - -## Procedure - -* Establish BGP sessions as follows between ATE and DUT. - * ATE emulates two eBGP neighbors peering with the DUT using public AS numbers. - * DUT Port1 (AS 500) ---eBGP--- ATE Port1 (AS 100) - * DUT Port2 (AS 500) ---eBGP--- ATE Port2 (AS 200) - * Inject routes with AS_PATH modified to have private AS number 65501 from eBGP neighbor #1 - (ATE Port1). - * Validate received routes on ATE Port2 should have AS Path "500 100 65501". - * Configure "remove private AS" with type PRIVATE_AS_REMOVE_ALL on DUT. - * Validate that private AS numbers are stripped before advertisement to the eBGP peer ATE Port2. - * AS path for received routes on ATE Port2 should be "500 100". - * TODO: different patterns of private AS should be tested. - * AS Path SEQ - 65501, 65507, 65554 - * AS Path SEQ - 65501, 600 - * AS Path SEQ - 800, 65501, 600 - ## TODO : https://github.com/openconfig/featureprofiles/issues/1659 - ## SET mode is not working in ATE. - * AS Path SET - 800, 65505, 600 - -## Config Parameter coverage - -* /network-instances/network-instance/protocols/protocol/bgp/peer-groups/peer-group/config/remove-private-as - -## Telemetry Parameter coverage - -* /network-instances/network-instance/protocols/protocol/bgp/rib/attr-sets/attr-set/as4-path/as4-segment/state - -## Protocol/RPC Parameter coverage - -N/A - -## Minimum DUT platform requirement - -N/A \ No newline at end of file diff --git a/feature/experimental/bgp/ate_tests/bgp_remove_private_as/bgp_remove_private_as_test.go b/feature/experimental/bgp/ate_tests/bgp_remove_private_as/bgp_remove_private_as_test.go deleted file mode 100644 index 0d785ad59c7..00000000000 --- a/feature/experimental/bgp/ate_tests/bgp_remove_private_as/bgp_remove_private_as_test.go +++ /dev/null @@ -1,394 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bgp_remove_private_as_test - -import ( - "testing" - "time" - - "github.com/google/go-cmp/cmp" - "github.com/openconfig/featureprofiles/internal/attrs" - "github.com/openconfig/featureprofiles/internal/deviations" - "github.com/openconfig/featureprofiles/internal/fptest" - "github.com/openconfig/ondatra" - "github.com/openconfig/ondatra/gnmi" - "github.com/openconfig/ondatra/gnmi/oc" - "github.com/openconfig/ygnmi/ygnmi" - "github.com/openconfig/ygot/ygot" -) - -func TestMain(m *testing.M) { - fptest.RunTests(m) -} - -// The testbed consists of ate:port1 -> dut:port1 and -// dut:port2 -> ate:port2. The first pair is called the "source" -// pair, and the second the "destination" pair. -// -// Source: ate:port1 -> dut:port1 subnet 192.0.2.0/30 -// Destination: dut:port2 -> ate:port2 subnet 192.0.2.4/30 -// -// Note that the first (.0, .3) and last (.4, .7) IPv4 addresses are -// reserved from the subnet for broadcast, so a /30 leaves exactly 2 -// usable addresses. This does not apply to IPv6 which allows /127 -// for point to point links, but we use /126 so the numbering is -// consistent with IPv4. - -const ( - trafficDuration = 1 * time.Minute - ipv4SrcTraffic = "192.0.2.2" - advertisedRoutesv4CIDR = "203.0.113.1/32" - peerGrpName1 = "BGP-PEER-GROUP1" - peerGrpName2 = "BGP-PEER-GROUP2" - policyName = "ALLOW" - routeCount = 254 - dutAS = 500 - ateAS1 = 100 - ateAS2 = 200 - plenIPv4 = 30 - plenIPv6 = 126 - removeASPath = true -) - -var ( - dutSrc = attrs.Attributes{ - Desc: "DUT to ATE source", - IPv4: "192.0.2.1", - IPv6: "2001:db8::192:0:2:1", - IPv4Len: plenIPv4, - IPv6Len: plenIPv6, - } - ateSrc = attrs.Attributes{ - Name: "ateSrc", - IPv4: "192.0.2.2", - IPv6: "2001:db8::192:0:2:2", - IPv4Len: plenIPv4, - IPv6Len: plenIPv6, - } - dutDst = attrs.Attributes{ - Desc: "DUT to ATE destination", - IPv4: "192.0.2.5", - IPv6: "2001:db8::192:0:2:5", - IPv4Len: plenIPv4, - IPv6Len: plenIPv6, - } - ateDst = attrs.Attributes{ - Name: "atedst", - IPv4: "192.0.2.6", - IPv6: "2001:db8::192:0:2:6", - IPv4Len: plenIPv4, - IPv6Len: plenIPv6, - } -) - -// configureDUT configures all the interfaces on the DUT. -func configureDUT(t *testing.T, dut *ondatra.DUTDevice) { - dc := gnmi.OC() - i1 := dutSrc.NewOCInterface(dut.Port(t, "port1").Name(), dut) - gnmi.Replace(t, dut, dc.Interface(i1.GetName()).Config(), i1) - - i2 := dutDst.NewOCInterface(dut.Port(t, "port2").Name(), dut) - gnmi.Replace(t, dut, dc.Interface(i2.GetName()).Config(), i2) -} - -// verifyPortsUp asserts that each port on the device is operating. -func verifyPortsUp(t *testing.T, dev *ondatra.Device) { - t.Helper() - for _, p := range dev.Ports() { - status := gnmi.Get(t, dev, gnmi.OC().Interface(p.Name()).OperStatus().State()) - if want := oc.Interface_OperStatus_UP; status != want { - t.Errorf("%s Status: got %v, want %v", p, status, want) - } - } -} - -// bgpCreateNbr creates a BGP object with neighbors pointing to ateSrc and ateDst. -func bgpCreateNbr(localAs, peerAs uint32, dut *ondatra.DUTDevice) *oc.NetworkInstance_Protocol { - nbr1v4 := &bgpNeighbor{as: ateAS1, neighborip: ateSrc.IPv4, isV4: true, peerGrp: peerGrpName1} - nbr2v4 := &bgpNeighbor{as: ateAS2, neighborip: ateDst.IPv4, isV4: true, peerGrp: peerGrpName2} - nbrs := []*bgpNeighbor{nbr1v4, nbr2v4} - - d := &oc.Root{} - ni1 := d.GetOrCreateNetworkInstance(deviations.DefaultNetworkInstance(dut)) - niProto := ni1.GetOrCreateProtocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP") - bgp := niProto.GetOrCreateBgp() - global := bgp.GetOrCreateGlobal() - global.RouterId = ygot.String(dutDst.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. - pg1 := bgp.GetOrCreatePeerGroup(peerGrpName1) - pg1.PeerAs = ygot.Uint32(ateAS1) - pg1.PeerGroupName = ygot.String(peerGrpName1) - - pg2 := bgp.GetOrCreatePeerGroup(peerGrpName2) - pg2.PeerAs = ygot.Uint32(ateAS2) - pg2.PeerGroupName = ygot.String(peerGrpName2) - - if deviations.RoutePolicyUnderAFIUnsupported(dut) { - rpl := pg1.GetOrCreateApplyPolicy() - rpl.ImportPolicy = []string{policyName} - rpl.ExportPolicy = []string{policyName} - - rp2 := pg2.GetOrCreateApplyPolicy() - rp2.ImportPolicy = []string{policyName} - rp2.ExportPolicy = []string{policyName} - } else { - pgaf := pg1.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST) - pgaf.Enabled = ygot.Bool(true) - rpl := pgaf.GetOrCreateApplyPolicy() - rpl.ImportPolicy = []string{policyName} - rpl.ExportPolicy = []string{policyName} - - pgaf2 := pg2.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST) - pgaf2.Enabled = ygot.Bool(true) - rp2 := pgaf2.GetOrCreateApplyPolicy() - rp2.ImportPolicy = []string{policyName} - rp2.ExportPolicy = []string{policyName} - } - - for _, nbr := range nbrs { - nv4 := bgp.GetOrCreateNeighbor(nbr.neighborip) - nv4.PeerGroup = ygot.String(nbr.peerGrp) - nv4.PeerAs = ygot.Uint32(nbr.as) - nv4.Enabled = ygot.Bool(true) - af4 := nv4.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST) - af4.Enabled = ygot.Bool(true) - af6 := nv4.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST) - af6.Enabled = ygot.Bool(false) - } - return niProto -} - -// verifyBGPTelemetry checks that the dut has an established BGP session with reasonable settings. -func verifyBGPTelemetry(t *testing.T, dut *ondatra.DUTDevice) { - var nbrIP = []string{ateSrc.IPv4, ateDst.IPv4} - t.Logf("Verifying BGP state.") - statePath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP").Bgp() - for _, nbr := range nbrIP { - var status *ygnmi.Value[oc.E_Bgp_Neighbor_SessionState] - nbrPath := statePath.Neighbor(nbr) - t.Logf("Waiting for BGP neighbor to establish...") - status, ok := gnmi.Watch(t, dut, nbrPath.SessionState().State(), time.Minute, func(val *ygnmi.Value[oc.E_Bgp_Neighbor_SessionState]) bool { - state, ok := val.Val() - return ok && state == oc.Bgp_Neighbor_SessionState_ESTABLISHED - }).Await(t) - if !ok { - fptest.LogQuery(t, "BGP reported state", nbrPath.State(), gnmi.Get(t, dut, nbrPath.State())) - t.Fatal("No BGP neighbor formed") - } - state, _ := status.Val() - t.Logf("BGP adjacency for %s: %s", nbr, state) - if want := oc.Bgp_Neighbor_SessionState_ESTABLISHED; state != want { - t.Errorf("BGP peer %s status got %v, want %d", nbr, status, want) - } - } -} - -// verifyPrefixesTelemetry confirms that the dut shows the correct numbers of installed, -// sent and received IPv4 prefixes. -func verifyPrefixesTelemetry(t *testing.T, dut *ondatra.DUTDevice, nbr string, wantInstalled, wantSent uint32) { - statePath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP").Bgp() - prefixesv4 := statePath.Neighbor(nbr).AfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).Prefixes() - if gotInstalled := gnmi.Get(t, dut, prefixesv4.Installed().State()); gotInstalled != wantInstalled { - t.Errorf("Installed prefixes mismatch: got %v, want %v", gotInstalled, wantInstalled) - } - if gotSent := gnmi.Get(t, dut, prefixesv4.Sent().State()); gotSent != wantSent { - t.Errorf("Sent prefixes mismatch: got %v, want %v", gotSent, wantSent) - } -} - -// configureATE configures the interfaces and BGP protocols on an ATE, including -// advertising some(faked) networks over BGP. -func configureATE(t *testing.T, ate *ondatra.ATEDevice, asSeg []uint32, asSEQMode bool) *ondatra.ATETopology { - port1 := ate.Port(t, "port1") - topo := ate.Topology().New() - iDut1 := topo.AddInterface(ateSrc.Name).WithPort(port1) - iDut1.IPv4().WithAddress(ateSrc.IPv4CIDR()).WithDefaultGateway(dutSrc.IPv4) - - port2 := ate.Port(t, "port2") - iDut2 := topo.AddInterface(ateDst.Name).WithPort(port2) - iDut2.IPv4().WithAddress(ateDst.IPv4CIDR()).WithDefaultGateway(dutDst.IPv4) - - // Setup ATE BGP route v4 advertisement. - bgpDut1 := iDut1.BGP() - bgpDut1.AddPeer().WithPeerAddress(dutSrc.IPv4).WithLocalASN(ateAS1). - WithTypeExternal() - - bgpDut2 := iDut2.BGP() - bgpDut2.AddPeer().WithPeerAddress(dutDst.IPv4).WithLocalASN(ateAS2). - WithTypeExternal() - - bgpNeti1 := iDut1.AddNetwork("bgpNeti1") - bgpNeti1.IPv4().WithAddress(advertisedRoutesv4CIDR).WithCount(routeCount) - bgpNeti1.BGP().WithNextHopAddress(ateSrc.IPv4) - - if asSEQMode { - bgpNeti1.BGP().AddASPathSegment(asSeg...).WithTypeSEQ() - } else { - // TODO : SET mode is not working - // https://github.com/openconfig/featureprofiles/issues/1659 - bgpNeti1.BGP().AddASPathSegment(asSeg...).WithTypeSET() - } - - t.Logf("Pushing config to ATE and starting protocols...") - topo.Push(t) - topo.StartProtocols(t) - - return topo -} - -type bgpNeighbor struct { - as uint32 - neighborip string - isV4 bool - peerGrp string -} - -// verifyBGPAsPath is to Validate AS Path attribute using bgp rib telemetry on ATE. -func verifyBGPAsPath(t *testing.T, dut *ondatra.DUTDevice, ate *ondatra.ATEDevice, asSeg []uint32, removeASPath bool) { - at := gnmi.OC() - rib := at.NetworkInstance(ateDst.Name).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "0").Bgp().Rib() - prefixPath := rib.AfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).Ipv4Unicast(). - NeighborAny().AdjRibInPre().RouteAny().WithPathId(0).Prefix() - - gnmi.WatchAll(t, ate, prefixPath.State(), time.Minute, func(v *ygnmi.Value[string]) bool { - _, present := v.Val() - return present - }).Await(t) - - var wantASSeg = []uint32{dutAS, ateAS1} - - if removeASPath { - for _, as := range asSeg { - if as < 64512 { - wantASSeg = append(wantASSeg, as) - } - } - } else { - wantASSeg = append(wantASSeg, asSeg...) - } - - gotASSeg, ok := gnmi.WatchAll(t, ate, rib.AttrSetAny().AsSegmentMap().State(), 1*time.Minute, func(v *ygnmi.Value[map[uint32]*oc.NetworkInstance_Protocol_Bgp_Rib_AttrSet_AsSegment]) bool { - val, present := v.Val() - if present { - for _, as := range val { - if cmp.Equal(as.Member, wantASSeg) { - return true - } - } - } - return false - }).Await(t) - if !ok { - t.Errorf("Obtained AS path on ATE is not as expected, gotASSeg %v, wantASSeg %v", gotASSeg, wantASSeg) - } -} - -// configreRoutePolicy adds route-policy config -func configureRoutePolicy(t *testing.T, dut *ondatra.DUTDevice, name string, pr oc.E_RoutingPolicy_PolicyResultType) { - d := &oc.Root{} - rp := d.GetOrCreateRoutingPolicy() - pd := rp.GetOrCreatePolicyDefinition(name) - st, err := pd.AppendNewStatement("id-1") - if err != nil { - t.Fatal(err) - } - stc := st.GetOrCreateConditions() - stc.InstallProtocolEq = oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP - st.GetOrCreateActions().PolicyResult = pr - gnmi.Replace(t, dut, gnmi.OC().RoutingPolicy().Config(), rp) -} - -// TestRemovePrivateAS is to Validate that private AS numbers are stripped -// before advertisement to the eBGP neighbor. -func TestRemovePrivateAS(t *testing.T) { - t.Logf("Start DUT config load.") - dut := ondatra.DUT(t, "dut") - - t.Run("Configure DUT interfaces", func(t *testing.T) { - t.Logf("Start DUT interface Config.") - configureDUT(t, dut) - }) - - t.Run("Configure DEFAULT network instance.", func(t *testing.T) { - t.Log("Configure Network Instance type to DEFAULT.") - dutConfNIPath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)) - gnmi.Replace(t, dut, dutConfNIPath.Type().Config(), oc.NetworkInstanceTypes_NETWORK_INSTANCE_TYPE_DEFAULT_INSTANCE) - }) - - dutConfPath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP") - t.Run("Configure BGP Neighbors.", func(t *testing.T) { - t.Logf("Start DUT BGP Config.") - gnmi.Delete(t, dut, dutConfPath.Config()) - configureRoutePolicy(t, dut, policyName, oc.RoutingPolicy_PolicyResultType_ACCEPT_ROUTE) - dutConf := bgpCreateNbr(dutAS, ateAS1, dut) - gnmi.Replace(t, dut, dutConfPath.Config(), dutConf) - fptest.LogQuery(t, "DUT BGP Config", dutConfPath.Config(), gnmi.Get(t, dut, dutConfPath.Config())) - }) - - cases := []struct { - desc string - asSeg []uint32 - asSEQMode bool - }{{ - desc: "AS Path SEQ - 65501, 65507, 65534", - asSeg: []uint32{65501, 65507, 65534}, - asSEQMode: true, - }, { - desc: "AS Path SEQ - 65501, 600", - asSeg: []uint32{65501, 600}, - asSEQMode: true, - }, { - desc: "AS Path SEQ - 800, 65501, 600", - asSeg: []uint32{800, 65501, 600}, - asSEQMode: true, - }} - - for _, tc := range cases { - t.Run(tc.desc, func(t *testing.T) { - t.Logf("Start ATE Config.") - ate := ondatra.ATE(t, "ate") - topo := configureATE(t, ate, tc.asSeg, tc.asSEQMode) - - t.Log("Verifying port status.") - verifyPortsUp(t, dut.Device) - - t.Log("Check BGP parameters.") - verifyBGPTelemetry(t, dut) - - t.Log("Verify BGP prefix telemetry.") - verifyPrefixesTelemetry(t, dut, ateSrc.IPv4, routeCount, 0) - verifyPrefixesTelemetry(t, dut, ateDst.IPv4, 0, routeCount) - - t.Log("Verify AS Path list received at ate Port2 including private AS number.") - verifyBGPAsPath(t, dut, ate, tc.asSeg, !removeASPath) - - t.Log("Configure remove private AS on DUT.") - gnmi.Update(t, dut, dutConfPath.Bgp().PeerGroup(peerGrpName2).RemovePrivateAs().Config(), oc.Bgp_RemovePrivateAsOption_PRIVATE_AS_REMOVE_ALL) - - t.Log("Private AS numbers should be stripped off while advertising BGP routes into public AS.") - verifyBGPAsPath(t, dut, ate, tc.asSeg, removeASPath) - - topo.StopProtocols(t) - - t.Log("Remove remove-private-AS on DUT.") - gnmi.Delete(t, dut, dutConfPath.Bgp().PeerGroup(peerGrpName2).RemovePrivateAs().Config()) - }) - } -} diff --git a/feature/experimental/bgp/ate_tests/bgp_remove_private_as/metadata.textproto b/feature/experimental/bgp/ate_tests/bgp_remove_private_as/metadata.textproto deleted file mode 100644 index 4a298ab13bd..00000000000 --- a/feature/experimental/bgp/ate_tests/bgp_remove_private_as/metadata.textproto +++ /dev/null @@ -1,24 +0,0 @@ -# proto-file: github.com/openconfig/featureprofiles/proto/metadata.proto -# proto-message: Metadata - -uuid: "2b4372c2-8827-4624-837c-f44b1a54edf7" -plan_id: "RT-1.11" -description: "BGP remove private AS" -testbed: TESTBED_DUT_ATE_2LINKS -platform_exceptions: { - platform: { - vendor: ARISTA - } - deviations: { - interface_enabled: true - default_network_instance: "default" - } -} -platform_exceptions: { - platform: { - vendor: NOKIA - } - deviations: { - interface_enabled: true - } -} diff --git a/feature/experimental/system/gnmi/benchmarking/ate_tests/drained_configuration_convergence_time/README.md b/feature/experimental/system/gnmi/benchmarking/ate_tests/drained_configuration_convergence_time/README.md deleted file mode 100644 index 80b76298f1e..00000000000 --- a/feature/experimental/system/gnmi/benchmarking/ate_tests/drained_configuration_convergence_time/README.md +++ /dev/null @@ -1,55 +0,0 @@ -# gNMI-1.3: Benchmarking: Drained Configuration Convergence Time - -## Summary - -Measure performance of drained configuration being applied. - -## Procedure - -Configure DUT with maximum number of IS-IS adjacencies, and BGP -peers - with physical interfaces between ATE and DUT for IS-IS -peers. - -First port is used as ingress port to send routes from ATE to DUT. - -For each of the following configurations, generate complete device -configuration and measure time for the operation to complete (as -defined in the case): - * TODO: IS-IS overload: - * At t=0, send Set to DUT marking IS-IS overload bit. - * Measure time between t=0 and all IS-IS sessions on ATE to - report DUT as overloaded. - * IS-IS metric change: - * At t=0, send Set to DUT marking IS-IS metric as changed for - all IS-IS interfaces. - * Measure time between t=0 and all IS-IS sessions on ATE to - report changed metric. - * BGP AS_PATH prepend: - * At t=0, send Set to DUT changing BGP policy for each session - to prepend AS_PATH. - * Measure time between t=0 and all BGP received routes on ATE - to report change in as path. - * TODO: BGP MED manipulation. - * At t=0, send Set to DUT changing BGP policy for each session to - set MED to non-default value. - * Measure time between t=0 and all BGP received routes on ATE to - report changed metric. - -## Config Parameter coverage - - * BGP - * /routing-policy/policy-definitions/policy-definition/statements/statement/actions/bgp-actions/config/set-med - * /routing-policy/policy-definitions/policy-definition/statements/statement/actions/bgp-actions/set-as-path-prepend/config/repeat-n - * /routing-policy/policy-definitions/policy-definition/statements/statement/actions/bgp-actions/set-as-path-prepend/config/as-number - - * ISIS - * /network-instances/network-instance/protocols/protocol/isis/interfaces/interface/levels/level/afi-safi/af/state/metric - * /network-instances/network-instance/protocols/protocol/isis/global/lsp-bit/overload-bit/state/set-bit - -## Telemetry Parameter coverage - - * ISIS - * /interfaces/interfaces/levels/level/adjacencies/adjacency/state/adjacency-state - * BGP - * /afi-safis/afi-safi/state/prefixes/sent - * /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor diff --git a/feature/experimental/system/gnmi/benchmarking/ate_tests/drained_configuration_convergence_time/drained_configuration_convergence_time_bgp_test.go b/feature/experimental/system/gnmi/benchmarking/ate_tests/drained_configuration_convergence_time/drained_configuration_convergence_time_bgp_test.go deleted file mode 100644 index 925e9149c55..00000000000 --- a/feature/experimental/system/gnmi/benchmarking/ate_tests/drained_configuration_convergence_time/drained_configuration_convergence_time_bgp_test.go +++ /dev/null @@ -1,367 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// drained_configuration_convergence_time_test is used to verify bgp test scenarios -// as given in gnmi1.3 testcase. -package drained_configuration_convergence_time_test - -import ( - "net" - "testing" - "time" - - "github.com/google/go-cmp/cmp" - "github.com/openconfig/featureprofiles/feature/experimental/system/gnmi/benchmarking/internal/setup" - "github.com/openconfig/featureprofiles/internal/deviations" - "github.com/openconfig/featureprofiles/internal/fptest" - "github.com/openconfig/ondatra" - "github.com/openconfig/ondatra/gnmi" - "github.com/openconfig/ondatra/gnmi/oc" - "github.com/openconfig/ygnmi/ygnmi" - "github.com/openconfig/ygot/ygot" -) - -func TestMain(m *testing.M) { - fptest.RunTests(m) -} - -const ( - asPathRepeatValue = 3 - aclStatement2 = "20" - aclStatement3 = "30" - setASpathPrependPolicy = "SET-ASPATH-PREPEND" - setMEDPolicy = "SET-MED" - setALLOWPolicy = "ALLOW" - bgpMED = 25 -) - -// setAllow is used to configure ALLOW routing policy on DUT. -func setAllow(t *testing.T, dut *ondatra.DUTDevice, d *oc.Root) { - - // Configure Allow Policy on DUT. - rp := d.GetOrCreateRoutingPolicy() - pd := rp.GetOrCreatePolicyDefinition(setALLOWPolicy) - st, err := pd.AppendNewStatement("id-1") - if err != nil { - t.Fatal(err) - } - st.GetOrCreateActions().PolicyResult = oc.RoutingPolicy_PolicyResultType_ACCEPT_ROUTE - - gnmi.Replace(t, dut, gnmi.OC().RoutingPolicy().Config(), rp) -} - -// setMED is used to configure routing policy to set BGP MED on DUT. -func setMED(t *testing.T, dut *ondatra.DUTDevice, d *oc.Root) { - - // Configure SetMED on DUT. - rp := d.GetOrCreateRoutingPolicy() - pdef5 := rp.GetOrCreatePolicyDefinition(setMEDPolicy) - stmt, err := pdef5.AppendNewStatement(aclStatement3) - if err != nil { - t.Fatal(err) - } - actions5 := stmt.GetOrCreateActions() - setMedBGP := actions5.GetOrCreateBgpActions() - setMedBGP.SetMed = oc.UnionUint32(bgpMED) - actions5.PolicyResult = oc.RoutingPolicy_PolicyResultType_ACCEPT_ROUTE - if deviations.BGPSetMedRequiresEqualOspfSetMetric(dut) { - actions5.GetOrCreateOspfActions().GetOrCreateSetMetric().SetMetric(bgpMED) - } - - gnmi.Replace(t, dut, gnmi.OC().RoutingPolicy().Config(), rp) -} - -// setASPath is used to configure route policy set-as-path prepend on DUT. -func setASPath(t *testing.T, dut *ondatra.DUTDevice, d *oc.Root) { - - // Configure SetASPATH routing policy on DUT. - rp := d.GetOrCreateRoutingPolicy() - pdef5 := rp.GetOrCreatePolicyDefinition(setASpathPrependPolicy) - stmt, err := pdef5.AppendNewStatement(aclStatement2) - if err != nil { - t.Fatal(err) - } - actions5 := stmt.GetOrCreateActions() - actions5.PolicyResult = oc.RoutingPolicy_PolicyResultType_ACCEPT_ROUTE - aspend := actions5.GetOrCreateBgpActions().GetOrCreateSetAsPathPrepend() - aspend.Asn = ygot.Uint32(setup.DUTAs) - aspend.RepeatN = ygot.Uint8(asPathRepeatValue) - - gnmi.Replace(t, dut, gnmi.OC().RoutingPolicy().Config(), rp) - - netInstance := d.GetOrCreateNetworkInstance(deviations.DefaultNetworkInstance(dut)) - bgp := netInstance.GetOrCreateProtocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP").GetOrCreateBgp() - pg := bgp.GetOrCreatePeerGroup(setup.PeerGrpName) - rpl := pg.GetOrCreateApplyPolicy() - rpl.SetImportPolicy([]string{setALLOWPolicy}) - - gnmi.Update(t, dut, gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP").Bgp().PeerGroup(setup.PeerGrpName).Config(), pg) - -} - -func setPolicyPeerGroup(t *testing.T, dut *ondatra.DUTDevice, d *oc.Root, policy []string) { - - // Set BGP Import policy - netInstance := d.GetOrCreateNetworkInstance(deviations.DefaultNetworkInstance(dut)) - bgp := netInstance.GetOrCreateProtocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP").GetOrCreateBgp() - pg := bgp.GetOrCreatePeerGroup(setup.PeerGrpName) - pg.PeerAs = ygot.Uint32(setup.ATEAs) - pg.PeerGroupName = ygot.String(setup.PeerGrpName) - afipg := pg.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST) - afipg.Enabled = ygot.Bool(true) - if deviations.RoutePolicyUnderAFIUnsupported(dut) { - pgpolicy := pg.GetOrCreateApplyPolicy() - pgpolicy.ImportPolicy = policy - gnmi.Replace(t, dut, gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP").Bgp().PeerGroup(setup.PeerGrpName).Config(), pg) - - } else { - pgpolicy := afipg.GetOrCreateApplyPolicy() - pgpolicy.ImportPolicy = policy - gnmi.Replace(t, dut, gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP").Bgp().PeerGroup(setup.PeerGrpName).Config(), pg) - - } -} - -// isConverged function is used to check if ATE has received all the prefixes. -func isConverged(t *testing.T, dut *ondatra.DUTDevice, ate *ondatra.ATEDevice, ap *ondatra.Port) { - - // Add 10 second timer for BGP update to propagate - time.Sleep(10 * time.Second) - // Check if all prefixes are learned at ATE. - statePath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)). - Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP").Bgp() -prefixLoop: - for repeat := 4; repeat > 0; repeat-- { - prefixesv4 := statePath.Neighbor(setup.ATEIPList[ap.ID()].String()). - AfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).Prefixes() - gotSent := gnmi.Get(t, dut, prefixesv4.Sent().State()) - switch { - case gotSent == setup.RouteCount: - t.Logf("Prefixes sent from ingress port are learnt at ATE dst port : %v are %v", setup.ATEIPList[ap.ID()].String(), setup.RouteCount) - break prefixLoop - case repeat > 0 && gotSent < setup.RouteCount: - t.Logf("All the prefixes are not learnt , wait for 5 secs before retry.. got %v, want %v", gotSent, setup.RouteCount) - time.Sleep(time.Second * 5) - case repeat == 0 && gotSent < setup.RouteCount: - t.Errorf("sent prefixes from DUT to neighbor %v is mismatch: got %v, want %v", setup.ATEIPList[ap.ID()].String(), gotSent, setup.RouteCount) - } - } - -} - -// verifyBGPAsPath is to Validate AS Path attribute using bgp rib telemetry on ATE. -func verifyBGPAsPath(t *testing.T, dut *ondatra.DUTDevice, ate *ondatra.ATEDevice) { - - // Start the timer. - start := time.Now() - if deviations.RoutePolicyUnderAFIUnsupported(dut) { - dutPolicyConfPath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)). - Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP").Bgp(). - PeerGroup(setup.PeerGrpName).ApplyPolicy().ExportPolicy() - - gnmi.Replace(t, dut, dutPolicyConfPath.Config(), []string{setASpathPrependPolicy}) - } else { - dutPolicyConfPath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)). - Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP").Bgp(). - PeerGroup(setup.PeerGrpName).AfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).ApplyPolicy().ExportPolicy() - gnmi.Replace(t, dut, dutPolicyConfPath.Config(), []string{setASpathPrependPolicy}) - } - t.Run("BGP-AS-PATH Verification", func(t *testing.T) { - at := gnmi.OC() - for _, ap := range ate.Ports() { - if ap.ID() == "port1" { - // port1 is ingress, skip verification on ingress port. - continue - } - - // Validate if all prefixes are received by ATE. - isConverged(t, dut, ate, ap) - - rib := at.NetworkInstance(ap.Name()).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "0").Bgp().Rib() - prefixPath := rib.AfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).Ipv4Unicast(). - NeighborAny().AdjRibInPre().RouteAny().WithPathId(0).Prefix() - - gnmi.WatchAll(t, ate, prefixPath.State(), time.Minute, func(v *ygnmi.Value[string]) bool { - _, present := v.Val() - return present - }).Await(t) - - singlepath := []uint32{setup.DUTAs, setup.DUTAs, setup.DUTAs, setup.DUTAs, setup.ATEAs2} - _, ok := gnmi.WatchAll(t, ate, rib.AttrSetAny().AsSegmentMap().State(), 5*time.Minute, func(v *ygnmi.Value[map[uint32]*oc.NetworkInstance_Protocol_Bgp_Rib_AttrSet_AsSegment]) bool { - val, present := v.Val() - if present { - for _, as := range val { - if cmp.Equal(as.Member, singlepath) { - return true - } - } - } - return false - }).Await(t) - if !ok { - t.Errorf("Obtained AS path on ATE is not as expected") - } - } - }) - - // End the timer and calculate time. - elapsed := time.Since(start) - t.Logf("Duration taken to apply as path prepend policy is %v", elapsed) -} - -// verifyBGPSetMED is to Validate MED attribute using bgp rib telemetry on ATE. -func verifyBGPSetMED(t *testing.T, dut *ondatra.DUTDevice, ate *ondatra.ATEDevice) { - - // Build wantSetMED to compare the diff. - var wantSetMED []uint32 - for i := 0; i < setup.RouteCount; i++ { - wantSetMED = append(wantSetMED, bgpMED) - } - - // Start the timer. - start := time.Now() - if deviations.RoutePolicyUnderAFIUnsupported(dut) { - dutPolicyConfPath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)). - Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP").Bgp(). - PeerGroup(setup.PeerGrpName).ApplyPolicy().ExportPolicy() - gnmi.Replace(t, dut, dutPolicyConfPath.Config(), []string{setMEDPolicy}) - } else { - dutPolicyConfPath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)). - Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP").Bgp(). - PeerGroup(setup.PeerGrpName).AfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).ApplyPolicy().ExportPolicy() - gnmi.Replace(t, dut, dutPolicyConfPath.Config(), []string{setMEDPolicy}) - } - - t.Run("BGP-MED-Verification", func(t *testing.T) { - at := gnmi.OC() - for _, ap := range ate.Ports() { - if ap.ID() == "port1" { - continue - } - - // Validate if all prefixes are received by ATE. - isConverged(t, dut, ate, ap) - rib := at.NetworkInstance(ap.Name()).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "0").Bgp().Rib() - routeP := rib.AfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).Ipv4Unicast(). - NeighborAny().AdjRibInPre().RouteAny().WithPathId(0) - routes := gnmi.GetAll(t, ate, routeP.State()) - attrs := gnmi.GetAll(t, ate, rib.AttrSetAny().State()) - mask := net.IPv4Mask(255, 255, 255, 0) - masked := net.ParseIP(setup.AdvertiseBGPRoutesv4).Mask(mask) - var gotSetMED []uint32 - var pref []string - for _, route := range routes { - ip, _, _ := net.ParseCIDR(route.GetPrefix()) - pref = append(pref, route.GetPrefix()) - if ip.Mask(mask).Equal(masked) { - idx := route.GetAttrIndex() - if idx >= uint64(len(attrs)) { - t.Errorf("Invalid attr-index %d for prefix: %s", idx, route.GetPrefix()) - continue - } - gotSetMED = append(gotSetMED, attrs[idx].GetMed()) - } - } - if diff := cmp.Diff(wantSetMED, gotSetMED); diff != "" { - t.Errorf("obtained MED on ATE is not as expected, got %v, want %v, Prefixes %v", gotSetMED, wantSetMED, pref) - } - } - }) - // End the timer and calculate time taken to apply setMED. - elapsed := time.Since(start) - t.Logf("Duration taken to apply setMed routing policy is %v", elapsed) -} - -// TestEstablish is to configure Interface, BGP and ISIS configurations on DUT -// using gnmi set request. It also verifies for bgp and isis adjacencies. -func TestEstablish(t *testing.T) { - - dut := ondatra.DUT(t, "dut") - dutConfigPath := gnmi.OC() - - t.Log("Configure Network Instance type to DEFAULT on DUT.") - fptest.ConfigureDefaultNetworkInstance(t, dut) - - t.Log("Build Benchmarking BGP and ISIS test configs.") - dutBenchmarkConfig := setup.BuildBenchmarkingConfig(t) - if !deviations.ExplicitInterfaceInDefaultVRF(dut) { - fptest.LogQuery(t, "Benchmarking configs to configure on DUT", dutConfigPath.Config(), dutBenchmarkConfig) - } - // Apply benchmarking configs on dut - gnmi.Update(t, dut, dutConfigPath.Config(), dutBenchmarkConfig) - - t.Log("Configure ATE with Interfaces, BGP, ISIS configs.") - ate := ondatra.ATE(t, "ate") - setup.ConfigureATE(t, ate) - - t.Log("Verify BGP Session state , should be in ESTABLISHED State.") - setup.VerifyBgpTelemetry(t, dut) - - t.Log("Verify ISIS adjacency state, should be UP.") - setup.VerifyISISTelemetry(t, dut) -} - -// TestBGPBenchmarking is test time taken to apply set as path prepend and set med routing -// policies on routes in bgp rib. Verification of routing policy is done on ATE using bgp -// rib table. -func TestBGPBenchmarking(t *testing.T) { - - d := &oc.Root{} - dut := ondatra.DUT(t, "dut") - ate := ondatra.ATE(t, "ate") - // Cleanup existing policy details. - if deviations.RoutePolicyUnderAFIUnsupported(dut) { - dutPolicyConfPath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP").Bgp().PeerGroup(setup.PeerGrpName).ApplyPolicy() - gnmi.Delete(t, dut, dutPolicyConfPath.ExportPolicy().Config()) - gnmi.Delete(t, dut, dutPolicyConfPath.ImportPolicy().Config()) - } else { - dutPolicyConfPath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP").Bgp().PeerGroup(setup.PeerGrpName).AfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).ApplyPolicy() - gnmi.Delete(t, dut, dutPolicyConfPath.ExportPolicy().Config()) - gnmi.Delete(t, dut, dutPolicyConfPath.ImportPolicy().Config()) - } - gnmi.Delete(t, dut, gnmi.OC().RoutingPolicy().Config()) - - t.Logf("Configure Allow policy.") - setAllow(t, dut, d) - - t.Logf("Configure MED routing policy.") - setMED(t, dut, d) - - t.Logf("Configure Allow Import routing policy in BGP.") - setPolicyPeerGroup(t, dut, d, []string{setALLOWPolicy}) - - t.Logf("Verify time taken to apply MED to all routes in bgp rib.") - verifyBGPSetMED(t, dut, ate) - - // Cleanup existing policy details. - if deviations.RoutePolicyUnderAFIUnsupported(dut) { - dutPolicyConfPath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP").Bgp().PeerGroup(setup.PeerGrpName).ApplyPolicy() - gnmi.Delete(t, dut, dutPolicyConfPath.ExportPolicy().Config()) - gnmi.Delete(t, dut, dutPolicyConfPath.ImportPolicy().Config()) - } else { - dutPolicyConfPath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP").Bgp().PeerGroup(setup.PeerGrpName).AfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).ApplyPolicy() - gnmi.Delete(t, dut, dutPolicyConfPath.ExportPolicy().Config()) - gnmi.Delete(t, dut, dutPolicyConfPath.ImportPolicy().Config()) - } - gnmi.Delete(t, dut, gnmi.OC().RoutingPolicy().Config()) - - t.Logf("Configure SET-AS-PATH routing policy.") - setASPath(t, dut, d) - - t.Logf("Configure Allow Import routing policy in BGP.") - setPolicyPeerGroup(t, dut, d, []string{setALLOWPolicy}) - - t.Logf("Verify time taken to apply SET-AS-PATH to all routes in bgp rib.") - verifyBGPAsPath(t, dut, ate) -} diff --git a/feature/experimental/system/gnmi/benchmarking/ate_tests/drained_configuration_convergence_time/drained_configuration_convergence_time_isis_test.go b/feature/experimental/system/gnmi/benchmarking/ate_tests/drained_configuration_convergence_time/drained_configuration_convergence_time_isis_test.go deleted file mode 100644 index e14f163c63f..00000000000 --- a/feature/experimental/system/gnmi/benchmarking/ate_tests/drained_configuration_convergence_time/drained_configuration_convergence_time_isis_test.go +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// drained_configuration_convergence_time_test is used to verify isis test scenarios -// as given in gnmi 1.3 testcase -package drained_configuration_convergence_time_test - -import ( - "testing" - "time" - - "github.com/openconfig/featureprofiles/feature/experimental/system/gnmi/benchmarking/internal/setup" - "github.com/openconfig/featureprofiles/internal/deviations" - "github.com/openconfig/ondatra" - "github.com/openconfig/ondatra/gnmi" - "github.com/openconfig/ondatra/gnmi/oc" - "github.com/openconfig/ygnmi/ygnmi" -) - -// setISISOverloadBit is used to configure isis overload bit to true. -func setISISOverloadBit(t *testing.T, dut *ondatra.DUTDevice) { - - // ISIS Configs to set Overload Bit to true. - dutISISPath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_ISIS, setup.ISISInstance).Isis() - lspBit := dutISISPath.Global().LspBit().OverloadBit() - gnmi.Replace(t, dut, lspBit.SetBit().Config(), true) -} - -// setISISMetric is used to configure metric on isis interfaces. -func setISISMetric(t *testing.T, dut *ondatra.DUTDevice) { - - dutISISPath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_ISIS, setup.ISISInstance).Isis() - t.Logf("Configure ISIS metric to %v", setup.ISISMetric) - for _, dp := range dut.Ports() { - intfName := dp.Name() - if deviations.ExplicitInterfaceInDefaultVRF(dut) { - intfName = dp.Name() + ".0" - } - dutISISPathIntfAF := dutISISPath.Interface(intfName).Level(2).Af(oc.IsisTypes_AFI_TYPE_IPV4, oc.IsisTypes_SAFI_TYPE_UNICAST) - if deviations.ISISRequireSameL1MetricWithL2Metric(dut) { - b := &gnmi.SetBatch{} - gnmi.BatchReplace(b, dutISISPathIntfAF.Metric().Config(), setup.ISISMetric) - l1AF := dutISISPath.Interface(intfName).Level(1).Af(oc.IsisTypes_AFI_TYPE_IPV4, oc.IsisTypes_SAFI_TYPE_UNICAST) - gnmi.BatchReplace(b, l1AF.Metric().Config(), setup.ISISMetric) - b.Set(t, dut) - } else { - gnmi.Replace(t, dut, dutISISPathIntfAF.Metric().Config(), setup.ISISMetric) - } - } -} - -// verifyISISMetric is used to verify on ATE to see how much time it -// has taken to apply changes in metric -func verifyISISMetric(t *testing.T, dut *ondatra.DUTDevice, ate *ondatra.ATEDevice) { - - t.Run("ISIS Metric verification", func(t *testing.T) { - at := gnmi.OC() - for _, ap := range ate.Ports() { - if ap.ID() == "port1" { - // Port1 is ingress, skip verification on ingress port - continue - } - - const want = oc.Interface_OperStatus_UP - - if got := gnmi.Get(t, ate, at.Interface(ap.Name()).OperStatus().State()); got != want { - t.Errorf("%s oper-status got %v, want %v", ap, got, want) - } - is := at.NetworkInstance(ap.Name()).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_ISIS, "0").Isis() - lsps := is.LevelAny().LspAny() - - _, ok := gnmi.WatchAll(t, ate, lsps.Tlv(oc.IsisLsdbTypes_ISIS_TLV_TYPE_EXTENDED_IPV4_REACHABILITY).ExtendedIpv4Reachability().PrefixAny().Metric().State(), 5*time.Minute, func(v *ygnmi.Value[uint32]) bool { - val, present := v.Val() - return present && val == setup.ISISMetric - }).Await(t) - if !ok { - t.Errorf("Obtained Metric on ATE is not as expected") - } - } - }) -} - -// verifyISISOverloadBit is used to verify on ATE to see how much time it -// has taken to apply overload bit on isis adjacencies. -func verifyISISOverloadBit(t *testing.T, dut *ondatra.DUTDevice, ate *ondatra.ATEDevice) { - - t.Run("ISIS Overload bit verification", func(t *testing.T) { - at := gnmi.OC() - for _, ap := range ate.Ports() { - if ap.ID() == "port1" { - // port1 is ingress, skip verification on ingress port - continue - } - - const want = oc.Interface_OperStatus_UP - - if got := gnmi.Get(t, ate, at.Interface(ap.Name()).OperStatus().State()); got != want { - t.Errorf("%s oper-status got %v, want %v", ap, got, want) - } - // TODO: SetBit retrieval is not working in ATE. - // Ref: https://github.com/openconfig/featureprofiles/issues/1176 - // Below code will be uncommented once above issue is resolved. - - // is := at.NetworkInstance(ap.Name()).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_ISIS, "0").Isis() - // lsps := is.LevelAny().LspAny() - // gotIsisSetBit := gnmi.GetAll(t, ate, lsps.Tlv(oc.IsisLsdbTypes_ISIS_TLV_TYPE_EXTENDED_IPV4_REACHABILITY).ExtendedIpv4Reachability().PrefixAny().SBit().State()) - // if diff := cmp.Diff(setup.ISISSetBitList, gotIsisSetBit); diff != "" { - // t.Errorf("obtained setBit on ATE is not as expected, got %v, want %v", gotIsisSetBit, setup.ISISSetBitList) - // } - } - }) -} - -// TestISISBenchmarking is to test ISIS overload bit and metric change -// applied on all isis sessions. -func TestISISBenchmarking(t *testing.T) { - - dut := ondatra.DUT(t, "dut") - ate := ondatra.ATE(t, "ate") - t.Log("Start timer for ISIS overload bit verification test.") - start := time.Now() - t.Log("Configure ISIS overload bit on DUT.") - setISISOverloadBit(t, dut) - t.Log("Verify on ATE if ISIS overload bit is reflected on ATE.") - verifyISISOverloadBit(t, dut, ate) - t.Log("End the timer and calculate time taken to apply ISIS overload bit.") - elapsed := time.Since(start) - t.Logf("Duration taken to apply overload bit: %v", elapsed) - - t.Log("Start timer for ISIS Metric test.") - start = time.Now() - t.Log("Configure ISIS Metric on DUT.") - setISISMetric(t, dut) - t.Log("Verify on ATE if ISIS Metric changes are reflected.") - verifyISISMetric(t, dut, ate) - t.Log("End the timer and calculate time taken to apply ISIS Metric.") - elapsed = time.Since(start) - t.Logf("Duration taken to apply isis metric: %v", elapsed) -} diff --git a/feature/experimental/system/gnmi/benchmarking/ate_tests/drained_configuration_convergence_time/metadata.textproto b/feature/experimental/system/gnmi/benchmarking/ate_tests/drained_configuration_convergence_time/metadata.textproto deleted file mode 100644 index e6104d7837a..00000000000 --- a/feature/experimental/system/gnmi/benchmarking/ate_tests/drained_configuration_convergence_time/metadata.textproto +++ /dev/null @@ -1,43 +0,0 @@ -# proto-file: github.com/openconfig/featureprofiles/proto/metadata.proto -# proto-message: Metadata - -uuid: "44ec09b1-d985-4188-9f4a-ae542ad9d3a2" -plan_id: "gNMI-1.3" -description: "Benchmarking: Drained Configuration Convergence Time" -testbed: TESTBED_DUT_ATE_2LINKS -platform_exceptions: { - platform: { - vendor: NOKIA - } - deviations: { - isis_global_authentication_not_required: true - isis_explicit_level_authentication_config: true - missing_isis_interface_afi_safi_enable: true - explicit_port_speed: true - explicit_interface_in_default_vrf: true - interface_enabled: true - } -} -platform_exceptions: { - platform: { - vendor: JUNIPER - } - deviations: { - isis_level_enabled: true - } -} -platform_exceptions: { - platform: { - vendor: ARISTA - } - deviations: { - route_policy_under_afi_unsupported: true - interface_enabled: true - default_network_instance: "default" - missing_isis_interface_afi_safi_enable: true - isis_interface_afi_unsupported: true - isis_require_same_l1_metric_with_l2_metric: true - bgp_set_med_requires_equal_ospf_set_metric: true - isis_instance_enabled_required: true - } -} From 98dfdcfda23dcdf3da4abb5ec1dde52f6ccecbd5 Mon Sep 17 00:00:00 2001 From: karthick-gunasekaran-arista <161495828+karthick-gunasekaran-arista@users.noreply.github.com> Date: Thu, 25 Apr 2024 10:19:26 +0530 Subject: [PATCH 4/5] Added sleep for Linecards to be properly up post power disable/enable and added a check to skip validation on unused FAPs which does not have any interface up (#2875) --- .../sampled_backplane_capacity_counters_test.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/feature/platform/fabric/otg_tests/sampled_backplane_capacity_counters_test/sampled_backplane_capacity_counters_test.go b/feature/platform/fabric/otg_tests/sampled_backplane_capacity_counters_test/sampled_backplane_capacity_counters_test.go index 4c1c707c0c6..3e7f39995df 100644 --- a/feature/platform/fabric/otg_tests/sampled_backplane_capacity_counters_test/sampled_backplane_capacity_counters_test.go +++ b/feature/platform/fabric/otg_tests/sampled_backplane_capacity_counters_test/sampled_backplane_capacity_counters_test.go @@ -129,7 +129,8 @@ func TestOnChangeBackplaneCapacityCounters(t *testing.T) { gnmi.Replace(t, dut, gnmi.OC().Component(f).Fabric().PowerAdminState().Config(), oc.Platform_ComponentPowerType_POWER_DISABLED) gnmi.Await(t, dut, gnmi.OC().Component(f).Fabric().PowerAdminState().State(), time.Minute, oc.Platform_ComponentPowerType_POWER_DISABLED) } - + t.Logf("Waiting for 90s after power disable...") + time.Sleep(90 * time.Second) ts2, tocs2, apct2 := getBackplaneCapacityCounters(t, dut, ics) for _, f := range fabrics[:fc] { @@ -145,7 +146,8 @@ func TestOnChangeBackplaneCapacityCounters(t *testing.T) { t.Errorf("Component %s oper-status after POWER_ENABLED, got: %v, want: %v", f, oper, oc.PlatformTypes_COMPONENT_OPER_STATUS_ACTIVE) } } - + t.Logf("Waiting for 90s after power enable...") + time.Sleep(90 * time.Second) ts3, tocs3, apct3 := getBackplaneCapacityCounters(t, dut, ics) for _, ic := range ics { @@ -184,7 +186,7 @@ func TestOnChangeBackplaneCapacityCounters(t *testing.T) { switch { case !ok1 || !ok2 || !ok3: t.Errorf("BackplaneFacingCapacity AvailablePct not present: ok1 %t, ok2 %t, ok3 %t", ok1, ok2, ok3) - case v1 <= v2 || v1 != v3: + case v1 != 0 && (v1 <= v2 || v1 != v3): t.Errorf("BackplaneFacingCapacity AvailablePct are not valid: v1 %d, v2 %d, v3 %d", v1, v2, v3) } }) From 64388db0ea85c18ed6e556324dc8f2dcc643ddfb Mon Sep 17 00:00:00 2001 From: Nachikethas AJ Date: Thu, 25 Apr 2024 16:30:57 -0700 Subject: [PATCH 5/5] [TE-16.3] Test specification for encap FRR with REPAIR (#2919) * [TE-16.3] Test specification for encap FRR with REPAIR * [TE-16.3] Add test case for missing encap entries * [TE-16.3] Add details for DSCP and static route --------- Co-authored-by: Xiao Wang <39514181+xw-g@users.noreply.github.com> --- .../encap_frr_with_repair_vrf/README.md | 617 ++++++++++++++++++ 1 file changed, 617 insertions(+) create mode 100644 feature/gribi/otg_tests/encap_frr_with_repair_vrf/README.md diff --git a/feature/gribi/otg_tests/encap_frr_with_repair_vrf/README.md b/feature/gribi/otg_tests/encap_frr_with_repair_vrf/README.md new file mode 100644 index 00000000000..3298b85d563 --- /dev/null +++ b/feature/gribi/otg_tests/encap_frr_with_repair_vrf/README.md @@ -0,0 +1,617 @@ +# TE-16.3: encapsulation FRR scenarios + +## Summary + +Test FRR behaviors with encapsulation scenarios. + +## Topology + +- ATE port-1 <------> port-1 DUT +- DUT port-2 <------> port-2 ATE +- DUT port-3 <------> port-3 ATE +- DUT port-4 <------> port-4 ATE +- DUT port-5 <------> port-5 ATE +- DUT port-6 <------> port-6 ATE +- DUT port-7 <------> port-7 ATE +- DUT port-8 <------> port-8 ATE + +## Baseline setup + +* Apply the following vrf selection policy to DUT port-1 + +``` +# DSCP value that will be matched to ENCAP_TE_VRF_A +* dscp_encap_a_1 = 10 +* dscp_encap_a_2 = 18 + +# DSCP value that will be matched to ENCAP_TE_VRF_B +* dscp_encap_b_1 = 20 +* dscp_encap_b_2 = 28 + +# DSCP value that will NOT be matched to any VRF for encapsulation. +* dscp_encap_no_match = 30 + +# Magic source IP addresses used in VRF selection policy +* ipv4_outer_src_111 = 198.51.100.111 +* ipv4_outer_src_222 = 198.51.100.222 + +# Magic destination MAC address +* magic_mac = 02:00:00:00:00:01` +``` + +``` +network-instances { + network-instance { + name: DEFAULT + policy-forwarding { + policies { + policy { + policy-id: "vrf_selection_policy_c" + rules { + rule { + sequence-id: 1 + ipv4 { + protocol: 4 + dscp-set: [dscp_encap_a_1, dscp_encap_a_2] + source-address: "ipv4_outer_src_222" + } + action { + decap-network-instance: "DECAP_TE_VRF" + post-network-instance: "ENCAP_TE_VRF_A" + decap-fallback-network-instance: "TE_VRF_222" + } + } + rule { + sequence-id: 2 + ipv4 { + protocol: 41 + dscp-set: [dscp_encap_a_1, dscp_encap_a_2] + source-address: "ipv4_outer_src_222" + } + action { + decap-network-instance: "DECAP_TE_VRF" + post-network-instance: "ENCAP_TE_VRF_A" + decap-fallback-network-instance: "TE_VRF_222" + } + } + rule { + sequence-id: 3 + ipv4 { + protocol: 4 + dscp-set: [dscp_encap_a_1, dscp_encap_a_2] + source-address: "ipv4_outer_src_111" + } + action { + decap-network-instance: "DECAP_TE_VRF" + post-network-instance: "ENCAP_TE_VRF_A" + decap-fallback-network-instance: "TE_VRF_111" + } + } + rule { + sequence-id: 4 + ipv4 { + protocol: 41 + dscp-set: [dscp_encap_a_1, dscp_encap_a_2] + source-address: "ipv4_outer_src_111" + } + action { + decap-network-instance: "DECAP_TE_VRF" + post-network-instance: "ENCAP_TE_VRF_A" + decap-fallback-network-instance: "TE_VRF_111" + } + } + rule { + sequence-id: 5 + ipv4 { + protocol: 4 + dscp-set: [dscp_encap_b_1, dscp_encap_b_2] + source-address: "ipv4_outer_src_222" + } + action { + decap-network-instance: "DECAP_TE_VRF" + post-network-instance: "ENCAP_TE_VRF_B" + decap-fallback-network-instance: "TE_VRF_222" + } + } + rule { + sequence-id: 6 + ipv4 { + protocol: 41 + dscp-set: [dscp_encap_b_1, dscp_encap_b_2] + source-address: "ipv4_outer_src_222" + } + action { + decap-network-instance: "DECAP_TE_VRF" + post-network-instance: "ENCAP_TE_VRF_B" + decap-fallback-network-instance: "TE_VRF_222" + } + } + rule { + sequence-id: 7 + ipv4 { + protocol: 4 + dscp-set: [dscp_encap_b_1, dscp_encap_b_2] + source-address: "ipv4_outer_src_111" + } + action { + decap-network-instance: "DECAP_TE_VRF" + post-network-instance: "ENCAP_TE_VRF_B" + decap-fallback-network-instance: "TE_VRF_111" + } + } + rule { + sequence-id: 8 + ipv4 { + protocol: 41 + dscp-set: [dscp_encap_b_1, dscp_encap_b_2] + source-address: "ipv4_outer_src_111" + } + action { + decap-network-instance: "DECAP_TE_VRF" + post-network-instance: "ENCAP_TE_VRF_B" + decap-fallback-network-instance: "TE_VRF_111" + } + } + rule { + sequence-id: 9 + ipv4 { + protocol: 4 + source-address: "ipv4_outer_src_222" + } + action { + decap-network-instance: "DECAP_TE_VRF" + post-network-instance: "DEFAULT" + decap-fallback-network-instance: "TE_VRF_222" + } + } + rule { + sequence-id: 10 + ipv4 { + protocol: 41 + source-address: "ipv4_outer_src_222" + } + action { + decap-network-instance: "DECAP_TE_VRF" + post-network-instance: "DEFAULT" + decap-fallback-network-instance: "TE_VRF_222" + } + } + rule { + sequence-id: 11 + ipv4 { + protocol: 4 + source-address: "ipv4_outer_src_111" + } + action { + decap-network-instance: "DECAP_TE_VRF" + post-network-instance: "DEFAULT" + decap-fallback-network-instance: "TE_VRF_111" + } + } + rule { + sequence-id: 12 + ipv4 { + protocol: 41 + source-address: "ipv4_outer_src_111" + } + action { + decap-network-instance: "DECAP_TE_VRF" + post-network-instance: "DEFAULT" + decap-fallback-network-instance: "TE_VRF_111" + } + } + rule { + sequence-id: 13 + ipv4 { + dscp-set: [dscp_encap_a_1, dscp_encap_a_2] + } + action { + network-instance: "ENCAP_TE_VRF_A" + } + } + rule { + sequence-id: 14 + ipv6 { + dscp-set: [dscp_encap_a_1, dscp_encap_a_2] + } + action { + network-instance: "ENCAP_TE_VRF_A" + } + } + rule { + sequence-id: 15 + ipv4 { + dscp-set: [dscp_encap_b_1, dscp_encap_b_2] + } + action { + network-instance: "ENCAP_TE_VRF_B" + } + } + rule { + sequence-id: 16 + ipv6 { + dscp-set: [dscp_encap_b_1, dscp_encap_b_2] + } + action { + network-instance: "ENCAP_TE_VRF_B" + } + } + rule { + sequence-id: 17 + action { + network-instance: "DEFAULT" + } + } + } + } + } + } + } +} +``` + +* Using gRIBI, install the following gRIBI AFTs, and validate the specified + behavior. + +``` +IPv4Entry {138.0.11.0/24 (ENCAP_TE_VRF_A)} -> NHG#101 (DEFAULT VRF) -> { + {NH#101, DEFAULT VRF, weight:1}, + {NH#102, DEFAULT VRF, weight:3}, + backup_next_hop_group: 2001 // fallback to DEFAULT VRF +} + +NHG#2001 (DEFAULT VRF) { + {NH#2001, DEFAULT VRF} +} +NH#2001 -> { + network_instance: "DEFAULT" +} + +NH#101 -> { + encapsulate_header: OPENCONFIGAFTTYPESENCAPSULATIONHEADERTYPE_IPV4 + ip_in_ip { + dst_ip: "203.0.113.1" + src_ip: "ipv4_outer_src_111" + } + network_instance: "TE_VRF_111" +} +NH#102 -> { + encapsulate_header: OPENCONFIGAFTTYPESENCAPSULATIONHEADERTYPE_IPV4 + ip_in_ip { + dst_ip: "203.0.113.2" + src_ip: "ipv4_outer_src_111" + } + network_instance: "TE_VRF_111" +} + + +IPv4Entry {203.0.113.1/32 (TE_VRF_111)} -> NHG#1 (DEFAULT VRF) -> { + {NH#1, DEFAULT VRF, weight:1,ip_address=192.0.2.101}, + {NH#2, DEFAULT VRF, weight:3,ip_address=192.0.2.102}, + backup_next_hop_group: 3000 // Go to REPAIR VRF +} +IPv4Entry {192.0.2.101/32 (DEFAULT VRF)} -> NHG#11 (DEFAULT VRF) -> { + {NH#11, DEFAULT VRF, weight:1,mac_address:magic_mac, interface-ref:dut-port-2-interface}, + {NH#12, DEFAULT VRF, weight:3,mac_address:magic_mac, interface-ref:dut-port-3-interface}, +} +IPv4Entry {192.0.2.102/32 (DEFAUlT VRF)} -> NHG#12 (DEFAULT VRF) -> { + {NH#13, DEFAULT VRF, weight:2,mac_address:magic_mac, interface-ref:dut-port-4-interface}, +} + +NHG#3000 (DEFAULT VRF) { + {NH#3000, DEFAULT VRF} +} +NH#3000 -> { + network_instance: "REPAIR" +} + +IPv4Entry {203.0.113.1/32 (REPAIR)} -> NHG#1000 (DEFAULT VRF) -> { + {NH#1000, DEFAULT VRF} + backup_next_hop_group: 2000 // decap and fallback to DEFAULT VRF +} +NH#1000 -> { + decapsulate_header: OPENCONFIGAFTTYPESENCAPSULATIONHEADERTYPE_IPV4 + encapsulate_header: OPENCONFIGAFTTYPESENCAPSULATIONHEADERTYPE_IPV4 + ip_in_ip { + dst_ip: "203.0.113.100" + src_ip: "ipv4_outer_src_222" + } + network_instance: "TE_VRF_222" +} + +IPv4Entry {203.0.113.100/32 (TE_VRF_222)} -> NHG#2 (DEFAULT VRF) -> { + {NH#3, DEFAULT VRF, weight:1,ip_address=192.0.2.103}, + backup_next_hop_group: 2000 // decap and fallback to DEFAULT VRF +} +IPv4Entry {192.0.2.103/32 (DEFAULT VRF)} -> NHG#13 (DEFAULT VRF) -> { + {NH#14, DEFAULT VRF, weight:1,mac_address:magic_mac, interface-ref:dut-port-5-interface}, +} + +// 203.0.113.2 is the tunnel IP address. Note that the NHG#3 is different than NHG#1. + +IPv4Entry {203.0.113.2/32 (TE_VRF_111)} -> NHG#3 (DEFAULT VRF) -> { + {NH#4, DEFAULT VRF, weight:1,ip_address=192.0.2.104}, + backup_next_hop_group: 3000 // Go to REPAIR VRF +} + +IPv4Entry {192.0.2.104/32 (DEFAULT VRF)} -> NHG#14 (DEFAULT VRF) -> { + {NH#15, DEFAULT VRF, weight:1,mac_address:magic_mac, interface-ref:dut-port-6-interface}, +} + +IPv4Entry {203.0.113.2/32 (REPAIR)} -> NHG#1001 (DEFAULT VRF) -> { + {NH#1001, DEFAULT VRF} + backup_next_hop_group: 2000 // decap and fallback to DEFAULT VRF +} +NHG#1001 (DEFAULT VRF) { + {NH#1001, DEFAULT VRF} +} +NH#1001 -> { + decapsulate_header: OPENCONFIGAFTTYPESENCAPSULATIONHEADERTYPE_IPV4 + encapsulate_header: OPENCONFIGAFTTYPESENCAPSULATIONHEADERTYPE_IPV4 + ip_in_ip { + dst_ip: "203.0.113.101" + src_ip: "ipv4_outer_src_222" + } + network_instance: "TE_VRF_222" +} + +IPv4Entry {203.0.113.101/32 (TE_VRF_222)} -> NHG#4 (DEFAULT VRF) -> { + {NH#5, DEFAULT VRF, weight:1,ip_address=192.0.2.105}, + backup_next_hop_group: 2000 // decap and fallback to DEFAULT VRF +} +IPv4Entry {192.0.2.105/32 (DEFAULT VRF)} -> NHG#15 (DEFAULT VRF) -> { + {NH#16, DEFAULT VRF, weight:1,mac_address:magic_mac, interface-ref:dut-port-7-interface}, +} + +NHG#2000 (DEFAULT VRF) { + {NH#2000, DEFAULT VRF} +} +NH#2000 -> { + decapsulate_header: OPENCONFIGAFTTYPESENCAPSULATIONHEADERTYPE_IPV4 + network_instance: "DEFAULT" +} +``` + +* Install a BGP route resolved by ISIS in default VRF to route 138.0.11.8 + traffic out of DUT port-8. + +## Procedure + +At the start of each of the following scenarios, ensure: + +* All ports are up and baseline is reset as above. +* Send packets to DUT port-1. The outer v4 header has the destination + addresses 138.0.11.8. +* Validate that traffic is encapsulated to 203.0.113.1 and 203.0.113.2, and is + distributed per the hierarchical weights. + +Unless otherwise specified, all the tests below should use traffic with +`dscp_encap_a_1`. + +#### Test-1, primary encap unviable but backup encap viable for single tunnel + +Tests that if the primary NHG for an encap tunnel is unviable, then the traffic +for that tunnel is re-encaped into its specified backup tunnel. + +1. Shutdown DUT port-2, port-3, and port-4. +2. Validate that corresponding traffic that was encapped to 203.0.113.1 should + now be encapped with 203.0.113.100. + +#### Test-2, primary and backup encap unviable for single tunnel + +Tests that if the primary NHGs of both the encap tunnel and its backup tunnel +are unviable, then the traffic for that tunnel is not encapped. Instead, that +fraction of traffic should be forwarded according to the BGP/IS-IS routes in the +DEFAULT VRF. + +1. Shutdown DUT port-2, port-3, port-4 and port-5. +2. Validate that corresponding traffic (25% of the total traffic) that was + encapped to 203.0.113.1 are no longer encapped, and forwarded per BGP-ISIS + routes (in the default VRF) out of DUT port-8. + +#### Test-3, primary encap unviable with backup to routing for single tunnel + +Tests that if the primary NHGs of both the encap tunnel is unviable, and its +backup specifies fallback to routing, then the traffic for that tunnel is not +encapped. Instead, that fraction of traffic should be forwarded according to the +BGP/IS-IS routes in the DEFAULT VRF. + +1. Update `NHG#1000` to the following: + +``` +NHG#1000 (Default VRF) { + {NH#1000, DEFAULT VRF} +} +NH#1000 -> { + decapsulate_header: OPENCONFIGAFTTYPESDECAPSULATIONHEADERTYPE_IPV4 + network_instance: "DEFAULT" +} +``` + +1. Validate that all traffic is distributed per the hierarchical weights. +2. Shutdown DUT port-2, port-3, and port-4. +3. Validate that corresponding traffic (25% of the total traffic) that was + encapped to 203.0.113.1 are no longer encapped, and forwarded per BGP-ISIS + routes (in the default VRF) out of DUT port-8. + +#### Test-4, primary encap unviable but backup encap viable for all tunnels + +Tests that if the primary NHG for all encap tunnels are unviable, then the +traffic is re-encaped into the specified backup tunnels. This test ensures that +the device does not withdraw this IPv4Entry and sends this traffic to routing. + +1. Shutdown DUT port-2, port-3, port-4 and port-6. +2. Validate that traffic is encapsulated to 203.0.113.100 and 203.0.113.101 per + the weights. + +#### Test-5, primary and backup encap unviable for all tunnels + +Tests that if the primary NHGs of both the encap tunnel and its backup tunnel +are unviable for all tunnels in the encap NHG, then the traffic for that cluster +prefix is not encapped. Instead, that traffic should be forwarded according to +the BGP/IS-IS routes in the DEFAULT VRF. This stresses the double failure +handling, and ensures that the fallback to DEFAULT is activated through the +backup NHGs of the tunnels instead of withdrawing the IPv4Entry. + +1. Shutdown DUT port-2, port-3, port-4, port-5, port-6 and port-7. +2. Validate that all traffic is no longer encapsulated, and is all egressing + out of DUT port-8 per the BGP-ISIS routes in the default VRF. + +#### Test-6, primary encap unviable with backup to routing for all tunnels + +Tests that if the primary NHGs of both the encap tunnel is unviable, and its +backup specifies fallback to routing, for all tunnels in the encap NHG, then the +traffic for that cluster prefix is not encapped. Instead, that traffic should be +forwarded according to the BGP/IS-IS routes in the DEFAULT VRF. This stresses +the double failure handling, and ensures that the fallback to DEFAULT is +activated through the backup NHGs of the tunnels instead of withdrawing the +IPv4Entry. + +1. Update `NHG#1000` and `NHG#1001` to the following: + +``` +NHG#1000 (Default VRF) { {NH#1000, DEFAULT VRF} } + +NH#1000 -> { + decapsulate_header: OPENCONFIGAFTTYPESDECAPSULATIONHEADERTYPE_IPV4 + network_instance: "DEFAULT" +} + +NHG#1001 (Default VRF) { {NH#1001, DEFAULT VRF} } + +NH#1001 -> { + decapsulate_header: OPENCONFIGAFTTYPESDECAPSULATIONHEADERTYPE_IPV4 + network_instance: "DEFAULT" +} +``` + +1. Validate that all traffic is distributed per the hierarchical weights. +2. Shutdown DUT port-2, port-3, and port-4, and port-6. +3. Validate that all traffic is no longer encapsulated, and is all egressing + out of DUT port-8 per the BGP-ISIS routes in the default VRF. + +#### Test-7, no match in encap VRF + +Test that if there is no lookup match in the encap VRF, then the traffic should +be routed to the DEFAULT VRF for further lookup. + +1. In `ENCAP_TE_VRF_A`, Add an 0/0 static route pointing to the DEFAULT VRF + using gNMI. +2. Send traffic with destination address 20.0.0.1, which should produce no + match in `ENCAP_TE_VRF_A`. +3. Validate that the traffic is routed per the BGP-ISIS routes (in the DEFAULT + VR) out of DUT port-8. + +#### Test-8, no match in TE_VRF_222 + +Tests that if the re-encaps point to tunnels that do not exist, then the traffic +should be routed to the `DEFAULT` VRF for further lookup. + +1. Update `NHG#1000` and `NHG#1001` to the following: + +``` +NHG#1000 (Default VRF) { {NH#1000, DEFAULT VRF} } + +NH#1000 -> { + decapsulate_header: OPENCONFIGAFTTYPESDECAPSULATIONHEADERTYPE_IPV4 + encapsulate_header: OPENCONFIGAFTTYPESENCAPSULATIONHEADERTYPE_IPV4 + ip_in_ip { + dst_ip: "203.100.113.100" // This route does not exist in TE_VRF_222 + src_ip: "ipv4_outer_src_222" + } + network_instance: "TE_VRF_222" +} + +NHG#1001 (Default VRF) { {NH#1001, DEFAULT VRF} } + +NH#1001 -> { + decapsulate_header: OPENCONFIGAFTTYPESDECAPSULATIONHEADERTYPE_IPV4 + encapsulate_header: OPENCONFIGAFTTYPESENCAPSULATIONHEADERTYPE_IPV4 + ip_in_ip { + dst_ip: "203.100.113.101" // This route does not exist in TE_VRF_222 + src_ip: "ipv4_outer_src_222" + } + network_instance: "TE_VRF_222" +} +``` + +1. Validate that all traffic is distributed per the hierarchical weights. +2. Shutdown DUT port-2, port-3, and port-4, and port-6. +3. Validate that all traffic is no longer encapsulated, and is all egressing + out of DUT port-8 per the BGP-ISIS routes in the default VRF. + +#### Test-8, no match in TE_VRF_111 + +Tests that if the primary encaps point to tunnels that do not exist, then the +traffic should be routed to the `DEFAULT` VRF for further lookup. + +1. Validate that all traffic is distributed per the hierarchical weights. +2. Update NHG#101 to the following: + +``` +NHG#101 (DEFAULT VRF) -> { + {NH#101, DEFAULT VRF, weight:1}, + {NH#102, DEFAULT VRF, weight:3}, + backup_next_hop_group: 2001 // fallback to DEFAULT VRF +} + +NH#101 -> { + encapsulate_header: OPENCONFIGAFTTYPESENCAPSULATIONHEADERTYPE_IPV4 + ip_in_ip { + dst_ip: "203.100.113.1" // This route does not exist in TE_VRF_111 + src_ip: "ipv4_outer_src_111" + } + network_instance: "TE_VRF_111" +} +NH#102 -> { + encapsulate_header: OPENCONFIGAFTTYPESENCAPSULATIONHEADERTYPE_IPV4 + ip_in_ip { + dst_ip: "203.100.113.2" // This route does not exist in TE_VRF_111 + src_ip: "ipv4_outer_src_111" + } + network_instance: "TE_VRF_111" +} +``` + +1. Validate that all traffic is no longer encapsulated, and is all egressing + out of DUT port-8 per the BGP-ISIS routes in the default VRF. + +## Config Parameter Coverage + +* network-instances/network-instance/name +* network-instances/network-instance/policy-forwarding/policies/policy/policy-id +* network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/sequence-id +* network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/ipv4/protocol +* network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/ipv4/dscp-set +* network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/ipv4/source-address +* network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/ipv6/protocol +* network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/ipv6/dscp-set +* network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/ipv6/source-address +* network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/action/decap-network-instance +* network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/action/post-network-instance +* network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/action/decap-fallback-network-instance + +## Telemetry Parameter Coverage + +* network-instances/network-instance/name +* network-instances/network-instance/policy-forwarding/policies/policy/policy-id +* network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/sequence-id +* network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/ipv4/protocol +* network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/ipv4/dscp-set +* network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/ipv4/source-address +* network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/ipv6/protocol +* network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/ipv6/dscp-set +* network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/ipv6/source-address +* network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/action/decap-network-instance +* network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/action/post-network-instance +* network-instances/network-instance/policy-forwarding/policies/policy/rules/rule/action/decap-fallback-network-instance + +## Protocol/RPC Parameter Coverage + +* gRIBI: + * Modify + * ModifyRequest + +## Required DUT platform + +- vRX