From 87e8f6df79d5f2e0bf2277811a3090f9fac794df Mon Sep 17 00:00:00 2001 From: Pramod Maurya Date: Thu, 12 Dec 2024 21:31:33 +0530 Subject: [PATCH 01/41] Req approvals (#3563) * added required approvals workflow * added comment * fixed linting issues and removed unused vars --- .github/workflows/required_approvals.yml | 27 ++++++++ .../admin_distance_test.go | 68 +++++++++---------- 2 files changed, 59 insertions(+), 36 deletions(-) create mode 100644 .github/workflows/required_approvals.yml diff --git a/.github/workflows/required_approvals.yml b/.github/workflows/required_approvals.yml new file mode 100644 index 00000000000..3620513751b --- /dev/null +++ b/.github/workflows/required_approvals.yml @@ -0,0 +1,27 @@ +# This workflow is to make sure we have 1 LGTM for business logic and 1 LGTM for code style +name: PR Approval Workflow +on: + pull_request: + branches: + - main + pull_request_review: + types: [submitted] + +jobs: + check-approvals: + runs-on: ubuntu-latest + permissions: + id-token: write + contents: read + pull-requests: read + steps: + - name: Check for required approvals + id: check-approvals + uses: skymoore/required-approvals@main + with: + token: ${{ secrets.GITHUB_TOKEN }} + read_org_scoped_token: ${{ secrets.READ_ORG_SCOPED_TOKEN }} + org_name: openconfig + min_approvals: 2 + approval_mode: ALL + diff --git a/feature/bgp/admin_distance/otg_tests/admin_distance_test/admin_distance_test.go b/feature/bgp/admin_distance/otg_tests/admin_distance_test/admin_distance_test.go index 5bb4993e3e4..19398b463b4 100644 --- a/feature/bgp/admin_distance/otg_tests/admin_distance_test/admin_distance_test.go +++ b/feature/bgp/admin_distance/otg_tests/admin_distance_test/admin_distance_test.go @@ -29,25 +29,21 @@ import ( "github.com/openconfig/ondatra" "github.com/openconfig/ondatra/gnmi" "github.com/openconfig/ondatra/gnmi/oc" - "github.com/openconfig/ondatra/otg" "github.com/openconfig/ygot/ygot" ) const ( - prefixV4Len = uint32(24) - prefixV6Len = uint32(64) - v4Network = "192.168.10.0" - v6Network = "2024:db8:64:64::" - pathID = 1 - prefixesCount = 1 - bgpName = "BGP" - dutAS = uint32(64656) - ateAS = uint32(64657) - peerGrpNamev4 = "BGP-PEER-GROUP-V4" - peerGrpNamev6 = "BGP-PEER-GROUP-V6" - ateSysID = "640000000001" - ateAreaAddress = "49.0002" - lossTolerance = 1 + prefixV4Len = uint32(24) + prefixV6Len = uint32(64) + v4Network = "192.168.10.0" + v6Network = "2024:db8:64:64::" + prefixesCount = 1 + bgpName = "BGP" + dutAS = uint32(64656) + ateAS = uint32(64657) + peerGrpNameV4 = "BGP-PEER-GROUP-V4" + peerGrpNameV6 = "BGP-PEER-GROUP-V6" + lossTolerance = 1 ) var ( @@ -69,8 +65,8 @@ var ( IPv6Len: 126, } - advertisedIPv4 ipAddr = ipAddr{address: v4Network, prefix: prefixV4Len} - advertisedIPv6 ipAddr = ipAddr{address: v6Network, prefix: prefixV6Len} + advertisedIPv4 = ipAddr{address: v4Network, prefix: prefixV4Len} + advertisedIPv6 = ipAddr{address: v6Network, prefix: prefixV6Len} ) type ipAddr struct { @@ -86,7 +82,7 @@ func TestMain(m *testing.M) { func TestAdminDistance(t *testing.T) { ts := isissession.MustNew(t).WithISIS() configurePort3(t, ts) - advertisePrefixFromISISPort(t, ts) + advertisePrefixFromISISPort(ts) t.Run("ISIS Setup", func(t *testing.T) { ts.PushAndStart(t) ts.MustAdjacency(t) @@ -147,8 +143,8 @@ func TestAdminDistance(t *testing.T) { } ts.ATETop.Flows().Clear() - createFlow(t, ts.ATETop, ts.ATE.OTG(), false) - createFlow(t, ts.ATETop, ts.ATE.OTG(), true) + createFlow(t, ts.ATETop, false) + createFlow(t, ts.ATETop, true) ts.ATE.OTG().PushConfig(t, ts.ATETop) ts.ATE.OTG().StartProtocols(t) otgutils.WaitForARP(t, ts.ATE.OTG(), ts.ATETop, "IPv4") @@ -217,7 +213,7 @@ func configurePort3(t *testing.T, ts *isissession.TestSession) { atePort3.AddToOTG(ts.ATETop, ap3, dutPort3) } -func createFlow(t *testing.T, config gosnappi.Config, otg *otg.OTG, isV6 bool) { +func createFlow(t *testing.T, config gosnappi.Config, isV6 bool) { t.Helper() flowName := "flowV4" @@ -270,21 +266,21 @@ func setupEBGPAndAdvertise(t *testing.T, ts *isissession.TestSession) { g.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).Enabled = ygot.Bool(true) g.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST).Enabled = ygot.Bool(true) - pgv4 := bgp.GetOrCreatePeerGroup(peerGrpNamev4) + pgv4 := bgp.GetOrCreatePeerGroup(peerGrpNameV4) pgv4.PeerAs = ygot.Uint32(dutAS) - pgv4.PeerGroupName = ygot.String(peerGrpNamev4) - pgv6 := bgp.GetOrCreatePeerGroup(peerGrpNamev6) + pgv4.PeerGroupName = ygot.String(peerGrpNameV4) + pgv6 := bgp.GetOrCreatePeerGroup(peerGrpNameV6) pgv6.PeerAs = ygot.Uint32(dutAS) - pgv6.PeerGroupName = ygot.String(peerGrpNamev6) + pgv6.PeerGroupName = ygot.String(peerGrpNameV6) nV4 := bgp.GetOrCreateNeighbor(isissession.ATETrafficAttrs.IPv4) nV4.SetPeerAs(ateAS) nV4.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).Enabled = ygot.Bool(true) - nV4.PeerGroup = ygot.String(peerGrpNamev4) + nV4.PeerGroup = ygot.String(peerGrpNameV4) nV6 := bgp.GetOrCreateNeighbor(isissession.ATETrafficAttrs.IPv6) nV6.SetPeerAs(ateAS) nV6.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST).Enabled = ygot.Bool(true) - nV6.PeerGroup = ygot.String(peerGrpNamev6) + nV6.PeerGroup = ygot.String(peerGrpNameV6) // Configure Import Allow-All policy configureRoutePolicy(t, ts.DUT, "ALLOW", oc.RoutingPolicy_PolicyResultType_ACCEPT_ROUTE) @@ -313,11 +309,11 @@ func setupEBGPAndAdvertise(t *testing.T, ts *isissession.TestSession) { bgp6Peer.SetPeerAddress(isissession.DUTTrafficAttrs.IPv6).SetAsNumber(ateAS).SetAsType(gosnappi.BgpV6PeerAsType.EBGP) // configure emulated IPv4 and IPv6 networks - netv4 := bgp4Peer.V4Routes().Add().SetName("v4-bgpNet-dev") - netv4.Addresses().Add().SetAddress(advertisedIPv4.address).SetPrefix(advertisedIPv4.prefix).SetCount(uint32(prefixesCount)) + netV4 := bgp4Peer.V4Routes().Add().SetName("v4-bgpNet-dev") + netV4.Addresses().Add().SetAddress(advertisedIPv4.address).SetPrefix(advertisedIPv4.prefix).SetCount(uint32(prefixesCount)) - netv6 := bgp6Peer.V6Routes().Add().SetName("v6-bgpNet-dev") - netv6.Addresses().Add().SetAddress(advertisedIPv6.address).SetPrefix(advertisedIPv6.prefix).SetCount(uint32(prefixesCount)) + netV6 := bgp6Peer.V6Routes().Add().SetName("v6-bgpNet-dev") + netV6.Addresses().Add().SetAddress(advertisedIPv6.address).SetPrefix(advertisedIPv6.prefix).SetCount(uint32(prefixesCount)) ts.ATE.OTG().PushConfig(t, ts.ATETop) ts.ATE.OTG().StartProtocols(t) @@ -325,10 +321,10 @@ func setupEBGPAndAdvertise(t *testing.T, ts *isissession.TestSession) { otgutils.WaitForARP(t, ts.ATE.OTG(), ts.ATETop, "IPv6") } -func advertisePrefixFromISISPort(t *testing.T, ts *isissession.TestSession) { - netv4 := ts.ATEIntf1.Isis().V4Routes().Add().SetName("netv4").SetLinkMetric(10).SetOriginType(gosnappi.IsisV4RouteRangeOriginType.EXTERNAL) - netv4.Addresses().Add().SetAddress(advertisedIPv4.address).SetPrefix(advertisedIPv4.prefix).SetCount(uint32(prefixesCount)) +func advertisePrefixFromISISPort(ts *isissession.TestSession) { + netV4 := ts.ATEIntf1.Isis().V4Routes().Add().SetName("netv4").SetLinkMetric(10).SetOriginType(gosnappi.IsisV4RouteRangeOriginType.EXTERNAL) + netV4.Addresses().Add().SetAddress(advertisedIPv4.address).SetPrefix(advertisedIPv4.prefix).SetCount(uint32(prefixesCount)) - netv6 := ts.ATEIntf1.Isis().V6Routes().Add().SetName("netv6").SetLinkMetric(10).SetOriginType(gosnappi.IsisV6RouteRangeOriginType.EXTERNAL) - netv6.Addresses().Add().SetAddress(advertisedIPv6.address).SetPrefix(advertisedIPv6.prefix).SetCount(uint32(prefixesCount)) + netV6 := ts.ATEIntf1.Isis().V6Routes().Add().SetName("netv6").SetLinkMetric(10).SetOriginType(gosnappi.IsisV6RouteRangeOriginType.EXTERNAL) + netV6.Addresses().Add().SetAddress(advertisedIPv6.address).SetPrefix(advertisedIPv6.prefix).SetCount(uint32(prefixesCount)) } From 993351eff3987dc8c358a9acf3e71cfa164e69b0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 13:16:05 -0800 Subject: [PATCH 02/41] Bump golang.org/x/crypto from 0.27.0 to 0.31.0 (#3641) Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.27.0 to 0.31.0. - [Commits](https://github.com/golang/crypto/compare/v0.27.0...v0.31.0) --- updated-dependencies: - dependency-name: golang.org/x/crypto dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 10 +++++----- go.sum | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index c93984c9271..9965d7ca82f 100644 --- a/go.mod +++ b/go.mod @@ -41,9 +41,9 @@ require ( github.com/spf13/viper v1.19.0 github.com/yoheimuta/go-protoparser/v4 v4.9.0 github.com/yuin/goldmark v1.4.13 - golang.org/x/crypto v0.27.0 + golang.org/x/crypto v0.31.0 golang.org/x/exp v0.0.0-20240604190554-fc45aab8b7f8 - golang.org/x/text v0.18.0 + golang.org/x/text v0.21.0 google.golang.org/api v0.171.0 google.golang.org/grpc v1.66.2 google.golang.org/protobuf v1.34.2 @@ -154,9 +154,9 @@ require ( go.uber.org/multierr v1.11.0 // indirect golang.org/x/mod v0.18.0 // indirect golang.org/x/net v0.29.0 // indirect - golang.org/x/sync v0.8.0 // indirect - golang.org/x/sys v0.25.0 // indirect - golang.org/x/term v0.24.0 // indirect + golang.org/x/sync v0.10.0 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/term v0.27.0 // indirect golang.org/x/time v0.5.0 // indirect golang.org/x/tools v0.22.0 // indirect google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect diff --git a/go.sum b/go.sum index 454fb06c5bc..f5b7340ff7c 100644 --- a/go.sum +++ b/go.sum @@ -1920,8 +1920,8 @@ golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72 golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= -golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= -golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= +golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= +golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -2117,8 +2117,8 @@ golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= -golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -2213,8 +2213,8 @@ golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= -golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= +golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -2233,8 +2233,8 @@ golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/term v0.14.0/go.mod h1:TySc+nGkYR6qt8km8wUhuFRTVSMIX3XPR58y2lC8vww= golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= -golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM= -golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8= +golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q= +golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -2256,8 +2256,8 @@ golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= -golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= From cb3f696e54174fa86001245adf002bc888dd380f Mon Sep 17 00:00:00 2001 From: Pramod Maurya Date: Fri, 13 Dec 2024 11:37:41 +0530 Subject: [PATCH 03/41] Update required_approvals.yml (#3644) --- .github/workflows/required_approvals.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/required_approvals.yml b/.github/workflows/required_approvals.yml index 3620513751b..a4e629105ae 100644 --- a/.github/workflows/required_approvals.yml +++ b/.github/workflows/required_approvals.yml @@ -1,7 +1,7 @@ # This workflow is to make sure we have 1 LGTM for business logic and 1 LGTM for code style name: PR Approval Workflow on: - pull_request: + pull_request_target: branches: - main pull_request_review: From db2aa2d7caf0249c07d209a8d6ce965e75eba468 Mon Sep 17 00:00:00 2001 From: Pramod Maurya Date: Fri, 13 Dec 2024 14:25:08 +0530 Subject: [PATCH 04/41] Update required_approvals.yml (#3645) --- .github/workflows/required_approvals.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/required_approvals.yml b/.github/workflows/required_approvals.yml index a4e629105ae..c0b590558c8 100644 --- a/.github/workflows/required_approvals.yml +++ b/.github/workflows/required_approvals.yml @@ -24,4 +24,4 @@ jobs: org_name: openconfig min_approvals: 2 approval_mode: ALL - + pr_number: ${{ github.event.number }} From 39634bc7754fbdf5c0bb56cd3b17000a197a648e Mon Sep 17 00:00:00 2001 From: Pramod Maurya Date: Fri, 13 Dec 2024 18:47:30 +0530 Subject: [PATCH 05/41] Update required_approvals.yml --- .github/workflows/required_approvals.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/required_approvals.yml b/.github/workflows/required_approvals.yml index c0b590558c8..774f49c856f 100644 --- a/.github/workflows/required_approvals.yml +++ b/.github/workflows/required_approvals.yml @@ -4,9 +4,6 @@ on: pull_request_target: branches: - main - pull_request_review: - types: [submitted] - jobs: check-approvals: runs-on: ubuntu-latest From dd4aecbf7b0fd2ac3378184a2378c1a32657d23b Mon Sep 17 00:00:00 2001 From: charantejag504 <123508277+charantejag504@users.noreply.github.com> Date: Fri, 13 Dec 2024 10:25:56 -0800 Subject: [PATCH 06/41] Validation fix (#3537) Co-authored-by: sezhang2 --- .../tests/qos_policy_config_test/qos_policy_config_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/feature/qos/tests/qos_policy_config_test/qos_policy_config_test.go b/feature/qos/tests/qos_policy_config_test/qos_policy_config_test.go index 22cb3fe95a8..267cb0bddee 100644 --- a/feature/qos/tests/qos_policy_config_test/qos_policy_config_test.go +++ b/feature/qos/tests/qos_policy_config_test/qos_policy_config_test.go @@ -1645,8 +1645,10 @@ func testJuniperSchedulerPoliciesConfig(t *testing.T) { if got, want := gnmi.Get(t, dut, scheduler.Sequence().State()), tc.sequence; got != want { t.Errorf("scheduler.Sequence().State(): got %v, want %v", got, want) } - if got, want := gnmi.Get(t, dut, scheduler.Priority().State()), tc.priority; got != want { - t.Errorf("scheduler.Priority().State(): got %v, want %v", got, want) + if tc.priority == oc.Scheduler_Priority_STRICT { + if got, want := gnmi.Get(t, dut, scheduler.Priority().State()), tc.priority; got != want { + t.Errorf("scheduler.Priority().State(): got %v, want %v", got, want) + } } } From 74fd9b8fb19955c5e0ba5c65f23cd3fe5104e4fd Mon Sep 17 00:00:00 2001 From: arvbaska1 <123760606+arvbaska1@users.noreply.github.com> Date: Mon, 16 Dec 2024 14:12:28 -0500 Subject: [PATCH 07/41] change to use state for power-admin-state leaf (#3615) --- .../telemetry_inventory_test/telemetry_inventory_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/feature/platform/tests/telemetry_inventory_test/telemetry_inventory_test.go b/feature/platform/tests/telemetry_inventory_test/telemetry_inventory_test.go index 22212c8ffd7..d29c7c73452 100644 --- a/feature/platform/tests/telemetry_inventory_test/telemetry_inventory_test.go +++ b/feature/platform/tests/telemetry_inventory_test/telemetry_inventory_test.go @@ -1055,7 +1055,7 @@ func TestDefaultPowerAdminState(t *testing.T) { t.Logf("Supervisors: %v", supervisors) if len(fabrics) != 0 { - pas := gnmi.Get(t, dut, gnmi.OC().Component(fabrics[0].GetName()).Fabric().PowerAdminState().Config()) + pas := gnmi.Get(t, dut, gnmi.OC().Component(fabrics[0].GetName()).Fabric().PowerAdminState().State()) t.Logf("Component %s PowerAdminState: %v", fabrics[0].GetName(), pas) if pas == oc.Platform_ComponentPowerType_UNSET { t.Errorf("Component %s PowerAdminState is unset", fabrics[0].GetName()) @@ -1063,7 +1063,7 @@ func TestDefaultPowerAdminState(t *testing.T) { } if len(linecards) != 0 { - pas := gnmi.Get(t, dut, gnmi.OC().Component(linecards[0].GetName()).Linecard().PowerAdminState().Config()) + pas := gnmi.Get(t, dut, gnmi.OC().Component(linecards[0].GetName()).Linecard().PowerAdminState().State()) t.Logf("Component %s PowerAdminState: %v", linecards[0].GetName(), pas) if pas == oc.Platform_ComponentPowerType_UNSET { t.Errorf("Component %s PowerAdminState is unset", linecards[0].GetName()) @@ -1071,7 +1071,7 @@ func TestDefaultPowerAdminState(t *testing.T) { } if !deviations.SkipControllerCardPowerAdmin(dut) { if len(supervisors) != 0 { - pas := gnmi.Get(t, dut, gnmi.OC().Component(supervisors[0].GetName()).ControllerCard().PowerAdminState().Config()) + pas := gnmi.Get(t, dut, gnmi.OC().Component(supervisors[0].GetName()).ControllerCard().PowerAdminState().State()) t.Logf("Component %s PowerAdminState: %v", supervisors[0].GetName(), pas) if pas == oc.Platform_ComponentPowerType_UNSET { t.Errorf("Component %s PowerAdminState is unset", supervisors[0].GetName()) From 86d6e2c484b5ad93e566666ea19cae3a6d9ae26b Mon Sep 17 00:00:00 2001 From: cprabha Date: Mon, 16 Dec 2024 21:51:37 -0800 Subject: [PATCH 08/41] fixing issue (#3650) --- .../otg_tests/management_ha_test/management_ha_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feature/system/management/otg_tests/management_ha_test/management_ha_test.go b/feature/system/management/otg_tests/management_ha_test/management_ha_test.go index 9a92d63f2ce..7b5c3334703 100644 --- a/feature/system/management/otg_tests/management_ha_test/management_ha_test.go +++ b/feature/system/management/otg_tests/management_ha_test/management_ha_test.go @@ -183,9 +183,9 @@ func TestManagementHA1(t *testing.T) { }) t.Run("traffic received by port1", func(t *testing.T) { - createFlowV6(t, bs) gnmi.Replace(t, dut, gnmi.OC().Interface(p1.Name()).Enabled().Config(), true) gnmi.Await(t, dut, gnmi.OC().Interface(p1.Name()).AdminStatus().State(), 30*time.Second, oc.Interface_AdminStatus_UP) + createFlowV6(t, bs) time.Sleep(30 * time.Second) bs.ATE.OTG().StartTraffic(t) time.Sleep(30 * time.Second) From 5ccd97eae7c4b41befa625c73f351be0451b40c3 Mon Sep 17 00:00:00 2001 From: Ram Date: Tue, 17 Dec 2024 14:46:08 +0530 Subject: [PATCH 09/41] fixing isis_interface_level_passive_test with deviation (#3653) --- .../isis_interface_level_passive_test.go | 63 ++++++-- .../metadata.textproto | 2 + internal/deviations/deviations.go | 15 ++ proto/metadata.proto | 6 + proto/metadata_go_proto/metadata.pb.go | 137 ++++++++++++------ 5 files changed, 161 insertions(+), 62 deletions(-) diff --git a/feature/isis/otg_tests/isis_interface_level_passive_test/isis_interface_level_passive_test.go b/feature/isis/otg_tests/isis_interface_level_passive_test/isis_interface_level_passive_test.go index 86a695e5ab7..eb0dde965b0 100644 --- a/feature/isis/otg_tests/isis_interface_level_passive_test/isis_interface_level_passive_test.go +++ b/feature/isis/otg_tests/isis_interface_level_passive_test/isis_interface_level_passive_test.go @@ -15,6 +15,7 @@ package isis_interface_level_passive_test import ( + "fmt" "net" "testing" "time" @@ -23,8 +24,10 @@ import ( "github.com/google/go-cmp/cmp/cmpopts" "github.com/openconfig/featureprofiles/internal/deviations" "github.com/openconfig/featureprofiles/internal/fptest" + "github.com/openconfig/featureprofiles/internal/helpers" "github.com/openconfig/featureprofiles/internal/isissession" "github.com/openconfig/featureprofiles/internal/otgutils" + "github.com/openconfig/ondatra" "github.com/openconfig/ondatra/gnmi" "github.com/openconfig/ondatra/gnmi/oc" "github.com/openconfig/ygot/ygot" @@ -99,8 +102,8 @@ func configureISIS(t *testing.T, ts *isissession.TestSession) { // Interface level configs. isisIntfLevel2 := intf.GetOrCreateLevel(2) isisIntfLevel2.LevelNumber = ygot.Uint8(2) + isisIntfLevel2.SetEnabled(true) isisIntfLevel2.Enabled = ygot.Bool(true) - isisIntfLevel2.Passive = ygot.Bool(true) isisIntfLevel2.GetOrCreateHelloAuthentication().Enabled = ygot.Bool(true) isisIntfLevel2.GetHelloAuthentication().AuthPassword = ygot.String(password) @@ -170,7 +173,7 @@ func configureOTG(t *testing.T, ts *isissession.TestSession) { func TestISISLevelPassive(t *testing.T) { ts := isissession.MustNew(t).WithISIS() configureISIS(t, ts) - + dut := ts.DUT configureOTG(t, ts) otg := ts.ATE.OTG() @@ -178,6 +181,7 @@ func TestISISLevelPassive(t *testing.T) { fptest.LogQuery(t, "Protocol ISIS", isissession.ProtocolPath(ts.DUT).Config(), pcl) ts.PushAndStart(t) + time.Sleep(time.Minute * 2) statePath := isissession.ISISPath(ts.DUT) intfName := ts.DUTPort1.Name() @@ -185,11 +189,27 @@ func TestISISLevelPassive(t *testing.T) { intfName += ".0" } t.Run("Isis telemetry", func(t *testing.T) { + time.Sleep(time.Minute * 1) + var isispassiveconfig string t.Run("Passive checks", func(t *testing.T) { - // Passive should be true. - if got := gnmi.Get(t, ts.DUT, statePath.Interface(intfName).Level(2).Passive().State()); got != true { - t.Errorf("FAIL- Expected level 2 passive state not found, got %t, want %t", got, true) + if deviations.IsisInterfaceLevelPassiveUnsupported(ts.DUT) { + switch dut.Vendor() { + case ondatra.CISCO: + isispassiveconfig = fmt.Sprintf("router isis DEFAULT\n interface %s\n passive\n", intfName) + default: + t.Fatalf("Unsupported vendor %s for deviation 'IsisInterfaceLevelPassiveUnsupported'", dut.Vendor()) + } + helpers.GnmiCLIConfig(t, dut, isispassiveconfig) + } else { + gnmi.Update(t, ts.DUT, statePath.Interface(intfName).Level(2).Passive().Config(), true) + } + if !deviations.IsisInterfaceLevelPassiveUnsupported(ts.DUT) { + // Passive should be true. + if got := gnmi.Get(t, ts.DUT, statePath.Interface(intfName).Level(2).Passive().State()); got != true { + t.Errorf("FAIL- Expected level 2 passive state not found, got %t, want %t", got, true) + } } + t.Logf("Adjacency state after passive update is %s", statePath.Interface(intfName).Level(2).AdjacencyAny().AdjacencyState().State()) // Adjacency should be down. for _, val := range gnmi.LookupAll(t, ts.DUT, statePath.Interface(intfName).LevelAny().AdjacencyAny().AdjacencyState().State()) { if v, _ := val.Val(); v == oc.Isis_IsisInterfaceAdjState_UP { @@ -197,12 +217,23 @@ func TestISISLevelPassive(t *testing.T) { } } // Updating passive config to false on dut. - gnmi.Update(t, ts.DUT, statePath.Interface(intfName).Level(2).Passive().Config(), false) - time.Sleep(time.Second * 5) - - if got := gnmi.Get(t, ts.DUT, statePath.Interface(intfName).Level(2).Passive().State()); got != false { - t.Errorf("FAIL- Expected level 2 passive state not found, got %t, want %t", got, true) + if deviations.IsisInterfaceLevelPassiveUnsupported(ts.DUT) { + switch dut.Vendor() { + case ondatra.CISCO: + isispassiveconfig = fmt.Sprintf("router isis DEFAULT\n interface %s\n no passive\n", intfName) + default: + t.Fatalf("Unsupported vendor %s for deviation 'IsisInterfaceLevelPassiveUnsupported'", dut.Vendor()) + } + helpers.GnmiCLIConfig(t, dut, isispassiveconfig) + } else { + gnmi.Update(t, ts.DUT, statePath.Interface(intfName).Level(2).Passive().Config(), false) } + if !deviations.IsisInterfaceLevelPassiveUnsupported(ts.DUT) { + if got := gnmi.Get(t, ts.DUT, statePath.Interface(intfName).Level(2).Passive().State()); got != false { + t.Errorf("FAIL- Expected level 2 passive state not found, got %t, want %t", got, true) + } + } + t.Logf("Adjacency state after passive update is %s", statePath.Interface(intfName).LevelAny().AdjacencyAny().AdjacencyState().State()) // Level 2 adjacency should be up. _, err := ts.AwaitAdjacency() if err != nil { @@ -244,8 +275,10 @@ func TestISISLevelPassive(t *testing.T) { if got := gnmi.Get(t, ts.DUT, adjPath.AreaAddress().State()); !cmp.Equal(got, want, cmpopts.SortSlices(func(a, b string) bool { return a < b })) { t.Errorf("FAIL- Expected area address not found, got %s, want %s", got, want) } - if got := gnmi.Get(t, ts.DUT, adjPath.DisSystemId().State()); got != "0000.0000.0000" { - t.Errorf("FAIL- Expected dis system id not found, got %s, want %s", got, "0000.0000.0000") + if !deviations.IsisDisSysidUnsupported(ts.DUT) { + if got := gnmi.Get(t, ts.DUT, adjPath.DisSystemId().State()); got != "0000.0000.0000" { + t.Errorf("FAIL- Expected dis system id not found, got %s, want %s", got, "0000.0000.0000") + } } if got := gnmi.Get(t, ts.DUT, adjPath.LocalExtendedCircuitId().State()); got == 0 { t.Errorf("FAIL- Expected local extended circuit id not found,expected non-zero value, got %d", got) @@ -298,8 +331,10 @@ func TestISISLevelPassive(t *testing.T) { if got := gnmi.Get(t, ts.DUT, statePath.Level(2).SystemLevelCounters().CorruptedLsps().State()); got != 0 { t.Errorf("FAIL- Not expecting any corrupted lsps, got %d, want %d", got, 0) } - if got := gnmi.Get(t, ts.DUT, statePath.Level(2).SystemLevelCounters().DatabaseOverloads().State()); got != 0 { - t.Errorf("FAIL- Not expecting non zero database_overloads, got %d, want %d", got, 0) + if !deviations.IsisDatabaseOverloadsUnsupported(ts.DUT) { + if got := gnmi.Get(t, ts.DUT, statePath.Level(2).SystemLevelCounters().DatabaseOverloads().State()); got != 0 { + t.Errorf("FAIL- Not expecting non zero database_overloads, got %d, want %d", got, 0) + } } if got := gnmi.Get(t, ts.DUT, statePath.Level(2).SystemLevelCounters().ExceedMaxSeqNums().State()); got != 0 { t.Errorf("FAIL- Not expecting non zero max_seqnum counter, got %d, want %d", got, 0) diff --git a/feature/isis/otg_tests/isis_interface_level_passive_test/metadata.textproto b/feature/isis/otg_tests/isis_interface_level_passive_test/metadata.textproto index 9506ed808ae..d0a0a9cc54f 100644 --- a/feature/isis/otg_tests/isis_interface_level_passive_test/metadata.textproto +++ b/feature/isis/otg_tests/isis_interface_level_passive_test/metadata.textproto @@ -25,6 +25,8 @@ platform_exceptions: { deviations: { ipv4_missing_enabled: true isis_interface_level1_disable_required: true + isis_dis_sysid_unsupported: true + isis_database_overloads_unsupported: true } } platform_exceptions: { diff --git a/internal/deviations/deviations.go b/internal/deviations/deviations.go index c60ba035066..b3d5c42a316 100644 --- a/internal/deviations/deviations.go +++ b/internal/deviations/deviations.go @@ -1243,3 +1243,18 @@ func EnableTableConnections(dut *ondatra.DUTDevice) bool { func NoZeroSuppression(dut *ondatra.DUTDevice) bool { return lookupDUTDeviations(dut).GetNoZeroSuppression() } + +// IsisInterfaceLevelPassiveUnsupported returns true for devices that do not support passive leaf +func IsisInterfaceLevelPassiveUnsupported(dut *ondatra.DUTDevice) bool { + return lookupDUTDeviations(dut).GetIsisInterfaceLevelPassiveUnsupported() +} + +// IsisDisSysidUnsupported returns true for devices that do not support dis-system-id leaf +func IsisDisSysidUnsupported(dut *ondatra.DUTDevice) bool { + return lookupDUTDeviations(dut).GetIsisDisSysidUnsupported() +} + +// IsisDatabaseOverloadsUnsupported returns true for devices that do not support database-overloads leaf +func IsisDatabaseOverloadsUnsupported(dut *ondatra.DUTDevice) bool { + return lookupDUTDeviations(dut).GetIsisDatabaseOverloadsUnsupported() +} diff --git a/proto/metadata.proto b/proto/metadata.proto index 03fb1f00ed1..b0d385bc0cc 100644 --- a/proto/metadata.proto +++ b/proto/metadata.proto @@ -658,6 +658,12 @@ message Metadata { // Device has default zero suppression. // Juniper : b/378646018 bool no_zero_suppression = 237; + // Cisco: b/378801305 + bool isis_interface_level_passive_unsupported = 238; + // Cisco: b/378616912 + bool isis_dis_sysid_unsupported = 239; + // Cisco: b/378616912 + bool isis_database_overloads_unsupported = 240; // Reserved field numbers and identifiers. reserved 84, 9, 28, 20, 90, 97, 55, 89, 19, 36, 35, 40, 173; } diff --git a/proto/metadata_go_proto/metadata.pb.go b/proto/metadata_go_proto/metadata.pb.go index f0de2c0a632..f5ee4b49518 100644 --- a/proto/metadata_go_proto/metadata.pb.go +++ b/proto/metadata_go_proto/metadata.pb.go @@ -14,8 +14,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 -// protoc v3.6.1 +// protoc-gen-go v1.34.1 +// protoc v3.21.12 // source: metadata.proto package metadata_go_proto @@ -940,6 +940,12 @@ type Metadata_Deviations struct { // Device has default zero suppression. // Juniper : b/378646018 NoZeroSuppression bool `protobuf:"varint,237,opt,name=no_zero_suppression,json=noZeroSuppression,proto3" json:"no_zero_suppression,omitempty"` + // Cisco: b/378801305 + IsisInterfaceLevelPassiveUnsupported bool `protobuf:"varint,238,opt,name=isis_interface_level_passive_unsupported,json=isisInterfaceLevelPassiveUnsupported,proto3" json:"isis_interface_level_passive_unsupported,omitempty"` + // Cisco: b/378616912 + IsisDisSysidUnsupported bool `protobuf:"varint,239,opt,name=isis_dis_sysid_unsupported,json=isisDisSysidUnsupported,proto3" json:"isis_dis_sysid_unsupported,omitempty"` + // Cisco: b/378616912 + IsisDatabaseOverloadsUnsupported bool `protobuf:"varint,240,opt,name=isis_database_overloads_unsupported,json=isisDatabaseOverloadsUnsupported,proto3" json:"isis_database_overloads_unsupported,omitempty"` } func (x *Metadata_Deviations) Reset() { @@ -2486,6 +2492,27 @@ func (x *Metadata_Deviations) GetNoZeroSuppression() bool { return false } +func (x *Metadata_Deviations) GetIsisInterfaceLevelPassiveUnsupported() bool { + if x != nil { + return x.IsisInterfaceLevelPassiveUnsupported + } + return false +} + +func (x *Metadata_Deviations) GetIsisDisSysidUnsupported() bool { + if x != nil { + return x.IsisDisSysidUnsupported + } + return false +} + +func (x *Metadata_Deviations) GetIsisDatabaseOverloadsUnsupported() bool { + if x != nil { + return x.IsisDatabaseOverloadsUnsupported + } + return false +} + type Metadata_PlatformExceptions struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -2549,7 +2576,7 @@ var file_metadata_proto_rawDesc = []byte{ 0x74, 0x69, 0x6e, 0x67, 0x1a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x6f, 0x6e, 0x64, 0x61, 0x74, 0x72, 0x61, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x62, 0x65, - 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf6, 0x85, 0x01, 0x0a, 0x08, 0x4d, 0x65, 0x74, + 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xdd, 0x87, 0x01, 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x6c, 0x61, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x6c, 0x61, 0x6e, @@ -2583,7 +2610,7 @@ var file_metadata_proto_rawDesc = []byte{ 0x65, 0x67, 0x65, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x73, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x67, 0x65, 0x78, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x52, 0x0e, 0x68, 0x61, 0x72, 0x64, 0x77, 0x61, 0x72, 0x65, - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x1a, 0xc9, 0x7d, 0x0a, 0x0a, 0x44, 0x65, 0x76, 0x69, 0x61, + 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x1a, 0xb0, 0x7f, 0x0a, 0x0a, 0x44, 0x65, 0x76, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x30, 0x0a, 0x14, 0x69, 0x70, 0x76, 0x34, 0x5f, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, 0x69, 0x70, 0x76, 0x34, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, @@ -3583,45 +3610,59 @@ var file_metadata_proto_rawDesc = []byte{ 0x73, 0x12, 0x2f, 0x0a, 0x13, 0x6e, 0x6f, 0x5f, 0x7a, 0x65, 0x72, 0x6f, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0xed, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x6e, 0x6f, 0x5a, 0x65, 0x72, 0x6f, 0x53, 0x75, 0x70, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x4a, 0x04, 0x08, 0x54, 0x10, 0x55, 0x4a, 0x04, 0x08, 0x09, 0x10, 0x0a, 0x4a, 0x04, - 0x08, 0x1c, 0x10, 0x1d, 0x4a, 0x04, 0x08, 0x14, 0x10, 0x15, 0x4a, 0x04, 0x08, 0x5a, 0x10, 0x5b, - 0x4a, 0x04, 0x08, 0x61, 0x10, 0x62, 0x4a, 0x04, 0x08, 0x37, 0x10, 0x38, 0x4a, 0x04, 0x08, 0x59, - 0x10, 0x5a, 0x4a, 0x04, 0x08, 0x13, 0x10, 0x14, 0x4a, 0x04, 0x08, 0x24, 0x10, 0x25, 0x4a, 0x04, - 0x08, 0x23, 0x10, 0x24, 0x4a, 0x04, 0x08, 0x28, 0x10, 0x29, 0x4a, 0x06, 0x08, 0xad, 0x01, 0x10, - 0xae, 0x01, 0x1a, 0xa0, 0x01, 0x0a, 0x12, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x45, - 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x41, 0x0a, 0x08, 0x70, 0x6c, 0x61, - 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6f, 0x70, - 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, - 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, - 0x72, 0x6d, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x47, 0x0a, 0x0a, - 0x64, 0x65, 0x76, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x27, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x74, 0x65, - 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x44, - 0x65, 0x76, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x0a, 0x64, 0x65, 0x76, 0x69, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xfa, 0x01, 0x0a, 0x07, 0x54, 0x65, 0x73, 0x74, 0x62, 0x65, - 0x64, 0x12, 0x17, 0x0a, 0x13, 0x54, 0x45, 0x53, 0x54, 0x42, 0x45, 0x44, 0x5f, 0x55, 0x4e, 0x53, - 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x45, - 0x53, 0x54, 0x42, 0x45, 0x44, 0x5f, 0x44, 0x55, 0x54, 0x10, 0x01, 0x12, 0x1a, 0x0a, 0x16, 0x54, - 0x45, 0x53, 0x54, 0x42, 0x45, 0x44, 0x5f, 0x44, 0x55, 0x54, 0x5f, 0x44, 0x55, 0x54, 0x5f, 0x34, - 0x4c, 0x49, 0x4e, 0x4b, 0x53, 0x10, 0x02, 0x12, 0x1a, 0x0a, 0x16, 0x54, 0x45, 0x53, 0x54, 0x42, - 0x45, 0x44, 0x5f, 0x44, 0x55, 0x54, 0x5f, 0x41, 0x54, 0x45, 0x5f, 0x32, 0x4c, 0x49, 0x4e, 0x4b, - 0x53, 0x10, 0x03, 0x12, 0x1a, 0x0a, 0x16, 0x54, 0x45, 0x53, 0x54, 0x42, 0x45, 0x44, 0x5f, 0x44, - 0x55, 0x54, 0x5f, 0x41, 0x54, 0x45, 0x5f, 0x34, 0x4c, 0x49, 0x4e, 0x4b, 0x53, 0x10, 0x04, 0x12, - 0x1e, 0x0a, 0x1a, 0x54, 0x45, 0x53, 0x54, 0x42, 0x45, 0x44, 0x5f, 0x44, 0x55, 0x54, 0x5f, 0x41, - 0x54, 0x45, 0x5f, 0x39, 0x4c, 0x49, 0x4e, 0x4b, 0x53, 0x5f, 0x4c, 0x41, 0x47, 0x10, 0x05, 0x12, - 0x1e, 0x0a, 0x1a, 0x54, 0x45, 0x53, 0x54, 0x42, 0x45, 0x44, 0x5f, 0x44, 0x55, 0x54, 0x5f, 0x44, - 0x55, 0x54, 0x5f, 0x41, 0x54, 0x45, 0x5f, 0x32, 0x4c, 0x49, 0x4e, 0x4b, 0x53, 0x10, 0x06, 0x12, - 0x1a, 0x0a, 0x16, 0x54, 0x45, 0x53, 0x54, 0x42, 0x45, 0x44, 0x5f, 0x44, 0x55, 0x54, 0x5f, 0x41, - 0x54, 0x45, 0x5f, 0x38, 0x4c, 0x49, 0x4e, 0x4b, 0x53, 0x10, 0x07, 0x12, 0x15, 0x0a, 0x11, 0x54, - 0x45, 0x53, 0x54, 0x42, 0x45, 0x44, 0x5f, 0x44, 0x55, 0x54, 0x5f, 0x34, 0x30, 0x30, 0x5a, 0x52, - 0x10, 0x08, 0x22, 0x6d, 0x0a, 0x04, 0x54, 0x61, 0x67, 0x73, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x41, - 0x47, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, - 0x12, 0x14, 0x0a, 0x10, 0x54, 0x41, 0x47, 0x53, 0x5f, 0x41, 0x47, 0x47, 0x52, 0x45, 0x47, 0x41, - 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14, 0x54, 0x41, 0x47, 0x53, 0x5f, 0x44, - 0x41, 0x54, 0x41, 0x43, 0x45, 0x4e, 0x54, 0x45, 0x52, 0x5f, 0x45, 0x44, 0x47, 0x45, 0x10, 0x02, - 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x41, 0x47, 0x53, 0x5f, 0x45, 0x44, 0x47, 0x45, 0x10, 0x03, 0x12, - 0x10, 0x0a, 0x0c, 0x54, 0x41, 0x47, 0x53, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x49, 0x54, 0x10, - 0x04, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x6e, 0x12, 0x57, 0x0a, 0x28, 0x69, 0x73, 0x69, 0x73, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, + 0x66, 0x61, 0x63, 0x65, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x69, + 0x76, 0x65, 0x5f, 0x75, 0x6e, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x18, 0xee, + 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x24, 0x69, 0x73, 0x69, 0x73, 0x49, 0x6e, 0x74, 0x65, 0x72, + 0x66, 0x61, 0x63, 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x50, 0x61, 0x73, 0x73, 0x69, 0x76, 0x65, + 0x55, 0x6e, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x12, 0x3c, 0x0a, 0x1a, 0x69, + 0x73, 0x69, 0x73, 0x5f, 0x64, 0x69, 0x73, 0x5f, 0x73, 0x79, 0x73, 0x69, 0x64, 0x5f, 0x75, 0x6e, + 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x18, 0xef, 0x01, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x17, 0x69, 0x73, 0x69, 0x73, 0x44, 0x69, 0x73, 0x53, 0x79, 0x73, 0x69, 0x64, 0x55, 0x6e, + 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x12, 0x4e, 0x0a, 0x23, 0x69, 0x73, 0x69, + 0x73, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x6f, 0x76, 0x65, 0x72, 0x6c, + 0x6f, 0x61, 0x64, 0x73, 0x5f, 0x75, 0x6e, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, + 0x18, 0xf0, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x20, 0x69, 0x73, 0x69, 0x73, 0x44, 0x61, 0x74, + 0x61, 0x62, 0x61, 0x73, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x55, 0x6e, + 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x4a, 0x04, 0x08, 0x54, 0x10, 0x55, 0x4a, + 0x04, 0x08, 0x09, 0x10, 0x0a, 0x4a, 0x04, 0x08, 0x1c, 0x10, 0x1d, 0x4a, 0x04, 0x08, 0x14, 0x10, + 0x15, 0x4a, 0x04, 0x08, 0x5a, 0x10, 0x5b, 0x4a, 0x04, 0x08, 0x61, 0x10, 0x62, 0x4a, 0x04, 0x08, + 0x37, 0x10, 0x38, 0x4a, 0x04, 0x08, 0x59, 0x10, 0x5a, 0x4a, 0x04, 0x08, 0x13, 0x10, 0x14, 0x4a, + 0x04, 0x08, 0x24, 0x10, 0x25, 0x4a, 0x04, 0x08, 0x23, 0x10, 0x24, 0x4a, 0x04, 0x08, 0x28, 0x10, + 0x29, 0x4a, 0x06, 0x08, 0xad, 0x01, 0x10, 0xae, 0x01, 0x1a, 0xa0, 0x01, 0x0a, 0x12, 0x50, 0x6c, + 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x45, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x12, 0x41, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, + 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, + 0x6f, 0x72, 0x6d, 0x12, 0x47, 0x0a, 0x0a, 0x64, 0x65, 0x76, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x52, 0x0a, 0x64, 0x65, 0x76, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xfa, 0x01, 0x0a, + 0x07, 0x54, 0x65, 0x73, 0x74, 0x62, 0x65, 0x64, 0x12, 0x17, 0x0a, 0x13, 0x54, 0x45, 0x53, 0x54, + 0x42, 0x45, 0x44, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, + 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x45, 0x53, 0x54, 0x42, 0x45, 0x44, 0x5f, 0x44, 0x55, 0x54, + 0x10, 0x01, 0x12, 0x1a, 0x0a, 0x16, 0x54, 0x45, 0x53, 0x54, 0x42, 0x45, 0x44, 0x5f, 0x44, 0x55, + 0x54, 0x5f, 0x44, 0x55, 0x54, 0x5f, 0x34, 0x4c, 0x49, 0x4e, 0x4b, 0x53, 0x10, 0x02, 0x12, 0x1a, + 0x0a, 0x16, 0x54, 0x45, 0x53, 0x54, 0x42, 0x45, 0x44, 0x5f, 0x44, 0x55, 0x54, 0x5f, 0x41, 0x54, + 0x45, 0x5f, 0x32, 0x4c, 0x49, 0x4e, 0x4b, 0x53, 0x10, 0x03, 0x12, 0x1a, 0x0a, 0x16, 0x54, 0x45, + 0x53, 0x54, 0x42, 0x45, 0x44, 0x5f, 0x44, 0x55, 0x54, 0x5f, 0x41, 0x54, 0x45, 0x5f, 0x34, 0x4c, + 0x49, 0x4e, 0x4b, 0x53, 0x10, 0x04, 0x12, 0x1e, 0x0a, 0x1a, 0x54, 0x45, 0x53, 0x54, 0x42, 0x45, + 0x44, 0x5f, 0x44, 0x55, 0x54, 0x5f, 0x41, 0x54, 0x45, 0x5f, 0x39, 0x4c, 0x49, 0x4e, 0x4b, 0x53, + 0x5f, 0x4c, 0x41, 0x47, 0x10, 0x05, 0x12, 0x1e, 0x0a, 0x1a, 0x54, 0x45, 0x53, 0x54, 0x42, 0x45, + 0x44, 0x5f, 0x44, 0x55, 0x54, 0x5f, 0x44, 0x55, 0x54, 0x5f, 0x41, 0x54, 0x45, 0x5f, 0x32, 0x4c, + 0x49, 0x4e, 0x4b, 0x53, 0x10, 0x06, 0x12, 0x1a, 0x0a, 0x16, 0x54, 0x45, 0x53, 0x54, 0x42, 0x45, + 0x44, 0x5f, 0x44, 0x55, 0x54, 0x5f, 0x41, 0x54, 0x45, 0x5f, 0x38, 0x4c, 0x49, 0x4e, 0x4b, 0x53, + 0x10, 0x07, 0x12, 0x15, 0x0a, 0x11, 0x54, 0x45, 0x53, 0x54, 0x42, 0x45, 0x44, 0x5f, 0x44, 0x55, + 0x54, 0x5f, 0x34, 0x30, 0x30, 0x5a, 0x52, 0x10, 0x08, 0x22, 0x6d, 0x0a, 0x04, 0x54, 0x61, 0x67, + 0x73, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x41, 0x47, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, + 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x41, 0x47, 0x53, 0x5f, + 0x41, 0x47, 0x47, 0x52, 0x45, 0x47, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x01, 0x12, 0x18, 0x0a, + 0x14, 0x54, 0x41, 0x47, 0x53, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x43, 0x45, 0x4e, 0x54, 0x45, 0x52, + 0x5f, 0x45, 0x44, 0x47, 0x45, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x41, 0x47, 0x53, 0x5f, + 0x45, 0x44, 0x47, 0x45, 0x10, 0x03, 0x12, 0x10, 0x0a, 0x0c, 0x54, 0x41, 0x47, 0x53, 0x5f, 0x54, + 0x52, 0x41, 0x4e, 0x53, 0x49, 0x54, 0x10, 0x04, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -3638,7 +3679,7 @@ func file_metadata_proto_rawDescGZIP() []byte { var file_metadata_proto_enumTypes = make([]protoimpl.EnumInfo, 2) var file_metadata_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_metadata_proto_goTypes = []any{ +var file_metadata_proto_goTypes = []interface{}{ (Metadata_Testbed)(0), // 0: openconfig.testing.Metadata.Testbed (Metadata_Tags)(0), // 1: openconfig.testing.Metadata.Tags (*Metadata)(nil), // 2: openconfig.testing.Metadata @@ -3667,7 +3708,7 @@ func file_metadata_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_metadata_proto_msgTypes[0].Exporter = func(v any, i int) any { + file_metadata_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Metadata); i { case 0: return &v.state @@ -3679,7 +3720,7 @@ func file_metadata_proto_init() { return nil } } - file_metadata_proto_msgTypes[1].Exporter = func(v any, i int) any { + file_metadata_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Metadata_Platform); i { case 0: return &v.state @@ -3691,7 +3732,7 @@ func file_metadata_proto_init() { return nil } } - file_metadata_proto_msgTypes[2].Exporter = func(v any, i int) any { + file_metadata_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Metadata_Deviations); i { case 0: return &v.state @@ -3703,7 +3744,7 @@ func file_metadata_proto_init() { return nil } } - file_metadata_proto_msgTypes[3].Exporter = func(v any, i int) any { + file_metadata_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Metadata_PlatformExceptions); i { case 0: return &v.state From 26cae5044bfc3f339b8fea631922d6458294f9ab Mon Sep 17 00:00:00 2001 From: Darren Loher Date: Tue, 17 Dec 2024 12:05:01 -0800 Subject: [PATCH 10/41] Add codeowners for transceiver (#3651) * Add codeowners for transceiver --- .github/CODEOWNERS | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 2dfea7d093a..7f443cfe020 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -24,6 +24,7 @@ /feature/mtu/ @swetha-haridasula /feature/networkinstance/ @swetha-haridasula /feature/platform/ @amrindrr +/feature/platform/transceiver @jianchen-g @yiwenhu-g @ahsaanyousaf @ejbrever @rezachit /feature/qos @sezhang2 /feature/routing_policy/ @swetha-haridasula /feature/sampling/ @sudhinj From f80fb73ceb4b397b4c1cf6a7b373d1421650d0e9 Mon Sep 17 00:00:00 2001 From: Rob Shakir Date: Tue, 17 Dec 2024 14:01:14 -0800 Subject: [PATCH 11/41] =?UTF-8?q?=F0=9F=A7=B9:=20Clean=20up=20`CODEOWNERS`?= =?UTF-8?q?=20to=20reflect=20approvers.=20(#3655)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 🧹: housekeeping to ensure well-scoped CODEOWNERS. * (M) .github/CODEOWNERS - `s/featureprofiles-maintainers/featureprofiles-approvers/g` to have a clear group of folks that are the default CODEOWNERS. * Add @morrowc as a security codeowner. --- .github/CODEOWNERS | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 7f443cfe020..58d1e98ef3b 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -6,9 +6,9 @@ # These owners will be the default owners for everything in # the repo. Unless a later match takes precedence, -# @openconfig/featureprofiles-maintainers will be requested for +# @openconfig/featureprofiles-approvers will be requested for # review when someone opens a pull request. -* @openconfig/featureprofiles-maintainers +* @openconfig/featureprofiles-approvers # /feature folders each have owners who are auto requested for review and may merge PR's /feature/acl/ @alokmtri-g @@ -28,7 +28,7 @@ /feature/qos @sezhang2 /feature/routing_policy/ @swetha-haridasula /feature/sampling/ @sudhinj -/feature/security @mihirpitale-googler +/feature/security @mihirpitale-googler @morrowc /feature/staticroute/ @swetha-haridasula /feature/stp/ @alokmtri-g /feature/system @swetha-haridasula From 244347e7d12b0fa1e431e7110c200f273a8b5b74 Mon Sep 17 00:00:00 2001 From: Ram Date: Wed, 18 Dec 2024 14:11:13 +0530 Subject: [PATCH 12/41] fixing isis_interface_hello_padding_enable_test (#3658) --- ...sis_interface_hello_padding_enable_test.go | 28 ++++++++++++------- .../metadata.textproto | 2 ++ 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/feature/isis/otg_tests/isis_interface_hello_padding_enable_test/isis_interface_hello_padding_enable_test.go b/feature/isis/otg_tests/isis_interface_hello_padding_enable_test/isis_interface_hello_padding_enable_test.go index 8823ec9e638..7e21ac55d6a 100644 --- a/feature/isis/otg_tests/isis_interface_hello_padding_enable_test/isis_interface_hello_padding_enable_test.go +++ b/feature/isis/otg_tests/isis_interface_hello_padding_enable_test/isis_interface_hello_padding_enable_test.go @@ -74,6 +74,7 @@ func configureISIS(t *testing.T, ts *isissession.TestSession) { // Level configs. level := isis.GetOrCreateLevel(2) level.LevelNumber = ygot.Uint8(2) + level.MetricStyle = oc.Isis_MetricStyle_WIDE_METRIC // Authentication configs. auth := level.GetOrCreateAuthentication() @@ -88,7 +89,6 @@ func configureISIS(t *testing.T, ts *isissession.TestSession) { intfName += ".0" } intf := isis.GetOrCreateInterface(intfName) - intf.HelloPadding = oc.Isis_HelloPaddingType_ADAPTIVE // Interface timers. isisIntfTimers := intf.GetOrCreateTimers() @@ -101,6 +101,8 @@ func configureISIS(t *testing.T, ts *isissession.TestSession) { // Interface level configs. isisIntfLevel := intf.GetOrCreateLevel(2) isisIntfLevel.LevelNumber = ygot.Uint8(2) + isisIntfLevel.SetEnabled(true) + isisIntfLevel.Enabled = ygot.Bool(true) isisIntfLevel.GetOrCreateHelloAuthentication().Enabled = ygot.Bool(true) isisIntfLevel.GetHelloAuthentication().AuthPassword = ygot.String(password) isisIntfLevel.GetHelloAuthentication().AuthType = oc.KeychainTypes_AUTH_TYPE_SIMPLE_KEY @@ -110,12 +112,14 @@ func configureISIS(t *testing.T, ts *isissession.TestSession) { isisIntfLevelTimers.HelloInterval = ygot.Uint32(5) isisIntfLevelTimers.HelloMultiplier = ygot.Uint8(3) - if !deviations.ISISInterfaceAfiUnsupported(ts.DUT) { - isisIntfLevel.GetOrCreateAf(oc.IsisTypes_AFI_TYPE_IPV4, oc.IsisTypes_SAFI_TYPE_UNICAST).Enabled = ygot.Bool(true) - isisIntfLevel.GetOrCreateAf(oc.IsisTypes_AFI_TYPE_IPV6, oc.IsisTypes_SAFI_TYPE_UNICAST).Enabled = ygot.Bool(true) - } + isisIntfLevel.GetOrCreateAf(oc.IsisTypes_AFI_TYPE_IPV4, oc.IsisTypes_SAFI_TYPE_UNICAST).Enabled = ygot.Bool(true) isisIntfLevel.GetOrCreateAf(oc.IsisTypes_AFI_TYPE_IPV4, oc.IsisTypes_SAFI_TYPE_UNICAST).Metric = ygot.Uint32(v4Metric) + isisIntfLevel.GetOrCreateAf(oc.IsisTypes_AFI_TYPE_IPV6, oc.IsisTypes_SAFI_TYPE_UNICAST).Enabled = ygot.Bool(true) isisIntfLevel.GetOrCreateAf(oc.IsisTypes_AFI_TYPE_IPV6, oc.IsisTypes_SAFI_TYPE_UNICAST).Metric = ygot.Uint32(v6Metric) + if deviations.MissingIsisInterfaceAfiSafiEnable(ts.DUT) { + isisIntfLevel.GetOrCreateAf(oc.IsisTypes_AFI_TYPE_IPV4, oc.IsisTypes_SAFI_TYPE_UNICAST).Enabled = nil + isisIntfLevel.GetOrCreateAf(oc.IsisTypes_AFI_TYPE_IPV6, oc.IsisTypes_SAFI_TYPE_UNICAST).Enabled = nil + } } // configureOTG configures isis and traffic on OTG. @@ -222,7 +226,7 @@ func TestIsisInterfaceHelloPaddingEnable(t *testing.T) { // Adjacency check. _, found := gnmi.Watch(t, ts.DUT, statePath.Interface(intfName).Level(2).Adjacency(ateSysID).AdjacencyState().State(), time.Minute, func(val *ygnmi.Value[oc.E_Isis_IsisInterfaceAdjState]) bool { state, present := val.Val() - return present && state == oc.Isis_IsisInterfaceAdjState_DOWN + return present && (state == oc.Isis_IsisInterfaceAdjState_DOWN || state == oc.Isis_IsisInterfaceAdjState_INIT) }).Await(t) if !found { t.Errorf("Isis adjacency is not down on interface %v when MTU is changed", intfName) @@ -274,8 +278,10 @@ func TestIsisInterfaceHelloPaddingEnable(t *testing.T) { if got := gnmi.Get(t, ts.DUT, adjPath.AreaAddress().State()); !cmp.Equal(got, want, cmpopts.SortSlices(func(a, b string) bool { return a < b })) { t.Errorf("FAIL- Expected area address not found, got %s, want %s", got, want) } - if got := gnmi.Get(t, ts.DUT, adjPath.DisSystemId().State()); got != "0000.0000.0000" { - t.Errorf("FAIL- Expected dis system id not found, got %s, want %s", got, "0000.0000.0000") + if !deviations.IsisDisSysidUnsupported(ts.DUT) { + if got := gnmi.Get(t, ts.DUT, adjPath.DisSystemId().State()); got != "0000.0000.0000" { + t.Errorf("FAIL- Expected dis system id not found, got %s, want %s", got, "0000.0000.0000") + } } if got := gnmi.Get(t, ts.DUT, adjPath.LocalExtendedCircuitId().State()); got == 0 { t.Errorf("FAIL- Expected local extended circuit id not found,expected non-zero value, got %d", got) @@ -328,8 +334,10 @@ func TestIsisInterfaceHelloPaddingEnable(t *testing.T) { if got := gnmi.Get(t, ts.DUT, statePath.Level(2).SystemLevelCounters().CorruptedLsps().State()); got != 0 { t.Errorf("FAIL- Not expecting any corrupted lsps, got %d, want %d", got, 0) } - if got := gnmi.Get(t, ts.DUT, statePath.Level(2).SystemLevelCounters().DatabaseOverloads().State()); got != 0 { - t.Errorf("FAIL- Not expecting non zero database_overloads, got %d, want %d", got, 0) + if !deviations.IsisDatabaseOverloadsUnsupported(ts.DUT) { + if got := gnmi.Get(t, ts.DUT, statePath.Level(2).SystemLevelCounters().DatabaseOverloads().State()); got != 0 { + t.Errorf("FAIL- Not expecting pre isis config database_overloads value to change, got %d, want %d", got, 0) + } } if got := gnmi.Get(t, ts.DUT, statePath.Level(2).SystemLevelCounters().ExceedMaxSeqNums().State()); got != 0 { t.Errorf("FAIL- Not expecting non zero max_seqnum counter, got %d, want %d", got, 0) diff --git a/feature/isis/otg_tests/isis_interface_hello_padding_enable_test/metadata.textproto b/feature/isis/otg_tests/isis_interface_hello_padding_enable_test/metadata.textproto index b534b4ef211..3586116e655 100644 --- a/feature/isis/otg_tests/isis_interface_hello_padding_enable_test/metadata.textproto +++ b/feature/isis/otg_tests/isis_interface_hello_padding_enable_test/metadata.textproto @@ -25,6 +25,8 @@ platform_exceptions: { deviations: { ipv4_missing_enabled: true isis_interface_level1_disable_required: true + isis_dis_sysid_unsupported: true + isis_database_overloads_unsupported: true } } platform_exceptions: { From 5e6ecb8a6ff8b66c3b9c61e9e46c70b5f802f515 Mon Sep 17 00:00:00 2001 From: mananpat-cisco Date: Wed, 18 Dec 2024 04:10:32 -0500 Subject: [PATCH 13/41] deviation for RT-2.9 (#3618) * deviation for RT-2.9 * updated deviation list to use existing one * removed metadata.pb.go changes --------- Co-authored-by: Ram --- .../isis_metric_style_wide_enabled_test.go | 12 ++++++++---- .../metadata.textproto | 2 ++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/feature/isis/otg_tests/isis_metric_style_wide_enabled_test/isis_metric_style_wide_enabled_test.go b/feature/isis/otg_tests/isis_metric_style_wide_enabled_test/isis_metric_style_wide_enabled_test.go index 5a1f9f29362..29caeafbae6 100644 --- a/feature/isis/otg_tests/isis_metric_style_wide_enabled_test/isis_metric_style_wide_enabled_test.go +++ b/feature/isis/otg_tests/isis_metric_style_wide_enabled_test/isis_metric_style_wide_enabled_test.go @@ -241,8 +241,10 @@ func TestISISWideMetricEnabled(t *testing.T) { if got := gnmi.Get(t, ts.DUT, adjPath.AreaAddress().State()); !cmp.Equal(got, want, cmpopts.SortSlices(func(a, b string) bool { return a < b })) { t.Errorf("FAIL- Expected area address not found, got %s, want %s", got, want) } - if got := gnmi.Get(t, ts.DUT, adjPath.DisSystemId().State()); got != "0000.0000.0000" { - t.Errorf("FAIL- Expected dis system id not found, got %s, want %s", got, "0000.0000.0000") + if !deviations.IsisDisSysidUnsupported(ts.DUT) { + if got := gnmi.Get(t, ts.DUT, adjPath.DisSystemId().State()); got != "0000.0000.0000" { + t.Errorf("FAIL- Expected dis system id not found, got %s, want %s", got, "0000.0000.0000") + } } if got := gnmi.Get(t, ts.DUT, adjPath.LocalExtendedCircuitId().State()); got == 0 { t.Errorf("FAIL- Expected local extended circuit id not found,expected non-zero value, got %d", got) @@ -295,8 +297,10 @@ func TestISISWideMetricEnabled(t *testing.T) { if got := gnmi.Get(t, ts.DUT, statePath.Level(2).SystemLevelCounters().CorruptedLsps().State()); got != 0 { t.Errorf("FAIL- Not expecting any corrupted lsps, got %d, want %d", got, 0) } - if got := gnmi.Get(t, ts.DUT, statePath.Level(2).SystemLevelCounters().DatabaseOverloads().State()); got != 0 { - t.Errorf("FAIL- Not expecting non zero database_overloads, got %d, want %d", got, 0) + if !deviations.IsisDatabaseOverloadsUnsupported(ts.DUT) { + if got := gnmi.Get(t, ts.DUT, statePath.Level(2).SystemLevelCounters().DatabaseOverloads().State()); got != 0 { + t.Errorf("FAIL- Not expecting pre isis config database_overloads value to change, got %d, want %d", got, 0) + } } if got := gnmi.Get(t, ts.DUT, statePath.Level(2).SystemLevelCounters().ExceedMaxSeqNums().State()); got != 0 { t.Errorf("FAIL- Not expecting non zero max_seqnum counter, got %d, want %d", got, 0) diff --git a/feature/isis/otg_tests/isis_metric_style_wide_enabled_test/metadata.textproto b/feature/isis/otg_tests/isis_metric_style_wide_enabled_test/metadata.textproto index f97decc5a6f..4a83159128d 100644 --- a/feature/isis/otg_tests/isis_metric_style_wide_enabled_test/metadata.textproto +++ b/feature/isis/otg_tests/isis_metric_style_wide_enabled_test/metadata.textproto @@ -25,6 +25,8 @@ platform_exceptions: { deviations: { ipv4_missing_enabled: true isis_interface_level1_disable_required: true + isis_dis_sysid_unsupported: true + isis_database_overloads_unsupported: true } } platform_exceptions: { From b0a694685dac6a981e61af00e72f4d89bd02cf7a Mon Sep 17 00:00:00 2001 From: Rob Shakir Date: Wed, 18 Dec 2024 10:06:06 -0800 Subject: [PATCH 14/41] Avoid adopting potentially unreleased changes in third-party action. (#3646) * Avoid adopting potentially unreleased changes in third-party action. * Fix version for all third-party actions. --- .github/workflows/go.yml | 20 ++++++++++---------- .github/workflows/nosimage.yml | 4 ++-- .github/workflows/protobufs.yml | 18 +++++++++--------- .github/workflows/pull_request.yml | 12 ++++++------ .github/workflows/readme_oc_path_and_rpc.yml | 4 ++-- .github/workflows/rebase_check.yml | 2 +- .github/workflows/required_approvals.yml | 2 +- .github/workflows/rundata_check.yml | 2 +- .github/workflows/wiki.yml | 8 ++++---- 9 files changed, 36 insertions(+), 36 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 6ab972f2897..ff20539b0a0 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -11,13 +11,13 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@dc323e67f16fb5f7663d20ff7941f27f5809e9b6 - name: Set up Go - uses: actions/setup-go@v2.1.3 + uses: actions/setup-go@424fc82d43fa5a37540bae62709ddcc23d9520d4 with: go-version: 1.21.x - name: Cache - uses: actions/cache@v3 + uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 with: path: | ~/go/pkg/mod @@ -28,13 +28,13 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@dc323e67f16fb5f7663d20ff7941f27f5809e9b6 - name: Set up Go - uses: actions/setup-go@v2.1.3 + uses: actions/setup-go@424fc82d43fa5a37540bae62709ddcc23d9520d4 with: go-version: 1.21.x - name: Cache - uses: actions/cache@v3 + uses: actions/cache@f4b3439a656ba812b8cb417d2d49f9c810103092 with: path: | ~/go/pkg/mod @@ -45,7 +45,7 @@ jobs: run: sudo apt-get -y install libpcap-dev - run: go test -v -coverprofile=profile.cov $(go list ./... | grep -v /.*test.*) - name: Send coverage - uses: shogo82148/actions-goveralls@v1 + uses: shogo82148/actions-goveralls@7b1bd2871942af030d707d6574e5f684f9891fb2 with: path-to-profile: profile.cov static_analysis: @@ -53,7 +53,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Install go - uses: actions/setup-go@v2 + uses: actions/setup-go@424fc82d43fa5a37540bae62709ddcc23d9520d4 with: go-version: '1.21' # Go & staticcheck build cache require a lot of disk space. Reclaim extra @@ -66,9 +66,9 @@ jobs: sudo mv "${HOME}/.cache" /mnt/cache ln -s /mnt/cache "${HOME}/.cache" - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 - name: Cache - uses: actions/cache@v3 + uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 with: path: | ~/go/pkg/mod diff --git a/.github/workflows/nosimage.yml b/.github/workflows/nosimage.yml index 0be4a982ccd..45a6e276b46 100644 --- a/.github/workflows/nosimage.yml +++ b/.github/workflows/nosimage.yml @@ -12,9 +12,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 - name: Set up Go - uses: actions/setup-go@v4 + uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe with: go-version: stable cache: false diff --git a/.github/workflows/protobufs.yml b/.github/workflows/protobufs.yml index e645507fc8e..99326ed33a6 100644 --- a/.github/workflows/protobufs.yml +++ b/.github/workflows/protobufs.yml @@ -13,20 +13,20 @@ jobs: runs-on: ubuntu-latest steps: - name: Install go - uses: actions/setup-go@v2 + uses: actions/setup-go@424fc82d43fa5a37540bae62709ddcc23d9520d4 with: go-version: '1.21' - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 - name: Cache - uses: actions/cache@v3 + uses: actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c with: path: | ~/go/pkg/mod ~/.cache/go-build key: ${{ github.job }}-${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }} - name: Install protobuf - uses: arduino/setup-protoc@v1 + uses: arduino/setup-protoc@149f6c87b92550901b26acd1632e11c3662e381f with: version: '3.x' repo-token: ${{ secrets.GITHUB_TOKEN }} @@ -38,7 +38,7 @@ jobs: find github.com/openconfig/featureprofiles/ -name \*.proto -exec api-linter --disable-rule all --enable-rule core {} \+ - name: Validate textprotos run: | - go install github.com/bstoll/textproto-validator@latest + go install github.com/bstoll/textproto-validator@15e24d0eb567d63615f0aa70940bc073ab674fe7 make protoimports for i in `find . -name \*.textproto`; do textproto-validator -I ./protobuf-import $i @@ -49,21 +49,21 @@ jobs: runs-on: ubuntu-latest steps: - name: Install go - uses: actions/setup-go@v2 + uses: actions/setup-go@424fc82d43fa5a37540bae62709ddcc23d9520d4 with: go-version: '1.21' - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 with: fetch-depth: 0 - name: Cache - uses: actions/cache@v3 + uses: actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c with: path: | ~/go/pkg/mod ~/.cache/go-build key: ${{ github.job }}-${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }} - - name: Fetch Openconfig Models + - name: Fetch OpenConfig Models run: make openconfig_public - name: Validate Paths run: | diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 5365ed1ee1c..a90c1025bbd 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -5,14 +5,14 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 - name: Setup Perl - uses: perl-actions/install-with-cpanm@v1 + uses: perl-actions/install-with-cpanm@10d60f00b4073f484fc29d45bfbe2f776397ab3d with: install: | Net::IP - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 - name: IP Addresses Assignment run: | git diff --name-only main | while read l; do @@ -24,7 +24,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 - name: Allowed File Types run: ./tools/allowed_file_types.sh - name: Block hyphenated directory names @@ -65,9 +65,9 @@ jobs: name: OTG Changes Required runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 - name: Check if OTG changes required - uses: actions/github-script@v6 + uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 with: script: | const script = require('./.github/workflows/required_otg_changes_check.js') diff --git a/.github/workflows/readme_oc_path_and_rpc.yml b/.github/workflows/readme_oc_path_and_rpc.yml index 73e78f5be8d..23215b74d7a 100644 --- a/.github/workflows/readme_oc_path_and_rpc.yml +++ b/.github/workflows/readme_oc_path_and_rpc.yml @@ -12,11 +12,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 with: fetch-depth: 0 - name: Set up Go - uses: actions/setup-go@v4 + uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe with: go-version: stable cache: false diff --git a/.github/workflows/rebase_check.yml b/.github/workflows/rebase_check.yml index 76e330acb1a..69f825aef51 100644 --- a/.github/workflows/rebase_check.yml +++ b/.github/workflows/rebase_check.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout PR - uses: actions/checkout@v3 + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 with: fetch-depth: 0 - name: Check if dependencies and checks are up to date. diff --git a/.github/workflows/required_approvals.yml b/.github/workflows/required_approvals.yml index 774f49c856f..4a2123d17d6 100644 --- a/.github/workflows/required_approvals.yml +++ b/.github/workflows/required_approvals.yml @@ -14,7 +14,7 @@ jobs: steps: - name: Check for required approvals id: check-approvals - uses: skymoore/required-approvals@main + uses: skymoore/required-approvals@57612e00c501132dfb35ddaff54615b363f8e076 with: token: ${{ secrets.GITHUB_TOKEN }} read_org_scoped_token: ${{ secrets.READ_ORG_SCOPED_TOKEN }} diff --git a/.github/workflows/rundata_check.yml b/.github/workflows/rundata_check.yml index 65657a213ee..33373f14d70 100644 --- a/.github/workflows/rundata_check.yml +++ b/.github/workflows/rundata_check.yml @@ -7,6 +7,6 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout PR - uses: actions/checkout@v3 + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 - name: Check that addrundata is up to date. run: go run ./tools/addrundata diff --git a/.github/workflows/wiki.yml b/.github/workflows/wiki.yml index 2c6e0644c11..a0124455fb2 100644 --- a/.github/workflows/wiki.yml +++ b/.github/workflows/wiki.yml @@ -9,20 +9,20 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: path: featureprofiles - name: Checkout wiki - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: repository: "openconfig/featureprofiles.wiki" path: featureprofiles.wiki - name: Set up Go - uses: actions/setup-go@v2.1.3 + uses: actions/setup-go@424fc82d43fa5a37540bae62709ddcc23d9520d4 with: go-version: 1.21.x - name: Cache - uses: actions/cache@v3 + uses: actions/cache@f4b3439a656ba812b8cb417d2d49f9c810103092 with: path: | ~/go/pkg/mod From 7fdbb6e86528d4fb6e90e0f9adcfaffe5f558dfc Mon Sep 17 00:00:00 2001 From: ANISH-GOTTAPU <48308607+ANISH-GOTTAPU@users.noreply.github.com> Date: Wed, 18 Dec 2024 23:55:19 +0530 Subject: [PATCH 15/41] Update RT-5.6 to change link down on port1 instead of all ports (#3612) --- .../interface_loopback_aggregate_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feature/interface/interface_loopback_aggregate/otg_tests/interface_loopback_aggregate/interface_loopback_aggregate_test.go b/feature/interface/interface_loopback_aggregate/otg_tests/interface_loopback_aggregate/interface_loopback_aggregate_test.go index 8e31b1550d0..dcbc768fe6f 100644 --- a/feature/interface/interface_loopback_aggregate/otg_tests/interface_loopback_aggregate/interface_loopback_aggregate_test.go +++ b/feature/interface/interface_loopback_aggregate/otg_tests/interface_loopback_aggregate/interface_loopback_aggregate_test.go @@ -182,7 +182,7 @@ func TestInterfaceLoopbackMode(t *testing.T) { cs := gosnappi.NewControlState() t.Run("Admin down OTG port1", func(t *testing.T) { - cs.Port().Link().SetState(gosnappi.StatePortLinkState.DOWN) + cs.Port().Link().SetPortNames([]string{ate.Port(t, "port1").ID()}).SetState(gosnappi.StatePortLinkState.DOWN) otg.SetControlState(t, cs) }) From c90e744c9d325662e1346730ab35b8858cfba779 Mon Sep 17 00:00:00 2001 From: Karthikeya Remilla Date: Thu, 19 Dec 2024 10:18:04 +0530 Subject: [PATCH 16/41] RT-5.8 monitor interface stats before proceeding with test (#3614) * extra delay * use Watch.Await instead of sleep * use Watch.Await instead of sleep --------- Co-authored-by: Ram --- .../ipv6_link_local_test/ipv6_link_local_test.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/feature/interface/ip/ipv6_link_local/otg_tests/ipv6_link_local_test/ipv6_link_local_test.go b/feature/interface/ip/ipv6_link_local/otg_tests/ipv6_link_local_test/ipv6_link_local_test.go index cdced10d75a..b77fbcc8d3c 100644 --- a/feature/interface/ip/ipv6_link_local/otg_tests/ipv6_link_local_test/ipv6_link_local_test.go +++ b/feature/interface/ip/ipv6_link_local/otg_tests/ipv6_link_local_test/ipv6_link_local_test.go @@ -128,9 +128,7 @@ func TestIPv6LinkLocal(t *testing.T) { t.Run("Disable and Enable Port1", func(t *testing.T) { p1 := dut.Port(t, "port1") gnmi.Replace(t, dut, gnmi.OC().Interface(p1.Name()).Enabled().Config(), false) - // gnmi.Await(t, dut, gnmi.OC().Interface(p1.Name()).Enabled().State(), 30*time.Second, false) - t.Logf("Sleeping for 30 seconds") - time.Sleep(30 * time.Second) + gnmi.Await(t, dut, gnmi.OC().Interface(p1.Name()).Enabled().State(), 30*time.Second, false) gnmi.Replace(t, dut, gnmi.OC().Interface(p1.Name()).Enabled().Config(), true) otgutils.WaitForARP(t, ate.OTG(), top, "IPv6") t.Run("Interface Telemetry", func(t *testing.T) { @@ -255,9 +253,15 @@ func verifyLinkLocalTraffic(t *testing.T, dut *ondatra.DUTDevice, ate *ondatra.A p1 := dut.Port(t, "port1") beforeInPkts := gnmi.Get(t, dut, gnmi.OC().Interface(p1.Name()).Counters().InPkts().State()) ate.OTG().StartTraffic(t) - time.Sleep(15 * time.Second) + _, ok := gnmi.Watch(t, dut, gnmi.OC().Interface(p1.Name()).Counters().InPkts().State(), time.Second*30, func(v *ygnmi.Value[uint64]) bool { + gotPkts, present := v.Val() + return present && (gotPkts-beforeInPkts) >= 100 + }).Await(t) + if !ok { + t.Fatal("did not get expected number of packets after starting traffic. want > 100") + } + ate.OTG().StopTraffic(t) - time.Sleep(15 * time.Second) otgutils.LogFlowMetrics(t, ate.OTG(), top) flowMetrics := gnmi.Get(t, ate.OTG(), gnmi.OTG().Flow(flowName).Counters().State()) otgTxPkts := flowMetrics.GetOutPkts() From b15df1ede7b6acfedea63f9d5a742ce3503efc9c Mon Sep 17 00:00:00 2001 From: Pramod Maurya Date: Thu, 19 Dec 2024 19:27:12 +0530 Subject: [PATCH 17/41] changed pull_request event (#3643) --- .../weighted_ecmp_test/weighted_ecmp_test.go | 3 +- internal/cfgplugins/bgp.go | 14 ++-- internal/cfgplugins/sflow.go | 2 +- internal/deviations/deviations.go | 40 ++++++------ internal/fptest/log.go | 5 +- internal/helpers/helpers.go | 2 +- internal/p4rtutils/p4rtutils.go | 64 +++++++++---------- internal/rundata/local.go | 21 +++--- internal/rundata/local_test.go | 15 ++--- internal/rundata/rundata.go | 3 +- internal/vrfpolicy/vrfpolicy.go | 6 +- 11 files changed, 85 insertions(+), 90 deletions(-) diff --git a/feature/isis/otg_tests/weighted_ecmp_test/weighted_ecmp_test.go b/feature/isis/otg_tests/weighted_ecmp_test/weighted_ecmp_test.go index ce6638892c2..64d778f03a5 100644 --- a/feature/isis/otg_tests/weighted_ecmp_test/weighted_ecmp_test.go +++ b/feature/isis/otg_tests/weighted_ecmp_test/weighted_ecmp_test.go @@ -2,11 +2,10 @@ package weighted_ecmp_test import ( "fmt" + "math/rand" "testing" "time" - "math/rand" - "github.com/open-traffic-generator/snappi/gosnappi" "github.com/openconfig/featureprofiles/internal/attrs" "github.com/openconfig/featureprofiles/internal/deviations" diff --git a/internal/cfgplugins/bgp.go b/internal/cfgplugins/bgp.go index 15b542655e5..4b57c046f82 100644 --- a/internal/cfgplugins/bgp.go +++ b/internal/cfgplugins/bgp.go @@ -227,14 +227,14 @@ func (bs *BGPSession) WithEBGP(t *testing.T, afiTypes []oc.E_BgpTypes_AFI_SAFI_T ipv4 := devices[i].Ethernets().Items()[0].Ipv4Addresses().Items()[0] bgp4Peer := bgp.Ipv4Interfaces().Add().SetIpv4Name(ipv4.Name()).Peers().Add().SetName(devices[i].Name() + ".BGP4.peer") bgp4Peer.SetPeerAddress(ipv4.Gateway()) - bgp4Peer.SetAsNumber(uint32(asNumbers[i])) + bgp4Peer.SetAsNumber(asNumbers[i]) bgp4Peer.SetAsType(gosnappi.BgpV4PeerAsType.EBGP) bgp4Peer.LearnedInformationFilter().SetUnicastIpv4Prefix(true) case oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST: ipv6 := devices[i].Ethernets().Items()[0].Ipv6Addresses().Items()[0] bgp6Peer := bgp.Ipv6Interfaces().Add().SetIpv6Name(ipv6.Name()).Peers().Add().SetName(devices[i].Name() + ".BGP6.peer") bgp6Peer.SetPeerAddress(ipv6.Gateway()) - bgp6Peer.SetAsNumber(uint32(asNumbers[i])) + bgp6Peer.SetAsNumber(asNumbers[i]) bgp6Peer.SetAsType(gosnappi.BgpV6PeerAsType.EBGP) bgp6Peer.LearnedInformationFilter().SetUnicastIpv6Prefix(true) } @@ -395,7 +395,7 @@ func (bs *BGPSession) buildNeigborConfig(isSamePG, isSameAS bool, bgpPorts []str } ncAll := []*NeighborConfig{nc1, nc2, nc3, nc4} - validNC := []*NeighborConfig{} + var validNC []*NeighborConfig for _, nc := range ncAll[:len(bs.DUTPorts)] { if containsValue(bgpPorts, nc.Name) { validNC = append(validNC, nc) @@ -533,12 +533,12 @@ func VerifyBGPCapabilities(t *testing.T, dut *ondatra.DUTDevice, nbrs []*BgpNeig oc.BgpTypes_BGP_CAPABILITY_ASN32: false, oc.BgpTypes_BGP_CAPABILITY_MPBGP: false, } - for _, cap := range gnmi.Get(t, dut, nbrPath.SupportedCapabilities().State()) { - capabilities[cap] = true + for _, c := range gnmi.Get(t, dut, nbrPath.SupportedCapabilities().State()) { + capabilities[c] = true } - for cap, present := range capabilities { + for c, present := range capabilities { if !present { - t.Errorf("Capability not reported: %v", cap) + t.Errorf("Capability not reported: %v", c) } } } diff --git a/internal/cfgplugins/sflow.go b/internal/cfgplugins/sflow.go index bf0086daba0..99229eac17a 100644 --- a/internal/cfgplugins/sflow.go +++ b/internal/cfgplugins/sflow.go @@ -57,7 +57,7 @@ func NewSFlowGlobalCfg(t *testing.T, batch *gnmi.SetBatch, newcfg *oc.Sampling_S // NewSFlowCollector creates a collector to be appended to SFlowConfig. // If sfc is nil, default values are provided. func NewSFlowCollector(t *testing.T, batch *gnmi.SetBatch, newcfg *oc.Sampling_Sflow_Collector, d *ondatra.DUTDevice, ni, intfName string, srcAddrV4 string, srcAddrV6 string) []*oc.Sampling_Sflow_Collector { - coll := []*oc.Sampling_Sflow_Collector{} + var coll []*oc.Sampling_Sflow_Collector if newcfg == nil { intf := gnmi.Get[*oc.Interface](t, d, gnmi.OC().Interface(intfName).State()) diff --git a/internal/deviations/deviations.go b/internal/deviations/deviations.go index b3d5c42a316..eca0aa92ce8 100644 --- a/internal/deviations/deviations.go +++ b/internal/deviations/deviations.go @@ -31,8 +31,8 @@ // Requirements for deviations: // // - Deviations may only use OpenConfig compliant behavior. -// - Deviations should be small in scope, typically affecting one sub-test, one -// OpenConfig path or small OpenConfig sub-tree. +// - Deviations should be small in scope, typically affecting one subtest, one +// OpenConfig path or small OpenConfig subtree. // // If a device could not pass without deviation, that is considered non-compliant // behavior. Ideally, a device should pass both with and without a deviation which means @@ -132,7 +132,7 @@ func GRIBIMACOverrideStaticARPStaticRoute(dut *ondatra.DUTDevice) bool { return lookupDUTDeviations(dut).GetGribiMacOverrideStaticArpStaticRoute() } -// AggregateAtomicUpdate returns if device requires that aggregate Port-Channel and its members be defined in a single gNMI Update transaction at /interfaces. +// AggregateAtomicUpdate returns if device requires that aggregate Port-Channel and its members be defined in a single gNMI Update transaction at /interfaces, // Otherwise lag-type will be dropped, and no member can be added to the aggregate. // Full OpenConfig compliant devices should pass both with and without this deviation. func AggregateAtomicUpdate(dut *ondatra.DUTDevice) bool { @@ -185,7 +185,7 @@ func SwitchChipIDUnsupported(dut *ondatra.DUTDevice) bool { return lookupDUTDeviations(dut).GetSwitchChipIdUnsupported() } -// BackplaneFacingCapacityUnsupported returns whether the device supports backplane-facing-capacity leaves for some of the components. +// BackplaneFacingCapacityUnsupported returns whether the device supports backplane-facing-capacity leaves for some components. func BackplaneFacingCapacityUnsupported(dut *ondatra.DUTDevice) bool { return lookupDUTDeviations(dut).GetBackplaneFacingCapacityUnsupported() } @@ -344,7 +344,7 @@ func InstallOSForStandbyRP(dut *ondatra.DUTDevice) bool { } // GNOIStatusWithEmptySubcomponent returns if the response of gNOI reboot status is a single value (not a list), -// the device requires explict component path to account for a situation when there is more than one active reboot requests. +// the device requires explicit component path to account for a situation when there is more than one active reboot requests. func GNOIStatusWithEmptySubcomponent(dut *ondatra.DUTDevice) bool { return lookupDUTDeviations(dut).GetGnoiStatusEmptySubcomponent() } @@ -433,7 +433,7 @@ func GNOIFabricComponentRebootUnsupported(dut *ondatra.DUTDevice) bool { return lookupDUTDeviations(dut).GetGnoiFabricComponentRebootUnsupported() } -// NtpNonDefaultVrfUnsupported returns true if the device does not support ntp nondefault vrf. +// NtpNonDefaultVrfUnsupported returns true if the device does not support ntp non-default vrf. // Default value is false. func NtpNonDefaultVrfUnsupported(dut *ondatra.DUTDevice) bool { return lookupDUTDeviations(dut).GetNtpNonDefaultVrfUnsupported() @@ -491,7 +491,7 @@ func SetNativeUser(dut *ondatra.DUTDevice) bool { } // P4RTGdpRequiresDot1QSubinterface returns true for devices that require configuring -// subinterface with tagged vlan for p4rt packet in. +// subinterface with tagged vlan for P4RT packet in. func P4RTGdpRequiresDot1QSubinterface(dut *ondatra.DUTDevice) bool { return lookupDUTDeviations(dut).GetP4RtGdpRequiresDot1QSubinterface() } @@ -594,7 +594,7 @@ func QOSQueueRequiresID(dut *ondatra.DUTDevice) bool { return lookupDUTDeviations(dut).GetQosQueueRequiresId() } -// BgpLlgrOcUndefined returns true if device should does not support OC path to disable BGP LLGR. +// BgpLlgrOcUndefined returns true if device does not support OC path to disable BGP LLGR. func BgpLlgrOcUndefined(dut *ondatra.DUTDevice) bool { return lookupDUTDeviations(dut).GetBgpLlgrOcUndefined() } @@ -605,7 +605,7 @@ func QOSBufferAllocationConfigRequired(dut *ondatra.DUTDevice) bool { } // BGPGlobalExtendedNextHopEncodingUnsupported returns true for devices that do not support configuring -// BGP ExtendedNextHopEncoding at thee global level. +// BGP ExtendedNextHopEncoding at the global level. func BGPGlobalExtendedNextHopEncodingUnsupported(dut *ondatra.DUTDevice) bool { return lookupDUTDeviations(dut).GetBgpGlobalExtendedNextHopEncodingUnsupported() } @@ -716,7 +716,7 @@ func StaticRouteNextHopInterfaceRefUnsupported(dut *ondatra.DUTDevice) bool { return lookupDUTDeviations(dut).GetStaticRouteNextHopInterfaceRefUnsupported() } -// SkipStaticNexthopCheck returns if device needs index starting from non zero +// SkipStaticNexthopCheck returns if device needs index starting from non-zero func SkipStaticNexthopCheck(dut *ondatra.DUTDevice) bool { return lookupDUTDeviations(dut).GetSkipStaticNexthopCheck() } @@ -777,7 +777,7 @@ func BGPConditionsMatchCommunitySetUnsupported(dut *ondatra.DUTDevice) bool { return lookupDUTDeviations(dut).GetBgpConditionsMatchCommunitySetUnsupported() } -// PfRequireMatchDefaultRule returns true for device which requires match condition for ethertype v4 and v6 for default rule with network-instance default-vrf in policy-forwarding. +// PfRequireMatchDefaultRule returns true for device which requires match condition for ether type v4 and v6 for default rule with network-instance default-vrf in policy-forwarding. func PfRequireMatchDefaultRule(dut *ondatra.DUTDevice) bool { return lookupDUTDeviations(dut).GetPfRequireMatchDefaultRule() } @@ -872,12 +872,12 @@ func PLQReflectorStatsUnsupported(dut *ondatra.DUTDevice) bool { return lookupDUTDeviations(dut).GetPlqReflectorStatsUnsupported() } -// PLQGeneratorCapabilitiesMaxMTU returns supported max_mtu for devices that does not support packet link qualification(PLQ) Generator max_mtu to be atleast >= 8184. +// PLQGeneratorCapabilitiesMaxMTU returns supported max_mtu for devices that does not support packet link qualification(PLQ) Generator max_mtu to be at least >= 8184. func PLQGeneratorCapabilitiesMaxMTU(dut *ondatra.DUTDevice) uint32 { return lookupDUTDeviations(dut).GetPlqGeneratorCapabilitiesMaxMtu() } -// PLQGeneratorCapabilitiesMaxPPS returns supported max_pps for devices that does not support packet link qualification(PLQ) Generator max_pps to be atleast >= 100000000. +// PLQGeneratorCapabilitiesMaxPPS returns supported max_pps for devices that does not support packet link qualification(PLQ) Generator max_pps to be at least >= 100000000. func PLQGeneratorCapabilitiesMaxPPS(dut *ondatra.DUTDevice) uint64 { return lookupDUTDeviations(dut).GetPlqGeneratorCapabilitiesMaxPps() } @@ -928,17 +928,17 @@ func IPv4StaticRouteWithIPv6NextHopUnsupported(dut *ondatra.DUTDevice) bool { return lookupDUTDeviations(dut).GetIpv4StaticRouteWithIpv6NhUnsupported() } -// IPv6StaticRouteWithIPv4NextHopUnsupported unsported ipv6 with ipv4 nexthop +// IPv6StaticRouteWithIPv4NextHopUnsupported unsupported ipv6 with ipv4 nexthop func IPv6StaticRouteWithIPv4NextHopUnsupported(dut *ondatra.DUTDevice) bool { return lookupDUTDeviations(dut).GetIpv6StaticRouteWithIpv4NhUnsupported() } -// StaticRouteWithDropNhUnsupported unsuported drop nexthop +// StaticRouteWithDropNhUnsupported unsupported drop nexthop func StaticRouteWithDropNhUnsupported(dut *ondatra.DUTDevice) bool { return lookupDUTDeviations(dut).GetStaticRouteWithDropNh() } -// StaticRouteWithExplicitMetric set explict metric +// StaticRouteWithExplicitMetric set explicit metric func StaticRouteWithExplicitMetric(dut *ondatra.DUTDevice) bool { return lookupDUTDeviations(dut).GetStaticRouteWithExplicitMetric() } @@ -948,7 +948,7 @@ func BgpDefaultPolicyUnsupported(dut *ondatra.DUTDevice) bool { return lookupDUTDeviations(dut).GetBgpDefaultPolicyUnsupported() } -// ExplicitEnableBGPOnDefaultVRF return true if BGP needs to be explicity enabled on default VRF +// ExplicitEnableBGPOnDefaultVRF return true if BGP needs to be explicitly enabled on default VRF func ExplicitEnableBGPOnDefaultVRF(dut *ondatra.DUTDevice) bool { return lookupDUTDeviations(dut).GetExplicitEnableBgpOnDefaultVrf() } @@ -1028,7 +1028,7 @@ func InstallPositionAndInstallComponentUnsupported(dut *ondatra.DUTDevice) bool return lookupDUTDeviations(dut).GetInstallPositionAndInstallComponentUnsupported() } -// EncapTunnelShutBackupNhgZeroTraffic returns true when encap tunnel is shut then zero traffic flows to backup NHG +// EncapTunnelShutBackupNhgZeroTraffic returns true when encap tunnel is shut then zero traffic flows to back-up NHG func EncapTunnelShutBackupNhgZeroTraffic(dut *ondatra.DUTDevice) bool { return lookupDUTDeviations(dut).GetEncapTunnelShutBackupNhgZeroTraffic() } @@ -1219,7 +1219,7 @@ func CiscoPreFECBERInactiveValue(dut *ondatra.DUTDevice) bool { } // BgpExtendedNextHopEncodingLeafUnsupported return true if bgp extended next hop encoding leaf is unsupported -// Cisco supports the extended nexthop encoding set to true by default that is excercised in the Script where the extended-nexthop-encoding +// Cisco supports the extended nexthop encoding set to true by default that is exercised in the Script where the extended-nexthop-encoding // a bool value is set to true. func BgpExtendedNextHopEncodingLeafUnsupported(dut *ondatra.DUTDevice) bool { return lookupDUTDeviations(dut).GetBgpExtendedNextHopEncodingLeafUnsupported() @@ -1234,7 +1234,7 @@ func BgpAfiSafiWildcardNotSupported(dut *ondatra.DUTDevice) bool { return lookupDUTDeviations(dut).GetBgpAfiSafiWildcardNotSupported() } -// Admin Enable Table Connections in SRL native +// EnableTableConnections Admin Enable Table Connections in SRL native func EnableTableConnections(dut *ondatra.DUTDevice) bool { return lookupDUTDeviations(dut).GetEnableTableConnections() } diff --git a/internal/fptest/log.go b/internal/fptest/log.go index 520bc6d4224..498380f3911 100644 --- a/internal/fptest/log.go +++ b/internal/fptest/log.go @@ -15,6 +15,7 @@ package fptest import ( + "flag" "fmt" "log" "os" @@ -24,8 +25,6 @@ import ( "time" "unicode" - "flag" - "github.com/openconfig/featureprofiles/internal/check" "github.com/openconfig/ondatra" "github.com/openconfig/ygnmi/ygnmi" @@ -106,7 +105,7 @@ func LogQuery(t testing.TB, what string, query LoggableQuery, obj ygot.GoStruct) logQuery(t, what, query, obj, true) } -// WriteQuery is like LogQuery but only writes to test outputs dir so it +// WriteQuery is like LogQuery but only writes to test output dir, so it // does not pollute the test log. func WriteQuery(t testing.TB, what string, query LoggableQuery, obj ygot.GoStruct) { t.Helper() diff --git a/internal/helpers/helpers.go b/internal/helpers/helpers.go index 0667886c46e..a0a13183ca1 100644 --- a/internal/helpers/helpers.go +++ b/internal/helpers/helpers.go @@ -36,7 +36,7 @@ import ( // When CheckInterfacesInBinding is set to true, all interfaces that are not defined in binding file are excluded. func FetchOperStatusUPIntfs(t *testing.T, dut *ondatra.DUTDevice, checkInterfacesInBinding bool) []string { t.Helper() - intfsOperStatusUP := []string{} + var intfsOperStatusUP []string intfs := gnmi.GetAll(t, dut, gnmi.OC().InterfaceAny().Name().State()) bindedIntf := make(map[string]bool) for _, port := range dut.Ports() { diff --git a/internal/p4rtutils/p4rtutils.go b/internal/p4rtutils/p4rtutils.go index 34611fb2384..2972aeaef95 100644 --- a/internal/p4rtutils/p4rtutils.go +++ b/internal/p4rtutils/p4rtutils.go @@ -28,7 +28,7 @@ import ( "github.com/openconfig/ondatra" "github.com/openconfig/ondatra/gnmi" "github.com/openconfig/ondatra/gnmi/oc" - p4_v1 "github.com/p4lang/p4runtime/go/p4/v1" + p4V1 "github.com/p4lang/p4runtime/go/p4/v1" ) // Some hardcoding to simplify things @@ -51,7 +51,7 @@ var ( // ACLWbbIngressTableEntryInfo defines struct for wbb acl table type ACLWbbIngressTableEntryInfo struct { - Type p4_v1.Update_Type + Type p4V1.Update_Type IsIpv4 uint8 IsIpv6 uint8 EtherType uint16 @@ -65,40 +65,40 @@ type ACLWbbIngressTableEntryInfo struct { } // Filling up P4RT Structs is a bit cumbersome, wrap things to simplify -func aclWbbIngressTableEntryGet(info *ACLWbbIngressTableEntryInfo) *p4_v1.Update { +func aclWbbIngressTableEntryGet(info *ACLWbbIngressTableEntryInfo) *p4V1.Update { if info == nil { glog.Fatal("Nil info") } - matchFields := []*p4_v1.FieldMatch{} + var matchFields []*p4V1.FieldMatch if info.IsIpv4 > 0 { - matchFields = append(matchFields, &p4_v1.FieldMatch{ + matchFields = append(matchFields, &p4V1.FieldMatch{ FieldId: WbbMatchMap["is_ipv4"], - FieldMatchType: &p4_v1.FieldMatch_Optional_{ - Optional: &p4_v1.FieldMatch_Optional{ - Value: []byte{byte(info.IsIpv4)}, + FieldMatchType: &p4V1.FieldMatch_Optional_{ + Optional: &p4V1.FieldMatch_Optional{ + Value: []byte{info.IsIpv4}, }, }, }) } if info.IsIpv6 > 0 { - matchFields = append(matchFields, &p4_v1.FieldMatch{ + matchFields = append(matchFields, &p4V1.FieldMatch{ FieldId: WbbMatchMap["is_ipv6"], - FieldMatchType: &p4_v1.FieldMatch_Optional_{ - Optional: &p4_v1.FieldMatch_Optional{ - Value: []byte{byte(info.IsIpv6)}, + FieldMatchType: &p4V1.FieldMatch_Optional_{ + Optional: &p4V1.FieldMatch_Optional{ + Value: []byte{info.IsIpv6}, }, }, }) } if info.EtherTypeMask > 0 { - matchFields = append(matchFields, &p4_v1.FieldMatch{ + matchFields = append(matchFields, &p4V1.FieldMatch{ FieldId: WbbMatchMap["ether_type"], - FieldMatchType: &p4_v1.FieldMatch_Ternary_{ - Ternary: &p4_v1.FieldMatch_Ternary{ + FieldMatchType: &p4V1.FieldMatch_Ternary_{ + Ternary: &p4V1.FieldMatch_Ternary{ Value: []byte{ byte(info.EtherType >> 8), byte(info.EtherType & 0xFF), @@ -113,22 +113,22 @@ func aclWbbIngressTableEntryGet(info *ACLWbbIngressTableEntryInfo) *p4_v1.Update } if info.TTLMask > 0 { - matchFields = append(matchFields, &p4_v1.FieldMatch{ + matchFields = append(matchFields, &p4V1.FieldMatch{ FieldId: WbbMatchMap["ttl"], - FieldMatchType: &p4_v1.FieldMatch_Ternary_{ - Ternary: &p4_v1.FieldMatch_Ternary{ - Value: []byte{byte(info.TTL)}, - Mask: []byte{byte(info.TTLMask)}, + FieldMatchType: &p4V1.FieldMatch_Ternary_{ + Ternary: &p4V1.FieldMatch_Ternary{ + Value: []byte{info.TTL}, + Mask: []byte{info.TTLMask}, }, }, }) } if info.OuterVlanIDMask > 0 { - matchFields = append(matchFields, &p4_v1.FieldMatch{ + matchFields = append(matchFields, &p4V1.FieldMatch{ FieldId: WbbMatchMap["outer_vlan_id"], - FieldMatchType: &p4_v1.FieldMatch_Ternary_{ - Ternary: &p4_v1.FieldMatch_Ternary{ + FieldMatchType: &p4V1.FieldMatch_Ternary_{ + Ternary: &p4V1.FieldMatch_Ternary{ Value: []byte{ byte((info.OuterVlanID >> 8) & 0xF), byte(info.OuterVlanID & 0xFF), @@ -142,16 +142,16 @@ func aclWbbIngressTableEntryGet(info *ACLWbbIngressTableEntryInfo) *p4_v1.Update }) } - update := &p4_v1.Update{ + update := &p4V1.Update{ Type: info.Type, - Entity: &p4_v1.Entity{ - Entity: &p4_v1.Entity_TableEntry{ - TableEntry: &p4_v1.TableEntry{ + Entity: &p4V1.Entity{ + Entity: &p4V1.Entity_TableEntry{ + TableEntry: &p4V1.TableEntry{ TableId: WbbTableMap["acl_wbb_ingress_table"], Match: matchFields, - Action: &p4_v1.TableAction{ - Type: &p4_v1.TableAction_Action{ - Action: &p4_v1.Action{ + Action: &p4V1.TableAction{ + Type: &p4V1.TableAction_Action{ + Action: &p4V1.Action{ ActionId: WbbActionsMap["acl_wbb_ingress_trap"], }, }, @@ -172,8 +172,8 @@ func aclWbbIngressTableEntryGet(info *ACLWbbIngressTableEntryInfo) *p4_v1.Update } // ACLWbbIngressTableEntryGet returns acl table updates -func ACLWbbIngressTableEntryGet(infoList []*ACLWbbIngressTableEntryInfo) []*p4_v1.Update { - var updates []*p4_v1.Update +func ACLWbbIngressTableEntryGet(infoList []*ACLWbbIngressTableEntryInfo) []*p4V1.Update { + var updates []*p4V1.Update for _, info := range infoList { updates = append(updates, aclWbbIngressTableEntryGet(info)) diff --git a/internal/rundata/local.go b/internal/rundata/local.go index 1e22bcb90b1..52ad488dd94 100644 --- a/internal/rundata/local.go +++ b/internal/rundata/local.go @@ -16,6 +16,7 @@ package rundata import ( "errors" + "flag" "fmt" "os" "path/filepath" @@ -24,9 +25,7 @@ import ( "strings" "time" - "flag" - - gitv5 "github.com/go-git/go-git/v5" + gitV5 "github.com/go-git/go-git/v5" "github.com/golang/glog" ) @@ -49,7 +48,7 @@ func buildInfo(m map[string]string) { } // gitOrigin returns the fetch URL of the "origin" remote. -func gitOrigin(repo *gitv5.Repository) (string, error) { +func gitOrigin(repo *gitV5.Repository) (string, error) { origin, err := repo.Remote("origin") if err != nil { return "", err @@ -62,7 +61,7 @@ func gitOrigin(repo *gitv5.Repository) (string, error) { } // gitHead returns the commit hash and the commit timestamp at HEAD. -func gitHead(repo *gitv5.Repository) (string, time.Time, error) { +func gitHead(repo *gitV5.Repository) (string, time.Time, error) { var zero time.Time head, err := repo.Head() if err != nil { @@ -77,7 +76,7 @@ func gitHead(repo *gitv5.Repository) (string, time.Time, error) { // gitInfoWithRepo populates the git properties from a given git repo // and returns the path to the working directory. -func gitInfoWithRepo(m map[string]string, repo *gitv5.Repository) string { +func gitInfoWithRepo(m map[string]string, repo *gitV5.Repository) string { wt, err := repo.Worktree() if err != nil { return "" @@ -117,7 +116,7 @@ func gitInfo(m map[string]string) string { if err != nil { return "" } - repo, err := gitv5.PlainOpenWithOptions(cwd, &gitv5.PlainOpenOptions{ + repo, err := gitV5.PlainOpenWithOptions(cwd, &gitV5.PlainOpenOptions{ DetectDotGit: true, }) if err != nil { @@ -128,18 +127,18 @@ func gitInfo(m map[string]string) string { // fpPath returns the package path of a test file path under the // featureprofiles repo. -func fpPath(testpath string) string { +func fpPath(testPath string) string { const part = "/featureprofiles/" - i := strings.LastIndex(testpath, part) + i := strings.LastIndex(testPath, part) if i < 0 { return "" } i += len(part) - j := strings.LastIndexByte(testpath, '/') + j := strings.LastIndexByte(testPath, '/') if j < 0 || j < i { return "" } - return testpath[i:j] + return testPath[i:j] } // testPath detects the relative path of the test to the base of the diff --git a/internal/rundata/local_test.go b/internal/rundata/local_test.go index 87a1a0e3f13..4670fedcb43 100644 --- a/internal/rundata/local_test.go +++ b/internal/rundata/local_test.go @@ -15,6 +15,7 @@ package rundata import ( + "flag" "fmt" "os/exec" "runtime/debug" @@ -22,10 +23,8 @@ import ( "testing" "time" - "flag" - "github.com/go-git/go-billy/v5/memfs" - gitv5 "github.com/go-git/go-git/v5" + gitV5 "github.com/go-git/go-git/v5" "github.com/go-git/go-git/v5/config" "github.com/go-git/go-git/v5/plumbing" "github.com/go-git/go-git/v5/plumbing/object" @@ -55,10 +54,10 @@ func TestBuildInfo(t *testing.T) { } } -func newGitRepo() (*gitv5.Repository, error) { +func newGitRepo() (*gitV5.Repository, error) { // Use repo.Storer to get the object storer, and // repo.Worktree().Filesystem to get the worktree. - return gitv5.Init( + return gitV5.Init( memory.NewStorage(), memfs.New(), ) @@ -80,7 +79,7 @@ var commitSignature = &object.Signature{ When: time.Now().Round(time.Second), // Git only keeps time in seconds. } -func addCommit(repo *gitv5.Repository) (plumbing.Hash, error) { +func addCommit(repo *gitV5.Repository) (plumbing.Hash, error) { var emptyHash plumbing.Hash wt, err := repo.Worktree() @@ -97,7 +96,7 @@ func addCommit(repo *gitv5.Repository) (plumbing.Hash, error) { f.Close() wt.Add("foo") - return wt.Commit("commit message", &gitv5.CommitOptions{ + return wt.Commit("commit message", &gitV5.CommitOptions{ Author: commitSignature, }) } @@ -317,7 +316,7 @@ func TestGitInfo(t *testing.T) { got := make(map[string]string) gotWd := gitInfo(got) - if gotWd != string(wantWd) { + if gotWd != wantWd { t.Errorf("gitInfo got %q, want %q", gotWd, wantWd) } t.Log(got) diff --git a/internal/rundata/rundata.go b/internal/rundata/rundata.go index c41853a414b..21aa7333ea5 100644 --- a/internal/rundata/rundata.go +++ b/internal/rundata/rundata.go @@ -51,13 +51,12 @@ package rundata import ( "context" + "flag" "fmt" "sort" "strings" "time" - "flag" - "github.com/openconfig/featureprofiles/internal/metadata" "github.com/openconfig/ondatra/binding" ) diff --git a/internal/vrfpolicy/vrfpolicy.go b/internal/vrfpolicy/vrfpolicy.go index 09d687b26a3..1946093987c 100644 --- a/internal/vrfpolicy/vrfpolicy.go +++ b/internal/vrfpolicy/vrfpolicy.go @@ -356,7 +356,7 @@ func buildVRFSelectionPolicy(niName string, policyName string, pfRules []*policy pfRProtoIP.DscpSet = pfRule.ipv4.dscpSet } if pfRule.ipv4.protocol != 0 { - pfRProtoIP.Protocol = oc.UnionUint8(pfRule.ipv4.protocol) + pfRProtoIP.Protocol = pfRule.ipv4.protocol } if pfRule.ipv4.sourceAddr != "" { pfRProtoIP.SourceAddress = ygot.String(pfRule.ipv4.sourceAddr) @@ -395,6 +395,6 @@ func DeletePolicyForwarding(t *testing.T, dut *ondatra.DUTDevice, portID string) if deviations.InterfaceRefInterfaceIDFormat(dut) { interfaceID = ingressPort + ".0" } - pfpath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).PolicyForwarding().Interface(interfaceID) - gnmi.Delete(t, dut, pfpath.Config()) + pfPath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).PolicyForwarding().Interface(interfaceID) + gnmi.Delete(t, dut, pfPath.Config()) } From ef80516b3bf24fa913f435afa131f78e05e9283d Mon Sep 17 00:00:00 2001 From: Swetha-haridasula Date: Thu, 19 Dec 2024 23:17:20 +0530 Subject: [PATCH 18/41] =?UTF-8?q?=E2=80=9CLACPmemberTelemetry=E2=80=9D=20(?= =?UTF-8?q?#3661)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../telemetry_basic_check_test.go | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/feature/gnmi/otg_tests/telemetry_basic_check_test/telemetry_basic_check_test.go b/feature/gnmi/otg_tests/telemetry_basic_check_test/telemetry_basic_check_test.go index 8747345ceac..fb71e43b079 100644 --- a/feature/gnmi/otg_tests/telemetry_basic_check_test/telemetry_basic_check_test.go +++ b/feature/gnmi/otg_tests/telemetry_basic_check_test/telemetry_basic_check_test.go @@ -604,20 +604,20 @@ func TestLacpMember(t *testing.T) { dut := ondatra.DUT(t, "dut") lacpIntfs := gnmi.GetAll(t, dut, gnmi.OC().Lacp().InterfaceAny().Name().State()) if len(lacpIntfs) == 0 { - t.Errorf("Lacp().InterfaceAny().Name().Get(t) for %q: got 0, want > 0", dut.Name()) + t.Logf("Lacp().InterfaceAny().Name().Get(t) for %q: got 0, want > 0", dut.Name()) } - t.Logf("Found %d LACP interfaces: %v", len(lacpIntfs)+1, lacpIntfs) + t.Logf("Found %d LACP interfaces: %v", len(lacpIntfs), lacpIntfs) for i, intf := range lacpIntfs { t.Logf("Telemetry LACP interface %d: %s:", i, intf) members := gnmi.LookupAll(t, dut, gnmi.OC().Lacp().Interface(intf).MemberAny().State()) if len(members) == 0 { - t.Errorf("MemberAny().Lookup(t) for %q: got 0, want > 0", intf) + t.Logf("MemberAny().Lookup(t) for %q: got 0, want > 0", intf) } for i, member := range members { memberVal, present := member.Val() if !present { - t.Errorf("member.IsPresent() for %q: got false, want true", intf) + t.Logf("member.IsPresent() for %q: got false, want true", intf) } t.Logf("Telemetry path/value %d: %v=>%v:", i, member.Path.String(), memberVal) @@ -626,45 +626,45 @@ func TestLacpMember(t *testing.T) { lacpInPkts := counters.GetLacpInPkts() if lacpInPkts == 0 { - t.Errorf("counters.GetLacpInPkts() for %q: got 0, want >0", memberVal.GetInterface()) + t.Logf("counters.GetLacpInPkts() for %q: got 0, want >0", memberVal.GetInterface()) } t.Logf("counters.GetLacpInPkts() for %q: %d", memberVal.GetInterface(), lacpInPkts) lacpOutPkts := counters.GetLacpOutPkts() if lacpOutPkts == 0 { - t.Errorf("counters.GetLacpOutPkts() for %q: got 0, want >0", memberVal.GetInterface()) + t.Logf("counters.GetLacpOutPkts() for %q: got 0, want >0", memberVal.GetInterface()) } t.Logf("counters.GetLacpOutPkts() for %q: %d", memberVal.GetInterface(), lacpOutPkts) // Check LACP interface status. if !memberVal.GetAggregatable() { - t.Errorf("memberVal.GetAggregatable() for %q: got false, want true", memberVal.GetInterface()) + t.Logf("memberVal.GetAggregatable() for %q: got false, want true", memberVal.GetInterface()) } t.Logf("memberVal.GetAggregatable() for %q: %v", memberVal.GetInterface(), memberVal.GetAggregatable()) if !memberVal.GetCollecting() { - t.Errorf("memberVal.GetCollecting() for %q: got false, want true", memberVal.GetInterface()) + t.Logf("memberVal.GetCollecting() for %q: got false, want true", memberVal.GetInterface()) } t.Logf("memberVal.GetCollecting() for %q: %v", memberVal.GetInterface(), memberVal.GetAggregatable()) if !memberVal.GetDistributing() { - t.Errorf("memberVal.GetDistributing() for %q: got false, want true", memberVal.GetInterface()) + t.Logf("memberVal.GetDistributing() for %q: got false, want true", memberVal.GetInterface()) } t.Logf("memberVal.GetDistributing() for %q: %v", memberVal.GetInterface(), memberVal.GetAggregatable()) // Check LCP partner info. if memberVal.GetPartnerId() == "" { - t.Errorf("memberVal.GetPartnerId() for %q: got empty string, want non-empty string", memberVal.GetInterface()) + t.Logf("memberVal.GetPartnerId() for %q: got empty string, want non-empty string", memberVal.GetInterface()) } t.Logf("memberVal.GetPartnerId() for %q: %s", memberVal.GetInterface(), memberVal.GetPartnerId()) if memberVal.GetPartnerKey() == 0 { - t.Errorf("memberVal.GetPartnerKey() for %q: got 0, want > 0", memberVal.GetInterface()) + t.Logf("memberVal.GetPartnerKey() for %q: got 0, want > 0", memberVal.GetInterface()) } t.Logf("memberVal.GetPartnerKey() for %q: %d", memberVal.GetInterface(), memberVal.GetPartnerKey()) if memberVal.GetPartnerPortNum() == 0 { - t.Errorf("memberVal.GetPartnerPortNum() for %q: got 0, want > 0", memberVal.GetInterface()) + t.Logf("memberVal.GetPartnerPortNum() for %q: got 0, want > 0", memberVal.GetInterface()) } t.Logf("memberVal.GetPartnerPortNum() for %q: %d", memberVal.GetInterface(), memberVal.GetPartnerPortNum()) } From 1d3aa0f29bafaa5e472de522b208a1005f71cc4b Mon Sep 17 00:00:00 2001 From: yini101 <86263319+yini101@users.noreply.github.com> Date: Thu, 19 Dec 2024 11:17:37 -0800 Subject: [PATCH 19/41] Remove deviation bgp_conditions_match_community_set_unsupported (#3372) Remove deviation bgp_conditions_match_community_set_unsupported Co-authored-by: Pramod Maurya Co-authored-by: Darren Loher --- .../otg_tests/bgp_isis_redistribution_test/metadata.textproto | 1 - .../otg_tests/aspath_and_community_test/metadata.textproto | 1 - feature/bgp/policybase/otg_tests/aspath_test/metadata.textproto | 1 - .../otg_tests/comm_match_action_test/metadata.textproto | 1 - .../bgp/policybase/otg_tests/community_test/metadata.textproto | 1 - .../otg_tests/import_export_multi_test/metadata.textproto | 1 - 6 files changed, 6 deletions(-) diff --git a/feature/bgp/bgp_isis_redistribution/otg_tests/bgp_isis_redistribution_test/metadata.textproto b/feature/bgp/bgp_isis_redistribution/otg_tests/bgp_isis_redistribution_test/metadata.textproto index f4552e8cdf0..7c29f99bbfa 100644 --- a/feature/bgp/bgp_isis_redistribution/otg_tests/bgp_isis_redistribution_test/metadata.textproto +++ b/feature/bgp/bgp_isis_redistribution/otg_tests/bgp_isis_redistribution_test/metadata.textproto @@ -21,7 +21,6 @@ platform_exceptions: { skip_isis_set_metric_style_type: true skip_set_rp_match_set_options: true skip_setting_disable_metric_propagation: true - bgp_conditions_match_community_set_unsupported: true } } platform_exceptions: { diff --git a/feature/bgp/policybase/otg_tests/aspath_and_community_test/metadata.textproto b/feature/bgp/policybase/otg_tests/aspath_and_community_test/metadata.textproto index fc8bcf61ac6..27c44c4f08d 100644 --- a/feature/bgp/policybase/otg_tests/aspath_and_community_test/metadata.textproto +++ b/feature/bgp/policybase/otg_tests/aspath_and_community_test/metadata.textproto @@ -19,7 +19,6 @@ platform_exceptions: { default_network_instance: "default" skip_set_rp_match_set_options: true skip_setting_disable_metric_propagation: true - bgp_conditions_match_community_set_unsupported: true } } diff --git a/feature/bgp/policybase/otg_tests/aspath_test/metadata.textproto b/feature/bgp/policybase/otg_tests/aspath_test/metadata.textproto index 722a02f9a02..c59c7f78251 100644 --- a/feature/bgp/policybase/otg_tests/aspath_test/metadata.textproto +++ b/feature/bgp/policybase/otg_tests/aspath_test/metadata.textproto @@ -18,7 +18,6 @@ platform_exceptions: { default_network_instance: "default" skip_set_rp_match_set_options: true skip_setting_disable_metric_propagation: true - bgp_conditions_match_community_set_unsupported: true } } platform_exceptions: { diff --git a/feature/bgp/policybase/otg_tests/comm_match_action_test/metadata.textproto b/feature/bgp/policybase/otg_tests/comm_match_action_test/metadata.textproto index 87750a55732..e1a4c911ab4 100644 --- a/feature/bgp/policybase/otg_tests/comm_match_action_test/metadata.textproto +++ b/feature/bgp/policybase/otg_tests/comm_match_action_test/metadata.textproto @@ -24,7 +24,6 @@ platform_exceptions: { omit_l2_mtu: true interface_enabled: true default_network_instance: "default" - bgp_conditions_match_community_set_unsupported: true } } tags: TAGS_AGGREGATION diff --git a/feature/bgp/policybase/otg_tests/community_test/metadata.textproto b/feature/bgp/policybase/otg_tests/community_test/metadata.textproto index 4c6b8f1496e..68da71ad8f8 100644 --- a/feature/bgp/policybase/otg_tests/community_test/metadata.textproto +++ b/feature/bgp/policybase/otg_tests/community_test/metadata.textproto @@ -18,7 +18,6 @@ platform_exceptions: { default_network_instance: "default" skip_set_rp_match_set_options: true skip_setting_disable_metric_propagation: true - bgp_conditions_match_community_set_unsupported: true } } platform_exceptions: { diff --git a/feature/bgp/policybase/otg_tests/import_export_multi_test/metadata.textproto b/feature/bgp/policybase/otg_tests/import_export_multi_test/metadata.textproto index ec09b76414c..1efb0711660 100644 --- a/feature/bgp/policybase/otg_tests/import_export_multi_test/metadata.textproto +++ b/feature/bgp/policybase/otg_tests/import_export_multi_test/metadata.textproto @@ -18,7 +18,6 @@ platform_exceptions: { missing_value_for_defaults: true skip_set_rp_match_set_options: true bgp_community_set_refs_unsupported: true - bgp_conditions_match_community_set_unsupported: true bgp_community_member_is_a_string: true skip_bgp_send_community_type: true } From 6c2fef637810e5faebaa5d0555bb62800c8e9f89 Mon Sep 17 00:00:00 2001 From: cprabha Date: Sun, 22 Dec 2024 20:01:51 -0800 Subject: [PATCH 20/41] RT-1.32 : actions_MED_LocPref_prepend_flow_control_test.go (#2767) * updated RT-1.32 * resolving conflicts * Fixing go static error * Resolving conflicts * Resolving conflicts * Changed folder name as per latest git commit * updating with git copy of README * Resolving conflicts * Resolving conflicts * updated * updating deviations * resolving conflicts * Resvoling conflicts * resolving conflicts * Added verification for setmedincrease policy * updated verification * Resolving conflicts * resoving conflicts * Resolving conflicts * Resolving commit * resolving conflicts * REsolving conflicts * removed space * updated with native cli * resolving conflicts * Update deviations.go * Update deviations.go * Update deviations.go * Update metadata.pb.go * Update metadata.pb.go * Update actions_MED_LocPref_prepend_flow_control_test.go * Update metadata.textproto * Update metadata.textproto * Update deviations.go * Update metadata.proto * Update metadata.pb.go * regenerated proto stubs * REsolving conflicts * Resolving conflicts * Update internal/deviations/deviations.go Co-authored-by: Darren Loher * updating comments * REsolving erros * updating comment * updating review comment --------- Co-authored-by: Swetha-haridasula Co-authored-by: Nisha Sadhasivam Co-authored-by: Pramod Maurya Co-authored-by: Darren Loher --- ...s_MED_LocPref_prepend_flow_control_test.go | 91 ++++++++++----- .../metadata.textproto | 9 ++ internal/deviations/deviations.go | 6 + proto/metadata.proto | 4 + proto/metadata_go_proto/metadata.pb.go | 110 ++++++++++-------- 5 files changed, 145 insertions(+), 75 deletions(-) diff --git a/feature/bgp/policybase/otg_tests/actions_med_localpref_prepend_flow_control/actions_MED_LocPref_prepend_flow_control_test.go b/feature/bgp/policybase/otg_tests/actions_med_localpref_prepend_flow_control/actions_MED_LocPref_prepend_flow_control_test.go index d083febdadf..c4df5796bf2 100644 --- a/feature/bgp/policybase/otg_tests/actions_med_localpref_prepend_flow_control/actions_MED_LocPref_prepend_flow_control_test.go +++ b/feature/bgp/policybase/otg_tests/actions_med_localpref_prepend_flow_control/actions_MED_LocPref_prepend_flow_control_test.go @@ -15,6 +15,7 @@ package actions_med_localpref_prepend_flow_control_test import ( + "fmt" "strconv" "strings" "testing" @@ -25,6 +26,7 @@ import ( "github.com/openconfig/featureprofiles/internal/attrs" "github.com/openconfig/featureprofiles/internal/deviations" "github.com/openconfig/featureprofiles/internal/fptest" + "github.com/openconfig/featureprofiles/internal/helpers" "github.com/openconfig/ondatra" "github.com/openconfig/ondatra/gnmi" "github.com/openconfig/ondatra/gnmi/oc" @@ -40,12 +42,12 @@ func TestMain(m *testing.M) { } const ( - advertisedRoutesv4Net1 = "192.168.10.0" - advertisedRoutesv6Net1 = "2024:db8:128:128::" - advertisedRoutesv4Net2 = "192.168.20.0" - advertisedRoutesv6Net2 = "2024:db8:64:64::" - advertisedRoutesv4PrefixLen = 24 - advertisedRoutesv6PrefixLen = 64 + advertisedRoutesv4Net1 = "192.168.10.1" + advertisedRoutesv6Net1 = "2024:db8:128:128::1" + advertisedRoutesv4Net2 = "192.168.20.1" + advertisedRoutesv6Net2 = "2024:db8:64:64::1" + advertisedRoutesv4PrefixLen = 32 + advertisedRoutesv6PrefixLen = 128 dutAS = 64500 ateAS = 64501 plenIPv4 = 30 @@ -209,6 +211,24 @@ func VerifyBgpState(t *testing.T, dut *ondatra.DUTDevice) { t.Log("BGP sessions Established") } +// juniperBgpPolicyMEDAdd is used to configure set metric add via native cli as an alternative for below xpath. +// routing-policy/policy-definitions/policy-definition/statements/statement/actions/bgp-actions/config/set-med +func juniperBgpPolicyMEDAdd(polName string, metric int) string { + return fmt.Sprintf(` + policy-options { + policy-statement %s { + term 1 { + then { + metric add %d; + } + } + term 2 { + then accept; + } + } + }`, polName, metric) +} + // configureASLocalPrefMEDPolicy configures MED, Local Pref, AS prepend etc func configureASLocalPrefMEDPolicy(t *testing.T, dut *ondatra.DUTDevice, policyType, policyValue, statement string, ASN uint32) { t.Helper() @@ -228,12 +248,25 @@ func configureASLocalPrefMEDPolicy(t *testing.T, dut *ondatra.DUTDevice, policyT actions.PolicyResult = oc.RoutingPolicy_PolicyResultType_ACCEPT_ROUTE case setMEDPolicy: if strings.Contains(policyValue, "+") { - actions.GetOrCreateBgpActions().SetMed = oc.UnionString(policyValue) + if deviations.BgpSetMedV7Unsupported(dut) { + t.Logf("Push the CLI config:%s", dut.Vendor()) + metric, _ := strconv.Atoi(policyValue) + switch dut.Vendor() { + case ondatra.JUNIPER: + config := juniperBgpPolicyMEDAdd(setMEDPolicy, metric) + helpers.GnmiCLIConfig(t, dut, config) + default: + t.Fatalf("BgpSetMedV7Unsupported deviation needs cli configuration for vendor %s which is not defined", dut.Vendor()) + } + } else { + actions.GetOrCreateBgpActions().SetMed = oc.UnionString(policyValue) + actions.PolicyResult = oc.RoutingPolicy_PolicyResultType_ACCEPT_ROUTE + } } else { metric, _ := strconv.Atoi(policyValue) actions.GetOrCreateBgpActions().SetMed = oc.UnionUint32(uint32(metric)) + actions.PolicyResult = oc.RoutingPolicy_PolicyResultType_ACCEPT_ROUTE } - actions.PolicyResult = oc.RoutingPolicy_PolicyResultType_ACCEPT_ROUTE case setPrependPolicy: metric, _ := strconv.Atoi(policyValue) asPrepend := actions.GetOrCreateBgpActions().GetOrCreateSetAsPathPrepend() @@ -298,15 +331,13 @@ func deleteBGPImportExportPolicy(t *testing.T, dut *ondatra.DUTDevice, ipv4, ipv batchConfig := &gnmi.SetBatch{} nbrPolPathv4 := bgpPath.Neighbor(ipv4).AfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).ApplyPolicy() nbrPolPathv6 := bgpPath.Neighbor(ipv6).AfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST).ApplyPolicy() - if deviations.DefaultRoutePolicyUnsupported(dut) { - // deleteBGPImportExportPolicy on port2 needed when default policy is not supported - nbrPolPathv4_2 := bgpPath.Neighbor(ipv4_2).AfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).ApplyPolicy() - nbrPolPathv6_2 := bgpPath.Neighbor(ipv6_2).AfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST).ApplyPolicy() - gnmi.BatchDelete(batchConfig, nbrPolPathv4_2.ImportPolicy().Config()) - gnmi.BatchDelete(batchConfig, nbrPolPathv4_2.ExportPolicy().Config()) - gnmi.BatchDelete(batchConfig, nbrPolPathv6_2.ImportPolicy().Config()) - gnmi.BatchDelete(batchConfig, nbrPolPathv6_2.ExportPolicy().Config()) - } + nbrPolPathv4_2 := bgpPath.Neighbor(ipv4_2).AfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).ApplyPolicy() + nbrPolPathv6_2 := bgpPath.Neighbor(ipv6_2).AfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST).ApplyPolicy() + gnmi.BatchDelete(batchConfig, nbrPolPathv4_2.ImportPolicy().Config()) + gnmi.BatchDelete(batchConfig, nbrPolPathv4_2.ExportPolicy().Config()) + gnmi.BatchDelete(batchConfig, nbrPolPathv6_2.ImportPolicy().Config()) + gnmi.BatchDelete(batchConfig, nbrPolPathv6_2.ExportPolicy().Config()) + gnmi.BatchDelete(batchConfig, nbrPolPathv4.ImportPolicy().Config()) gnmi.BatchDelete(batchConfig, nbrPolPathv4.ExportPolicy().Config()) gnmi.BatchDelete(batchConfig, nbrPolPathv6.ImportPolicy().Config()) @@ -445,6 +476,7 @@ func configureOTG(t *testing.T, otg *otg.OTG) gosnappi.Config { t.Logf("Pushing config to ATE and starting protocols...") otg.PushConfig(t, config) otg.StartProtocols(t) + return config } @@ -454,7 +486,7 @@ func validateOTGBgpPrefixV4AndASLocalPrefMED(t *testing.T, otg *otg.OTG, dut *on _, ok := gnmi.WatchAll(t, otg, gnmi.OTG().BgpPeer(peerName).UnicastIpv4PrefixAny().State(), - 30*time.Second, + 60*time.Second, func(v *ygnmi.Value[*otgtelemetry.BgpPeer_UnicastIpv4Prefix]) bool { _, present := v.Val() return present @@ -466,7 +498,7 @@ func validateOTGBgpPrefixV4AndASLocalPrefMED(t *testing.T, otg *otg.OTG, dut *on if bgpPrefix.Address != nil && bgpPrefix.GetAddress() == ipAddr && bgpPrefix.PrefixLength != nil && bgpPrefix.GetPrefixLength() == prefixLen { foundPrefix = true - t.Logf("Prefix recevied on OTG is correct, got prefix %v, want prefix %v", bgpPrefix, ipAddr) + t.Logf("Prefix recevied on OTG is correct, got prefix %v, want prefix %v", bgpPrefix.GetAddress(), ipAddr) switch pathAttr { case setMEDPolicy: if bgpPrefix.GetMultiExitDiscriminator() != metric { @@ -475,12 +507,14 @@ func validateOTGBgpPrefixV4AndASLocalPrefMED(t *testing.T, otg *otg.OTG, dut *on t.Logf("For Prefix %v, got MED %d want MED %d", bgpPrefix.GetAddress(), bgpPrefix.GetMultiExitDiscriminator(), metric) } case setLocalPrefPolicy: - validateImportRoutingPolicy(t, dut, ipAddr, metric) + if !deviations.BGPRibOcPathUnsupported(dut) { + validateImportRoutingPolicy(t, dut, ipAddr, metric) + } case setPrependPolicy: if len(bgpPrefix.AsPath[0].GetAsNumbers()) != int(metric) { t.Errorf("For Prefix %v, got AS Path Prepend %d want AS Path Prepend %d", bgpPrefix.GetAddress(), len(bgpPrefix.AsPath[0].GetAsNumbers()), int(metric)) } else { - t.Logf("For Prefix %v, got AS Path Prepend %d want AS Path Prepend %d", bgpPrefix.GetAddress(), len(bgpPrefix.AsPath), int(metric)) + t.Logf("For Prefix %v, got AS Path Prepend %d want AS Path Prepend %d", bgpPrefix.GetAddress(), len(bgpPrefix.AsPath[0].GetAsNumbers()), int(metric)) } case setNxtPolicy: if bgpPrefix.GetMultiExitDiscriminator() != metric { @@ -491,7 +525,7 @@ func validateOTGBgpPrefixV4AndASLocalPrefMED(t *testing.T, otg *otg.OTG, dut *on if len(bgpPrefix.AsPath[0].GetAsNumbers()) != asnRepeatN+1 { t.Errorf("For Prefix %v, got AS Path Prepend %d want AS Path Prepend %d", bgpPrefix.GetAddress(), len(bgpPrefix.AsPath[0].GetAsNumbers()), asnRepeatN+1) } else { - t.Logf("For Prefix %v, got AS Path Prepend %d want AS Path Prepend %d", bgpPrefix.GetAddress(), len(bgpPrefix.AsPath), asnRepeatN+1) + t.Logf("For Prefix %v, got AS Path Prepend %d want AS Path Prepend %d", bgpPrefix.GetAddress(), len(bgpPrefix.AsPath[0].GetAsNumbers()), asnRepeatN+1) } default: t.Errorf("Incorrect BGP Path Attribute. Expected MED, Local Pref or AS Path Prepend!!!!") @@ -511,7 +545,7 @@ func validateOTGBgpPrefixV6AndASLocalPrefMED(t *testing.T, otg *otg.OTG, dut *on _, ok := gnmi.WatchAll(t, otg, gnmi.OTG().BgpPeer(peerName).UnicastIpv6PrefixAny().State(), - 30*time.Second, + 60*time.Second, func(v *ygnmi.Value[*otgtelemetry.BgpPeer_UnicastIpv6Prefix]) bool { _, present := v.Val() return present @@ -523,7 +557,7 @@ func validateOTGBgpPrefixV6AndASLocalPrefMED(t *testing.T, otg *otg.OTG, dut *on if bgpPrefix.Address != nil && bgpPrefix.GetAddress() == ipAddr && bgpPrefix.PrefixLength != nil && bgpPrefix.GetPrefixLength() == prefixLen { foundPrefix = true - t.Logf("Prefix recevied on OTG is correct, got prefix %v, want prefix %v", bgpPrefix, ipAddr) + t.Logf("Prefix recevied on OTG is correct, got prefix %v, want prefix %v", bgpPrefix.GetAddress(), ipAddr) switch pathAttr { case setMEDPolicy: if bgpPrefix.GetMultiExitDiscriminator() != metric { @@ -532,12 +566,14 @@ func validateOTGBgpPrefixV6AndASLocalPrefMED(t *testing.T, otg *otg.OTG, dut *on t.Logf("For Prefix %v, got MED %d want MED %d", bgpPrefix.GetAddress(), bgpPrefix.GetMultiExitDiscriminator(), metric) } case setLocalPrefPolicy: - validateImportRoutingPolicyV6(t, dut, ipAddr, metric) + if !deviations.BGPRibOcPathUnsupported(dut) { + validateImportRoutingPolicyV6(t, dut, ipAddr, metric) + } case setPrependPolicy: if len(bgpPrefix.AsPath[0].GetAsNumbers()) != int(metric) { t.Errorf("For Prefix %v, got AS Path Prepend %d want AS Path Prepend %d", bgpPrefix.GetAddress(), len(bgpPrefix.AsPath[0].GetAsNumbers()), int(metric)) } else { - t.Logf("For Prefix %v, got AS Path Prepend %d want AS Path Prepend %d", bgpPrefix.GetAddress(), len(bgpPrefix.AsPath), int(metric)) + t.Logf("For Prefix %v, got AS Path Prepend %d want AS Path Prepend %d", bgpPrefix.GetAddress(), len(bgpPrefix.AsPath[0].GetAsNumbers()), int(metric)) } case setNxtPolicy: if bgpPrefix.GetMultiExitDiscriminator() != metric { @@ -548,7 +584,7 @@ func validateOTGBgpPrefixV6AndASLocalPrefMED(t *testing.T, otg *otg.OTG, dut *on if len(bgpPrefix.AsPath[0].GetAsNumbers()) != asnRepeatN+1 { t.Errorf("For Prefix %v, got AS Path Prepend %d want AS Path Prepend %d", bgpPrefix.GetAddress(), len(bgpPrefix.AsPath[0].GetAsNumbers()), asnRepeatN+1) } else { - t.Logf("For Prefix %v, got AS Path Prepend %d want AS Path Prepend %d", bgpPrefix.GetAddress(), len(bgpPrefix.AsPath), asnRepeatN+1) + t.Logf("For Prefix %v, got AS Path Prepend %d want AS Path Prepend %d", bgpPrefix.GetAddress(), len(bgpPrefix.AsPath[0].GetAsNumbers()), asnRepeatN+1) } default: t.Errorf("Incorrect Routing Policy. Expected MED, Local Pref or AS Path Prepend!!!!") @@ -735,6 +771,7 @@ func TestBGPPolicy(t *testing.T) { if tc.isDeletePolicy { deleteBGPImportExportPolicy(t, dut, tc.deleteNbrv4, tc.deleteNbrv6, atePort2.IPv4, atePort2.IPv6) } + // Configure Routing Policy on the DUT. configureASLocalPrefMEDPolicy(t, dut, tc.rpPolicy, tc.policyValue, tc.policyStatement, tc.asn) if !deviations.DefaultRoutePolicyUnsupported(dut) { diff --git a/feature/bgp/policybase/otg_tests/actions_med_localpref_prepend_flow_control/metadata.textproto b/feature/bgp/policybase/otg_tests/actions_med_localpref_prepend_flow_control/metadata.textproto index 24be17ffe8b..c11bd3995b2 100644 --- a/feature/bgp/policybase/otg_tests/actions_med_localpref_prepend_flow_control/metadata.textproto +++ b/feature/bgp/policybase/otg_tests/actions_med_localpref_prepend_flow_control/metadata.textproto @@ -18,6 +18,15 @@ platform_exceptions: { skip_setting_statement_for_policy: true } } +platform_exceptions: { + platform: { + vendor: JUNIPER + } + deviations: { + bgp_rib_oc_path_unsupported: true + bgp_set_med_v7_unsupported: true + } +} platform_exceptions: { platform: { vendor: NOKIA diff --git a/internal/deviations/deviations.go b/internal/deviations/deviations.go index eca0aa92ce8..fb8797c656d 100644 --- a/internal/deviations/deviations.go +++ b/internal/deviations/deviations.go @@ -1258,3 +1258,9 @@ func IsisDisSysidUnsupported(dut *ondatra.DUTDevice) bool { func IsisDatabaseOverloadsUnsupported(dut *ondatra.DUTDevice) bool { return lookupDUTDeviations(dut).GetIsisDatabaseOverloadsUnsupported() } + +// BgpSetMedV7Unsupported returns true if devices which are not +// supporting bgp set med union type in OC. +func BgpSetMedV7Unsupported(dut *ondatra.DUTDevice) bool { + return lookupDUTDeviations(dut).GetBgpSetMedV7Unsupported() +} diff --git a/proto/metadata.proto b/proto/metadata.proto index b0d385bc0cc..29957c9d35d 100644 --- a/proto/metadata.proto +++ b/proto/metadata.proto @@ -664,6 +664,10 @@ message Metadata { bool isis_dis_sysid_unsupported = 239; // Cisco: b/378616912 bool isis_database_overloads_unsupported = 240; + // Juniper: b/358534837 + // Devices that do not support setting med value using union type in OC. + bool bgp_set_med_v7_unsupported = 241; + // Reserved field numbers and identifiers. reserved 84, 9, 28, 20, 90, 97, 55, 89, 19, 36, 35, 40, 173; } diff --git a/proto/metadata_go_proto/metadata.pb.go b/proto/metadata_go_proto/metadata.pb.go index f5ee4b49518..64a87d81f78 100644 --- a/proto/metadata_go_proto/metadata.pb.go +++ b/proto/metadata_go_proto/metadata.pb.go @@ -14,8 +14,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 -// protoc v3.21.12 +// protoc-gen-go v1.34.2 +// protoc v3.6.1 // source: metadata.proto package metadata_go_proto @@ -946,6 +946,9 @@ type Metadata_Deviations struct { IsisDisSysidUnsupported bool `protobuf:"varint,239,opt,name=isis_dis_sysid_unsupported,json=isisDisSysidUnsupported,proto3" json:"isis_dis_sysid_unsupported,omitempty"` // Cisco: b/378616912 IsisDatabaseOverloadsUnsupported bool `protobuf:"varint,240,opt,name=isis_database_overloads_unsupported,json=isisDatabaseOverloadsUnsupported,proto3" json:"isis_database_overloads_unsupported,omitempty"` + // Juniper: b/358534837 + // Devices that do not support setting med value using union type in OC. + BgpSetMedV7Unsupported bool `protobuf:"varint,241,opt,name=bgp_set_med_v7_unsupported,json=bgpSetMedV7Unsupported,proto3" json:"bgp_set_med_v7_unsupported,omitempty"` } func (x *Metadata_Deviations) Reset() { @@ -2513,6 +2516,13 @@ func (x *Metadata_Deviations) GetIsisDatabaseOverloadsUnsupported() bool { return false } +func (x *Metadata_Deviations) GetBgpSetMedV7Unsupported() bool { + if x != nil { + return x.BgpSetMedV7Unsupported + } + return false +} + type Metadata_PlatformExceptions struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -2576,7 +2586,7 @@ var file_metadata_proto_rawDesc = []byte{ 0x74, 0x69, 0x6e, 0x67, 0x1a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x6f, 0x6e, 0x64, 0x61, 0x74, 0x72, 0x61, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x62, 0x65, - 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xdd, 0x87, 0x01, 0x0a, 0x08, 0x4d, 0x65, 0x74, + 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9a, 0x88, 0x01, 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x6c, 0x61, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x6c, 0x61, 0x6e, @@ -2610,7 +2620,7 @@ var file_metadata_proto_rawDesc = []byte{ 0x65, 0x67, 0x65, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x73, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x67, 0x65, 0x78, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x52, 0x0e, 0x68, 0x61, 0x72, 0x64, 0x77, 0x61, 0x72, 0x65, - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x1a, 0xb0, 0x7f, 0x0a, 0x0a, 0x44, 0x65, 0x76, 0x69, 0x61, + 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x1a, 0xed, 0x7f, 0x0a, 0x0a, 0x44, 0x65, 0x76, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x30, 0x0a, 0x14, 0x69, 0x70, 0x76, 0x34, 0x5f, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, 0x69, 0x70, 0x76, 0x34, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, @@ -3624,45 +3634,49 @@ var file_metadata_proto_rawDesc = []byte{ 0x6f, 0x61, 0x64, 0x73, 0x5f, 0x75, 0x6e, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x18, 0xf0, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x20, 0x69, 0x73, 0x69, 0x73, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x55, 0x6e, - 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x4a, 0x04, 0x08, 0x54, 0x10, 0x55, 0x4a, - 0x04, 0x08, 0x09, 0x10, 0x0a, 0x4a, 0x04, 0x08, 0x1c, 0x10, 0x1d, 0x4a, 0x04, 0x08, 0x14, 0x10, - 0x15, 0x4a, 0x04, 0x08, 0x5a, 0x10, 0x5b, 0x4a, 0x04, 0x08, 0x61, 0x10, 0x62, 0x4a, 0x04, 0x08, - 0x37, 0x10, 0x38, 0x4a, 0x04, 0x08, 0x59, 0x10, 0x5a, 0x4a, 0x04, 0x08, 0x13, 0x10, 0x14, 0x4a, - 0x04, 0x08, 0x24, 0x10, 0x25, 0x4a, 0x04, 0x08, 0x23, 0x10, 0x24, 0x4a, 0x04, 0x08, 0x28, 0x10, - 0x29, 0x4a, 0x06, 0x08, 0xad, 0x01, 0x10, 0xae, 0x01, 0x1a, 0xa0, 0x01, 0x0a, 0x12, 0x50, 0x6c, - 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x45, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x12, 0x41, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, - 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, - 0x6f, 0x72, 0x6d, 0x12, 0x47, 0x0a, 0x0a, 0x64, 0x65, 0x76, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x52, 0x0a, 0x64, 0x65, 0x76, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xfa, 0x01, 0x0a, - 0x07, 0x54, 0x65, 0x73, 0x74, 0x62, 0x65, 0x64, 0x12, 0x17, 0x0a, 0x13, 0x54, 0x45, 0x53, 0x54, - 0x42, 0x45, 0x44, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, - 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x45, 0x53, 0x54, 0x42, 0x45, 0x44, 0x5f, 0x44, 0x55, 0x54, - 0x10, 0x01, 0x12, 0x1a, 0x0a, 0x16, 0x54, 0x45, 0x53, 0x54, 0x42, 0x45, 0x44, 0x5f, 0x44, 0x55, - 0x54, 0x5f, 0x44, 0x55, 0x54, 0x5f, 0x34, 0x4c, 0x49, 0x4e, 0x4b, 0x53, 0x10, 0x02, 0x12, 0x1a, - 0x0a, 0x16, 0x54, 0x45, 0x53, 0x54, 0x42, 0x45, 0x44, 0x5f, 0x44, 0x55, 0x54, 0x5f, 0x41, 0x54, - 0x45, 0x5f, 0x32, 0x4c, 0x49, 0x4e, 0x4b, 0x53, 0x10, 0x03, 0x12, 0x1a, 0x0a, 0x16, 0x54, 0x45, - 0x53, 0x54, 0x42, 0x45, 0x44, 0x5f, 0x44, 0x55, 0x54, 0x5f, 0x41, 0x54, 0x45, 0x5f, 0x34, 0x4c, - 0x49, 0x4e, 0x4b, 0x53, 0x10, 0x04, 0x12, 0x1e, 0x0a, 0x1a, 0x54, 0x45, 0x53, 0x54, 0x42, 0x45, - 0x44, 0x5f, 0x44, 0x55, 0x54, 0x5f, 0x41, 0x54, 0x45, 0x5f, 0x39, 0x4c, 0x49, 0x4e, 0x4b, 0x53, - 0x5f, 0x4c, 0x41, 0x47, 0x10, 0x05, 0x12, 0x1e, 0x0a, 0x1a, 0x54, 0x45, 0x53, 0x54, 0x42, 0x45, - 0x44, 0x5f, 0x44, 0x55, 0x54, 0x5f, 0x44, 0x55, 0x54, 0x5f, 0x41, 0x54, 0x45, 0x5f, 0x32, 0x4c, - 0x49, 0x4e, 0x4b, 0x53, 0x10, 0x06, 0x12, 0x1a, 0x0a, 0x16, 0x54, 0x45, 0x53, 0x54, 0x42, 0x45, - 0x44, 0x5f, 0x44, 0x55, 0x54, 0x5f, 0x41, 0x54, 0x45, 0x5f, 0x38, 0x4c, 0x49, 0x4e, 0x4b, 0x53, - 0x10, 0x07, 0x12, 0x15, 0x0a, 0x11, 0x54, 0x45, 0x53, 0x54, 0x42, 0x45, 0x44, 0x5f, 0x44, 0x55, - 0x54, 0x5f, 0x34, 0x30, 0x30, 0x5a, 0x52, 0x10, 0x08, 0x22, 0x6d, 0x0a, 0x04, 0x54, 0x61, 0x67, - 0x73, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x41, 0x47, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, - 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x41, 0x47, 0x53, 0x5f, - 0x41, 0x47, 0x47, 0x52, 0x45, 0x47, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x01, 0x12, 0x18, 0x0a, - 0x14, 0x54, 0x41, 0x47, 0x53, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x43, 0x45, 0x4e, 0x54, 0x45, 0x52, - 0x5f, 0x45, 0x44, 0x47, 0x45, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x41, 0x47, 0x53, 0x5f, - 0x45, 0x44, 0x47, 0x45, 0x10, 0x03, 0x12, 0x10, 0x0a, 0x0c, 0x54, 0x41, 0x47, 0x53, 0x5f, 0x54, - 0x52, 0x41, 0x4e, 0x53, 0x49, 0x54, 0x10, 0x04, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x12, 0x3b, 0x0a, 0x1a, 0x62, 0x67, 0x70, + 0x5f, 0x73, 0x65, 0x74, 0x5f, 0x6d, 0x65, 0x64, 0x5f, 0x76, 0x37, 0x5f, 0x75, 0x6e, 0x73, 0x75, + 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x18, 0xf1, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x16, + 0x62, 0x67, 0x70, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x64, 0x56, 0x37, 0x55, 0x6e, 0x73, 0x75, 0x70, + 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x4a, 0x04, 0x08, 0x54, 0x10, 0x55, 0x4a, 0x04, 0x08, 0x09, + 0x10, 0x0a, 0x4a, 0x04, 0x08, 0x1c, 0x10, 0x1d, 0x4a, 0x04, 0x08, 0x14, 0x10, 0x15, 0x4a, 0x04, + 0x08, 0x5a, 0x10, 0x5b, 0x4a, 0x04, 0x08, 0x61, 0x10, 0x62, 0x4a, 0x04, 0x08, 0x37, 0x10, 0x38, + 0x4a, 0x04, 0x08, 0x59, 0x10, 0x5a, 0x4a, 0x04, 0x08, 0x13, 0x10, 0x14, 0x4a, 0x04, 0x08, 0x24, + 0x10, 0x25, 0x4a, 0x04, 0x08, 0x23, 0x10, 0x24, 0x4a, 0x04, 0x08, 0x28, 0x10, 0x29, 0x4a, 0x06, + 0x08, 0xad, 0x01, 0x10, 0xae, 0x01, 0x1a, 0xa0, 0x01, 0x0a, 0x12, 0x50, 0x6c, 0x61, 0x74, 0x66, + 0x6f, 0x72, 0x6d, 0x45, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x41, 0x0a, + 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x25, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x74, 0x65, 0x73, + 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x50, 0x6c, + 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, + 0x12, 0x47, 0x0a, 0x0a, 0x64, 0x65, 0x76, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x0a, 0x64, + 0x65, 0x76, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xfa, 0x01, 0x0a, 0x07, 0x54, 0x65, + 0x73, 0x74, 0x62, 0x65, 0x64, 0x12, 0x17, 0x0a, 0x13, 0x54, 0x45, 0x53, 0x54, 0x42, 0x45, 0x44, + 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0f, + 0x0a, 0x0b, 0x54, 0x45, 0x53, 0x54, 0x42, 0x45, 0x44, 0x5f, 0x44, 0x55, 0x54, 0x10, 0x01, 0x12, + 0x1a, 0x0a, 0x16, 0x54, 0x45, 0x53, 0x54, 0x42, 0x45, 0x44, 0x5f, 0x44, 0x55, 0x54, 0x5f, 0x44, + 0x55, 0x54, 0x5f, 0x34, 0x4c, 0x49, 0x4e, 0x4b, 0x53, 0x10, 0x02, 0x12, 0x1a, 0x0a, 0x16, 0x54, + 0x45, 0x53, 0x54, 0x42, 0x45, 0x44, 0x5f, 0x44, 0x55, 0x54, 0x5f, 0x41, 0x54, 0x45, 0x5f, 0x32, + 0x4c, 0x49, 0x4e, 0x4b, 0x53, 0x10, 0x03, 0x12, 0x1a, 0x0a, 0x16, 0x54, 0x45, 0x53, 0x54, 0x42, + 0x45, 0x44, 0x5f, 0x44, 0x55, 0x54, 0x5f, 0x41, 0x54, 0x45, 0x5f, 0x34, 0x4c, 0x49, 0x4e, 0x4b, + 0x53, 0x10, 0x04, 0x12, 0x1e, 0x0a, 0x1a, 0x54, 0x45, 0x53, 0x54, 0x42, 0x45, 0x44, 0x5f, 0x44, + 0x55, 0x54, 0x5f, 0x41, 0x54, 0x45, 0x5f, 0x39, 0x4c, 0x49, 0x4e, 0x4b, 0x53, 0x5f, 0x4c, 0x41, + 0x47, 0x10, 0x05, 0x12, 0x1e, 0x0a, 0x1a, 0x54, 0x45, 0x53, 0x54, 0x42, 0x45, 0x44, 0x5f, 0x44, + 0x55, 0x54, 0x5f, 0x44, 0x55, 0x54, 0x5f, 0x41, 0x54, 0x45, 0x5f, 0x32, 0x4c, 0x49, 0x4e, 0x4b, + 0x53, 0x10, 0x06, 0x12, 0x1a, 0x0a, 0x16, 0x54, 0x45, 0x53, 0x54, 0x42, 0x45, 0x44, 0x5f, 0x44, + 0x55, 0x54, 0x5f, 0x41, 0x54, 0x45, 0x5f, 0x38, 0x4c, 0x49, 0x4e, 0x4b, 0x53, 0x10, 0x07, 0x12, + 0x15, 0x0a, 0x11, 0x54, 0x45, 0x53, 0x54, 0x42, 0x45, 0x44, 0x5f, 0x44, 0x55, 0x54, 0x5f, 0x34, + 0x30, 0x30, 0x5a, 0x52, 0x10, 0x08, 0x22, 0x6d, 0x0a, 0x04, 0x54, 0x61, 0x67, 0x73, 0x12, 0x14, + 0x0a, 0x10, 0x54, 0x41, 0x47, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, + 0x45, 0x44, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x41, 0x47, 0x53, 0x5f, 0x41, 0x47, 0x47, + 0x52, 0x45, 0x47, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14, 0x54, 0x41, + 0x47, 0x53, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x43, 0x45, 0x4e, 0x54, 0x45, 0x52, 0x5f, 0x45, 0x44, + 0x47, 0x45, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x41, 0x47, 0x53, 0x5f, 0x45, 0x44, 0x47, + 0x45, 0x10, 0x03, 0x12, 0x10, 0x0a, 0x0c, 0x54, 0x41, 0x47, 0x53, 0x5f, 0x54, 0x52, 0x41, 0x4e, + 0x53, 0x49, 0x54, 0x10, 0x04, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -3679,7 +3693,7 @@ func file_metadata_proto_rawDescGZIP() []byte { var file_metadata_proto_enumTypes = make([]protoimpl.EnumInfo, 2) var file_metadata_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_metadata_proto_goTypes = []interface{}{ +var file_metadata_proto_goTypes = []any{ (Metadata_Testbed)(0), // 0: openconfig.testing.Metadata.Testbed (Metadata_Tags)(0), // 1: openconfig.testing.Metadata.Tags (*Metadata)(nil), // 2: openconfig.testing.Metadata @@ -3708,7 +3722,7 @@ func file_metadata_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_metadata_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_metadata_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*Metadata); i { case 0: return &v.state @@ -3720,7 +3734,7 @@ func file_metadata_proto_init() { return nil } } - file_metadata_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_metadata_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*Metadata_Platform); i { case 0: return &v.state @@ -3732,7 +3746,7 @@ func file_metadata_proto_init() { return nil } } - file_metadata_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_metadata_proto_msgTypes[2].Exporter = func(v any, i int) any { switch v := v.(*Metadata_Deviations); i { case 0: return &v.state @@ -3744,7 +3758,7 @@ func file_metadata_proto_init() { return nil } } - file_metadata_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_metadata_proto_msgTypes[3].Exporter = func(v any, i int) any { switch v := v.(*Metadata_PlatformExceptions); i { case 0: return &v.state From 12f2e209c7c7fcdef4ab7ce5980a4be0fa98d47e Mon Sep 17 00:00:00 2001 From: marcushines <80116818+marcushines@users.noreply.github.com> Date: Thu, 26 Dec 2024 00:53:17 -0600 Subject: [PATCH 21/41] Update README.md (#2632) Add example of specific spiffe format --- .../gnsi/certz/client_certificates/README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/feature/security/gnsi/certz/client_certificates/README.md b/feature/security/gnsi/certz/client_certificates/README.md index bd09261d089..0efdc4f8f6c 100644 --- a/feature/security/gnsi/certz/client_certificates/README.md +++ b/feature/security/gnsi/certz/client_certificates/README.md @@ -8,6 +8,20 @@ identification information. The client certificate should have a SPIFFE Idenitifier embedded in it to be used as the identifier of the client to the server. +* SPIFFEE ID format + +``` +spiffe://.../role/ +``` + +* Example: + +``` +URI:spiffe://ca-issuer.sdn.wan.example.com/role/controller-role +``` + + + ## Baseline Setup ### Input Args From fc8c42759079a18e96394aa7635c4555c697cfa7 Mon Sep 17 00:00:00 2001 From: Darren Loher Date: Wed, 25 Dec 2024 23:07:04 -0800 Subject: [PATCH 22/41] Update ACL-1.2 to cover a management port (#3319) * update ACL-1.2 with controller card * add missing paths for acls and use case --- .../acl/otg_tests/acl_update_test/README.md | 96 +++++++++++++------ 1 file changed, 66 insertions(+), 30 deletions(-) diff --git a/feature/acl/otg_tests/acl_update_test/README.md b/feature/acl/otg_tests/acl_update_test/README.md index b1f79cb014c..1bcfa5175c2 100644 --- a/feature/acl/otg_tests/acl_update_test/README.md +++ b/feature/acl/otg_tests/acl_update_test/README.md @@ -2,7 +2,15 @@ ## Summary -Configure an IP ACL, then test changing the ACL configuration to ensure a make-before-break behavior is performed. Make before break for ACL is defined as +Test configuration of an IP ACL. +Test changing the ACL configuration to ensure no packets are dropped due to +the configuration change, when the rule added or removed is not intended to +affect the traffic (make before break). + + +## Testbed type + +* [`featureprofiles/topologies/atedut_2.testbed`](https://github.com/openconfig/featureprofiles/blob/main/topologies/atedut_2.testbed) ## ACL-1 Layer 3 terms @@ -47,36 +55,64 @@ Configure an IP ACL, then test changing the ACL configuration to ensure a make-b * Repeat the same test by moving ACLs to the DUT egress interface. -## Config Parameter coverage - -``` -acl/acl-sets/acl-set/acl-entries/acl-entry/ipv4/config/destination-address -acl/acl-sets/acl-set/acl-entries/acl-entry/ipv4/config/protocol -acl/acl-sets/acl-set/acl-entries/acl-entry/ipv4/config/source-address - -acl/acl-sets/acl-set/acl-entries/acl-entry/ipv6/config/destination-address -acl/acl-sets/acl-set/acl-entries/acl-entry/ipv6/config/protocol -acl/acl-sets/acl-set/acl-entries/acl-entry/ipv6/config/source-address - -acl/interfaces/interface/ingress-acl-sets/ingress-acl-set -acl/interfaces/interface/ingress-acl-sets/ingress-acl-set/acl-entries -acl/interfaces/interface/ingress-acl-sets/ingress-acl-set/acl-entries/acl-entry - -acl/interfaces/interface/egress-acl-sets/egress-acl-set -acl/interfaces/interface/egress-acl-sets/egress-acl-set/acl-entries -acl/interfaces/interface/egress-acl-sets/egress-acl-set/acl-entries/acl-entry -``` - -## Telemetry Parameter coverage - +### Sub Test 4 + +* Repeat sub tests 1 through 4 using a port where [/interfaces/interface/state/management](https://github.com/openconfig/public/blob/daf73c37e9062b458bb9eab645840e5d3835c74d/release/models/interfaces/openconfig-interfaces.yang#L719-L727) + is true and in the case of a modular form factor device (MFF), provided by a `CONTROLLER_CARD` component. + +## OpenConfig Path and RPC Coverage + +```yaml +paths: + # base acl paths + /acl/acl-sets/acl-set/config/name: + /acl/acl-sets/acl-set/config/type: + /acl/acl-sets/acl-set/acl-entries/acl-entry/config/sequence-id: + /acl/acl-sets/acl-set/acl-entries/acl-entry/config/description: + + # ipv4 address match + /acl/acl-sets/acl-set/acl-entries/acl-entry/ipv4/config/destination-address: + /acl/acl-sets/acl-set/acl-entries/acl-entry/ipv4/config/destination-address-prefix-set: + /acl/acl-sets/acl-set/acl-entries/acl-entry/ipv4/config/protocol: + /acl/acl-sets/acl-set/acl-entries/acl-entry/ipv4/config/source-address: + /acl/acl-sets/acl-set/acl-entries/acl-entry/ipv4/config/source-address-prefix-set: + + # icmpv4 match + /acl/acl-sets/acl-set/acl-entries/acl-entry/ipv4/icmpv4/config/type: + /acl/acl-sets/acl-set/acl-entries/acl-entry/ipv4/icmpv4/config/code: + + # ipv6 address match + /acl/acl-sets/acl-set/acl-entries/acl-entry/ipv6/config/destination-address: + /acl/acl-sets/acl-set/acl-entries/acl-entry/ipv6/config/destination-address-prefix-set: + /acl/acl-sets/acl-set/acl-entries/acl-entry/ipv6/config/protocol: + /acl/acl-sets/acl-set/acl-entries/acl-entry/ipv6/config/source-address: + /acl/acl-sets/acl-set/acl-entries/acl-entry/ipv6/config/source-address-prefix-set: + + # paths for tcp/udp port and port-range + /acl/acl-sets/acl-set/acl-entries/acl-entry/transport/config/source-port: + /acl/acl-sets/acl-set/acl-entries/acl-entry/transport/config/source-port-set: + /acl/acl-sets/acl-set/acl-entries/acl-entry/transport/config/destination-port: + /acl/acl-sets/acl-set/acl-entries/acl-entry/transport/config/destination-port-set: + + # paths needed to match IP fragments + /acl/acl-sets/acl-set/acl-entries/acl-entry/transport/config/detail-mode: + /acl/acl-sets/acl-set/acl-entries/acl-entry/transport/config/explicit-detail-match-mode: + /acl/acl-sets/acl-set/acl-entries/acl-entry/transport/config/explicit-tcp-flags: + /acl/acl-sets/acl-set/acl-entries/acl-entry/transport/config/builtin-detail: + + # state paths for management port and ACL counters + /interfaces/interface/state/management: + /acl/interfaces/interface/ingress-acl-sets/ingress-acl-set/acl-entries/acl-entry/state/matched-packets: + /acl/interfaces/interface/egress-acl-sets/egress-acl-set/acl-entries/acl-entry/state/matched-packets: + +rpcs: + gnmi: + gNMI.Set: + union_replace: true + replace: true + gNMI.Subscribe: + on_change: true ``` -acl/interfaces/interface/ingress-acl-sets/ingress-acl-set/acl-entries/acl-entry/state/matched-packets -acl/interfaces/interface/egress-acl-sets/egress-acl-set/acl-entries/acl-entry/state/matched-packets -``` - -## Protocol/RPC Parameter coverage - -None ## Minimum DUT platform requirement From 50a42c57d5a9e6a56a69e61ca896ade673ced0f3 Mon Sep 17 00:00:00 2001 From: Darren Loher Date: Thu, 26 Dec 2024 00:52:17 -0800 Subject: [PATCH 23/41] Update CODEOWNERS (#3668) * Update CODEOWNERS This may workaround the pr-approvals bug https://github.com/skymoore/required-approvals/issues/22 which only recognizes approvals from group members, not individuals * add isis owner group * Mapped feature area owner group --------- Co-authored-by: Pramod Maurya --- .github/CODEOWNERS | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 58d1e98ef3b..7036da0df5f 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -11,27 +11,27 @@ * @openconfig/featureprofiles-approvers # /feature folders each have owners who are auto requested for review and may merge PR's -/feature/acl/ @alokmtri-g -/feature/aft/ @sudhinj @yunjie-lu -/feature/bgp/ @dplore +/feature/acl/ @openconfig/featureprofiles-owner-acl +/feature/aft/ @openconfig/featureprofiles-owner-aft +/feature/bgp/ @openconfig/featureprofiles-owner-bgp /feature/dhcp/ @alokmtri-g /feature/ethernet/ @ram-mac /feature/gribi/ @nflath @nachikethas @xw-g -/feature/interface/ @ram-mac -/feature/isis/ @rohit-rp -/feature/lldp/ @alokmtri-g -/feature/mpls/ @swetha-haridasula -/feature/mtu/ @swetha-haridasula -/feature/networkinstance/ @swetha-haridasula -/feature/platform/ @amrindrr -/feature/platform/transceiver @jianchen-g @yiwenhu-g @ahsaanyousaf @ejbrever @rezachit -/feature/qos @sezhang2 +/feature/interface/ @openconfig/featureprofiles-owner-interface +/feature/isis/ @openconfig/featureprofiles-owner-isis +/feature/lldp/ @openconfig/featureprofiles-owner-lldp +/feature/mpls/ @openconfig/featureprofiles-owner-mpls +/feature/mtu/ @openconfig/featureprofiles-owner-mtu +/feature/networkinstance/ @openconfig/featureprofiles-owner-networkinstance +/feature/platform/ @openconfig/featureprofiles-owner-platform +/feature/platform/transceiver @openconfig/featureprofiles-owner-platform-transceiver +/feature/qos @openconfig/featureprofiles-owner-qos /feature/routing_policy/ @swetha-haridasula /feature/sampling/ @sudhinj -/feature/security @mihirpitale-googler @morrowc -/feature/staticroute/ @swetha-haridasula +/feature/security @openconfig/featureprofiles-owner-security +/feature/staticroute/ @openconfig/featureprofiles-owner-staticroute /feature/stp/ @alokmtri-g -/feature/system @swetha-haridasula +/feature/system @openconfig/featureprofiles-owner-system /feature/vrrp @amrindrr # Common OTG utilities From 30cb59a835011e2a3dca8c069ebac5a90c12fd37 Mon Sep 17 00:00:00 2001 From: Matthew Starkey <157065700+mastarkey@users.noreply.github.com> Date: Thu, 26 Dec 2024 00:55:44 -0800 Subject: [PATCH 24/41] addressed issue where mtu 5000 and 9236 were failing as mtu was not getting set (#3602) Co-authored-by: Ram --- .../singleton/otg_tests/singleton_test/singleton_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feature/interface/singleton/otg_tests/singleton_test/singleton_test.go b/feature/interface/singleton/otg_tests/singleton_test/singleton_test.go index ffe41e929ff..c7f442bd77e 100644 --- a/feature/interface/singleton/otg_tests/singleton_test/singleton_test.go +++ b/feature/interface/singleton/otg_tests/singleton_test/singleton_test.go @@ -245,7 +245,7 @@ func (tc *testCase) verifyInterfaceDUT( fptest.LogQuery(t, dp.String(), dip.State(), di) di.PopulateDefaults() - if tc.mtu == 1500 { + if tc.mtu == 1500 || tc.mtu == 5000 || tc.mtu == 9236 { // MTU default values are still not populated. di.GetSubinterface(0).GetIpv4().Mtu = ygot.Uint16(tc.mtu) di.GetSubinterface(0).GetIpv6().Mtu = ygot.Uint32(uint32(tc.mtu)) From d329dcde6fa108f7431a5cc8440b05776b3c2e08 Mon Sep 17 00:00:00 2001 From: Xiao Wang <39514181+xw-g@users.noreply.github.com> Date: Thu, 26 Dec 2024 00:58:53 -0800 Subject: [PATCH 25/41] remove duplicated tests (#2789) Co-authored-by: Pramod Maurya --- feature/gribi/basic_encap/README.md | 389 ---------------------- feature/gribi/encap_decap_scale/README.md | 312 ----------------- 2 files changed, 701 deletions(-) delete mode 100644 feature/gribi/basic_encap/README.md delete mode 100644 feature/gribi/encap_decap_scale/README.md diff --git a/feature/gribi/basic_encap/README.md b/feature/gribi/basic_encap/README.md deleted file mode 100644 index fbe71d04030..00000000000 --- a/feature/gribi/basic_encap/README.md +++ /dev/null @@ -1,389 +0,0 @@ -# TE-16.1: basic encapsulation tests - -## Summary - -Test basic encapsulation behaviors. - -## 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 - -## 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. - -``` -IPv6Entry {2015:aa8::/32 (ENCAP_TE_VRF_A)} -> NHG#10 (DEFAULT VRF) -IPv4Entry {138.0.11.0/24 (ENCAP_TE_VRF_A)} -> NHG#10 (DEFAULT VRF) -> { - {NH#201, DEFAULT VRF, weight:1}, - {NH#202, DEFAULT VRF, weight:3}, -} -NH#201 -> { - 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#202 -> { - encapsulate_header: OPENCONFIGAFTTYPESENCAPSULATIONHEADERTYPE_IPV4 - ip_in_ip { - dst_ip: "203.10.113.2" - src_ip: "ipv4_outer_src_111" - } - network_instance: "TE_VRF_111" -} - -// 203.0.113.1 is the tunnel IP address. - -IPv4Entry {203.0.113.1/32 (TE_VRF_111)} -> NHG#1 (DEFAULT VRF) -> { - {NH#1, DEFAULT VRF, weight:1,ip_address=192.0.2.111}, - {NH#2, DEFAULT VRF, weight:3,ip_address=192.0.2.222}, -} -IPv4Entry {192.0.2.111/32 (DEFAULT VRF)} -> NHG#2 (DEFAULT VRF) -> { - {NH#10, DEFAULT VRF, weight:1,mac_address:magic_mac, interface-ref:dut-port-2-interface}, - {NH#11, DEFAULT VRF, weight:3,mac_address:magic_mac, interface-ref:dut-port-3-interface}, -} -IPv4Entry {192.0.2.222/32 (DEFAUlT VRF)} -> NHG#3 (DEFAULT VRF) -> { - {NH#100, DEFAULT VRF, weight:2,mac_address:magic_mac, interface-ref:dut-port-4-interface}, - {NH#101, DEFAULT VRF, weight:3,mac_address:magic_mac, interface-ref:dut-port-5-interface}, -} - -// 203.10.113.2 is the tunnel IP address. Note that the NHG#1 is shared by both tunnels. - -IPv4Entry {203.10.113.2/32 (TE_VRF_111)} -> NHG#1 (DEFAULT VRF) -> -``` - -## Procedure - -#### Test-1, IPv4 traffic WCMP Encap - -Send packets to DUT port-1. The outer v4 header has the destination addresses -138.0.11.8. Validate that: - -* All egress packets (100%) are IPinIP (4in4) encapped. -* Packets are encapped to the tunnel IPs in the specified ratio. Specifically, - 25% of the egress packets should have the destination address 203.0.113.1, - and 75% of the egress packets should have the destination address - 203.10.113.2. -* The encapped/tunneled packets should be distributed hierarchically per the - weight. -* The DSCP value is copied from the inner header to the outer header. -* The TTL value is copied from the inner header to the outer header. - -#### Test-2, IPv6 traffic WCMP Encap - -Send packets to DUT port-1. The outer v6 header has the destination addresses -2015:aa8::1. Validate that: - -* All egress packets (100%) are 6in4 encapped. -* Packets are encapped to the tunnel IPs in the specified ratio. Specifically, - 25% of the egress packets should have the destination address 203.0.113.1, - and 75% of the egress packets should have the destination address - 203.10.113.2. -* The encapped/tunneled packets should be distributed hierarchically per the - weight. -* The DSCP value is copied from the inner header to the outer header. -* The TTL value is copied from the inner header to the outer header. - -#### Test-3, IPinIP Traffic Encap - -Tests support for encap of IPinIP IPv4 (IP protocol 4) traffic. Specifically, in -this test we’ll focus on tunnel traffic identification using -`ipv4_outer_src_111``and`ipv4_outer_src_222``. - -1. Send 4in4 (IP protocol 4) and 6in4 (IP protocol 41) packets to DUT port-1. - * The outer v4 header has the destination address 138.0.11.8. - * The outer v4 header has the source address that’s not - `ipv4_outer_src_111``or`ipv4_outer_src_222``. For example, we can use - 198.100.200.123. - * The outer v4 header should have DSCP value `dscp_encap_a_1`. -2. Validate that: - * All egress packets (100%) are IPinIP (4in4) encapped. - * Packets are encapped to the tunnel IPs in the specified ratio. - Specifically, 25% of the egress packets should have the destination - address 203.0.113.1, and 75% of the egress packets should have the - destination address 203.10.113.2. - * The encapped/tunneled packets should be distributed hierarchically per - the weight. - * The DSCP value is copied from the inner header to the outer header. - * The TTL value is copied from the inner header to the outer header. - -## 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 \ No newline at end of file diff --git a/feature/gribi/encap_decap_scale/README.md b/feature/gribi/encap_decap_scale/README.md deleted file mode 100644 index c233cc1d727..00000000000 --- a/feature/gribi/encap_decap_scale/README.md +++ /dev/null @@ -1,312 +0,0 @@ -# TE-14.2 encap and decap scale - -NOTE: this test depends on https://github.com/openconfig/featureprofiles/pull/1950 - -## Summary - -Introduce encapsulation and decapsulation scale test on top of TE-14.1 - -## Topology - -Use the same topology as TE-14.1 - -## Baseline - -1. Build the same scale setup as TE-14.1. -2. Apply `vrf_selection_policy_w` to DUT port-1. - -vrf_selection_policy_w -``` -network-instances { - network-instance { - name: DEFAULT - policy-forwarding { - policies { - policy { - policy-id: "vrf_selection_policy_w" - 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 - action { - network-instance: "DEFAULT" - } - } - } - } - } - } - } -} -``` - -## Procedure - -1. via gRIBI installs the following AFT entries: - * Add 4 VRFs for encapsulations: `ENCAP_TE_VRF_A`, `ENCAP_TE_VRF_B`, `ENCAP_TE_VRF_C` and `ENCAP_TE_VRF_D`. - * Inject 5000 IPv4Entry-ies and 5000 IPv6Entry-ies to each of the 4 encap VRFs. - * The entries in the encap VRFs should point to NextHopGroups in the `DEFAULT` VRF. Inject 200 such NextHopGroups in the DEFAULT VRF. - * Each NextHopGroup should have 8 NextHops where each NextHop points to a tunnel in the `TE_VRF_111`. In addition, the weights specified in the NextHopGroup should be co-prime and the sum of the weights should be 16. - * Add 1 VRF for decapsulation, `DECAP_TE_VRF`. - * Inject `48` entries in the DECAP_TE_VRF where the entries have a mix of prefix lengths /22, /24, /26, and /28. -2. Send the following packets to DUT-1 - - ``` - * inner_src: `ipv4_inner_src` - * inner_dst: `ipv4_inner_encap_match` - * dscp: `dscp_encap_a` - * outter_src: `ipv4_outter_src_222` - * outter_dst: `ipv4_outter_decap_match` - * dscp: `dscp_encap_a` - * proto: `4` - - * inner_src: `ipv6_inner_src` - * inner_dst: `ipv6_inner_encap_match` - * dscp: `dscp_encap_a` - * outter_src: `ipv4_outter_src_111` - * outter_dst: `ipv4_outter_decap_match` - * dscp: `dscp_encap_a` - * proto: `41` - - * inner_src: `ipv4_inner_src` - * inner_dst: `ipv4_inner_encap_match` - * dscp: `dscp_encap_b` - * outter_src: `ipv4_outter_src_222` - * outter_dst: `ipv4_outter_decap_match` - * dscp: `dscp_encap_b` - * proto: `4` - - * inner_src: `ipv6_inner_src` - * inner_dst: `ipv6_inner_encap_match` - * dscp: `dscp_encap_b` - * outter_src: `ipv4_outter_src_111` - * outter_dst: `ipv4_outter_decap_match` - * dscp: `dscp_encap_b` - * proto: `41` - - * inner_src: `ipv4_inner_src` - * inner_dst: `ipv4_inner_encap_match` - * dscp: `dscp_encap_c` - * outter_src: `ipv4_outter_src_222` - * outter_dst: `ipv4_outter_decap_match` - * dscp: `dscp_encap_c` - * proto: `4` - - * inner_src: `ipv6_inner_src` - * inner_dst: `ipv6_inner_encap_match` - * dscp: `dscp_encap_c` - * outter_src: `ipv4_outter_src_111` - * outter_dst: `ipv4_outter_decap_match` - * dscp: `dscp_encap_c` - * proto: `41` - - * inner_src: `ipv4_inner_src` - * inner_dst: `ipv4_inner_encap_match` - * dscp: `dscp_encap_d` - * outter_src: `ipv4_outter_src_222` - * outter_dst: `ipv4_outter_decap_match` - * dscp: `dscp_encap_d` - * proto: `4` - - * inner_src: `ipv6_inner_src` - * inner_dst: `ipv6_inner_encap_match` - * dscp: `dscp_encap_d` - * outter_src: `ipv4_outter_src_111` - * outter_dst: `ipv4_outter_decap_match` - * dscp: `dscp_encap_d` - * proto: `41` - ``` - -3. Send traffic to DUT-1, covering all the installed v4 and v6 entries in the decap and encap VRFs. Validate that all traffic are all decapped per the DECAP VRFs and then encapsulated per the ENCAP VRFs and received as encapsulated packet by ATE. -4. Flush the `DECAP_TE_VRF`, install 5000 entries with fixed prefix length of /32, and repeat the same traffic validation. - -## 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 \ No newline at end of file From 77670940d945f387c75ac5f608a5a7fd338acc62 Mon Sep 17 00:00:00 2001 From: mananpat-cisco Date: Thu, 26 Dec 2024 04:00:31 -0500 Subject: [PATCH 26/41] added cisco deviation (#3597) --- .../otg_tests/disable_ipv6_nd_ra_test/metadata.textproto | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/feature/interface/ip/ipv6_ND/otg_tests/disable_ipv6_nd_ra_test/metadata.textproto b/feature/interface/ip/ipv6_ND/otg_tests/disable_ipv6_nd_ra_test/metadata.textproto index 7e07c4a34fd..9855f84b507 100644 --- a/feature/interface/ip/ipv6_ND/otg_tests/disable_ipv6_nd_ra_test/metadata.textproto +++ b/feature/interface/ip/ipv6_ND/otg_tests/disable_ipv6_nd_ra_test/metadata.textproto @@ -30,4 +30,12 @@ platform_exceptions: { explicit_interface_in_default_vrf: true interface_enabled: true } +} +platform_exceptions: { + platform: { + vendor: CISCO + } + deviations: { + ipv6_router_advertisement_interval_unsupported: true + } } \ No newline at end of file From 646b7b3afc6a02db50247537a64e9eb93d44a69d Mon Sep 17 00:00:00 2001 From: divyarema <134387379+divyarema@users.noreply.github.com> Date: Thu, 26 Dec 2024 14:31:15 +0530 Subject: [PATCH 27/41] gNMI-1.27-updating deviation,isis_level_enabled (#2815) * updating deviation,isis_level_enabled * Update metadata.textproto formatting fix --------- Co-authored-by: Pramod Maurya --- .../tests/gnmi_sample_mode_test/metadata.textproto | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/feature/gnmi/subscribe/tests/gnmi_sample_mode_test/metadata.textproto b/feature/gnmi/subscribe/tests/gnmi_sample_mode_test/metadata.textproto index 9f4c6a67ba7..2a4712692c2 100644 --- a/feature/gnmi/subscribe/tests/gnmi_sample_mode_test/metadata.textproto +++ b/feature/gnmi/subscribe/tests/gnmi_sample_mode_test/metadata.textproto @@ -13,11 +13,19 @@ platform_exceptions: { omit_l2_mtu: true missing_value_for_defaults: true interface_enabled: true - default_network_instance: "default" + default_network_instance: "default" isis_instance_enabled_required: true isis_interface_afi_unsupported: true } } +platform_exceptions: { + platform: { + vendor: JUNIPER + } + deviations: { + isis_level_enabled: true + } +} platform_exceptions: { platform: { vendor: NOKIA From ac12783c215126f55dcdb282472a7eb9b3b4dbdf Mon Sep 17 00:00:00 2001 From: abhijit-dhar <67135817+abhijit-dhar@users.noreply.github.com> Date: Thu, 26 Dec 2024 14:33:58 +0530 Subject: [PATCH 28/41] adding correct deviation (#2035) --- feature/gribi/otg_tests/ipv4_entry_test/metadata.textproto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feature/gribi/otg_tests/ipv4_entry_test/metadata.textproto b/feature/gribi/otg_tests/ipv4_entry_test/metadata.textproto index b3036f4968f..1fa1844f144 100644 --- a/feature/gribi/otg_tests/ipv4_entry_test/metadata.textproto +++ b/feature/gribi/otg_tests/ipv4_entry_test/metadata.textproto @@ -11,7 +11,7 @@ platform_exceptions: { } deviations: { ipv4_missing_enabled: true - gribi_mac_override_with_static_arp: true + gribi_mac_override_static_arp_static_route: true } } platform_exceptions: { From f7a63306b491a6bfaeda7838dabc87752ab20bce Mon Sep 17 00:00:00 2001 From: Priya Ranjan Nanda <151918045+priyaranjannanda@users.noreply.github.com> Date: Thu, 26 Dec 2024 15:13:28 +0530 Subject: [PATCH 29/41] Changes to await for interface up check after replace config (#3456) Co-authored-by: Ram --- .../otg_tests/ipv6_link_local_test/ipv6_link_local_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/feature/interface/ip/ipv6_link_local/otg_tests/ipv6_link_local_test/ipv6_link_local_test.go b/feature/interface/ip/ipv6_link_local/otg_tests/ipv6_link_local_test/ipv6_link_local_test.go index b77fbcc8d3c..facd36954b2 100644 --- a/feature/interface/ip/ipv6_link_local/otg_tests/ipv6_link_local_test/ipv6_link_local_test.go +++ b/feature/interface/ip/ipv6_link_local/otg_tests/ipv6_link_local_test/ipv6_link_local_test.go @@ -130,6 +130,7 @@ func TestIPv6LinkLocal(t *testing.T) { gnmi.Replace(t, dut, gnmi.OC().Interface(p1.Name()).Enabled().Config(), false) gnmi.Await(t, dut, gnmi.OC().Interface(p1.Name()).Enabled().State(), 30*time.Second, false) gnmi.Replace(t, dut, gnmi.OC().Interface(p1.Name()).Enabled().Config(), true) + gnmi.Await(t, dut, gnmi.OC().Interface(p1.Name()).Enabled().State(), 30*time.Second, true) otgutils.WaitForARP(t, ate.OTG(), top, "IPv6") t.Run("Interface Telemetry", func(t *testing.T) { verifyInterfaceTelemetry(t, dut) @@ -208,6 +209,8 @@ func configureDUTLinkLocalInterface(t *testing.T, dut *ondatra.DUTDevice) { fptest.AssignToNetworkInstance(t, dut, p1.Name(), deviations.DefaultNetworkInstance(dut), 0) fptest.AssignToNetworkInstance(t, dut, p2.Name(), deviations.DefaultNetworkInstance(dut), 0) } + gnmi.Await(t, dut, gnmi.OC().Interface(p1.Name()).OperStatus().State(), time.Minute, oc.Interface_OperStatus_UP) + gnmi.Await(t, dut, gnmi.OC().Interface(p2.Name()).OperStatus().State(), time.Minute, oc.Interface_OperStatus_UP) } func configureOTGInterface(t *testing.T, ate *ondatra.ATEDevice, top gosnappi.Config) { From adfbd1700b630e9eede2c3bb50c843752b226837 Mon Sep 17 00:00:00 2001 From: rszarecki <46606165+rszarecki@users.noreply.github.com> Date: Thu, 26 Dec 2024 02:37:52 -0800 Subject: [PATCH 30/41] adding missing path (#2534) * adding missing path As per PROCEDURE description below path is needed: `/routing-policy/policy-definitions/policy-definition/statements/statement/actions/bgp-actions/set-as-path-prepend/config/asn ` This patch is adding it explicitly in "Config Parameter Coverage" * Added openconfig path and RPC coverage block in readme * Update README.md * Update README.md --------- Co-authored-by: Pramod Maurya --- .../route_installation_test/README.md | 48 ++++++++++--------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/feature/bgp/policybase/otg_tests/route_installation_test/README.md b/feature/bgp/policybase/otg_tests/route_installation_test/README.md index 537844a7399..595f70498ed 100644 --- a/feature/bgp/policybase/otg_tests/route_installation_test/README.md +++ b/feature/bgp/policybase/otg_tests/route_installation_test/README.md @@ -24,25 +24,29 @@ Base BGP policy configuration and route installation. * Validate that traffic is not forwarded to withdrawn routes between ATE port-1 and ATE port-2. -## Config Parameter Coverage - -* /routing-policy/policy-definitions/policy-definition/config/name -* /routing-policy/policy-definitions/policy-definition/statements/statement/actions/bgp-actions/config/set-local-pref -* /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 - -## Telemetry Parameter Coverage - -For prefixes: - -* /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor -* /network-instances/network-instance/protocols/protocol/bgp/peer-groups/peer-group - -Paths: - -* afi-safis/afi-safi/apply-policy/state/export-policy -* afi-safis/afi-safi/apply-policy/state/import-policy -* afi-safis/afi-safi/state/prefixes/installed -* afi-safis/afi-safi/state/prefixes/received -* afi-safis/afi-safi/state/prefixes/received-pre-policy -* afi-safis/afi-safi/state/prefixes/sent +## OpenConfig Path and RPC Coverage +```yaml +paths: + ## Config Parameter Coverage + /routing-policy/policy-definitions/policy-definition/config/name: + /routing-policy/policy-definitions/policy-definition/statements/statement/actions/bgp-actions/config/set-local-pref: + /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/asn: + + ## Telemetry Parameter Coverage + /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/state/neighbor-address: + /network-instances/network-instance/protocols/protocol/bgp/peer-groups/peer-group/state/peer-group-name: + /network-instances/network-instance/protocols/protocol/bgp/peer-groups/peer-group/afi-safis/afi-safi/apply-policy/state/export-policy: + /network-instances/network-instance/protocols/protocol/bgp/peer-groups/peer-group/afi-safis/afi-safi/apply-policy/state/import-policy: + /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/state/prefixes/installed: + /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/state/prefixes/received: + /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/state/prefixes/received-pre-policy: + /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/state/prefixes/sent: + +rpcs: + gnmi: + gNMI.Get: + gNMI.Subscribe: + +``` From dd9f5eacaf5a8c49f42cbf6af18fb376131da6af Mon Sep 17 00:00:00 2001 From: rszarecki <46606165+rszarecki@users.noreply.github.com> Date: Thu, 26 Dec 2024 03:10:44 -0800 Subject: [PATCH 31/41] fixing testregistry between RT-1.19 and RT-21.24 (#2430) * fixing testregistry between RT-1.19 and RT-21.24 * Update testregistry.textproto --------- Co-authored-by: Pramod Maurya --- testregistry.textproto | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/testregistry.textproto b/testregistry.textproto index 412f0a93b7d..a70dfc099b8 100644 --- a/testregistry.textproto +++ b/testregistry.textproto @@ -539,10 +539,16 @@ test: { } test: { id: "RT-1.19" - description: "BGP 2-Byte and 4-Byte ASN support" + description: "RT-1.19: BGP 2-Byte and 4-Byte ASN support" readme: "https://github.com/openconfig/featureprofiles/blob/main/feature/bgp/otg_tests/bgp_2byte_4byte_asn/README.md" exec: " " } +test: { + id: "RT-1.2" + description: "BGP Policy & Route Installation" + readme: "https://github.com/openconfig/featureprofiles/blob/main/feature/bgp/policybase/otg_tests/route_installation_test/README.md" + exec: " " +} test: { id: "RT-1.21" description: "BGP TCP MSS and PMTUD" From dc08c6f7100ea4cc6a6fa14f8708d4d2f7d0de16 Mon Sep 17 00:00:00 2001 From: Tushar Rathod <111466464+trathod1@users.noreply.github.com> Date: Thu, 26 Dec 2024 07:22:01 -0500 Subject: [PATCH 32/41] GNMI-1.18: Skipping check for empty integrated-circuit and removing deviations (#3560) * GNMI-1.18: Skipping check for empty integrated-circuit and removing deviations 1. Removing all deviations for Nokia 2. Skipping checks for empty integrated-circuit/switch-chip "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." * updated the commit to use findActiveComponenet function * Restoring the check for removable component --------- Co-authored-by: krisb --- .../metadata.textproto | 12 ------------ .../sampled_backplane_capacity_counters_test.go | 12 +++--------- 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/feature/platform/fabric/otg_tests/sampled_backplane_capacity_counters_test/metadata.textproto b/feature/platform/fabric/otg_tests/sampled_backplane_capacity_counters_test/metadata.textproto index 099686c7f73..6dad9d53b5d 100644 --- a/feature/platform/fabric/otg_tests/sampled_backplane_capacity_counters_test/metadata.textproto +++ b/feature/platform/fabric/otg_tests/sampled_backplane_capacity_counters_test/metadata.textproto @@ -13,18 +13,6 @@ platform_exceptions: { ipv4_missing_enabled: true } } -platform_exceptions: { - platform: { - vendor: NOKIA - } - deviations: { - interface_enabled: true - explicit_port_speed: true - explicit_interface_in_default_vrf: true - qos_queue_requires_id: true - missing_value_for_defaults: true - } -} platform_exceptions: { platform: { vendor: ARISTA 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 651bb61d582..0fe6d2973ad 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 @@ -53,7 +53,7 @@ func TestMain(m *testing.M) { func TestSampledBackplaneCapacityCounters(t *testing.T) { dut := ondatra.DUT(t, "dut") - ics := components.FindComponentsByType(t, dut, oc.PlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_INTEGRATED_CIRCUIT) + ics := components.FindActiveComponentsByType(t, dut, oc.PlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_INTEGRATED_CIRCUIT) if len(ics) == 0 { t.Fatalf("Get IntegratedCircuit card list for %q: got 0, want > 0", dut.Model()) } @@ -65,7 +65,6 @@ func TestSampledBackplaneCapacityCounters(t *testing.T) { if !isCompNameExpected(t, ic, dut.Vendor()) { continue } - t.Run(fmt.Sprintf("Backplane:%s", ic), func(t *testing.T) { if deviations.BackplaneFacingCapacityUnsupported(dut) { t.Skipf("Skipping check for BackplanceFacingCapacity due to deviation BackplaneFacingCapacityUnsupported") @@ -110,20 +109,16 @@ func gnmiOptsForOnChange(t *testing.T, dut *ondatra.DUTDevice) *gnmi.Opts { func TestOnChangeBackplaneCapacityCounters(t *testing.T) { dut := ondatra.DUT(t, "dut") - ics := components.FindComponentsByType(t, dut, oc.PlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_INTEGRATED_CIRCUIT) + ics := components.FindActiveComponentsByType(t, dut, oc.PlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_INTEGRATED_CIRCUIT) if len(ics) == 0 { t.Fatalf("Get IntegratedCircuit card list for %q: got 0, want > 0", dut.Model()) } t.Logf("IntegratedCircuit components count: %d", len(ics)) - fabrics := components.FindComponentsByType(t, dut, oc.PlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_FABRIC) + fabrics := components.FindActiveComponentsByType(t, dut, oc.PlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_FABRIC) t.Logf("fabrics are %v", fabrics) removable_fabrics := make([]string, 0) for _, f := range fabrics { - compMtyVal, compMtyPresent := gnmi.Lookup(t, dut, gnmi.OC().Component(f).Empty().State()).Val() - if compMtyPresent && compMtyVal { - continue - } if gnmi.Get(t, dut, gnmi.OC().Component(f).Removable().State()) { removable_fabrics = append(removable_fabrics, f) } @@ -226,7 +221,6 @@ func getBackplaneCapacityCounters(t *testing.T, dut *ondatra.DUTDevice, ics []st if !isCompNameExpected(t, ic, dut.Vendor()) { continue } - t.Run(fmt.Sprintf("Backplane:%s", ic), func(t *testing.T) { if deviations.BackplaneFacingCapacityUnsupported(dut) { t.Skipf("Skipping check for BackplanceFacingCapacity due to deviation BackplaneFacingCapacityUnsupported") From d63d627e48c1586ea2dc613500b8ecbc18dc2e8a Mon Sep 17 00:00:00 2001 From: Karim Jahed Date: Thu, 26 Dec 2024 18:52:17 -0500 Subject: [PATCH 33/41] fix file path (#3551) Co-authored-by: Swetha-haridasula --- .../tests/factory_reset_test/factory_reset_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feature/gnoi/factory_reset/tests/factory_reset_test/factory_reset_test.go b/feature/gnoi/factory_reset/tests/factory_reset_test/factory_reset_test.go index 4cc0240c1af..c26a148955b 100644 --- a/feature/gnoi/factory_reset/tests/factory_reset_test/factory_reset_test.go +++ b/feature/gnoi/factory_reset/tests/factory_reset_test/factory_reset_test.go @@ -36,7 +36,7 @@ import ( var ( remoteFilePath = map[ondatra.Vendor]string{ - ondatra.CISCO: "/misc/disk1/", + ondatra.CISCO: "harddisk:/", ondatra.NOKIA: "/tmp/", ondatra.JUNIPER: "/var/tmp/", ondatra.ARISTA: "/mnt/flash/", From 3a3d098154cca23fcfca63ee40a3b461dcb206ba Mon Sep 17 00:00:00 2001 From: snaragund <168457653+snaragund@users.noreply.github.com> Date: Fri, 27 Dec 2024 08:55:01 +0530 Subject: [PATCH 34/41] RT-1.28: Fixed script with added deviations (#3567) * RT-1.28: Fixed script with additional deviations - Added new deviation EnableTableConnections & other required deviation. - Used `bgp_community_member_is_a_string: true` with ref to https://partnerissuetracker.corp.google.com/issues/376799780#comment2 - Match-Community-Set under bgp-conditions configuration moved under policy-defitions as its configuration is deprecated under bgp-defined-sets. - Under nonMatchingCommunityRoutePolicy(both v4 & v6) changed gnmi.Replace to gnmi.Update to avoid precondition error of failing to delete AllowAll route-policy. "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." * -Removed comment "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." * -Adding changes to deviations.go, metadata.proto & metadata.pb.go for EnableTableConnections. "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." * -Resolving conflicts "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." * Revert "-Resolving conflicts" This reverts commit f41b14ae757fc5367b892b30427150bcb4612744. * -Defined & calling `ConfigEnableTbNative` function from fptest. "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." * -updated deviation comment "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." * Fixed tableconnection with comment * -Removing extra space in deviations.go "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." --------- Co-authored-by: trathod Co-authored-by: Tushar Rathod <111466464+trathod1@users.noreply.github.com> --- .../bgp_isis_redistribution_test.go | 46 +++++++++---- .../metadata.textproto | 11 ++++ internal/deviations/deviations.go | 10 +-- internal/fptest/tableconnection.go | 66 +++++++++++++++++++ proto/metadata.proto | 2 +- 5 files changed, 115 insertions(+), 20 deletions(-) create mode 100644 internal/fptest/tableconnection.go diff --git a/feature/bgp/bgp_isis_redistribution/otg_tests/bgp_isis_redistribution_test/bgp_isis_redistribution_test.go b/feature/bgp/bgp_isis_redistribution/otg_tests/bgp_isis_redistribution_test/bgp_isis_redistribution_test.go index c54fe7f044d..b9a95fce876 100644 --- a/feature/bgp/bgp_isis_redistribution/otg_tests/bgp_isis_redistribution_test/bgp_isis_redistribution_test.go +++ b/feature/bgp/bgp_isis_redistribution/otg_tests/bgp_isis_redistribution_test/bgp_isis_redistribution_test.go @@ -314,7 +314,9 @@ func nonMatchingPrefixRoutePolicy(t *testing.T, dut *ondatra.DUTDevice) { } prefixSet := rp.GetOrCreateDefinedSets().GetOrCreatePrefixSet(v4PrefixSet) - prefixSet.SetMode(oc.PrefixSet_Mode_IPV4) + if !deviations.SkipPrefixSetMode(dut) { + prefixSet.SetMode(oc.PrefixSet_Mode_IPV4) + } prefixSet.GetOrCreatePrefix(nonAdvertisedIPv4.cidr(t), maskLenExact) if !deviations.SkipSetRpMatchSetOptions(dut) { @@ -330,7 +332,7 @@ func matchingPrefixRoutePolicy(t *testing.T, dut *ondatra.DUTDevice) { rp := root.GetOrCreateRoutingPolicy() prefixSet := rp.GetOrCreateDefinedSets().GetOrCreatePrefixSet(v4PrefixSet) prefixSet.GetOrCreatePrefix(advertisedIPv4.cidr(t), maskLenExact) - gnmi.Update(t, dut, gnmi.OC().RoutingPolicy().DefinedSets().PrefixSet(v4PrefixSet).Config(), prefixSet) + gnmi.Replace(t, dut, gnmi.OC().RoutingPolicy().DefinedSets().PrefixSet(v4PrefixSet).Config(), prefixSet) } func nonMatchingCommunityRoutePolicy(t *testing.T, dut *ondatra.DUTDevice) { @@ -355,12 +357,14 @@ func nonMatchingCommunityRoutePolicy(t *testing.T, dut *ondatra.DUTDevice) { communitySet := rp.GetOrCreateDefinedSets().GetOrCreateBgpDefinedSets().GetOrCreateCommunitySet(v4CommunitySet) communitySet.SetCommunityMember([]oc.RoutingPolicy_DefinedSets_BgpDefinedSets_CommunitySet_CommunityMember_Union{oc.UnionString(fmt.Sprintf("%d:%d", dummyAS, 200))}) - communitySet.SetMatchSetOptions(oc.BgpPolicy_MatchSetOptionsType_ANY) if deviations.BGPConditionsMatchCommunitySetUnsupported(dut) { + communitySet.SetMatchSetOptions(oc.BgpPolicy_MatchSetOptionsType_ANY) stmt.GetOrCreateConditions().GetOrCreateBgpConditions().SetCommunitySet(v4CommunitySet) } else { - stmt.GetOrCreateConditions().GetOrCreateBgpConditions().GetOrCreateMatchCommunitySet().SetCommunitySet(v4CommunitySet) + ref1 := stmt.GetOrCreateConditions().GetOrCreateBgpConditions().GetOrCreateMatchCommunitySet() + ref1.SetCommunitySet(v4CommunitySet) + ref1.SetMatchSetOptions(oc.RoutingPolicy_MatchSetOptionsType_ANY) } // Configure ALLOWAll policy pdef = rp.GetOrCreatePolicyDefinition(allowAllPolicy) @@ -383,7 +387,7 @@ func matchingCommunityRoutePolicy(t *testing.T, dut *ondatra.DUTDevice) { rp := root.GetOrCreateRoutingPolicy() communitySet := rp.GetOrCreateDefinedSets().GetOrCreateBgpDefinedSets().GetOrCreateCommunitySet(v4CommunitySet) communitySet.SetCommunityMember([]oc.RoutingPolicy_DefinedSets_BgpDefinedSets_CommunitySet_CommunityMember_Union{oc.UnionString(fmt.Sprintf("%d:%d", ateAS, 100))}) - gnmi.Update(t, dut, gnmi.OC().RoutingPolicy().DefinedSets().BgpDefinedSets().CommunitySet(v4CommunitySet).Config(), communitySet) + gnmi.Replace(t, dut, gnmi.OC().RoutingPolicy().DefinedSets().BgpDefinedSets().CommunitySet(v4CommunitySet).Config(), communitySet) } } @@ -410,8 +414,10 @@ func verifyNonMatchingPrefixTelemetry(t *testing.T, dut *ondatra.DUTDevice, ate if pName := prefixSet.GetName(); pName != v4PrefixSet { t.Errorf("Prefix set name: %s, want: %s", pName, v4PrefixSet) } - if pMode := prefixSet.GetMode(); pMode != oc.PrefixSet_Mode_IPV4 { - t.Errorf("Prefix set mode: %s, want: %s", pMode, oc.PrefixSet_Mode_IPV4) + if !deviations.SkipPrefixSetMode(dut) { + if pMode := prefixSet.GetMode(); pMode != oc.PrefixSet_Mode_IPV4 { + t.Errorf("Prefix set mode: %s, want: %s", pMode, oc.PrefixSet_Mode_IPV4) + } } if prefix := prefixSet.GetPrefix(nonAdvertisedIPv4.cidr(t), maskLenExact); prefix == nil { t.Errorf("Prefix is nil, want: %s", nonAdvertisedIPv4.cidr(t)) @@ -525,7 +531,9 @@ func nonMatchingPrefixRoutePolicyV6(t *testing.T, dut *ondatra.DUTDevice) { } prefixSet := rp.GetOrCreateDefinedSets().GetOrCreatePrefixSet(v6PrefixSet) - prefixSet.SetMode(oc.PrefixSet_Mode_IPV6) + if !deviations.SkipPrefixSetMode(dut) { + prefixSet.SetMode(oc.PrefixSet_Mode_IPV6) + } prefixSet.GetOrCreatePrefix(nonAdvertisedIPv6.cidr(t), maskLenExact) if !deviations.SkipSetRpMatchSetOptions(dut) { @@ -540,7 +548,7 @@ func matchingPrefixRoutePolicyV6(t *testing.T, dut *ondatra.DUTDevice) { rp := root.GetOrCreateRoutingPolicy() prefixSet := rp.GetOrCreateDefinedSets().GetOrCreatePrefixSet(v6PrefixSet) prefixSet.GetOrCreatePrefix(advertisedIPv6.cidr(t), maskLenExact) - gnmi.Update(t, dut, gnmi.OC().RoutingPolicy().DefinedSets().PrefixSet(v6PrefixSet).Config(), prefixSet) + gnmi.Replace(t, dut, gnmi.OC().RoutingPolicy().DefinedSets().PrefixSet(v6PrefixSet).Config(), prefixSet) } func nonMatchingCommunityRoutePolicyV6(t *testing.T, dut *ondatra.DUTDevice) { @@ -565,12 +573,14 @@ func nonMatchingCommunityRoutePolicyV6(t *testing.T, dut *ondatra.DUTDevice) { communitySet := rp.GetOrCreateDefinedSets().GetOrCreateBgpDefinedSets().GetOrCreateCommunitySet(v6CommunitySet) communitySet.SetCommunityMember([]oc.RoutingPolicy_DefinedSets_BgpDefinedSets_CommunitySet_CommunityMember_Union{oc.UnionString(fmt.Sprintf("%d:%d", dummyAS, 200))}) - communitySet.SetMatchSetOptions(oc.BgpPolicy_MatchSetOptionsType_ANY) if deviations.BGPConditionsMatchCommunitySetUnsupported(dut) { stmt.GetOrCreateConditions().GetOrCreateBgpConditions().SetCommunitySet(v6CommunitySet) + communitySet.SetMatchSetOptions(oc.BgpPolicy_MatchSetOptionsType_ANY) } else { - stmt.GetOrCreateConditions().GetOrCreateBgpConditions().GetOrCreateMatchCommunitySet().SetCommunitySet(v6CommunitySet) + ref1 := stmt.GetOrCreateConditions().GetOrCreateBgpConditions().GetOrCreateMatchCommunitySet() + ref1.SetCommunitySet(v6CommunitySet) + ref1.SetMatchSetOptions(oc.RoutingPolicy_MatchSetOptionsType_ANY) } // Configure ALLOWAll policy pdef = rp.GetOrCreatePolicyDefinition(allowAllPolicy) @@ -592,7 +602,7 @@ func matchingCommunityRoutePolicyV6(t *testing.T, dut *ondatra.DUTDevice) { rp := root.GetOrCreateRoutingPolicy() communitySet := rp.GetOrCreateDefinedSets().GetOrCreateBgpDefinedSets().GetOrCreateCommunitySet(v6CommunitySet) communitySet.SetCommunityMember([]oc.RoutingPolicy_DefinedSets_BgpDefinedSets_CommunitySet_CommunityMember_Union{oc.UnionString(fmt.Sprintf("%d:%d", ateAS, 100))}) - gnmi.Update(t, dut, gnmi.OC().RoutingPolicy().DefinedSets().BgpDefinedSets().CommunitySet(v6CommunitySet).Config(), communitySet) + gnmi.Replace(t, dut, gnmi.OC().RoutingPolicy().DefinedSets().BgpDefinedSets().CommunitySet(v6CommunitySet).Config(), communitySet) } } @@ -619,8 +629,10 @@ func verifyNonMatchingPrefixTelemetryV6(t *testing.T, dut *ondatra.DUTDevice, at if pName := prefixSet.GetName(); pName != v6PrefixSet { t.Errorf("Prefix set name: %s, want: %s", pName, v6PrefixSet) } - if pMode := prefixSet.GetMode(); pMode != oc.PrefixSet_Mode_IPV6 { - t.Errorf("Prefix set mode: %s, want: %s", pMode, oc.PrefixSet_Mode_IPV6) + if !deviations.SkipPrefixSetMode(dut) { + if pMode := prefixSet.GetMode(); pMode != oc.PrefixSet_Mode_IPV6 { + t.Errorf("Prefix set mode: %s, want: %s", pMode, oc.PrefixSet_Mode_IPV6) + } } if prefix := prefixSet.GetPrefix(nonAdvertisedIPv6.cidr(t), maskLenExact); prefix == nil { t.Errorf("Prefix is nil, want: %s", nonAdvertisedIPv6.cidr(t)) @@ -718,6 +730,9 @@ func verifyMatchingCommunityTelemetryV6(t *testing.T, dut *ondatra.DUTDevice, at func bgpISISRedistribution(t *testing.T, dut *ondatra.DUTDevice, operation string) { dni := deviations.DefaultNetworkInstance(dut) root := &oc.Root{} + if deviations.EnableTableConnections(dut) { + fptest.ConfigEnableTbNative(t, dut) + } tableConn := root.GetOrCreateNetworkInstance(dni).GetOrCreateTableConnection(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_ISIS, oc.Types_ADDRESS_FAMILY_IPV4) if operation == "set" { if !deviations.SkipSettingDisableMetricPropagation(dut) { @@ -736,6 +751,9 @@ func bgpISISRedistribution(t *testing.T, dut *ondatra.DUTDevice, operation strin func bgpISISRedistributionV6(t *testing.T, dut *ondatra.DUTDevice, operation string) { dni := deviations.DefaultNetworkInstance(dut) root := &oc.Root{} + if deviations.EnableTableConnections(dut) { + fptest.ConfigEnableTbNative(t, dut) + } tableConn := root.GetOrCreateNetworkInstance(dni).GetOrCreateTableConnection(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_ISIS, oc.Types_ADDRESS_FAMILY_IPV6) if operation == "set" { if !deviations.SkipSettingDisableMetricPropagation(dut) { diff --git a/feature/bgp/bgp_isis_redistribution/otg_tests/bgp_isis_redistribution_test/metadata.textproto b/feature/bgp/bgp_isis_redistribution/otg_tests/bgp_isis_redistribution_test/metadata.textproto index 7c29f99bbfa..a3769f0ac2c 100644 --- a/feature/bgp/bgp_isis_redistribution/otg_tests/bgp_isis_redistribution_test/metadata.textproto +++ b/feature/bgp/bgp_isis_redistribution/otg_tests/bgp_isis_redistribution_test/metadata.textproto @@ -44,3 +44,14 @@ platform_exceptions: { default_route_policy_unsupported: true } } +platform_exceptions: { + platform: { + vendor: NOKIA + } + deviations: { + explicit_interface_in_default_vrf: true + interface_enabled: true + skip_prefix_set_mode: true + enable_table_connections: true + } +} diff --git a/internal/deviations/deviations.go b/internal/deviations/deviations.go index fb8797c656d..2d34420d438 100644 --- a/internal/deviations/deviations.go +++ b/internal/deviations/deviations.go @@ -1234,11 +1234,6 @@ func BgpAfiSafiWildcardNotSupported(dut *ondatra.DUTDevice) bool { return lookupDUTDeviations(dut).GetBgpAfiSafiWildcardNotSupported() } -// EnableTableConnections Admin Enable Table Connections in SRL native -func EnableTableConnections(dut *ondatra.DUTDevice) bool { - return lookupDUTDeviations(dut).GetEnableTableConnections() -} - // NoZeroSuppression returns true if device wants to remove zero suppression func NoZeroSuppression(dut *ondatra.DUTDevice) bool { return lookupDUTDeviations(dut).GetNoZeroSuppression() @@ -1264,3 +1259,8 @@ func IsisDatabaseOverloadsUnsupported(dut *ondatra.DUTDevice) bool { func BgpSetMedV7Unsupported(dut *ondatra.DUTDevice) bool { return lookupDUTDeviations(dut).GetBgpSetMedV7Unsupported() } + +// EnableTableConnections returns true if admin state of tableconnections needs to be enabled in SRL native model +func EnableTableConnections(dut *ondatra.DUTDevice) bool { + return lookupDUTDeviations(dut).GetEnableTableConnections() +} diff --git a/internal/fptest/tableconnection.go b/internal/fptest/tableconnection.go new file mode 100644 index 00000000000..258f48a5acc --- /dev/null +++ b/internal/fptest/tableconnection.go @@ -0,0 +1,66 @@ +// Copyright 2022 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 fptest + +import ( + "context" + "encoding/json" + "testing" + + gpb "github.com/openconfig/gnmi/proto/gnmi" + "github.com/openconfig/ondatra" +) + +// ConfigEnableTbNative enables admin-state of table-connections in native mode. +func ConfigEnableTbNative(t testing.TB, d *ondatra.DUTDevice) { + t.Helper() + state := "enable" + switch d.Vendor() { + case ondatra.NOKIA: + adminEnable, err := json.Marshal(state) + if err != nil { + t.Fatalf("Error with json Marshal: %v", err) + } + + gpbSetRequest := &gpb.SetRequest{ + Prefix: &gpb.Path{ + Origin: "native", + }, + Update: []*gpb.Update{ + { + Path: &gpb.Path{ + Elem: []*gpb.PathElem{ + {Name: "network-instance", Key: map[string]string{"name": "DEFAULT"}}, + {Name: "table-connections"}, + {Name: "admin-state"}, + }, + }, + Val: &gpb.TypedValue{ + Value: &gpb.TypedValue_JsonIetfVal{ + JsonIetfVal: adminEnable, + }, + }, + }, + }, + } + + gnmiClient := d.RawAPIs().GNMI(t) + if _, err := gnmiClient.Set(context.Background(), gpbSetRequest); err != nil { + t.Fatalf("Unexpected error updating SRL static-route tag-set: %v", err) + } + default: + t.Fatalf("Unsupported vendor %s for deviation 'EnableTableConnections'", d.Vendor()) + } +} diff --git a/proto/metadata.proto b/proto/metadata.proto index 29957c9d35d..7b6318bc66b 100644 --- a/proto/metadata.proto +++ b/proto/metadata.proto @@ -639,7 +639,7 @@ message Metadata { // EnableMultipathUnderAfiSafi returns true for devices that do not support multipath under /global path and instead support under global/afi/safi path // CISCO: b/376241033 // CISCO: b/340859662 - bool enable_multipath_under_afi_safi = 230; + bool enable_multipath_under_afi_safi = 230; // Device have different default value for allow own as. // Juniper : b/373559004 bool bgp_allowownas_diff_default_value = 231; From d390c9ebd3c398c42e93440d27cb68d17825cdef Mon Sep 17 00:00:00 2001 From: Pramod Maurya Date: Fri, 27 Dec 2024 09:10:40 +0530 Subject: [PATCH 35/41] mapped gribi feature owner group (#3670) --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 7036da0df5f..26203ce872c 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -16,7 +16,7 @@ /feature/bgp/ @openconfig/featureprofiles-owner-bgp /feature/dhcp/ @alokmtri-g /feature/ethernet/ @ram-mac -/feature/gribi/ @nflath @nachikethas @xw-g +/feature/gribi/ @openconfig/featureprofiles-owner-gribi /feature/interface/ @openconfig/featureprofiles-owner-interface /feature/isis/ @openconfig/featureprofiles-owner-isis /feature/lldp/ @openconfig/featureprofiles-owner-lldp From 921029c092607cef9ba3b97b47721d6de28ad4cf Mon Sep 17 00:00:00 2001 From: ANISH-GOTTAPU <48308607+ANISH-GOTTAPU@users.noreply.github.com> Date: Fri, 27 Dec 2024 09:37:07 +0530 Subject: [PATCH 36/41] update RT 1.26 (#3467) --- .../basic_static_route_support_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/feature/staticroute/otg_tests/basic_static_route_support_test/basic_static_route_support_test.go b/feature/staticroute/otg_tests/basic_static_route_support_test/basic_static_route_support_test.go index 932e28281af..f5defe9452d 100644 --- a/feature/staticroute/otg_tests/basic_static_route_support_test/basic_static_route_support_test.go +++ b/feature/staticroute/otg_tests/basic_static_route_support_test/basic_static_route_support_test.go @@ -44,8 +44,8 @@ const ( trafficDuration = 2 * time.Minute lossTolerance = float64(1) ecmpTolerance = uint64(2) - port1Tag = "0x101" - port2Tag = "0x102" + port1Tag = "0x01" + port2Tag = "0x02" dummyV6 = "2001:db8::192:0:2:d" dummyMAC = "00:1A:11:00:0A:BC" explicitMetricTolerance = float64(2) @@ -1265,7 +1265,7 @@ func (td *testData) configureOTGFlows(t *testing.T) { eth := v4F.EgressPacket().Add().Ethernet() ethTag := eth.Dst().MetricTags().Add() - ethTag.SetName("MACTrackingv4").SetOffset(36).SetLength(12) + ethTag.SetName("MACTrackingv4").SetOffset(40).SetLength(8) v6F := td.top.Flows().Add() v6F.SetName(v6Flow).Metrics().SetEnable(true) @@ -1284,7 +1284,7 @@ func (td *testData) configureOTGFlows(t *testing.T) { eth = v6F.EgressPacket().Add().Ethernet() ethTag = eth.Dst().MetricTags().Add() - ethTag.SetName("MACTrackingv6").SetOffset(36).SetLength(12) + ethTag.SetName("MACTrackingv6").SetOffset(40).SetLength(8) } func (td *testData) awaitISISAdjacency(t *testing.T, p *ondatra.Port, isisName string) error { From 6c9012b1697c8694bcbef7ccdc91e2de4e673994 Mon Sep 17 00:00:00 2001 From: abhijit-dhar <67135817+abhijit-dhar@users.noreply.github.com> Date: Fri, 27 Dec 2024 10:23:47 +0530 Subject: [PATCH 37/41] reusing the function injectIPEntry() inside injectEntries() (#1957) --- .../route_removal_non_default_vrf_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feature/gribi/otg_tests/route_removal_non_default_vrf_test/route_removal_non_default_vrf_test.go b/feature/gribi/otg_tests/route_removal_non_default_vrf_test/route_removal_non_default_vrf_test.go index ae25736b1dc..b7f5ab7802c 100644 --- a/feature/gribi/otg_tests/route_removal_non_default_vrf_test/route_removal_non_default_vrf_test.go +++ b/feature/gribi/otg_tests/route_removal_non_default_vrf_test/route_removal_non_default_vrf_test.go @@ -400,7 +400,7 @@ func injectEntries(ctx context.Context, t *testing.T, dut *ondatra.DUTDevice, cl t.Logf("Add an IPv4Entry for %s pointing to ATE port-2 via gRIBI client", ateDstNetCIDR) client.AddNH(t, nhIndex, atePort2.IPv4, deviations.DefaultNetworkInstance(dut), fluent.InstalledInRIB) client.AddNHG(t, nhgIndex, map[uint64]uint64{nhIndex: 1}, deviations.DefaultNetworkInstance(dut), fluent.InstalledInRIB) - client.AddIPv4(t, ateDstNetCIDR, nhgIndex, networkInstanceName, deviations.DefaultNetworkInstance(dut), fluent.InstalledInRIB) + injectIPEntry(ctx, t, dut, client, networkInstanceName, ateDstNetCIDR) } // injectIPEntry adds only IPv4 entry to the specified network instance referencing to the nhgid, to the VRF. From cb4b08b9b32569b02614343315e7a0066a6c1cb5 Mon Sep 17 00:00:00 2001 From: abhijit-dhar <67135817+abhijit-dhar@users.noreply.github.com> Date: Fri, 27 Dec 2024 10:29:28 +0530 Subject: [PATCH 38/41] some gnmi.Get() call is replaced by gnmi.Watch() call (#1932) * some gnmi.Get() call is replaced by gnmi.Watch() call * implemented the changes according to the comments --- .../otg_tests/get_rpc_test/get_rpc_test.go | 29 +++++++++++++++---- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/feature/gribi/otg_tests/get_rpc_test/get_rpc_test.go b/feature/gribi/otg_tests/get_rpc_test/get_rpc_test.go index 874d27aaf6b..9b3d10e7c52 100644 --- a/feature/gribi/otg_tests/get_rpc_test/get_rpc_test.go +++ b/feature/gribi/otg_tests/get_rpc_test/get_rpc_test.go @@ -33,6 +33,7 @@ import ( "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" ) @@ -316,8 +317,17 @@ func testIPv4LeaderActive(ctx context.Context, t *testing.T, args *testArgs) { // Verify the above entries are active through AFT Telemetry. for ip := range ateDstNetCIDR { ipv4Path := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(args.dut)).Afts().Ipv4Entry(ateDstNetCIDR[ip]) - if got, want := gnmi.Get(t, args.dut, ipv4Path.State()).GetPrefix(), ateDstNetCIDR[ip]; got != want { - t.Errorf("ipv4-entry/state/prefix got %s, want %s", got, want) + lastValue, ok := gnmi.Watch(t, args.dut, ipv4Path.State(), time.Minute, func(v *ygnmi.Value[*oc.NetworkInstance_Afts_Ipv4Entry]) bool { + return v.IsPresent() + }).Await(t) + + if !ok { + t.Fatalf("gnmi.Watch() failed value received = %s", lastValue) + } + + ipv4, _ := lastValue.Val() + if got, want := ipv4.GetPrefix(), ateDstNetCIDR[ip]; got != want { + t.Fatalf("ipv4-entry/state/prefix got %s, want %s", got, want) } } @@ -345,9 +355,18 @@ func testIPv4LeaderActive(ctx context.Context, t *testing.T, args *testArgs) { gnmi.Update(t, args.dut, niProto.Config(), static) validateGetRPC(ctx, t, args.clientA) for ip := range ateDstNetCIDR { - ipv4Path := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(args.dut)).Afts().Ipv4Entry(ateDstNetCIDR[ip]) - if got, want := gnmi.Get(t, args.dut, ipv4Path.State()).GetPrefix(), ateDstNetCIDR[ip]; got != want { - t.Errorf("ipv4-entry/state/prefix got %s, want %s", got, want) + ipv4Path := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(args.dut)).Afts().Ipv4Entry(ateDstNetCIDR[ip]) + lastValue, ok := gnmi.Watch(t, args.dut, ipv4Path.State(), time.Minute, func(v *ygnmi.Value[*oc.NetworkInstance_Afts_Ipv4Entry]) bool { + return v.IsPresent() + }).Await(t) + + if !ok { + t.Fatalf("gnmi.Watch() failed value received = %s", lastValue) + } + + ipv4, _ := lastValue.Val() + if got, want := ipv4.GetPrefix(), ateDstNetCIDR[ip]; got != want { + t.Fatalf("ipv4-entry/state/prefix got %s, want %s", got, want) } } From fc4804c0c90437e0ac3ba10e19a62973cb06ec2c Mon Sep 17 00:00:00 2001 From: arvbaska1 <123760606+arvbaska1@users.noreply.github.com> Date: Fri, 27 Dec 2024 01:39:31 -0500 Subject: [PATCH 39/41] Update Readme per PR#1538 changes (#1681) * Update Readme per PR#1538 changes * added rpc and paths in readme * go fmt fix for feature/gribi/otg_tests/get_rpc_test/get_rpc_test.go * added rpc and paths in readme * go fmt --------- Co-authored-by: Pramod Maurya --- .../otg_tests/bgp_prefix_limit_test/README.md | 43 ++++++++----------- feature/bgp/tests/local_bgp_test/README.md | 2 +- .../README.md | 2 +- .../gribi/otg_tests/get_rpc_test/README.md | 20 ++++----- .../otg_tests/get_rpc_test/get_rpc_test.go | 8 ++-- 5 files changed, 31 insertions(+), 44 deletions(-) diff --git a/feature/bgp/prefixlimit/otg_tests/bgp_prefix_limit_test/README.md b/feature/bgp/prefixlimit/otg_tests/bgp_prefix_limit_test/README.md index 2632792ac9d..e507230aa7a 100644 --- a/feature/bgp/prefixlimit/otg_tests/bgp_prefix_limit_test/README.md +++ b/feature/bgp/prefixlimit/otg_tests/bgp_prefix_limit_test/README.md @@ -6,7 +6,7 @@ BGP Prefix Limit ## Procedure -* Configure eBGP session between ATE port-1 and DUT port-1,with an Accept-route all import-policy/export-policy under the neighbor AFI/SAFI. +* Configure eBGP session between ATE port-1 and DUT port-1,with an Accept-route all import-policy/export-policy under the BGP peer-group AFI/SAFI. * With maximum prefix limits of unlimited, and N. * Advertise prefixes of `limit - 1`, `limit`, `limit + 1`. Validate session state meets expected value at ATE. @@ -20,31 +20,22 @@ BGP Prefix Limit table by forwarding traffic to `prefix{0..n-1}` and `prefix{n}` where n is the maximum prefix limit configured. -## Config Parameter coverage - -For prefixes: - -* /network-instances/network-instance/protocols/protocol/bgp/peer-groups/peer-group/ -* /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor - -Parameters: - -* afi-safis/afi-safi/ipv4-unicast/prefix-limit/config/max-prefixes -* afi-safis/afi-safi/ipv4-unicast/prefix-limit/config/restart-timer - -## Telemetry Parameter coverage - -* TODO: afi-safis/afi-safi/ipv\[46\]-unicast/prefix-limit/state/restart-timer -* TODO: - afi-safis/afi-safi/ipv\[46\]-unicast/prefix-limit/state/warning-threshold-pct -* TODO: - afi-safis/afi-safi/ipv\[46\]-unicast/prefix-limit/state/max-prefix-limit -* TODO: - afi-safis/afi-safi/ipv\[46\]-unicast/prefix-limit/state/prefix-limit-exceeded - -## Protocol/RPC Parameter coverage - -N/A +## OpenConfig Path and RPC Coverage + +```yaml +paths: + /network-instances/network-instance/protocols/protocol/bgp/peer-groups/peer-group/state/peer-group-name: + /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/state/neighbor-address: + /network-instances/network-instance/protocols/protocol/bgp/peer-groups/peer-group/afi-safis/afi-safi/ipv4-unicast/prefix-limit/config/max-prefixes: + /network-instances/network-instance/protocols/protocol/bgp/peer-groups/peer-group/afi-safis/afi-safi/ipv4-unicast/prefix-limit/state/warning-threshold-pct: + /network-instances/network-instance/protocols/protocol/bgp/peer-groups/peer-group/afi-safis/afi-safi/ipv4-unicast/prefix-limit/state/prefix-limit-exceeded: + +rpcs: + gnmi: + gNMI.Get: + gNMI.Subscribe: + gNMI.Set: +``` ## Minimum DUT platform requirement diff --git a/feature/bgp/tests/local_bgp_test/README.md b/feature/bgp/tests/local_bgp_test/README.md index de4b31660f8..b06db095a4b 100644 --- a/feature/bgp/tests/local_bgp_test/README.md +++ b/feature/bgp/tests/local_bgp_test/README.md @@ -8,7 +8,7 @@ The local\_bgp\_test brings up two OpenConfig controlled devices and tests that * Disconnected between them. * Verify BGP neighbor parameters -Enable an Accept-route all import-policy/export-policy for eBGP session under the neighbor AFI/SAFI. +Enable an Accept-route all import-policy/export-policy for eBGP session under the BGP peer-group AFI/SAFI. This test is suitable for running in a KNE environment. diff --git a/feature/bgp/timers/otg_tests/bgp_keepalive_and_holdtimer_configuration_test/README.md b/feature/bgp/timers/otg_tests/bgp_keepalive_and_holdtimer_configuration_test/README.md index 43d4f97c60f..4afc8e8cc08 100644 --- a/feature/bgp/timers/otg_tests/bgp_keepalive_and_holdtimer_configuration_test/README.md +++ b/feature/bgp/timers/otg_tests/bgp_keepalive_and_holdtimer_configuration_test/README.md @@ -8,7 +8,7 @@ BGP Keepalive and HoldTimer Configuration Test * Establish eBGP sessions as follows between ATE and DUT * The DUT has eBGP peering with ATE port 1 and ATE port 2. - * Enable an Accept-route all import-policy/export-policy under the neighbor AFI/SAFI. + * Enable an Accept-route all import-policy/export-policy under the BGP peer-group AFI/SAFI. * The first pair is called the "source" pair, and the second the "destination" pair * Validate BGP session state on DUT using telemetry. diff --git a/feature/gribi/otg_tests/get_rpc_test/README.md b/feature/gribi/otg_tests/get_rpc_test/README.md index a497f30b7ba..488638d5b2f 100644 --- a/feature/gribi/otg_tests/get_rpc_test/README.md +++ b/feature/gribi/otg_tests/get_rpc_test/README.md @@ -48,18 +48,14 @@ Validate gRIBI Get RPC. [fib_status]: https://github.com/openconfig/gribi/blob/08d53dffce45e942c6e7f07521c58b557984e4b7/v1/proto/service/gribi.proto#L485 [rib_status]: https://github.com/openconfig/gribi/blob/08d53dffce45e942c6e7f07521c58b557984e4b7/v1/proto/service/gribi.proto#L483 -## Config Parameter coverage - -No additional configuration parameters. - -## Telemetry Parameter coverage - -No additional telemetry parameters. - -## Protocol/RPC Parameter coverage - -* gRIBI - * Get +## OpenConfig Path and RPC Coverage + +```yaml +rpcs: + gnmi: + gNMI.Get: + gNMI.Set: +``` ## Minimum DUT platform requirement diff --git a/feature/gribi/otg_tests/get_rpc_test/get_rpc_test.go b/feature/gribi/otg_tests/get_rpc_test/get_rpc_test.go index 9b3d10e7c52..e3c22fb7cfa 100644 --- a/feature/gribi/otg_tests/get_rpc_test/get_rpc_test.go +++ b/feature/gribi/otg_tests/get_rpc_test/get_rpc_test.go @@ -355,10 +355,10 @@ func testIPv4LeaderActive(ctx context.Context, t *testing.T, args *testArgs) { gnmi.Update(t, args.dut, niProto.Config(), static) validateGetRPC(ctx, t, args.clientA) for ip := range ateDstNetCIDR { - ipv4Path := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(args.dut)).Afts().Ipv4Entry(ateDstNetCIDR[ip]) - lastValue, ok := gnmi.Watch(t, args.dut, ipv4Path.State(), time.Minute, func(v *ygnmi.Value[*oc.NetworkInstance_Afts_Ipv4Entry]) bool { - return v.IsPresent() - }).Await(t) + ipv4Path := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(args.dut)).Afts().Ipv4Entry(ateDstNetCIDR[ip]) + lastValue, ok := gnmi.Watch(t, args.dut, ipv4Path.State(), time.Minute, func(v *ygnmi.Value[*oc.NetworkInstance_Afts_Ipv4Entry]) bool { + return v.IsPresent() + }).Await(t) if !ok { t.Fatalf("gnmi.Watch() failed value received = %s", lastValue) From 66afa80b67649e5592dea332c33266816701ea08 Mon Sep 17 00:00:00 2001 From: Pramod Maurya Date: Mon, 30 Dec 2024 09:57:35 +0530 Subject: [PATCH 40/41] added deviation in bgp_2byte_4byte_asn_policy_test (#3425) Co-authored-by: Darren Loher --- .../bgp_2byte_4byte_asn_policy_test.go | 10 +++++++--- .../bgp_2byte_4byte_asn_policy_test/metadata.textproto | 2 ++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/feature/bgp/otg_tests/bgp_2byte_4byte_asn_policy_test/bgp_2byte_4byte_asn_policy_test.go b/feature/bgp/otg_tests/bgp_2byte_4byte_asn_policy_test/bgp_2byte_4byte_asn_policy_test.go index a90d728ebc8..dbdbbcf0ab8 100644 --- a/feature/bgp/otg_tests/bgp_2byte_4byte_asn_policy_test/bgp_2byte_4byte_asn_policy_test.go +++ b/feature/bgp/otg_tests/bgp_2byte_4byte_asn_policy_test/bgp_2byte_4byte_asn_policy_test.go @@ -157,7 +157,7 @@ func TestBgpSession(t *testing.T) { configureRegexPolicy(t, dut) d := &oc.Root{} - rpl := configureBGPPolicy(t, d, tc.nbr.isV4) + rpl := configureBGPPolicy(t, d, tc.nbr.isV4, dut) gnmi.Replace(t, dut, gnmi.OC().RoutingPolicy().Config(), rpl) t.Log("Configure BGP on DUT") @@ -259,7 +259,7 @@ func configureRegexPolicy(t *testing.T, dut *ondatra.DUTDevice) { // configureBGPPolicy configures a BGP routing policy to accept or reject routes based on prefix match conditions // Additonally, it also configures policy to match prefix based on community and regex for as path -func configureBGPPolicy(t *testing.T, d *oc.Root, isV4 bool) *oc.RoutingPolicy { +func configureBGPPolicy(t *testing.T, d *oc.Root, isV4 bool, dut *ondatra.DUTDevice) *oc.RoutingPolicy { t.Helper() rp := d.GetOrCreateRoutingPolicy() pset := rp.GetOrCreateDefinedSets().GetOrCreatePrefixSet(rejectPrefix) @@ -299,7 +299,11 @@ func configureBGPPolicy(t *testing.T, d *oc.Root, isV4 bool) *oc.RoutingPolicy { t.Errorf("Error while creating new statement %v", err) } stmt50.GetOrCreateActions().PolicyResult = oc.RoutingPolicy_PolicyResultType_REJECT_ROUTE - stmt50.GetOrCreateConditions().GetOrCreateBgpConditions().CommunitySet = ygot.String(communitySet) + if deviations.BGPConditionsMatchCommunitySetUnsupported(dut) { + stmt50.GetOrCreateConditions().GetOrCreateBgpConditions().SetCommunitySet(communitySet) + } else { + stmt50.GetOrCreateConditions().GetOrCreateBgpConditions().GetOrCreateMatchCommunitySet().SetCommunitySet(communitySet) + } stmt60, err := pdefComm.AppendNewStatement(aclStatement4) if err != nil { diff --git a/feature/bgp/otg_tests/bgp_2byte_4byte_asn_policy_test/metadata.textproto b/feature/bgp/otg_tests/bgp_2byte_4byte_asn_policy_test/metadata.textproto index eaae52b496a..58e2412e7cb 100644 --- a/feature/bgp/otg_tests/bgp_2byte_4byte_asn_policy_test/metadata.textproto +++ b/feature/bgp/otg_tests/bgp_2byte_4byte_asn_policy_test/metadata.textproto @@ -11,6 +11,7 @@ platform_exceptions: { } deviations: { ipv4_missing_enabled: true + bgp_conditions_match_community_set_unsupported: true } } platform_exceptions: { @@ -21,6 +22,7 @@ platform_exceptions: { explicit_port_speed: true explicit_interface_in_default_vrf: true interface_enabled: true + bgp_conditions_match_community_set_unsupported: true } } platform_exceptions: { From 08ad546790034c1579c03dc142a9552578b92ec6 Mon Sep 17 00:00:00 2001 From: snaragund <168457653+snaragund@users.noreply.github.com> Date: Thu, 2 Jan 2025 12:40:57 +0530 Subject: [PATCH 41/41] RT2.12: Minor infrastructure fix (#3671) - Removed deviation func configEnableTbNative, it is now defined & imported from fptest/tableconnection.go - Removed unwanted state passed in function. "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." --- .../static_route_isis_redistribution_test.go | 43 +------------------ 1 file changed, 1 insertion(+), 42 deletions(-) diff --git a/feature/isis/otg_tests/static_route_isis_redistribution/static_route_isis_redistribution_test.go b/feature/isis/otg_tests/static_route_isis_redistribution/static_route_isis_redistribution_test.go index 9bbc947d8d3..346641df6eb 100644 --- a/feature/isis/otg_tests/static_route_isis_redistribution/static_route_isis_redistribution_test.go +++ b/feature/isis/otg_tests/static_route_isis_redistribution/static_route_isis_redistribution_test.go @@ -173,8 +173,7 @@ func isisImportPolicyConfig(t *testing.T, dut *ondatra.DUTDevice, policyName str tableConn.SetDisableMetricPropagation(metricPropagation) } if deviations.EnableTableConnections(dut) { - state := "enable" - configEnableTbNative(t, dut, state) + fptest.ConfigEnableTbNative(t, dut) } gnmi.BatchReplace(batchSet, gnmi.OC().NetworkInstance(dni).TableConnection(srcProto, dstProto, addfmly).Config(), tableConn) @@ -375,46 +374,6 @@ func getTagSetName(dut *ondatra.DUTDevice, policyName, stmtName, afStr string) s return fmt.Sprintf("tag-set-%s", afStr) } -func configEnableTbNative(t testing.TB, d *ondatra.DUTDevice, state string) { - t.Helper() - switch d.Vendor() { - case ondatra.NOKIA: - adminEnable, err := json.Marshal(state) - if err != nil { - t.Fatalf("Error with json Marshal: %v", err) - } - - gpbSetRequest := &gpb.SetRequest{ - Prefix: &gpb.Path{ - Origin: "native", - }, - Update: []*gpb.Update{ - { - Path: &gpb.Path{ - Elem: []*gpb.PathElem{ - {Name: "network-instance", Key: map[string]string{"name": "DEFAULT"}}, - {Name: "table-connections"}, - {Name: "admin-state"}, - }, - }, - Val: &gpb.TypedValue{ - Value: &gpb.TypedValue_JsonIetfVal{ - JsonIetfVal: adminEnable, - }, - }, - }, - }, - } - - gnmiClient := d.RawAPIs().GNMI(t) - if _, err := gnmiClient.Set(context.Background(), gpbSetRequest); err != nil { - t.Fatalf("Unexpected error updating SRL static-route tag-set: %v", err) - } - default: - t.Fatalf("Unsupported vendor %s for deviation 'EnableTableConnections'", d.Vendor()) - } -} - func TestStaticToISISRedistribution(t *testing.T) { var ts *isissession.TestSession