From 813b40ea5b6498c9a2abc1435a6cbfbf82d56f66 Mon Sep 17 00:00:00 2001 From: sudhirakondi <165871916+sudhirakondi@users.noreply.github.com> Date: Thu, 20 Feb 2025 15:16:54 +0530 Subject: [PATCH 1/9] Revert Deviation added in Pull #3347 (#3824) * reverting earlier introduced code with deviation (PR #3347) * enabling setpackets unrelated to the deviation * removing unused import --- .../static_lsp_test/metadata.textproto | 9 --- .../static_lsp_test/static_lsp_test.go | 64 +++---------------- 2 files changed, 9 insertions(+), 64 deletions(-) diff --git a/feature/gribi/otg_tests/static_lsp_test/metadata.textproto b/feature/gribi/otg_tests/static_lsp_test/metadata.textproto index 88d91863db3..5d5dbf8904f 100644 --- a/feature/gribi/otg_tests/static_lsp_test/metadata.textproto +++ b/feature/gribi/otg_tests/static_lsp_test/metadata.textproto @@ -13,12 +13,3 @@ platform_exceptions: { ipv4_missing_enabled: true } } - -platform_exceptions: { - platform: { - vendor: JUNIPER - } - deviations: { - static_lsp_unsupported: true - } -} diff --git a/feature/gribi/otg_tests/static_lsp_test/static_lsp_test.go b/feature/gribi/otg_tests/static_lsp_test/static_lsp_test.go index 4d80bc3f01b..f5cf1fe1fca 100644 --- a/feature/gribi/otg_tests/static_lsp_test/static_lsp_test.go +++ b/feature/gribi/otg_tests/static_lsp_test/static_lsp_test.go @@ -15,7 +15,6 @@ 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/featureprofiles/internal/otgutils" "github.com/openconfig/ondatra" "github.com/openconfig/ondatra/gnmi" @@ -142,60 +141,15 @@ func configureOTG(t *testing.T) gosnappi.Config { // configureStaticLSP configures a static MPLS LSP with the provided parameters. func configureStaticLSP(t *testing.T, dut *ondatra.DUTDevice, lspName string, incomingLabel uint32, nextHopIP string) { - if deviations.StaticLspConfigUnsupported(dut) { - t.Logf("Push config via native CLI:%s", dut.Vendor()) - switch dut.Vendor() { - case ondatra.JUNIPER: - config := juniperMplsLSPConfig(t, dut, lspName, incomingLabel, nextHopIP) - helpers.GnmiCLIConfig(t, dut, config) - default: - t.Fatalf("StaticLspConfigUnsupported deviation needs cli configuration for vendor %s which is not defined", dut.Vendor()) - } - } else { - d := &oc.Root{} - // ConfigureDefaultNetworkInstance configures the default network instance name and type. - fptest.ConfigureDefaultNetworkInstance(t, dut) - mplsCfg := d.GetOrCreateNetworkInstance(deviations.DefaultNetworkInstance(dut)).GetOrCreateMpls() - staticMplsCfg := mplsCfg.GetOrCreateLsps().GetOrCreateStaticLsp(lspName) - staticMplsCfg.GetOrCreateEgress().SetIncomingLabel(oc.UnionUint32(incomingLabel)) - staticMplsCfg.GetOrCreateEgress().SetNextHop(nextHopIP) - staticMplsCfg.GetOrCreateEgress().SetPushLabel(oc.Egress_PushLabel_IMPLICIT_NULL) - gnmi.Update(t, dut, gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).Mpls().Config(), mplsCfg) - } -} - -// juniperMplsLSPConfig is used to configure mpls lsp configuration via native cli as an alternative to below xpaths. -// /network-instances/network-instance/mpls/lsps/static-lsps/static-lsp/egress/config/next-hop -// /network-instances/network-instance/mpls/lsps/static-lsps/static-lsp/egress/config/incoming-label -// /network-instances/network-instance/mpls/lsps/static-lsps/static-lsp/egress/config/push-label -func juniperMplsLSPConfig(t *testing.T, dut *ondatra.DUTDevice, lspName string, incomingLabel uint32, nextHopIP string) string { - p1 := dut.Port(t, "port1").Name() - p2 := dut.Port(t, "port2").Name() - return fmt.Sprintf(` - interfaces { - %s { - unit %d { - family mpls; - } - } - %s { - unit %d { - family mpls; - } - } - } - protocols { - mpls { - interface %s; - interface %s; - static-label-switched-path %s { - transit %d { - next-hop %s; - pop; - } - } - } - }`, p1, 0, p2, 0, p1, p2, lspName, incomingLabel, nextHopIP) + d := &oc.Root{} + // ConfigureDefaultNetworkInstance configures the default network instance name and type. + fptest.ConfigureDefaultNetworkInstance(t, dut) + mplsCfg := d.GetOrCreateNetworkInstance(deviations.DefaultNetworkInstance(dut)).GetOrCreateMpls() + staticMplsCfg := mplsCfg.GetOrCreateLsps().GetOrCreateStaticLsp(lspName) + staticMplsCfg.GetOrCreateEgress().SetIncomingLabel(oc.UnionUint32(incomingLabel)) + staticMplsCfg.GetOrCreateEgress().SetNextHop(nextHopIP) + staticMplsCfg.GetOrCreateEgress().SetPushLabel(oc.Egress_PushLabel_IMPLICIT_NULL) + gnmi.Update(t, dut, gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).Mpls().Config(), mplsCfg) } func createTrafficFlow(t *testing.T, From 1c021b63294d70b308ebb2ca6d9c4c6f42b764ac Mon Sep 17 00:00:00 2001 From: AmrNJ <155722765+AmrNJ@users.noreply.github.com> Date: Thu, 20 Feb 2025 21:40:10 +0530 Subject: [PATCH 2/9] Update base_adjacencies_test.go (#3835) --- .../otg_tests/base_adjacencies_test/base_adjacencies_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/feature/isis/otg_tests/base_adjacencies_test/base_adjacencies_test.go b/feature/isis/otg_tests/base_adjacencies_test/base_adjacencies_test.go index 77b0ccfa5d9..342782bee06 100644 --- a/feature/isis/otg_tests/base_adjacencies_test/base_adjacencies_test.go +++ b/feature/isis/otg_tests/base_adjacencies_test/base_adjacencies_test.go @@ -449,7 +449,6 @@ func TestAuthentication(t *testing.T) { ts := isissession.MustNew(t).WithISIS() ts.ConfigISIS(func(isis *oc.NetworkInstance_Protocol_Isis) { level := isis.GetOrCreateLevel(2) - level.Enabled = ygot.Bool(true) auth := level.GetOrCreateAuthentication() auth.Enabled = ygot.Bool(true) auth.AuthMode = tc.mode From b9fa8d1010f7baffb84125b44646a882db5962e5 Mon Sep 17 00:00:00 2001 From: Ram Date: Fri, 21 Feb 2025 12:16:07 +0530 Subject: [PATCH 3/9] fixed README.md related to global AFI-SAFI level behavior and also added the neighbor AFI-SAFI under global (#3834) Co-authored-by: Rohit Rattan --- feature/bgp/otg_tests/bgp_afi_safi_defaults/README.md | 5 ++--- .../bgp_afi_safi_defaults/bgp_afi_safi_defaults_test.go | 2 ++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/feature/bgp/otg_tests/bgp_afi_safi_defaults/README.md b/feature/bgp/otg_tests/bgp_afi_safi_defaults/README.md index 10037d7171c..b89367d3fa2 100644 --- a/feature/bgp/otg_tests/bgp_afi_safi_defaults/README.md +++ b/feature/bgp/otg_tests/bgp_afi_safi_defaults/README.md @@ -30,7 +30,7 @@ BGP AFI SAFI OC DEFAULTS TEST "IPv6-unicast enabled" boolean is left to OC default for the IPv4 peer". * Ensure that only IPv6-Unicast enabled boolean is made "true" for IPv6 neighbor. "IPv4-unicast enabled" boolean is left to OC default for the IPv6 peer". - * Ensure that there are no AFI-SAFI configurations at the global and peer-group levels. + * Ensure that there are no AFI-SAFI configurations at peer-group levels. * On the ATE side ensure that IPv4-unicast and IPv6-unicast AFI-SAFI are enabled==true for IPv4 and IPv6 neighbors. * Ensure that there is extended-next-hop encoding feature is configured via OC path and the @@ -46,7 +46,7 @@ BGP AFI SAFI OC DEFAULTS TEST * Configuration at the neighbor level is same as in [Test case-1] except for IPv4-unicast and IPv6-unicast being enabled at the peer-group level - * No configuration should be made at the global AFI-SAFI level + * No configuration should be made at the neighbor AFI-SAFI level * Verification: * For IPv4 neighbor, ensure that the IPv4 neighborship is up and both IPv4-unicast and @@ -78,7 +78,6 @@ BGP AFI SAFI OC DEFAULTS TEST * For IPv6 neighbor ensure that the IPv6 neighborship is not ESTABLISHED and IPv6-unicast capabilities are set to FALSE. - ## OpenConfig Path and RPC Coverage The below yaml defines the OC paths intended to be covered by this test. OC paths used for test setup are not listed here. diff --git a/feature/bgp/otg_tests/bgp_afi_safi_defaults/bgp_afi_safi_defaults_test.go b/feature/bgp/otg_tests/bgp_afi_safi_defaults/bgp_afi_safi_defaults_test.go index 77d1a362bc5..948ddf3157b 100644 --- a/feature/bgp/otg_tests/bgp_afi_safi_defaults/bgp_afi_safi_defaults_test.go +++ b/feature/bgp/otg_tests/bgp_afi_safi_defaults/bgp_afi_safi_defaults_test.go @@ -166,8 +166,10 @@ func bgpCreateNbr(t *testing.T, localAs, peerAs uint32, dut *ondatra.DUTDevice, case globalLevel: if nbr.isV4 == true { global.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).Enabled = ygot.Bool(true) + nv4.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).Enabled = ygot.Bool(true) } else { global.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST).Enabled = ygot.Bool(true) + nv4.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST).Enabled = ygot.Bool(true) } if !isV4Only { if !deviations.BGPGlobalExtendedNextHopEncodingUnsupported(dut) { From aecebfef4795c1f8296c73f442c9b1ad4df41bb5 Mon Sep 17 00:00:00 2001 From: dipchauh <159579776+dipchauh@users.noreply.github.com> Date: Fri, 21 Feb 2025 04:09:42 -0500 Subject: [PATCH 4/9] Fix empty banner test (#3753) "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." --- .../system_banner_test/system_banner_test.go | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/feature/system/system_base_test/tests/system_banner_test/system_banner_test.go b/feature/system/system_base_test/tests/system_banner_test/system_banner_test.go index fdd39700e17..28b3a6ae0c7 100644 --- a/feature/system/system_base_test/tests/system_banner_test/system_banner_test.go +++ b/feature/system/system_base_test/tests/system_banner_test/system_banner_test.go @@ -57,10 +57,8 @@ func TestMotdBanner(t *testing.T) { t.Run("Get MOTD Config", func(t *testing.T) { if testCase.banner == "" { - if gnmi.LookupConfig(t, dut, config.Config()).IsPresent() { + if v, ok := gnmi.LookupConfig(t, dut, config.Config()).Val(); ok && v != "" { t.Errorf("MOTD Banner not empty") - } else { - t.Logf("No response for the path is expected as the config is empty") } } else { configGot := gnmi.Get(t, dut, config.Config()) @@ -73,10 +71,8 @@ func TestMotdBanner(t *testing.T) { t.Run("Get MOTD Telemetry", func(t *testing.T) { if testCase.banner == "" { - if gnmi.LookupConfig(t, dut, config.Config()).IsPresent() { + if v, ok := gnmi.Lookup(t, dut, state.State()).Val(); ok && v != "" { t.Errorf("MOTD Telemetry Banner not empty") - } else { - t.Logf("No response for the path is expected as the config is empty") } } else { stateGot := gnmi.Get(t, dut, state.State()) @@ -124,10 +120,8 @@ func TestLoginBanner(t *testing.T) { t.Run("Get Login Banner Config", func(t *testing.T) { if testCase.banner == "" { - if gnmi.LookupConfig(t, dut, config.Config()).IsPresent() { + if v, ok := gnmi.LookupConfig(t, dut, config.Config()).Val(); ok && v != "" { t.Errorf("Config Login Banner not empty") - } else { - t.Logf("No response for the path expected is expected as the config is empty") } } else { configGot := gnmi.Get(t, dut, config.Config()) @@ -140,10 +134,8 @@ func TestLoginBanner(t *testing.T) { t.Run("Get Login Banner Telemetry", func(t *testing.T) { if testCase.banner == "" { - if gnmi.LookupConfig(t, dut, config.Config()).IsPresent() { + if v, ok := gnmi.Lookup(t, dut, state.State()).Val(); ok && v != "" { t.Errorf("Telemetry Login Banner not empty") - } else { - t.Logf("No response for the path is expected as the config is empty") } } else { stateGot := gnmi.Get(t, dut, state.State()) From 79a1a1961fed5a5275799239eab8a1df747425ab Mon Sep 17 00:00:00 2001 From: Brandon Stoll Date: Fri, 21 Feb 2025 13:41:53 -0800 Subject: [PATCH 5/9] Update the groups who can authorize CI executions. (#3841) --- tools/ci-trigger/config.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/ci-trigger/config.go b/tools/ci-trigger/config.go index 3ab5af1e244..9061579e951 100644 --- a/tools/ci-trigger/config.go +++ b/tools/ci-trigger/config.go @@ -58,8 +58,7 @@ const ( // authorizedTeams is the list of GitHub organization teams authorized to launch Cloud Build jobs. var authorizedTeams = []string{ - "featureprofiles-maintainers", - "featureprofiles-quattro-tl", + "featureprofiles-writers", } // triggerKeywords is the list of authorized keywords to launch a test. The From dee7e7d8b80245ae1551a296d5beaf85f931b380 Mon Sep 17 00:00:00 2001 From: Brandon Stoll Date: Fri, 21 Feb 2025 15:37:05 -0800 Subject: [PATCH 6/9] Update ci-trigger to build using latest golang 1.x (#3842) --- tools/ci-trigger/cloudbuild.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ci-trigger/cloudbuild.yaml b/tools/ci-trigger/cloudbuild.yaml index 41819d1663c..ac742d7d964 100644 --- a/tools/ci-trigger/cloudbuild.yaml +++ b/tools/ci-trigger/cloudbuild.yaml @@ -1,5 +1,5 @@ steps: - - name: golang:1.21 + - name: golang:1 entrypoint: /bin/bash args: [ '-c', 'go test -timeout 5m -v github.com/openconfig/featureprofiles/tools/ci-trigger/...'] - name: 'gcr.io/cloud-builders/docker' From 19e5b85a682e0c053def77ffe7a80be155420523 Mon Sep 17 00:00:00 2001 From: Brandon Stoll Date: Fri, 21 Feb 2025 18:17:01 -0800 Subject: [PATCH 7/9] Update ci-trigger's Dockerfile to use newest go1.x (#3843) --- tools/ci-trigger/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/ci-trigger/Dockerfile b/tools/ci-trigger/Dockerfile index 9ef4a65f0c2..58d6abdd93e 100644 --- a/tools/ci-trigger/Dockerfile +++ b/tools/ci-trigger/Dockerfile @@ -1,8 +1,8 @@ -FROM golang:1.21 as builder +FROM golang:1 as builder WORKDIR /app COPY . /app/ RUN CGO_ENABLED=0 GOOS=linux go build -mod=readonly -v -o server github.com/openconfig/featureprofiles/tools/ci-trigger -FROM golang:1.21-alpine +FROM golang:1-alpine COPY --from=builder /app/server /server ENTRYPOINT ["/server"] CMD ["-alsologtostderr"] From 4b5f9e7be88eb6d8fbe6a343db9dcbdcd45a0f05 Mon Sep 17 00:00:00 2001 From: Ram Date: Mon, 24 Feb 2025 10:18:30 +0530 Subject: [PATCH 8/9] fixing ipv4_entry_test (#3836) --- .../ipv4_entry_test/ipv4_entry_test.go | 29 +++++++++++++++---- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/feature/gribi/otg_tests/ipv4_entry_test/ipv4_entry_test.go b/feature/gribi/otg_tests/ipv4_entry_test/ipv4_entry_test.go index 7b44b9d500d..2dcf9965d41 100644 --- a/feature/gribi/otg_tests/ipv4_entry_test/ipv4_entry_test.go +++ b/feature/gribi/otg_tests/ipv4_entry_test/ipv4_entry_test.go @@ -117,10 +117,12 @@ func TestMain(m *testing.M) { func staticARPWithMagicUniversalIP(t *testing.T, dut *ondatra.DUTDevice) { t.Helper() + dummyIPCIDR1 := nh1IpAddr + "/32" + dummyIPCIDR2 := nh2IpAddr + "/32" p2 := dut.Port(t, "port2") p3 := dut.Port(t, "port3") s2 := &oc.NetworkInstance_Protocol_Static{ - Prefix: ygot.String(nh1IpAddr + "/32"), + Prefix: ygot.String(dummyIPCIDR1), NextHop: map[string]*oc.NetworkInstance_Protocol_Static_NextHop{ strconv.Itoa(nh1ID): { Index: ygot.String(strconv.Itoa(nh1ID)), @@ -131,7 +133,7 @@ func staticARPWithMagicUniversalIP(t *testing.T, dut *ondatra.DUTDevice) { }, } s3 := &oc.NetworkInstance_Protocol_Static{ - Prefix: ygot.String(nh2IpAddr + "/32"), + Prefix: ygot.String(dummyIPCIDR2), NextHop: map[string]*oc.NetworkInstance_Protocol_Static_NextHop{ strconv.Itoa(nh2ID): { Index: ygot.String(strconv.Itoa(nh2ID)), @@ -141,9 +143,24 @@ func staticARPWithMagicUniversalIP(t *testing.T, dut *ondatra.DUTDevice) { }, }, } + static1 := &oc.NetworkInstance_Protocol{ + Identifier: oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_STATIC, + Name: ygot.String(deviations.StaticProtocolName(dut)), + Static: map[string]*oc.NetworkInstance_Protocol_Static{ + dummyIPCIDR1: s2, + }, + } + static2 := &oc.NetworkInstance_Protocol{ + Identifier: oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_STATIC, + Name: ygot.String(deviations.StaticProtocolName(dut)), + Static: map[string]*oc.NetworkInstance_Protocol_Static{ + dummyIPCIDR2: s3, + }, + } + fptest.ConfigureDefaultNetworkInstance(t, dut) sp := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_STATIC, deviations.StaticProtocolName(dut)) - gnmi.Replace(t, dut, sp.Static(nh1IpAddr+"/32").Config(), s2) - gnmi.Replace(t, dut, sp.Static(nh2IpAddr+"/32").Config(), s3) + gnmi.Update(t, dut, sp.Config(), static1) + gnmi.Update(t, dut, sp.Config(), static2) gnmi.Update(t, dut, gnmi.OC().Interface(p2.Name()).Config(), configStaticArp(p2, nh1IpAddr, staticDstMAC)) gnmi.Update(t, dut, gnmi.OC().Interface(p3.Name()).Config(), configStaticArp(p3, nh2IpAddr, staticDstMAC)) } @@ -349,7 +366,7 @@ func TestIPv4Entry(t *testing.T) { if tc.gribiMACOverrideWithStaticARPStaticRoute { staticARPWithMagicUniversalIP(t, dut) } else if tc.gribiMACOverrideWithStaticARP { - //Creating a Static ARP entry for staticDstMAC + // Creating a Static ARP entry for staticDstMAC d := gnmi.OC() p2 := dut.Port(t, "port2") p3 := dut.Port(t, "port3") @@ -359,7 +376,7 @@ func TestIPv4Entry(t *testing.T) { gnmi.Update(t, dut, d.Interface(p3.Name()).Config(), configStaticArp(p3, nh2IpAddr, staticDstMAC)) } if tc.gribiMACOverrideWithStaticARP || tc.gribiMACOverrideWithStaticARPStaticRoute { - //Programming a gRIBI flow with above IP/mac-address as the next-hop entry + // Programming a gRIBI flow with above IP/mac-address as the next-hop entry tc.entries = []fluent.GRIBIEntry{ fluent.NextHopEntry().WithNetworkInstance(deviations.DefaultNetworkInstance(dut)). WithIndex(nh1ID).WithInterfaceRef(dut.Port(t, "port2").Name()).WithIPAddress(nh1IpAddr).WithMacAddress(staticDstMAC), From d8f764e2ef2b862d71d8d3275016cc06615dd2f1 Mon Sep 17 00:00:00 2001 From: Ram Date: Mon, 24 Feb 2025 11:14:57 +0530 Subject: [PATCH 9/9] fix bgp_tcp_mss_path_mtu_test for issue with address family initialization (#3837) --- .../otg_tests/bgp_tcp_mss_path_mtu/bgp_tcp_mss_path_mtu_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/feature/bgp/otg_tests/bgp_tcp_mss_path_mtu/bgp_tcp_mss_path_mtu_test.go b/feature/bgp/otg_tests/bgp_tcp_mss_path_mtu/bgp_tcp_mss_path_mtu_test.go index 468f7480fdb..58975462e5f 100644 --- a/feature/bgp/otg_tests/bgp_tcp_mss_path_mtu/bgp_tcp_mss_path_mtu_test.go +++ b/feature/bgp/otg_tests/bgp_tcp_mss_path_mtu/bgp_tcp_mss_path_mtu_test.go @@ -118,6 +118,8 @@ func bgpCreateNbr(t *testing.T, dut *ondatra.DUTDevice, authPwd, routerID string global := bgp.GetOrCreateGlobal() global.RouterId = ygot.String(routerID) global.As = ygot.Uint32(localAs) + global.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).Enabled = ygot.Bool(true) + global.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST).Enabled = ygot.Bool(true) pg1 := bgp.GetOrCreatePeerGroup(peerGrpName1) pg1.PeerAs = ygot.Uint32(ateAS1)