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

[Snappi] Added multi dut pfcwd a2a test case

Open vikumarks opened this issue 1 year ago • 11 comments

Description of PR

  • Test to determine the PFC watchdog behavior with multiple sender and multiple receiver

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 verify the pfc watchdog behavior in multi-dut/multi-asic scenario.

How did you do it?

The existing RDMA cases for single dut has been modified to accommodate T2 topology, where separate fixtures has been added that takes into account the chassis type and asic choice as user input, so that the script supports both T1 and T2 topology

How did you verify/test it?

Tested against voq chassis with SONiC installed in it

Any platform specific information?

Tested against J2C+

Supported testbed topology if it's a new test case?

T2, T1 & T0

Documentation

https://github.com/sonic-net/sonic-mgmt/blob/master/docs/testplan/pfcwd/PFCWD_2SENDER_2RECEIVER.md

Output

AzDevOps@6105354dad99:~/sonic-mgmt/tests$ py.test --inventory ../ansible/snappi-sonic --host-pattern sonic-s6100-dut --testbed vms-snappi-sonic --testbed_file ../ansible/testbed.csv --show-capture=stdout --log-cli-level info --showlocals -ra --allow_recover --skip_sanity --disable_loganalyzer snappi_tests/multidut/pfcwd/test_multidut_pfcwd_a2a_with_snappi.py /usr/local/lib/python2.7/dist-packages/ansible/parsing/vault/init.py:44: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in the next release. from cryptography.exceptions import InvalidSignature ======================================================================================================= test session starts ======================================================================================================= platform linux2 -- Python 2.7.18, pytest-4.6.11, py-1.11.0, pluggy-0.13.1 ansible: 2.8.20 rootdir: /var/AzDevOps/sonic-mgmt/tests, inifile: pytest.ini plugins: allure-pytest-2.8.22, celery-4.4.7, ansible-2.2.4, forked-1.3.0, html-1.22.1, metadata-1.11.0, repeat-0.9.1, xdist-1.28.0 collecting 1 item
------------------------------------------------------------------------------------------------------- live log collection ------------------------------------------------------------------------------------------------------- 18:29:59 init.pytest_collection_modifyitems L0582 INFO | Available basic facts that can be used in conditional skip: { "topo_type": "ptf", "testbed": "vms-snappi-sonic", "topo_name": "ptf64" }

