Skip to content

Replace redis-cli with sonic-db-cli for the test cases could be run for image with or without ENABLE_MULTIDB=y#15084

Open
Pan-XT wants to merge 3 commits intosonic-net:masterfrom
Pan-XT:multidb
Open

Replace redis-cli with sonic-db-cli for the test cases could be run for image with or without ENABLE_MULTIDB=y#15084
Pan-XT wants to merge 3 commits intosonic-net:masterfrom
Pan-XT:multidb

Conversation

@Pan-XT
Copy link

@Pan-XT Pan-XT commented Oct 22, 2024

Description of PR

Modify /tests/iface_namingmode/test_iface_namingmode.py and /tests/generic_config_updater/test_mmu_dynamic_threshold_config_update.py
Replace redis-cli with sonic-db-cli for the test cases could be run for image with or without ENABLE_MULTIDB=y

Summary:
Fixes # (issue)

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Approach

What is the motivation for this PR?

sonic-mgmt tests for multi DB

How did you do it?

Replace redis-cli with sonic-db-cli

How did you verify/test it?

For test_iface_namingmode.py, run
./run_tests.sh -n vms-kvm-t0 -d vlab-01 -c iface_namingmode/test_iface_namingmode.py -f vtestbed.yaml -i ../ansible/veos_vtb -e "--neighbor_type=sonic"
in image with or without ENABLE_MULTIDB=y, results are both
38 passed, 22 skipped, 1 warning

For test_mmu_dynamic_threshold_config_update.py, run
./run_tests.sh -n vms-kvm-t0 -d vlab-01 -c generic_config_updater/test_mmu_dynamic_threshold_config_update.py -f vtestbed.yaml -i ../ansible/veos_vtb -e "--neighbor_type=sonic"
in image with or without ENABLE_MULTIDB=y, results are both
generic_config_updater/test_mmu_dynamic_threshold_config_update.py::test_dynamic_th_config_updates[replace] PASSED [100%]
instead of SKIPPED

@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/generic_config_updater/test_mmu_dynamic_threshold_config_update.py:95:121: E501 line too long (124 > 120 characters)
tests/iface_namingmode/test_iface_namingmode.py:320:15: E275 missing whitespace after keyword
tests/iface_namingmode/test_iface_namingmode.py:554:15: E275 missing whitespace after keyword

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
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/iface_namingmode/test_iface_namingmode.py:320:15: E275 missing whitespace after keyword
tests/iface_namingmode/test_iface_namingmode.py:554:15: E275 missing whitespace after keyword

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>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants