Run test_announce_routes.py only with add-topo#2741
Run test_announce_routes.py only with add-topo#2741wangxin merged 3 commits intosonic-net:masterfrom wangxin:add-topo-ann-routes
Conversation
ansible/testbed-cli.sh
Outdated
There was a problem hiding this comment.
run_test.sh will set some environment variable, including ANSIBLE_CONFIG, ANSIBLE_LIBRARY and ANSIBLE_CONNECTION_PLUGINS. Can we run pytest without these variables?
There was a problem hiding this comment.
we need to set ANSIBLE_CONFIG for sure. I encountered failure recently when running pytest directly
There was a problem hiding this comment.
Good catch! Thanks!
My sonic-mgmt used for testing already has these environment variables exported. That's why the issue was not caught in my testing. Indeed I noticed another issue, currently it only works for VS setup. The reason is that the inventory file used for VS setup veos_vtb has host information of PTF. For physical test setups, the veos file does not have PTF host information, the script would fail. I need to figure out how to make it work for physical test setups as well.
There was a problem hiding this comment.
Updated this PR with a new approach. Updated PR description.
|
This pull request introduces 2 alerts when merging 78ae80f41090df9ef262a07026f099dec0a1dd2b into 6feb19a - view on LGTM.com new alerts:
|
|
This pull request introduces 2 alerts when merging dabda62d720f6ade76c9dc33c5a1e32f9a9ec78e into 6feb19a - view on LGTM.com new alerts:
|
|
This pull request introduces 1 alert when merging b75dde2a32865b7c76aaf40ce982bb4cdaaf45b7 into 6feb19a - view on LGTM.com new alerts:
|
|
This pull request introduces 1 alert when merging 9b7a104053d5cdcd5f7c33ef563e4f7d18a6c2b3 into 6feb19a - view on LGTM.com new alerts:
|
|
This pull request introduces 1 alert when merging 23a94db49b3f616835c5cf239ae84136fbf581dc into 6feb19a - view on LGTM.com new alerts:
|
|
@neethajohn @bingwang-ms Can you check again? |
|
Is there a way to keep the route announce code at one place? I am thinking the pytest test_announce_route.py invokes fib plug to announce route. That code is very similar to what you added. Can you refactor the code to a single place, you can use symbolic link if have to. Just so that we won't have these 2 chunk of code out of sync. |
Although the test_announce_routes.py script is always executed by the run_tests.sh tool while preparing DUT, not every vendor uses run_tests.sh to trigger testing. People usually forget to run test_announce_routes.py after a new topology is deployed. Since announcing routes just need to be executed once after a new topology is deployed, life could be a little bit easier if we announce routes together with add-topo. Changes in this PR: * Added new ansible module `announce_routes.py` for announcing routes. * Added new playbook `announce_routes.yml` for starting exabgp processes on PTF and call the announce_routes module. * Updated the add-topo.yml to run the new playbook. * Removed the fib at tests/common/plugins/fib.py * Removed the tests/test_announce_routes.py script * The tests/decap/test_decap.py script was dependent on the fib plugin. Updated this test to generate fib_info file from redis DB information. * Updated the IP_decap_test.py script not to test all the FIB entries to limit test execution time. Signed-off-by: Xin Wang <xiwang5@microsoft.com>
|
I have deprecated the fib plugin. Now there is no code duplication. |
|
This pull request fixes 2 alerts when merging 890f45c into 7abdb38 - view on LGTM.com fixed alerts:
|
|
|
||
| when: | ||
| - ptf_host_user is defined | ||
| - ptf_host_pass is defined |
There was a problem hiding this comment.
Why do we need this check?
when:
- ptf_host_user is defined
- ptf_host_pass is defined
There was a problem hiding this comment.
Indeed it is unnecessary. I'll remove this check.
|
This pull request fixes 2 alerts when merging b65b5d8 into 42ca406 - view on LGTM.com fixed alerts:
|
In PR #2741, the fib plugin for announcing routes have been deprecated. Announcing routes is done together with add-topo. The test_dir_bcast.py script dependent on the fib plugin was missed in PR #2741. Since the routes have already been announced during add-topo, there is no need to do that for test_dir_bcast.py again. To fix the issue, we can simply removes the dependency of the fib plugin for test_dir_bcast.py. Signed-off-by: Xin Wang <xiwang5@microsoft.com>
In PR #2741, test script for announcing IP routes to PTF docker container was deprecated. The function of announcing IP routes is moved to 'testbed-cli.sh add-topo'. Then we do not need to run the test script to announce IP routes after a new topology is deployed. However, there are still occasions that people may want to re-announce the IP routes to PTF docker containers. Because announcing routes is part of add-topo, then the only possible way to re-announce routes is to run 'testbed-cli.sh remove-topo' and 'testbed-cli.sh add-topo'. This is inconvenient and time consuming. This change added a new 'announce-routes' sub-command to the testbed-cli.sh tool. We can now just re-announce IP routes using command like below: ./testbed-cli.sh -t vtestbed.csv vms-kvm-t0 password.txt Other changes: * Corrected the inv_name field in vtestbed.csv file. * Moved the 'announce_routes.py' module from ansible/roles/vm_set/library to ansible/library Signed-off-by: Xin Wang <xiwang5@microsoft.com>
…net#14309) Why I did it src/sonic-dbsyncd * 4dcfb61 - (HEAD -> 202205, origin/202205) Handled the error case of negative age (sonic-net#57) (2 days ago) [Vivek] src/sonic-swss * 142abdf - (HEAD -> 202205, origin/202205) swss: Fix egress queue counters in voq systems. (sonic-net#2705) (2 days ago) [Sambath Kumar Balasubramanian] src/sonic-utilities * 42a57f4c - (HEAD -> 202205, origin/202205) [202205] Update the ref guide to reflect the vlan brief output (sonic-net#2741) (2 days ago) [Vivek]
Description of PR
Summary:
Fixes # (issue)
Type of change
Approach
What is the motivation for this PR?
Although the test_announce_routes.py script is always executed by the run_tests.sh
tool while preparing DUT, not every vendor uses run_tests.sh to trigger testing.
People usually forget to run test_announce_routes.py after a new topology is
deployed. Since announcing routes just need to be executed once after a new topology
is deployed, life could be a little bit easier if we announce routes together with
add-topo.
How did you do it?
Changes in this PR:
announce_routes.pyfor announcing routes.announce_routes.ymlfor starting exabgp processes on PTF andcall the announce_routes module.
to generate fib_info file from redis DB information.
test execution time.
How did you verify/test it?
Test run remove-topo and add-topo on both VS setup and physical setup.
Test run run_tests.sh.
Test run tests/decap/test_decap.py
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation