From 70ab01dbba7dbf4fc5d5af0c222a39024842ddac Mon Sep 17 00:00:00 2001 From: Marc Charlebois <105758144+MarcCharlebois@users.noreply.github.com> Date: Tue, 5 Mar 2024 22:57:01 -0800 Subject: [PATCH] RT-5.2 fix for case-insensitive check for partnerid/systemid (#2664) Precedent for this case is: https://github.com/openconfig/featureprofiles/blob/main/feature/interface/staticarp/otg_tests/static_arp_test/static_arp_test.go#L286 "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." --- .../aggregate/otg_tests/aggregate_test/aggregate_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/feature/interface/aggregate/otg_tests/aggregate_test/aggregate_test.go b/feature/interface/aggregate/otg_tests/aggregate_test/aggregate_test.go index 61367b17ef0..51f9f345db9 100644 --- a/feature/interface/aggregate/otg_tests/aggregate_test/aggregate_test.go +++ b/feature/interface/aggregate/otg_tests/aggregate_test/aggregate_test.go @@ -21,6 +21,7 @@ import ( "net" "sort" "strconv" + "strings" "testing" "time" @@ -394,11 +395,11 @@ func (tc *testCase) verifyLACPTelemetry(t *testing.T) { t.Errorf("DUT LAG %s: ATE partner-key (%d) did not match DUT oper-key (%d)", tc.aggID, ateLACP.PartnerKey, dutLACP.OperKey) } - if ateLACP.PartnerId == nil || dutLACP.SystemId == nil || *ateLACP.PartnerId != *dutLACP.SystemId { + if ateLACP.PartnerId == nil || dutLACP.SystemId == nil || !strings.EqualFold(*ateLACP.PartnerId, *dutLACP.SystemId) { t.Errorf("DUT LAG %s: ATE partner-id (%s) did not match DUT system-id (%s)", tc.aggID, *ateLACP.PartnerId, *dutLACP.SystemId) } - if dutLACP.PartnerId == nil || ateLACP.SystemId == nil || *dutLACP.PartnerId != *ateLACP.SystemId { + if dutLACP.PartnerId == nil || ateLACP.SystemId == nil || !strings.EqualFold(*ateLACP.PartnerId, *dutLACP.SystemId) { t.Errorf("DUT LAG %s: ATE system-id (%s) did not match DUT partner-id (%s)", tc.aggID, *ateLACP.SystemId, *dutLACP.PartnerId) } }