Skip to content

[tests]: Remove mirror destination route correctly#4786

Open
Xichen96 wants to merge 1 commit into
sonic-net:masterfrom
Xichen96:dev/xichenlin/mirror-route-cleanup
Open

[tests]: Remove mirror destination route correctly#4786
Xichen96 wants to merge 1 commit into
sonic-net:masterfrom
Xichen96:dev/xichenlin/mirror-route-cleanup

Conversation

@Xichen96

Copy link
Copy Markdown

What I did

Corrected test_MirrorDestMoveVlan cleanup to remove port_ip_prefix, the static route installed by the test, instead of attempting to remove the unrelated VLAN interface prefix.

Why I did it

The stale route keeps the Ethernet32 router interface referenced after the IPv4 case. The following IPv6 case can then inherit stale mirror-session state or fail interface recreation, especially when removal retry fencing is enabled.

How I verified it

PR CI only. The existing test covers both IPv4 and IPv6 paths and now removes the exact prefix each path installs.

Details if related

Observed while investigating repeated test_MirrorDestMoveVlan failures in #4746. This cleanup defect predates and is separate from that product change.

Delete the routed destination prefix installed by the test so the Ethernet32 router interface is no longer retained across IPv4 and IPv6 cases.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: b6b568a1-5d2a-4309-b1ac-ef21ca155079

Signed-off-by: Xichen96 <lukelin0907@gmail.com>
Copilot AI review requested due to automatic review settings July 23, 2026 17:57
@Xichen96
Xichen96 requested a review from prsunny as a code owner July 23, 2026 17:57
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Copilot AI left a comment

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.

Pull request overview

This PR fixes cleanup in the test_MirrorDestMoveVlan test so it deletes the exact static route the test installs (port_ip_prefix) rather than attempting to delete the VLAN interface’s connected prefix (vlan_intf_addr). This prevents stale route state from keeping the Ethernet32 router interface referenced across the IPv4→IPv6 subtest sequence.

Changes:

  • Update test_MirrorDestMoveVlan teardown to call remove_route(dvs, port_ip_prefix) (matching the earlier add_route(dvs, port_ip_prefix, ...)).

@Xichen96

Copy link
Copy Markdown
Author

Retrying CI once: build 1173115 ASAN compile hit the 60-minute agent limit, and regular vstest failed before pytest when host preflight sudo ip link del Vrf1 segfaulted (exit 139) on agent sonictest002E9A.

@Xichen96 Xichen96 closed this Jul 23, 2026
@Xichen96 Xichen96 reopened this Jul 23, 2026
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants