From f880c4b0e3df396f564f5f0f90d9591de90e7c41 Mon Sep 17 00:00:00 2001 From: cprabha Date: Fri, 12 Jul 2024 02:40:50 -0700 Subject: [PATCH 1/4] added ipv6 neighbor check --- .../otg_tests/defaults_test/defaults_test.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/feature/networkinstance/otg_tests/defaults_test/defaults_test.go b/feature/networkinstance/otg_tests/defaults_test/defaults_test.go index 9c1aa24c511..0595dd10fe5 100644 --- a/feature/networkinstance/otg_tests/defaults_test/defaults_test.go +++ b/feature/networkinstance/otg_tests/defaults_test/defaults_test.go @@ -29,6 +29,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" ) @@ -103,6 +104,7 @@ var ( IPv6Len: 64, MAC: "02:00:02:01:01:01", } + lossTolerancePct = 2.0 ) // TestDefaultAddressFamilies verifies that both IPv4 and IPv6 are enabled by default without a need for additional @@ -181,6 +183,16 @@ func TestDefaultAddressFamilies(t *testing.T) { otgutils.WaitForARP(t, ate.OTG(), top, "IPv4") otgutils.WaitForARP(t, ate.OTG(), top, "IPv6") + intfNbrPath := gnmi.OC().Interface(dutP2.Name()).Subinterface(0).Ipv6().Neighbor(atePort2.IPv6) + _, ok := gnmi.Watch(t, dut, intfNbrPath.LinkLayerAddress().State(), 5*time.Minute, func(val *ygnmi.Value[string]) bool { + _, ok := val.Val() + return ok + }).Await(t) + + if !ok { + t.Log("IPv6 neighbor resolution failed") + } + ate.OTG().StartTraffic(t) time.Sleep(15 * time.Second) ate.OTG().StopTraffic(t) @@ -198,7 +210,7 @@ func TestDefaultAddressFamilies(t *testing.T) { } loss := tx - rx lossPct := loss * 100 / tx - if got := lossPct; got > 0 { + if got := lossPct; got > float32(lossTolerancePct) { t.Errorf("LossPct for flow %s: got %v, want 0", flow, got) } } From 789b7176966dee6bdfdf3c0c1b0dc81582b3d70c Mon Sep 17 00:00:00 2001 From: cprabha Date: Wed, 28 Aug 2024 12:39:58 -0700 Subject: [PATCH 2/4] Update defaults_test.go --- .../networkinstance/otg_tests/defaults_test/defaults_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feature/networkinstance/otg_tests/defaults_test/defaults_test.go b/feature/networkinstance/otg_tests/defaults_test/defaults_test.go index 0595dd10fe5..5ec9b910549 100644 --- a/feature/networkinstance/otg_tests/defaults_test/defaults_test.go +++ b/feature/networkinstance/otg_tests/defaults_test/defaults_test.go @@ -190,7 +190,7 @@ func TestDefaultAddressFamilies(t *testing.T) { }).Await(t) if !ok { - t.Log("IPv6 neighbor resolution failed") + t.Fatal("IPv6 neighbor resolution failed") } ate.OTG().StartTraffic(t) From 533d4e5f783cafbf92013034f11ddfd3a311c7af Mon Sep 17 00:00:00 2001 From: cprabha Date: Mon, 14 Oct 2024 11:51:49 -0700 Subject: [PATCH 3/4] updating to check kne platform --- .../otg_tests/defaults_test/defaults_test.go | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/feature/networkinstance/otg_tests/defaults_test/defaults_test.go b/feature/networkinstance/otg_tests/defaults_test/defaults_test.go index 5ec9b910549..65aa87e6800 100644 --- a/feature/networkinstance/otg_tests/defaults_test/defaults_test.go +++ b/feature/networkinstance/otg_tests/defaults_test/defaults_test.go @@ -18,6 +18,7 @@ package ni_address_families_test import ( "fmt" + "slices" "testing" "time" @@ -29,7 +30,6 @@ 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" ) @@ -104,7 +104,8 @@ var ( IPv6Len: 64, MAC: "02:00:02:01:01:01", } - lossTolerancePct = 2.0 + lossTolerancePct = 2.0 + kneDeviceModelList = []string{"ncptx"} ) // TestDefaultAddressFamilies verifies that both IPv4 and IPv6 are enabled by default without a need for additional @@ -183,14 +184,12 @@ func TestDefaultAddressFamilies(t *testing.T) { otgutils.WaitForARP(t, ate.OTG(), top, "IPv4") otgutils.WaitForARP(t, ate.OTG(), top, "IPv6") - intfNbrPath := gnmi.OC().Interface(dutP2.Name()).Subinterface(0).Ipv6().Neighbor(atePort2.IPv6) - _, ok := gnmi.Watch(t, dut, intfNbrPath.LinkLayerAddress().State(), 5*time.Minute, func(val *ygnmi.Value[string]) bool { - _, ok := val.Val() - return ok - }).Await(t) - - if !ok { - t.Fatal("IPv6 neighbor resolution failed") + // https://github.com/openconfig/featureprofiles/issues/3410 + // Below code will be removed once ixia issue is fixed. + if slices.Contains(kneDeviceModelList, dut.Model()) { + ate.OTG().StartTraffic(t) + time.Sleep(15 * time.Second) + ate.OTG().StopTraffic(t) } ate.OTG().StartTraffic(t) From 0badc8267b7ed3fc0f61e5f7a5ffb0d02910ac94 Mon Sep 17 00:00:00 2001 From: cprabha Date: Mon, 14 Oct 2024 11:59:03 -0700 Subject: [PATCH 4/4] Updating code for kne platform --- .../networkinstance/otg_tests/defaults_test/defaults_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/feature/networkinstance/otg_tests/defaults_test/defaults_test.go b/feature/networkinstance/otg_tests/defaults_test/defaults_test.go index 65aa87e6800..295eab9360c 100644 --- a/feature/networkinstance/otg_tests/defaults_test/defaults_test.go +++ b/feature/networkinstance/otg_tests/defaults_test/defaults_test.go @@ -104,7 +104,6 @@ var ( IPv6Len: 64, MAC: "02:00:02:01:01:01", } - lossTolerancePct = 2.0 kneDeviceModelList = []string{"ncptx"} ) @@ -209,7 +208,7 @@ func TestDefaultAddressFamilies(t *testing.T) { } loss := tx - rx lossPct := loss * 100 / tx - if got := lossPct; got > float32(lossTolerancePct) { + if got := lossPct; got > 0 { t.Errorf("LossPct for flow %s: got %v, want 0", flow, got) } }