[action] [PR:15297] Fix asic identification #15522
Merged
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
ASIC identification is (mostly) done by matching entire lines from the output of the lspci command. This is prone to failure over time, if the output lines change for whatever reason. A more robust approach is to match only those tokens which can
be considered reliable in identifying and distinguishing the ASICs, as opposed to matching whole lines of output. This change implements the token-based approach.
Additionally, this PR introduces the token matching for the TH4 and TH5 asics.
Summary:
Fixes # (issue)
Type of change
Back port request
Approach
What is the motivation for this PR?
test_everflow_per_interface.py
was failing due to misidentified asic (i.e. asic was "unknown"), causing the test to execute a different code path than intended.How did you do it?
Updated the matching logic to compare on the pertinent information returned from the lspci command, rather than entire portions of the returned lines.
How did you verify/test it?
Ran the
test_everflow_per_interface.py
against TH2, TH4, and TH5-based Arista DUTs and confirmed that the tests passed.