From 55b08c49126febb12741a31b2f399c476ac27fa8 Mon Sep 17 00:00:00 2001 From: Ram Date: Tue, 5 Nov 2024 17:05:54 +0530 Subject: [PATCH] fix leaf constraint error and address family initialisation error (#3558) --- .../bgp_afi_safi_defaults/bgp_afi_safi_defaults_test.go | 7 +++++++ 1 file changed, 7 insertions(+) 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 568d9060182..899d897e164 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 @@ -134,6 +134,8 @@ func bgpCreateNbr(t *testing.T, localAs, peerAs uint32, dut *ondatra.DUTDevice, global := bgp.GetOrCreateGlobal() global.RouterId = ygot.String(dutPort2.IPv4) global.As = ygot.Uint32(localAs) + global.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).Enabled = ygot.Bool(true) + global.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST).Enabled = ygot.Bool(true) // Note: we have to define the peer group even if we aren't setting any policy because it's // invalid OC for the neighbor to be part of a peer group that doesn't exist. @@ -402,6 +404,11 @@ func TestAfiSafiOcDefaults(t *testing.T) { t.Run("Configure DEFAULT network instance", func(t *testing.T) { dutConfNIPath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)) + name := deviations.DefaultNetworkInstance(dut) + c := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)) + gnmi.Update(t, dut, c.Config(), &oc.NetworkInstance{ + Name: ygot.String(name), + }) gnmi.Replace(t, dut, dutConfNIPath.Type().Config(), oc.NetworkInstanceTypes_NETWORK_INSTANCE_TYPE_DEFAULT_INSTANCE) })