-
Notifications
You must be signed in to change notification settings - Fork 741
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
Conversation
…le setup, compatible with both frontend and any type of DUT host test suites.
asic_namespace = random.choice(namespace_list) | ||
asic_index = duthost.get_asic_id_from_namespace(asic_namespace) | ||
|
||
return asic_namespace, asic_index |
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, while rand_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.
@@ -477,3 +480,53 @@ def expect_acl_rule_removed(duthost, rulename, setup): | |||
removed = len(output) == 0 | |||
|
|||
pytest_assert(removed, "'{}' showed a rule, this following rule should have been removed".format(cmds)) | |||
|
|||
|
|||
def save_backup_test_config(duthost, file_postfix="bkp"): |
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 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.
@xincunli-sonic Could you please review? |
conditions: | ||
- "'t2' in topo_name" | ||
- "('t2' in topo_name) and (release in ['201811', '201911', '202012', '202106', '202111'])" |
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.
Description of PR
This PR adds the common changes for adding Multi-ASIC support for generic config updater (GCU) in existing suites.
Original ticket #14070
Summary:
Fixes # (issue)
Type of change
Back port request
Approach
What is the motivation for this PR?
To add common test code so as to support Multi-ASIC testing in existing GCU suites.
How did you do it?
Two new fixtures where introduced that return random tuple of asic namespace, asic index.
How did you verify/test it?
Ran in vs-kvm-t0 testbed. Ran in t2 MA platform.
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation