[fib] Fix incorrect prefix/nh list generation for single_asic device #3352
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.
Description of PR
Summary:
Fixes test_basic_fib failing due to incorrect fib_info generation on single_asic devices.
Type of change
Approach
What is the motivation for this PR?
PR 3214 introduced multi-asic support for fib test.
test_basic_fib fails on single-asic devices with the following error:
"AssertionError: Received expected packet on port 13 for device 0, but it should have arrived on one of these ports: [28, 29, 30, 31].
This occurs due to prefixes for directly connected subnets not being added to fib_info_file.
E.g. we have following entry on DUT:
Previously, we added entry for
192.168.0.0/21
to fib_info with nexthop '[]' and skipped this range later during the test.Now this entry is skipped from the start and not added to fib_info.
This results in IP range for subnet 192.168.0.0/21 (or any other directly connected subnet) being considered a part of IP range for previous subnet:
Expected IP range:
Actual IP range:
How did you do it?
For single-asic devices, skipped prefixes are now added to fib_info file with nexthop '[]'.
How did you verify/test it?
Run test_basic_fib
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation