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) { 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) 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), 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, 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 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()) 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"] 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' 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