Adding a new testcase to check if mac learning happens correctly #13912
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is the motivation for this PR?
When the DUT performs MAC Learning, a situation may arise such that even if the interface is shutdown, 'show mac' will show previously learnt MAC addresses on the 'Down' interfaces. These stale entries will persist even after doing 'sonic-clear fdb all'
This Testcase covers this scenario and makes sure that stale entries are removed
How did you do it?
Followed below steps to recreate the scenario
-shut down all ports
-config save
-config reload
-bring up 1 port. populate fdb
-bring up 3 more ports. populate fdb.
-shut down 3 ports added in last step
-verify that MAC entries connected to shutdown ports are gone from MAC table
-sonic-clear fdb all
-populate fdb for the UP port
-verify that the MAC entries connected to shutdown ports don't show up in the MAC table again
Type of change
-Test case(new)
Back port request
-202305
-202311
-202405
How did you verify/test it?
Tested on an Image which does not have a fix for this issue. Made sure that TC fails.
Tested on an Image with the fix. Made sure that TC passes.