-
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
[PR:14926] Configuring Community SNMP Credentials for SNMP TCs #15359
Conversation
Description of PR Summary: The PR contains changes to snmp/conftest.py with logic to configure snmp credentials stored in snmp.yml for every host before running any test script. Approach What is the motivation for this PR? If credentials in snmp.yml isn't configured, then the changes in PR configures them before running the tests and restores the original configuration after the TC execution. How did you do it? snmp/conftest.py will now copy the snmp.yml from DUT to UCS (if DUT has snmp.yml) & then it will configure the SNMP credentials for every host via sudo config snmp command. The logic it configures is same as in snmp_yml_to_configdb.py script; where it checks whether the credentials in yml are configured in config_db or not, if the keys are configured but the values are different / the keys are not configured - then it will configure them. Before the test script execution, SNMP is configured, once the execution completes, it reverts the configuration that existed before. How did you verify/test it? Run changes with 202405 image on a T0 setup without snmp credentials configured / with different credentials configured in image and snmp tests passed as expected in all scenarios. co-authorized by: [email protected]
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.
LGTM
Hi @agadia-cisco , test is reporting error, more than one yield in a fixture. |
@vperumal for viz |
PR #15529 will fix the issue. |
Approach What is the motivation for this PR? #15359 has introduced a "yield" statement inside the for loop of duthosts which is causing fixture teardown to fail with Failed: fixture function has more than one 'yield' message. How did you do it? Move "yield" statement out of this for loop of duthosts and do config rollback in a seperate for loop of duthosts. How did you verify/test it? Ran tests under snmp folder and tests are passing on Arista-7260CX3-D108C8 platform. Any platform specific information?
this cause regression, and fixed in https://github.com/sonic-net/sonic-mgmt/pull/15359/files |
Approach What is the motivation for this PR? sonic-net#15359 has introduced a "yield" statement inside the for loop of duthosts which is causing fixture teardown to fail with Failed: fixture function has more than one 'yield' message. How did you do it? Move "yield" statement out of this for loop of duthosts and do config rollback in a seperate for loop of duthosts. How did you verify/test it? Ran tests under snmp folder and tests are passing on Arista-7260CX3-D108C8 platform. Any platform specific information?
Approach What is the motivation for this PR? #15359 has introduced a "yield" statement inside the for loop of duthosts which is causing fixture teardown to fail with Failed: fixture function has more than one 'yield' message. How did you do it? Move "yield" statement out of this for loop of duthosts and do config rollback in a seperate for loop of duthosts. How did you verify/test it? Ran tests under snmp folder and tests are passing on Arista-7260CX3-D108C8 platform. Any platform specific information?
Approach What is the motivation for this PR? sonic-net#15359 has introduced a "yield" statement inside the for loop of duthosts which is causing fixture teardown to fail with Failed: fixture function has more than one 'yield' message. How did you do it? Move "yield" statement out of this for loop of duthosts and do config rollback in a seperate for loop of duthosts. How did you verify/test it? Ran tests under snmp folder and tests are passing on Arista-7260CX3-D108C8 platform. Any platform specific information?
Approach What is the motivation for this PR? sonic-net#15359 has introduced a "yield" statement inside the for loop of duthosts which is causing fixture teardown to fail with Failed: fixture function has more than one 'yield' message. How did you do it? Move "yield" statement out of this for loop of duthosts and do config rollback in a seperate for loop of duthosts. How did you verify/test it? Ran tests under snmp folder and tests are passing on Arista-7260CX3-D108C8 platform. Any platform specific information?
Description of PR
Summary: The PR contains changes to
snmp/conftest.py
with logic to configuresnmp
credentials stored insnmp.yml
for every host before running any test script.Fixes # (issue)
Type of change
Back port request
Approach
What is the motivation for this PR?
If credentials in
snmp.yml
isn't configured, then the changes in PR configures them before running the tests and restores the original configuration after the TC execution.How did you do it?
snmp/conftest.py
will now copy thesnmp.yml
from DUT to UCS (if DUT hassnmp.yml
) & then it will configure the SNMP credentials for every host viasudo config snmp
command. The logic it configures is same as insnmp_yml_to_configdb.py
script; where it checks whether the credentials in yml are configured inconfig_db
or not, if the keys are configured but the values are different / the keys are not configured - then it will configure them. Before the test script execution, SNMP is configured, once the execution completes, it reverts the configuration that existed before.How did you verify/test it?
202405
image on a T0 setup withoutsnmp
credentials configured / with different credentials configured in image andsnmp
tests passed as expected in all scenarios.