--------------------------------------------------------------------------------------------------------- live log setup ---------------------------------------------------------------------------------------------------------- 18:29:59 init.set_default L0054 INFO | Completeness level not set during test execution. Setting to default level: CompletenessLevel.basic 18:29:59 init.check_test_completeness L0152 INFO | Test has no defined levels. Continue without test completeness checks 18:30:05 ptfhost_utils.run_icmp_responder_session L0239 INFO | Skip running icmp_responder at session level, it is only for dualtor testbed with active-active mux ports. 18:30:06 conftest.creds_on_dut L0704 INFO | dut sonic-s6100-dut belongs to groups [u'snappi-sonic', u'sonic', u'sonic_dell64_40', 'fanout'] 18:30:06 conftest.creds_on_dut L0728 INFO | skip empty var file ../ansible/group_vars/all/corefile_uploader.yml 18:30:06 conftest.creds_on_dut L0728 INFO | skip empty var file ../ansible/group_vars/all/env.yml 18:30:06 conftest.nbrhosts L0521 INFO | No VMs exist for this topology: ptf64 18:30:06 conftest.core_dump_and_config_check L2032 INFO | Collecting core dumps before test on sonic-s6100-dut 18:30:06 conftest.core_dump_and_config_check L2041 INFO | Collecting running config before test on sonic-s6100-dut 18:30:11 init.sanity_check L0125 INFO | Skip sanity check according to command line argument 18:30:11 conftest.generate_params_dut_hostname L1108 INFO | Using DUTs ['sonic-s6100-dut'] in testbed 'vms-snappi-sonic' 18:30:11 conftest.rand_one_dut_hostname L0378 INFO | Randomly select dut sonic-s6100-dut for testing 18:30:11 init._fixture_generator_decorator L0081 INFO | -------------------- fixture enable_packet_aging_after_test setup starts -------------------- 18:30:11 init._fixture_generator_decorator L0085 INFO | -------------------- fixture enable_packet_aging_after_test setup ends -------------------- 18:30:11 init._fixture_generator_decorator L0081 INFO | -------------------- fixture rand_lossless_prio setup starts -------------------- 18:30:11 init._fixture_generator_decorator L0085 INFO | -------------------- fixture rand_lossless_prio setup ends -------------------- 18:30:11 init._fixture_generator_decorator L0081 INFO | -------------------- fixture rand_lossy_prio setup starts -------------------- 18:30:11 init._fixture_generator_decorator L0085 INFO | -------------------- fixture rand_lossy_prio setup ends -------------------- 18:30:11 init._fixture_generator_decorator L0081 INFO | -------------------- fixture start_pfcwd_after_test setup starts -------------------- 18:30:11 init._fixture_generator_decorator L0085 INFO | -------------------- fixture start_pfcwd_after_test setup ends -------------------- 18:30:11 init._fixture_func_decorator L0069 INFO | -------------------- fixture snappi_api_serv_ip setup starts -------------------- 18:30:11 init._fixture_func_decorator L0076 INFO | -------------------- fixture snappi_api_serv_ip setup ends -------------------- 18:30:11 init._fixture_func_decorator L0069 INFO | -------------------- fixture snappi_api_serv_port setup starts -------------------- 18:30:11 init._fixture_func_decorator L0076 INFO | -------------------- fixture snappi_api_serv_port setup ends -------------------- 18:30:11 init._fixture_generator_decorator L0081 INFO | -------------------- fixture snappi_api setup starts -------------------- 18:30:11 init._fixture_generator_decorator L0085 INFO | -------------------- fixture snappi_api setup ends -------------------- 18:30:11 init._fixture_func_decorator L0069 INFO | -------------------- fixture prio_dscp_map setup starts -------------------- 18:30:13 init._fixture_func_decorator L0076 INFO | -------------------- fixture prio_dscp_map setup ends -------------------- 18:30:13 init._fixture_func_decorator L0069 INFO | -------------------- fixture all_prio_list setup starts -------------------- 18:30:13 init._fixture_func_decorator L0076 INFO | -------------------- fixture all_prio_list setup ends -------------------- 18:30:13 init._fixture_func_decorator L0069 INFO | -------------------- fixture lossless_prio_list setup starts -------------------- 18:30:14 init._fixture_func_decorator L0076 INFO | -------------------- fixture lossless_prio_list setup ends -------------------- 18:30:14 init._fixture_func_decorator L0069 INFO | -------------------- fixture lossy_prio_list setup starts -------------------- 18:30:14 init._fixture_func_decorator L0076 INFO | -------------------- fixture lossy_prio_list setup ends -------------------- 18:30:14 init.loganalyzer L0045 INFO | Log analyzer is disabled 18:30:14 init._fixture_func_decorator L0069 INFO | -------------------- fixture get_multidut_snappi_ports setup starts -------------------- 18:30:14 init._fixture_func_decorator L0076 INFO | -------------------- fixture get_multidut_snappi_ports setup ends -------------------- ---------------------------------------------------------------------------------------------------------- live log call ---------------------------------------------------------------------------------------------------------- 18:30:14 snappi_fixtures.__intf_config_multidut L0789 INFO | Configuring Dut: sonic-s6100-dut with port Ethernet0 with IP 20.1.1.1/8 18:30:15 snappi_fixtures.__intf_config_multidut L0789 INFO | Configuring Dut: sonic-s6100-dut with port Ethernet4 with IP 21.1.1.1/8 18:30:17 snappi_fixtures.__intf_config_multidut L0789 INFO | Configuring Dut: sonic-s6100-dut with port Ethernet8 with IP 22.1.1.1/8 18:30:26 connection._warn L0246 WARNING| Verification of certificates is disabled 18:30:26 connection._info L0243 INFO | Determining the platform and rest_port using the 10.36.78.135 address... 18:30:26 connection._warn L0246 WARNING| Unable to connect to http://10.36.78.135:443. 18:30:26 connection._info L0243 INFO | Connection established to https://10.36.78.135:443 on linux 18:30:39 connection._info L0243 INFO | Using IxNetwork api server version 9.30.2212.7 18:30:39 connection._info L0243 INFO | User info IxNetwork/ixnetworkweb/admin-120-16681 18:30:39 snappi_api.info L1132 INFO | snappi-0.9.1 18:30:39 snappi_api.info L1132 INFO | snappi_ixnetwork-0.9.1 18:30:39 snappi_api.info L1132 INFO | ixnetwork_restpy-1.0.64 18:30:40 snappi_api.info L1132 INFO | Config validation 0.028s 18:30:42 snappi_api.info L1132 INFO | Ports configuration 1.724s 18:30:42 snappi_api.info L1132 INFO | Captures configuration 0.174s 18:30:45 snappi_api.info L1132 INFO | Add location hosts [10.36.78.53] 2.311s 18:30:49 snappi_api.info L1132 INFO | Location hosts ready [10.36.78.53] 4.182s 18:30:50 snappi_api.info L1132 INFO | Speed conversion is not require for (port.name, speed) : [('Port 0', u'novusHundredGigNonFanOut'), ('Port 1', u'novusHundredGigNonFanOut'), ('Port 2', u'novusHundredGigNonFanOut')] 18:30:50 snappi_api.info L1132 INFO | Aggregation mode speed change 0.461s 18:30:56 snappi_api.info L1132 INFO | Location preemption [10.36.78.53;6;2, 10.36.78.53;6;3, 10.36.78.53;6;1] 0.118s 18:31:19 snappi_api.info L1132 INFO | Location connect [Port 0, Port 1, Port 2] 23.011s 18:31:20 snappi_api.warning L1138 WARNING| Port 0 connectedLinkDown 18:31:20 snappi_api.warning L1138 WARNING| Port 1 connectedLinkDown 18:31:20 snappi_api.warning L1138 WARNING| Port 2 connectedLinkDown 18:31:20 snappi_api.info L1132 INFO | Location state check [Port 0, Port 1, Port 2] 0.269s 18:31:20 snappi_api.info L1132 INFO | Location configuration 37.422s 18:31:38 snappi_api.info L1132 INFO | Layer1 configuration 18.464s 18:31:38 snappi_api.info L1132 INFO | Lag Configuration 0.090s 18:31:39 snappi_api.info L1132 INFO | Convert device config : 0.251s 18:31:39 snappi_api.info L1132 INFO | Create IxNetwork device config : 0.000s 18:31:39 snappi_api.info L1132 INFO | Push IxNetwork device config : 0.664s 18:31:39 snappi_api.info L1132 INFO | Devices configuration 0.999s 18:31:51 snappi_api.info L1132 INFO | Flows configuration 11.615s 18:31:58 snappi_api.info L1132 INFO | Start interfaces 6.805s 18:31:58 snappi_api.info L1132 INFO | IxNet - The Traffic Item was modified. Please perform a Traffic Generate to update the associated traffic Flow Groups 18:31:58 pfcwd_multidut_multi_node_helper.__run_t L0508 INFO | Wait for Arp to Resolve ... 18:32:00 pfcwd_multidut_multi_node_helper.__run_t L0511 INFO | Starting transmit on all flows ... 18:32:04 snappi_api.info L1132 INFO | Flows generate/apply 3.476s 18:32:16 snappi_api.info L1132 INFO | Flows clear statistics 12.191s 18:32:16 snappi_api.info L1132 INFO | Captures start 0.000s 18:32:20 snappi_api.info L1132 INFO | Flows start 3.804s 18:32:30 pfcwd_multidut_multi_node_helper.__run_t L0544 INFO | Stop transmit on all flows ... 18:32:31 pfcwd_multidut_multi_node_helper.__verif L0589 INFO | Flow Name : Warm Up Traffic 2 -> 0 Prio 3 , Tx Frames : 2634099, Rx Frames : 2634099 18:32:31 pfcwd_multidut_multi_node_helper.__verif L0589 INFO | Flow Name : Background Flow 1 -> 0 Prio 2 , Tx Frames : 957854, Rx Frames : 957854 18:32:31 pfcwd_multidut_multi_node_helper.__verif L0599 INFO | Background flows expected not to have any dropped packets 18:32:31 pfcwd_multidut_multi_node_helper.__verif L0589 INFO | Flow Name : Background Flow 1 -> 0 Prio 5 , Tx Frames : 957854, Rx Frames : 957854 18:32:31 pfcwd_multidut_multi_node_helper.__verif L0599 INFO | Background flows expected not to have any dropped packets 18:32:31 pfcwd_multidut_multi_node_helper.__verif L0589 INFO | Flow Name : Background Flow 1 -> 0 Prio 6 , Tx Frames : 957854, Rx Frames : 957854 18:32:31 pfcwd_multidut_multi_node_helper.__verif L0599 INFO | Background flows expected not to have any dropped packets 18:32:31 pfcwd_multidut_multi_node_helper.__verif L0589 INFO | Flow Name : Warm Up Traffic 1 -> 0 Prio 3 , Tx Frames : 2634099, Rx Frames : 2634099 18:32:31 pfcwd_multidut_multi_node_helper.__verif L0589 INFO | Flow Name : Test Flow 1 -> 0 Prio 3 , Tx Frames : 5268199, Rx Frames : 5268199 18:32:31 pfcwd_multidut_multi_node_helper.__verif L0628 INFO | This test flow is delayed by PFC storm 18:32:31 pfcwd_multidut_multi_node_helper.__verif L0629 INFO | Tx and Rx should not have any dropped packet 18:32:31 pfcwd_multidut_multi_node_helper.__verif L0589 INFO | Flow Name : Background Flow 1 -> 0 Prio 1 , Tx Frames : 957854, Rx Frames : 957854 18:32:31 pfcwd_multidut_multi_node_helper.__verif L0599 INFO | Background flows expected not to have any dropped packets 18:32:31 pfcwd_multidut_multi_node_helper.__verif L0589 INFO | Flow Name : Pause Storm , Tx Frames : 596, Rx Frames : 0 18:32:31 pfcwd_multidut_multi_node_helper.__verif L0593 INFO | PFC pause storm expected to be dropped 18:32:31 pfcwd_multidut_multi_node_helper.__verif L0589 INFO | Flow Name : Test Flow 2 -> 0 Prio 3 , Tx Frames : 5268199, Rx Frames : 5268199 18:32:31 pfcwd_multidut_multi_node_helper.__verif L0628 INFO | This test flow is delayed by PFC storm 18:32:31 pfcwd_multidut_multi_node_helper.__verif L0629 INFO | Tx and Rx should not have any dropped packet 18:32:31 pfcwd_multidut_multi_node_helper.__verif L0589 INFO | Flow Name : Background Flow 2 -> 0 Prio 6 , Tx Frames : 957854, Rx Frames : 957854 18:32:31 pfcwd_multidut_multi_node_helper.__verif L0599 INFO | Background flows expected not to have any dropped packets 18:32:31 pfcwd_multidut_multi_node_helper.__verif L0589 INFO | Flow Name : Background Flow 1 -> 0 Prio 0 , Tx Frames : 957854, Rx Frames : 957854 18:32:31 pfcwd_multidut_multi_node_helper.__verif L0599 INFO | Background flows expected not to have any dropped packets 18:32:31 pfcwd_multidut_multi_node_helper.__verif L0589 INFO | Flow Name : Background Flow 2 -> 0 Prio 5 , Tx Frames : 957854, Rx Frames : 957854 18:32:31 pfcwd_multidut_multi_node_helper.__verif L0599 INFO | Background flows expected not to have any dropped packets 18:32:31 pfcwd_multidut_multi_node_helper.__verif L0589 INFO | Flow Name : Background Flow 2 -> 0 Prio 2 , Tx Frames : 957854, Rx Frames : 957854 18:32:31 pfcwd_multidut_multi_node_helper.__verif L0599 INFO | Background flows expected not to have any dropped packets 18:32:31 pfcwd_multidut_multi_node_helper.__verif L0589 INFO | Flow Name : Background Flow 2 -> 0 Prio 0 , Tx Frames : 957854, Rx Frames : 957854 18:32:31 pfcwd_multidut_multi_node_helper.__verif L0599 INFO | Background flows expected not to have any dropped packets 18:32:31 pfcwd_multidut_multi_node_helper.__verif L0589 INFO | Flow Name : Background Flow 2 -> 0 Prio 1 , Tx Frames : 957854, Rx Frames : 957854 18:32:31 pfcwd_multidut_multi_node_helper.__verif L0599 INFO | Background flows expected not to have any dropped packets 18:32:31 snappi_fixtures.cleanup_config L0942 INFO | Removing Configuration on Dut: sonic-s6100-dut with port Ethernet0 with ip :20.1.1.1/8 18:32:33 snappi_fixtures.cleanup_config L0942 INFO | Removing Configuration on Dut: sonic-s6100-dut with port Ethernet4 with ip :21.1.1.1/8 18:32:34 snappi_fixtures.cleanup_config L0942 INFO | Removing Configuration on Dut: sonic-s6100-dut with port Ethernet8 with ip :22.1.1.1/8 PASSED [100%] -------------------------------------------------------------------------------------------------------- live log teardown -------------------------------------------------------------------------------------------------------- 18:32:35 init._fixture_generator_decorator L0093 INFO | -------------------- fixture snappi_api teardown starts -------------------- 18:32:56 init._fixture_generator_decorator L0102 INFO | -------------------- fixture snappi_api teardown ends -------------------- 18:32:56 init._fixture_generator_decorator L0093 INFO | -------------------- fixture start_pfcwd_after_test teardown starts -------------------- 18:32:57 init._fixture_generator_decorator L0102 INFO | -------------------- fixture start_pfcwd_after_test teardown ends -------------------- 18:32:57 init._fixture_generator_decorator L0093 INFO | -------------------- fixture rand_lossy_prio teardown starts -------------------- 18:32:57 init._fixture_generator_decorator L0102 INFO | -------------------- fixture rand_lossy_prio teardown ends -------------------- 18:32:57 init._fixture_generator_decorator L0093 INFO | -------------------- fixture rand_lossless_prio teardown starts -------------------- 18:32:57 init._fixture_generator_decorator L0102 INFO | -------------------- fixture rand_lossless_prio teardown ends -------------------- 18:32:57 init._fixture_generator_decorator L0093 INFO | -------------------- fixture enable_packet_aging_after_test teardown starts -------------------- 18:32:58 init._fixture_generator_decorator L0102 INFO | -------------------- fixture enable_packet_aging_after_test teardown ends -------------------- 18:32:59 conftest.core_dump_and_config_check L2069 INFO | Collecting core dumps after test on sonic-s6100-dut 18:32:59 conftest.core_dump_and_config_check L2086 INFO | Collecting running config after test on sonic-s6100-dut 18:33:00 conftest.core_dump_and_config_check L2211 WARNING| Core dump or config check failed for snappi_tests/dinesh_response_time_pr/test_multidut_pfcwd_a2a_with_snappi.py, results: {"core_dump_check": {"new_core_dumps": {"sonic-s6100-dut": []}, "pass": true}, "config_db_check": {"cur_only_config": {"sonic-s6100-dut": {"null": {"INTERFACE": {"Ethernet8": {}, "Ethernet0|2000:1::1/16": {}, "Ethernet8|21.1.1.1/8": {}, "Ethernet0": {}, "Ethernet12|22.1.1.1/8": {}, "Ethernet12|21.1.1.1/8": {}, "Ethernet4": {}, "Ethernet4|22.1.1.1/8": {}, "Ethernet0|21.1.1.1/8": {}, "Ethernet12|23.1.1.1/8": {}, "Ethernet12|2003:1::1/16": {}, "Ethernet8|20.1.1.1/8": {}, "Ethernet4|2001:1::1/16": {}, "Ethernet12": {}, "Ethernet8|2002:1::1/16": {}}, "PFC_WD": {"Ethernet0": {"action": "drop", "detection_time": "200", "restoration_time": "200"}, "GLOBAL": {"POLL_INTERVAL": "200"}, "Ethernet4": {"action": "drop", "detection_time": "200", "restoration_time": "200"}, "Ethernet12": {"action": "drop", "detection_time": "200", "restoration_time": "200"}, "Ethernet8": {"action": "drop", "detection_time": "200", "restoration_time": "200"}}}}}, "inconsistent_config": {"sonic-s6100-dut": {"null": {}}}, "pre_only_config": {"sonic-s6100-dut": {"null": {"VLAN_MEMBER": {"Vlan2|Ethernet8": {"tagging_mode": "untagged"}, "Vlan2|Ethernet0": {"tagging_mode": "untagged"}, "Vlan2|Ethernet12": {"tagging_mode": "untagged"}, "Vlan2|Ethernet4": {"tagging_mode": "untagged"}}}}}, "pass": false}}

======================================================================================================== warnings summary ========================================================================================================= /usr/local/lib/python2.7/dist-packages/_pytest/config/init.py:545 /usr/local/lib/python2.7/dist-packages/_pytest/config/init.py:545: PytestAssertRewriteWarning: Module already imported so cannot be rewritten: tests.common.plugins.loganalyzer self.import_plugin(import_spec)

/usr/local/lib/python2.7/dist-packages/_pytest/config/init.py:545 /usr/local/lib/python2.7/dist-packages/_pytest/config/init.py:545: PytestAssertRewriteWarning: Module already imported so cannot be rewritten: tests.common.plugins.sanity_check self.import_plugin(import_spec)

/usr/local/lib/python2.7/dist-packages/_pytest/config/init.py:545 /usr/local/lib/python2.7/dist-packages/_pytest/config/init.py:545: PytestAssertRewriteWarning: Module already imported so cannot be rewritten: tests.common.dualtor self.import_plugin(import_spec)

snappi_tests/dinesh_response_time_pr/test_multidut_pfcwd_a2a_with_snappi.py::test_multidut_pfcwd_all_to_all[linecard_configuration_set0-non_chassis_single_line_card-False] /usr/local/lib/python2.7/dist-packages/pytest_ansible/module_dispatcher/v28.py:81: UserWarning: provided hosts list is empty, only localhost is available warnings.warn("provided hosts list is empty, only localhost is available")

-- Docs: https://docs.pytest.org/en/latest/warnings.html ----------------------------------------------------------------------------------------------------- live log sessionfinish ------------------------------------------------------------------------------------------------------ 18:33:00 init.pytest_terminal_summary L0064 INFO | Can not get Allure report URL. Please check logs ==================== 1 passed, 4 warnings in 182.07 seconds ==================== INFO:root:Can not get Allure report URL. Please check logs

vikumarks avatar Mar 29 '23 23:03 vikumarks

Testplan for pfcwd a2a testcase is same for both singledut and multidut https://github.com/sonic-net/sonic-mgmt/blob/master/docs/testplan/pfcwd/PFCWD_2SENDER_2RECEIVER.md

kamalsahu0001 avatar Apr 19 '23 17:04 kamalsahu0001

/azp run

dks0692 avatar Aug 25 '23 17:08 dks0692

Commenter does not have sufficient privileges for PR 7916 in repo sonic-net/sonic-mgmt

azure-pipelines[bot] avatar Aug 25 '23 17:08 azure-pipelines[bot]

@developfast Can you please review

dks0692 avatar Oct 06 '23 16:10 dks0692

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/snappi_tests/multidut/pfcwd/test_multidut_pfcwd_a2a_with_snappi.py:9:1: F401 'tests.snappi_tests.multidut.pfcwd.files.pfcwd_multidut_multi_node_helper.skip_pfcwd_test' imported but unused

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 Feb 21 '24 01:02 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 tests/snappi_tests/multidut/pfcwd/files/pfcwd_multidut_multi_node_helper.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 Feb 21 '24 01:02 mssonicbld

@developfast can we merge this PR

vikumarks avatar Mar 13 '24 19:03 vikumarks

@yxieca @developfast @wangxin please help merge.

vmittal-msft avatar Mar 19 '24 23:03 vmittal-msft

@yxieca @developfast @wangxin please help merge.

vikumarks avatar Mar 26 '24 22:03 vikumarks

@yxieca @developfast @wangxin please help merge.

vikumarks avatar Apr 02 '24 02:04 vikumarks

@yxieca @wangxin please help merge.

vmittal-msft avatar Apr 08 '24 17:04 vmittal-msft