Tahansb800bc: fix the agent hw Mirroring test cases test IP address #714
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.
Pre-submission checklist
pip install -r requirements-dev.txt && pre-commit installpre-commit runSummary
When running the AgentMirroringTest related cases on the santa barbara (tahansb800bc), observed a consistent test failures like this:
Root Cause Analysis
When the agent test is configured for 400G mode, the test framework automatically creates over 200 L3 interfaces and assigns IP addresses to them (e.g., 1.0.0.1/24, 2.0.0.1/24, ..., 201.0.0.1/24,...):
The AgentMirroringTest sends test packets to a destination IP of 201.0.0.x, assuming this traffic will be forwarded via the default route (0.0.0.0/0). However, due to the interface setup described above, a more specific route (201.0.0.0/24) exists in the routing table:
This output clearly shows that traffic destined for the 201.0.0.0/24 network will be routed via 201.0.0.1, not the default route's next-hop 1.0.0.2.
Also, the test code only creates the neighbor entries for the next-hops it expects to use, which are the default route's next-hop (1.0.0.2) and the mirror destination's next-hop (2.0.0.3). It does not create the neighbor for the actual next-hop (201.0.0.1) that the packet is routed to. The logs confirm that only the expected, but incorrect, neighbors are added:
When the hardware ASIC receives the packet for forwarding, it performs the L3 lookup and correctly determines that the packet should be sent to the next-hop 201.0.0.1. However, when it performs the L2 lookup to find the destination MAC address for this next-hop, it fails because the neighbor was never resolved. So the hardware cannot forward the packet. As a result, it traps the packet to the CPU as an exception. This is confirmed by the CPU port counters in drivshell:
Solution
Change the test IP address to another one, like 201.201.0.10, etc.
Also fixed the IPv6 address since it has similar issue.
Also fixed the AgentL4PortBlackholingTests and AgentRouteTests cases.
Test Plan
Full log put in Gdrive
config file running agent hw test in Gdrive