sonic-mgmt
sonic-mgmt copied to clipboard
Added support for running T2 applicable tests using vsonic(KVM) for n…
Description of PR
Added support for running T2 applicable tests using vsonic(KVM) for neighbors
Summary: Fixes # (issue)
Type of change
- [ ] Bug fix
- [ ] Testbed and Framework(new/improvement)
- [ x] Test case(new/improvement)
Back port request
- [ ] 201911
- [ ] 202012
Approach
What is the motivation for this PR?
To add support for vsonic/KVM commands on neighbors, as the commands are different from Eo
How did you do it?
-
Fix for test_lldp testcase: KVM neighbors do not advertise port ifname. They instead advertise 'descr'. We will use ifname for EosHost and descr for KVM
-
Fix for test_snmp_loopback testcase: snmpget command requires running in snmp docker
Eos Example: ARISTA01T3#bash snmpget -v2c -c public 10.1.0.1 1.3.6.1.2.1.1.1.0 SNMPv2-MIB::sysDescr.0 = STRING: SONiC Software Version: SONiC.HEAD.291231-msft-2205-c679f2d - HwSku: Nokia- IXR7250E-36x100G - Distribution: Debian 11.4 - Kernel: 5.10.0-12-2-amd64
vSonic Exmple: admin@ARISTA01T1:~$ docker exec -it snmp snmpget -v2c -c public 10.1.0.1 1.3.6.1.2.1.1.1.0 iso.3.6.1.2.1.1.1.0 = STRING: "SONiC Software Version: SONiC.HEAD.291231-msft-2205-c679f2d - HwSku: Nokia-IXR7250E- 6x400G - Distribution: Debian 11.4 - Kernel: 5.10.0-12-2-amd64"
-
Fix for voq tests BGP: - Use vtysh for BGP configuration on vsonic Interface up/down: - Use shut/no shut commands
-
voq_helper Interface name and numbering:
- Neighbors interface name is difference on vsonic vs Eos.
- On Eos, inerfaces are named 'eth' (Ex. eth1) and portchannels are named po (Ex. po1).
- On vsonic, interfaces are named Ethernet (Ex. Ethernet1) and portchannels are named PortChannel (PortChannel1).
- Neighbors interface name is difference on vsonic vs Eos.
-
Fix for test_lag interface There is no support for setting lacp rate in vsonic. So, skipping these tests.
How did you verify/test it?
Tested the code on a dut that uses Eos VM as it's neighbors in one setup and against vsonic neighbors in another setup.
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation
This pull request introduces 1 alert when merging bad9a3177e129a72f4725b1aa5888945ca427fc5 into e33b2284dbe6ae74234c901602d1e1ffaceaf5dd - view on LGTM.com
new alerts:
- 1 for Unused import
/easycla
The pre-commit check detected issues in the files touched by this pull request. The detected issues may be old or new. For new issues, please try to fix them.
For old issues, it is not mandatory to fix them because they were not caused by this change. It is unfair to blame author of this pull request. But if you can take extra effort to fix the old issues as well, that would be great!
Detailed pre-commit check results:
trim trailing whitespace.................................................Failed
- hook id: trailing-whitespace
- exit code: 1
- files were modified by this hook
Fixing tests/pc/test_lag_2.py
Fixing tests/lldp/test_lldp.py
fix end of files.........................................................Failed
- hook id: end-of-file-fixer
- exit code: 1
- files were modified by this hook
Fixing tests/snmp/test_snmp_loopback.py
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Failed
- hook id: flake8
...
[truncated extra lines, please run pre-commit locally to view full check results]
To run the pre-commit checks locally, you can follow below steps:
- Ensure that default python is python3. In sonic-mgmt docker container, default python is python2. You can run the check by activating the python3 virtual environment in sonic-mgmt docker container or outside of sonic-mgmt docker container.
- Ensure that the
pre-commit
package is installed:
sudo pip install pre-commit
- Go to repository root folder
- Install the pre-commit hooks:
pre-commit install
- Use pre-commit to check staged file:
pre-commit
- Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>
cc @judyjoseph
@sanmalho-git Can we close this soon.
/azp run
Azure Pipelines successfully started running 1 pipeline(s).
The pre-commit check detected issues in the files touched by this pull request. The detected issues may be old or new. For new issues, please try to fix them.
For old issues, it is not mandatory to fix them because they were not caused by this change. It is unfair to blame author of this pull request. But if you can take extra effort to fix the old issues as well, that would be great!
Detailed pre-commit check results:
trim trailing whitespace.................................................Failed
- hook id: trailing-whitespace
- exit code: 1
- files were modified by this hook
Fixing tests/pc/test_lag_2.py
Fixing tests/lldp/test_lldp.py
fix end of files.........................................................Failed
- hook id: end-of-file-fixer
- exit code: 1
- files were modified by this hook
Fixing tests/snmp/test_snmp_loopback.py
Fixing tests/voq/test_voq_nbr.py
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Failed
...
[truncated extra lines, please run pre-commit locally to view full check results]
To run the pre-commit checks locally, you can follow below steps:
- Ensure that default python is python3. In sonic-mgmt docker container, default python is python2. You can run the check by activating the python3 virtual environment in sonic-mgmt docker container or outside of sonic-mgmt docker container.
- Ensure that the
pre-commit
package is installed:
sudo pip install pre-commit
- Go to repository root folder
- Install the pre-commit hooks:
pre-commit install
- Use pre-commit to check staged file:
pre-commit
- Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>
Which topology was this ran in for this setup? Was it the t2-topo?
Which topology was this ran in for this setup? Was it the t2-topo?
T2 Toplogy
Which topology was this ran in for this setup? Was it the t2-topo?
T2 Toplogy
Thanks. Was this a physical T2 setup with vSONIC KVM neighbors?
Which topology was this ran in for this setup? Was it the t2-topo?
T2 Toplogy
Thanks. Was this a physical T2 setup with vSONIC KVM neighbors?
The topology that we are using is T2_min with a physical chassis with 2 Linecards and 1 supervisor card and all eBGP peers being simulated using vsonic
The pre-commit check detected issues in the files touched by this pull request. The detected issues may be old or new. For new issues, please try to fix them.
For old issues, it is not mandatory to fix them because they were not caused by this change. It is unfair to blame author of this pull request. But if you can take extra effort to fix the old issues as well, that would be great!
Detailed pre-commit check results:
trim trailing whitespace.................................................Failed
- hook id: trailing-whitespace
- exit code: 1
- files were modified by this hook
Fixing tests/pc/test_lag_2.py
fix end of files.........................................................Failed
- hook id: end-of-file-fixer
- exit code: 1
- files were modified by this hook
Fixing tests/fib/test_fib.py
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1
...
[truncated extra lines, please run pre-commit locally to view full check results]
To run the pre-commit checks locally, you can follow below steps:
- Ensure that default python is python3. In sonic-mgmt docker container, default python is python2. You can run the check by activating the python3 virtual environment in sonic-mgmt docker container or outside of sonic-mgmt docker container.
- Ensure that the
pre-commit
package is installed:
sudo pip install pre-commit
- Go to repository root folder
- Install the pre-commit hooks:
pre-commit install
- Use pre-commit to check staged file:
pre-commit
- Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>
The pre-commit check detected issues in the files touched by this pull request. The pre-commit check is a mandatory check, please fix detected issues.
Detailed pre-commit check results:
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1
ansible/roles/test/files/tools/loganalyzer/loganalyzer.py:38:1: E265 block comment should start with '# '
ansible/roles/test/files/tools/loganalyzer/loganalyzer.py:40:1: E265 block comment should start with '# '
ansible/roles/test/files/tools/loganalyzer/loganalyzer.py:46:1: E265 block comment should start with '# '
ansible/roles/test/files/tools/loganalyzer/loganalyzer.py:56:1: E302 expected 2 blank lines, found 1
ansible/roles/test/files/tools/loganalyzer/loganalyzer.py:92:57: E251 unexpected spaces around keyword / parameter equals
ansible/roles/test/files/tools/loganalyzer/loganalyzer.py:92:59: E251 unexpected spaces around keyword / parameter equals
ansible/roles/test/files/tools/loganalyzer/loganalyzer.py:95:5: E265 block comment should start with '# '
ansible/roles/test/files/tools/loganalyzer/loganalyzer.py:97:53: E251 unexpected spaces around keyword / parameter equals
ansible/roles/test/files/tools/loganalyzer/loganalyzer.py:97:55: E251 unexpected spaces around keyword / parameter equals
ansible/roles/test/files/tools/loganalyzer/loganalyzer.py:101:5: E265 block comment should start with '# '
ansible/roles/test/files/tools/loganalyzer/loganalyzer.py:108:5: E265 block comment should start with '# '
...
[truncated extra lines, please run pre-commit locally to view full check results]
To run the pre-commit checks locally, you can follow below steps:
- Ensure that default python is python3. In sonic-mgmt docker container, default python is python2. You can run the check by activating the python3 virtual environment in sonic-mgmt docker container or outside of sonic-mgmt docker container.
- Ensure that the
pre-commit
package is installed:
sudo pip install pre-commit
- Go to repository root folder
- Install the pre-commit hooks:
pre-commit install
- Use pre-commit to check staged file:
pre-commit
- Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>
/Azp run Azure.sonic-mgmt
The pre-commit check detected issues in the files touched by this pull request. The pre-commit check is a mandatory check, please fix detected issues.
Detailed pre-commit check results:
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1
tests/fib/test_fib.py:77:20: F811 redefinition of unused 'toggle_all_simulator_ports_to_random_side' from line 17
tests/fib/test_fib.py:78:20: F811 redefinition of unused 'fib_info_files_per_function' from line 20
tests/fib/test_fib.py:79:36: F811 redefinition of unused 'mux_server_url' from line 15
tests/fib/test_fib.py:81:32: F811 redefinition of unused 'single_fib_for_duts' from line 21
tests/fib/test_fib.py:289:51: F811 redefinition of unused 'fib_info_files_per_function' from line 20
tests/fib/test_fib.py:290:15: F811 redefinition of unused 'toggle_all_simulator_ports_to_rand_selected_tor_m' from line 16
tests/fib/test_fib.py:291:31: F811 redefinition of unused 'mux_server_url' from line 15
tests/fib/test_fib.py:292:27: F811 redefinition of unused 'single_fib_for_duts' from line 21
tests/lldp/test_lldp.py:3:1: F401 'tests.common.devices.eos.EosHost' imported but unused
tests/lldp/test_lldp.py:21:121: E501 line too long (143 > 120 characters)
tests/lldp/test_lldp.py:88:121: E501 line too long (129 > 120 characters)
...
[truncated extra lines, please run pre-commit locally to view full check results]
To run the pre-commit checks locally, you can follow below steps:
- Ensure that default python is python3. In sonic-mgmt docker container, default python is python2. You can run the check by activating the python3 virtual environment in sonic-mgmt docker container or outside of sonic-mgmt docker container.
- Ensure that the
pre-commit
package is installed:
sudo pip install pre-commit
- Go to repository root folder
- Install the pre-commit hooks:
pre-commit install
- Use pre-commit to check staged file:
pre-commit
- Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>
The pre-commit check detected issues in the files touched by this pull request. The pre-commit check is a mandatory check, please fix detected issues.
Detailed pre-commit check results:
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1
tests/lldp/test_lldp.py:88:121: E501 line too long (129 > 120 characters)
tests/lldp/test_lldp.py:91:121: E501 line too long (131 > 120 characters)
tests/snmp/test_snmp_loopback.py:31:121: E501 line too long (140 > 120 characters)
tests/snmp/test_snmp_loopback.py:34:121: E501 line too long (167 > 120 characters)
tests/snmp/test_snmp_loopback.py:76:121: E501 line too long (135 > 120 characters)
tests/snmp/test_snmp_loopback.py:77:121: E501 line too long (156 > 120 characters)
tests/snmp/test_snmp_loopback.py:79:121: E501 line too long (132 > 120 characters)
tests/snmp/test_snmp_loopback.py:80:121: E501 line too long (153 > 120 characters)
tests/voq/test_voq_nbr.py:136:121: E501 line too long (188 > 120 characters)
tests/voq/test_voq_nbr.py:329:121: E501 line too long (203 > 120 characters)
tests/voq/test_voq_nbr.py:350:121: E501 line too long (203 > 120 characters)
...
[truncated extra lines, please run pre-commit locally to view full check results]
To run the pre-commit checks locally, you can follow below steps:
- Ensure that default python is python3. In sonic-mgmt docker container, default python is python2. You can run the check by activating the python3 virtual environment in sonic-mgmt docker container or outside of sonic-mgmt docker container.
- Ensure that the
pre-commit
package is installed:
sudo pip install pre-commit
- Go to repository root folder
- Install the pre-commit hooks:
pre-commit install
- Use pre-commit to check staged file:
pre-commit
- Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>
The pre-commit check detected issues in the files touched by this pull request. The pre-commit check is a mandatory check, please fix detected issues.
Detailed pre-commit check results:
trim trailing whitespace.................................................Passed
fix end of files.........................................................Failed
- hook id: end-of-file-fixer
- exit code: 1
- files were modified by this hook
Fixing tests/snmp/test_snmp_loopback.py
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1
tests/snmp/test_snmp_loopback.py:79:9: E303 too many blank lines (2)
check conditional mark sort..........................(no files to check)Skipped
To run the pre-commit checks locally, you can follow below steps:
- Ensure that default python is python3. In sonic-mgmt docker container, default python is python2. You can run the check by activating the python3 virtual environment in sonic-mgmt docker container or outside of sonic-mgmt docker container.
- Ensure that the
pre-commit
package is installed:
sudo pip install pre-commit
- Go to repository root folder
- Install the pre-commit hooks:
pre-commit install
- Use pre-commit to check staged file:
pre-commit
- Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>
Testing of this is pending https://github.com/sonic-net/sonic-mgmt/pull/8418 in 202205 branch
@mannytaheri https://github.com/sonic-net/sonic-mgmt/pull/8418 is merged in 202205, will you be able to test and update this PR as per comments and resolve merge conflicts
The pre-commit check detected issues in the files touched by this pull request. The pre-commit check is a mandatory check, please fix detected issues.
Detailed pre-commit check results:
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1
ansible/roles/test/files/tools/loganalyzer/loganalyzer.py:771:121: E501 line too long (173 > 120 characters)
flake8...............................................(no files to check)Skipped
check conditional mark sort..........................(no files to check)Skipped
To run the pre-commit checks locally, you can follow below steps:
- Ensure that default python is python3. In sonic-mgmt docker container, default python is python2. You can run the check by activating the python3 virtual environment in sonic-mgmt docker container or outside of sonic-mgmt docker container.
- Ensure that the
pre-commit
package is installed:
sudo pip install pre-commit
- Go to repository root folder
- Install the pre-commit hooks:
pre-commit install
- Use pre-commit to check staged file:
pre-commit
- Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>
The pre-commit check detected issues in the files touched by this pull request. The pre-commit check is a mandatory check, please fix detected issues.
Detailed pre-commit check results:
trim trailing whitespace.................................................Failed
- hook id: trailing-whitespace
- exit code: 1
- files were modified by this hook
Fixing ansible/roles/test/files/tools/loganalyzer/loganalyzer.py
fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Passed
flake8...............................................(no files to check)Skipped
check conditional mark sort..........................(no files to check)Skipped
To run the pre-commit checks locally, you can follow below steps:
- Ensure that default python is python3. In sonic-mgmt docker container, default python is python2. You can run the check by activating the python3 virtual environment in sonic-mgmt docker container or outside of sonic-mgmt docker container.
- Ensure that the
pre-commit
package is installed:
sudo pip install pre-commit
- Go to repository root folder
- Install the pre-commit hooks:
pre-commit install
- Use pre-commit to check staged file:
pre-commit
- Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>
The pre-commit check detected issues in the files touched by this pull request. The pre-commit check is a mandatory check, please fix detected issues.
Detailed pre-commit check results:
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1
ansible/roles/test/files/tools/loganalyzer/loganalyzer.py:771:121: E501 line too long (173 > 120 characters)
flake8...............................................(no files to check)Skipped
check conditional mark sort..........................(no files to check)Skipped
To run the pre-commit checks locally, you can follow below steps:
- Ensure that default python is python3. In sonic-mgmt docker container, default python is python2. You can run the check by activating the python3 virtual environment in sonic-mgmt docker container or outside of sonic-mgmt docker container.
- Ensure that the
pre-commit
package is installed:
sudo pip install pre-commit
- Go to repository root folder
- Install the pre-commit hooks:
pre-commit install
- Use pre-commit to check staged file:
pre-commit
- Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>
/azp run
Azure Pipelines successfully started running 1 pipeline(s).
/azp run
Azure Pipelines successfully started running 1 pipeline(s).
@mannytaheri failure seen at sonic-mgmt PR checker , fails at pytest collection with below error:
____________________ ERROR collecting voq/test_voq_intfs.py ____________________
ImportError while importing test module '/var/src/sonic-mgmt/tests/voq/test_voq_intfs.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.8/importlib/init.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
voq/test_voq_intfs.py:13: in
@mannytaheri failure seen at sonic-mgmt PR checker , fails at pytest collection with below error: ____________________ ERROR collecting voq/test_voq_intfs.py ____________________ ImportError while importing test module '/var/src/sonic-mgmt/tests/voq/test_voq_intfs.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /usr/lib/python3.8/importlib/init.py:127: in import_module return _bootstrap._gcd_import(name[level:], package, level) voq/test_voq_intfs.py:13: in from .test_voq_disrupts import check_bgp_neighbors voq/test_voq_disrupts.py:8: in from .test_voq_ipfwd import pick_ports voq/test_voq_ipfwd.py:20: in from .test_voq_nbr import LinkFlap voq/test_voq_nbr.py:18: in from voq_helpers import get_neighbor_info E ModuleNotFoundError: No module named 'voq_helpers'
@SuvarnaMeenakshi @judyjoseph I have fixed the PR. All testcases passed. Please help to merge it if it looks ok.
@SuvarnaMeenakshi @judyjoseph I have fixed the PR. All testcases passed. Please help to merge it if it looks ok.