Skip to content

Revert "Fetch capability of mirror before configuring it"#4158

Closed
yxieca wants to merge 1 commit intomasterfrom
revert-4089-mirror_capability_check
Closed

Revert "Fetch capability of mirror before configuring it"#4158
yxieca wants to merge 1 commit intomasterfrom
revert-4089-mirror_capability_check

Conversation

@yxieca
Copy link
Copy Markdown
Contributor

@yxieca yxieca commented Dec 14, 2025

Reverts #4089

Copilot AI review requested due to automatic review settings December 14, 2025 01:01
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 reverts PR #4089 which added capability checking for mirror sessions before configuration. The revert removes the ASIC capability validation that was previously introduced to check if port mirror directions (ingress/egress) are supported by the hardware.

Key changes:

  • Removes the is_port_mirror_capability_supported() function that queried STATE_DB for ASIC capabilities
  • Removes the capability check from validate_mirror_session_config() that prevented unsupported mirror directions
  • Removes two test functions that validated the capability checking functionality

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
config/main.py Removes is_port_mirror_capability_supported() function and its invocation in validate_mirror_session_config(), reverting to the previous validation logic
tests/config_mirror_session_test.py Removes test functions test_mirror_session_capability_checking() and test_mirror_session_capability_function() that tested the capability checking feature

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


mocked.assert_called_with("test_session", "100.1.1.1", "2.2.2.2", 8, 63, 0, 0, None)

Copy link

Copilot AI Dec 14, 2025

Choose a reason for hiding this comment

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

This line contains trailing whitespace that should be removed to maintain code cleanliness.

Suggested change

Copilot uses AI. Check for mistakes.
assert result.exit_code != 0
assert ERR_MSG_GRE_TYPE_FAILURE in result.stdout

Copy link

Copilot AI Dec 14, 2025

Choose a reason for hiding this comment

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

This line contains trailing whitespace that should be removed to maintain code cleanliness.

Copilot uses AI. Check for mistakes.
config.config.commands["mirror_session"].commands["span"].commands["add"],
["test_session", "Ethernet8", "Ethernet4", "tx", "100"])

Copy link

Copilot AI Dec 14, 2025

Choose a reason for hiding this comment

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

This line contains trailing whitespace that should be removed to maintain code cleanliness.

Suggested change

Copilot uses AI. Check for mistakes.
@yxieca yxieca closed this Dec 14, 2025
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