Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ func TestRemoteSyslog(t *testing.T) {
t.Cleanup(func() {
gnmi.Delete(t, dut, gnmi.OC().Interface(p1.Name()).Config())
gnmi.Delete(t, dut, gnmi.OC().Interface(p2.Name()).Config())
gnmi.Delete(t, dut, gnmi.OC().Interface(lb).Config())
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Removing the deletion of the loopback interface (lb) from the cleanup function means that any configurations applied to it by configureDUTLoopback will persist after the test. This can lead to resource leaks and potential test flakiness or interference with other tests.

If lb is a system-critical interface that cannot be fully deleted, the configureDUTLoopback function should be modified to only apply incremental changes (e.g., adding specific IP addresses) and the cleanup should then explicitly revert only those specific changes, rather than attempting to replace or delete the entire interface configuration.

gnmi.Delete(t, dut, gnmi.OC().NetworkInstance(tc.vrf).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_STATIC, "DEFAULT").Static(v4Route+"/30").Config())
gnmi.Delete(t, dut, gnmi.OC().NetworkInstance(tc.vrf).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_STATIC, "DEFAULT").Static(v6Route+"/126").Config())
if tc.vrf != deviations.DefaultNetworkInstance(dut) {
Expand Down
Loading