Skip to content
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

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

Merged
merged 11 commits into from
Feb 27, 2024

Conversation

mannytaheri
Copy link
Contributor

@mannytaheri mannytaheri commented Jul 21, 2022

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
  • 202205

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 mannytaheri requested a review from a team as a code owner July 21, 2022 22:22
@lgtm-com
Copy link

lgtm-com bot commented Jul 21, 2022

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

new alerts:

  • 1 for Unused import

@tjchadaga
Copy link
Contributor

/easycla

tests/voq/test_voq_nbr.py Outdated Show resolved Hide resolved
tests/voq/test_voq_nbr.py Outdated Show resolved Hide resolved
Copy link
Contributor

@arlakshm arlakshm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as comments

@azure-pipelines
Copy link

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>

@abdosi
Copy link
Contributor

abdosi commented Mar 1, 2023

cc @judyjoseph

@abdosi
Copy link
Contributor

abdosi commented Mar 1, 2023

@sanmalho-git Can we close this soon.

@abdosi
Copy link
Contributor

abdosi commented Mar 1, 2023

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@wangxin
Copy link
Collaborator

wangxin commented Mar 1, 2023

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>

@mrkcmo
Copy link

mrkcmo commented Mar 2, 2023

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

@mannytaheri
Copy link
Contributor Author

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

T2 Toplogy

@mrkcmo
Copy link

mrkcmo commented Mar 2, 2023

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?

@mannytaheri
Copy link
Contributor Author

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

@mssonicbld
Copy link
Collaborator

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
Copy link
Collaborator

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>

@arlakshm
Copy link
Contributor

/Azp run Azure.sonic-mgmt

@mssonicbld
Copy link
Collaborator

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>

@mannytaheri
Copy link
Contributor Author

mannytaheri commented Feb 22, 2024

@judyjoseph I removed that section of the code as it is not related to this PR. All tests have passed.

Copy link
Contributor

@SuvarnaMeenakshi SuvarnaMeenakshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mssonicbld
Copy link
Collaborator

@mannytaheri PR conflicts with 202205 branch

mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Mar 4, 2024
sonic-net#6022)

* Added support for running T2 applicable tests using vsonic(KVM) for neighbors

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
3. voq tests
  BGP:
    - Use vtysh for BGP configuration on vsonic
  Interface up/down:
    - Use shut/no shut commands

  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).
mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Mar 4, 2024
sonic-net#6022)

* Added support for running T2 applicable tests using vsonic(KVM) for neighbors

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
3. voq tests
  BGP:
    - Use vtysh for BGP configuration on vsonic
  Interface up/down:
    - Use shut/no shut commands

  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).
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202305: #11852

@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202311: #11853

mssonicbld pushed a commit that referenced this pull request Mar 4, 2024
#6022)

* Added support for running T2 applicable tests using vsonic(KVM) for neighbors

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
3. voq tests
  BGP:
    - Use vtysh for BGP configuration on vsonic
  Interface up/down:
    - Use shut/no shut commands

  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).
mssonicbld pushed a commit that referenced this pull request Mar 5, 2024
#6022)

* Added support for running T2 applicable tests using vsonic(KVM) for neighbors

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
3. voq tests
  BGP:
    - Use vtysh for BGP configuration on vsonic
  Interface up/down:
    - Use shut/no shut commands

  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).
mannytaheri added a commit to mannytaheri/sonic-mgmt that referenced this pull request Mar 5, 2024
sonic-net#6022)

* Added support for running T2 applicable tests using vsonic(KVM) for neighbors

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
3. voq tests
  BGP:
    - Use vtysh for BGP configuration on vsonic
  Interface up/down:
    - Use shut/no shut commands

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

(cherry picked from commit 0a3acb7)
rlhui pushed a commit that referenced this pull request Mar 23, 2024
#6022) (#11905)

* Added support for running T2 applicable tests using vsonic(KVM) for neighbors

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
3. voq tests
  BGP:
    - Use vtysh for BGP configuration on vsonic
  Interface up/down:
    - Use shut/no shut commands

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

(cherry picked from commit 0a3acb7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.