sonic-mgmt icon indicating copy to clipboard operation
sonic-mgmt copied to clipboard

Added support for running T2 applicable tests using vsonic(KVM) for n…

Open mannytaheri opened this issue 2 years ago • 2 comments

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?

  1. 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

  2. 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"

  3. Fix for voq tests BGP: - Use vtysh for BGP configuration on vsonic Interface up/down: - Use shut/no shut commands

  4. 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).
  5. 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

mannytaheri avatar Jul 21 '22 22:07 mannytaheri

This pull request introduces 1 alert when merging bad9a3177e129a72f4725b1aa5888945ca427fc5 into e33b2284dbe6ae74234c901602d1e1ffaceaf5dd - view on LGTM.com

new alerts:

  • 1 for Unused import

lgtm-com[bot] avatar Jul 21 '22 22:07 lgtm-com[bot]

/easycla

tjchadaga avatar Oct 27 '22 19:10 tjchadaga

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:

  1. 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.
  2. Ensure that the pre-commit package is installed:
sudo pip install pre-commit
  1. Go to repository root folder
  2. Install the pre-commit hooks:
pre-commit install
  1. Use pre-commit to check staged file:
pre-commit
  1. Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>

azure-pipelines[bot] avatar Nov 16 '22 21:11 azure-pipelines[bot]

cc @judyjoseph

abdosi avatar Mar 01 '23 18:03 abdosi

@sanmalho-git Can we close this soon.

abdosi avatar Mar 01 '23 18:03 abdosi

/azp run

abdosi avatar Mar 01 '23 18:03 abdosi

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Mar 01 '23 18:03 azure-pipelines[bot]

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:

  1. 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.
  2. Ensure that the pre-commit package is installed:
sudo pip install pre-commit
  1. Go to repository root folder
  2. Install the pre-commit hooks:
pre-commit install
  1. Use pre-commit to check staged file:
pre-commit
  1. Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>

wangxin avatar Mar 01 '23 18:03 wangxin

Which topology was this ran in for this setup? Was it the t2-topo?

mrkcmo avatar Mar 02 '23 15:03 mrkcmo

Which topology was this ran in for this setup? Was it the t2-topo?

T2 Toplogy

mannytaheri avatar Mar 02 '23 15:03 mannytaheri

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?

mrkcmo avatar Mar 02 '23 15:03 mrkcmo

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

mannytaheri avatar Mar 02 '23 16:03 mannytaheri

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:

  1. 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.
  2. Ensure that the pre-commit package is installed:
sudo pip install pre-commit
  1. Go to repository root folder
  2. Install the pre-commit hooks:
pre-commit install
  1. Use pre-commit to check staged file:
pre-commit
  1. Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>

mssonicbld avatar Apr 06 '23 21:04 mssonicbld

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:

  1. 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.
  2. Ensure that the pre-commit package is installed:
sudo pip install pre-commit
  1. Go to repository root folder
  2. Install the pre-commit hooks:
pre-commit install
  1. Use pre-commit to check staged file:
pre-commit
  1. Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>

mssonicbld avatar Apr 21 '23 17:04 mssonicbld

/Azp run Azure.sonic-mgmt

arlakshm avatar Apr 27 '23 17:04 arlakshm

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:

  1. 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.
  2. Ensure that the pre-commit package is installed:
sudo pip install pre-commit
  1. Go to repository root folder
  2. Install the pre-commit hooks:
pre-commit install
  1. Use pre-commit to check staged file:
pre-commit
  1. Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>

mssonicbld avatar Jun 05 '23 18:06 mssonicbld

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:

  1. 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.
  2. Ensure that the pre-commit package is installed:
sudo pip install pre-commit
  1. Go to repository root folder
  2. Install the pre-commit hooks:
pre-commit install
  1. Use pre-commit to check staged file:
pre-commit
  1. Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>

mssonicbld avatar Jun 05 '23 20:06 mssonicbld

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:

  1. 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.
  2. Ensure that the pre-commit package is installed:
sudo pip install pre-commit
  1. Go to repository root folder
  2. Install the pre-commit hooks:
pre-commit install
  1. Use pre-commit to check staged file:
pre-commit
  1. Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>

mssonicbld avatar Jun 14 '23 21:06 mssonicbld

Testing of this is pending https://github.com/sonic-net/sonic-mgmt/pull/8418 in 202205 branch

rlhui avatar Jul 26 '23 17:07 rlhui

@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

SuvarnaMeenakshi avatar Aug 11 '23 16:08 SuvarnaMeenakshi

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:

  1. 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.
  2. Ensure that the pre-commit package is installed:
sudo pip install pre-commit
  1. Go to repository root folder
  2. Install the pre-commit hooks:
pre-commit install
  1. Use pre-commit to check staged file:
pre-commit
  1. Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>

mssonicbld avatar Aug 15 '23 18:08 mssonicbld

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:

  1. 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.
  2. Ensure that the pre-commit package is installed:
sudo pip install pre-commit
  1. Go to repository root folder
  2. Install the pre-commit hooks:
pre-commit install
  1. Use pre-commit to check staged file:
pre-commit
  1. Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>

mssonicbld avatar Aug 16 '23 18:08 mssonicbld

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:

  1. 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.
  2. Ensure that the pre-commit package is installed:
sudo pip install pre-commit
  1. Go to repository root folder
  2. Install the pre-commit hooks:
pre-commit install
  1. Use pre-commit to check staged file:
pre-commit
  1. Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>

mssonicbld avatar Jan 25 '24 19:01 mssonicbld

/azp run

judyjoseph avatar Feb 08 '24 23:02 judyjoseph

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Feb 08 '24 23:02 azure-pipelines[bot]

/azp run

judyjoseph avatar Feb 15 '24 21:02 judyjoseph

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Feb 15 '24 21:02 azure-pipelines[bot]

@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 avatar Feb 15 '24 21:02 SuvarnaMeenakshi

@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.

mannytaheri avatar Feb 22 '24 04:02 mannytaheri

@SuvarnaMeenakshi @judyjoseph I have fixed the PR. All testcases passed. Please help to merge it if it looks ok.

mannytaheri avatar Feb 22 '24 04:02 mannytaheri