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.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GCU] [MA] Adding support in existing tests - Common changes #15182
base: master
Are you sure you want to change the base?
[GCU] [MA] Adding support in existing tests - Common changes #15182
Changes from all commits
f9c2905
4289bbc
2947290
77aaf0c
c311296
1802727
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do have checkpoint and rollback cli.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code was already available as part of setup fixtures in the GCU test suites.
The main change introduced by this PR is moving the code into a separate function to avoid code duplication, as it is used by multiple setup module fixtures. Additionally, support has been added to save backup files for different namespaces on multi-ASIC platforms.
Most GCU setup module fixtures create a checkpoint and save backup configuration JSON files before the test (this block of code), then roll back to the checkpoint afterward. If the rollback fails, these backup files are used to reload the configdb.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand the code could be existing in old implementation, but my point is that we should leverage the checkpoint and rollback feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no 202211, 202305, 202311. We will start support from 202405.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two functions are identical.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, they could potentially use different duthost types.
rand_asic_namespace
can use any type of duthost, whilerand_front_end_asic_namespace
requires only front-end duthosts. This separation was necessary because some features run only on front-end duthosts in a multi-ASIC T2 platform and are not applicable to supervisor cards. Test suites are adapted accordingly based on their requirements to select the appropriate fixture, depending on when the feature is valid.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, although these two functions execute differently, the code is indeed duplicated. I will work on a solution to keep a single common function that adapts based on the availability of the two duthost fixtures.