Skip to content

Remove DATAACL to free TCAM resources for test_stress_acl.py#11250

Merged
wangxin merged 1 commit intosonic-net:masterfrom
kbabujp:sm_acl_stress
Jan 13, 2024
Merged

Remove DATAACL to free TCAM resources for test_stress_acl.py#11250
wangxin merged 1 commit intosonic-net:masterfrom
kbabujp:sm_acl_stress

Conversation

@kbabujp
Copy link
Contributor

@kbabujp kbabujp commented Jan 11, 2024

Description of PR

The goal of test_stress_acl.py is to add/delete acl entries frequently. Refer: #6903
test_stress_acl.py is adding new acl table and it will fail if the TCAM space is not available. As done in other acl tests, removing DATAACL to free TCAM resources to run test_stress_acl.py.

Summary:
Fixes # (issue)

Type of change

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

Back port request

  • 201911
  • 202012
  • 202205
  • [*] 202305

Approach

What is the motivation for this PR?

How did you do it?

How did you verify/test it?

Any platform specific information?

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

Documentation

@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/acl/test_stress_acl.py:38:1: E302 expected 2 blank lines, found 1
tests/acl/test_stress_acl.py:65:1: E302 expected 2 blank lines, found 1

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>

Copy link
Collaborator

Choose a reason for hiding this comment

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

  1. Config reload takes time. Is there a faster way to recover DATAACL after testing?
  2. If config reload is the only way to recover configuration, please use config source from running_golden_config:
config_reload(duthost, config_source="running_golden_config"

The reason is that there are some pretests updated a few configurations and saved the running config to "running_golden_config". We have a common fixture always compare the running config with the running golden config to detect any configuration not recovered by the current script to avoid affecting subsequent test scripts. If there are any configuration differences, the common fixture will do a reload.
So, if a test does not restore the configuration to running config, the common fixture has to do a config reload again. This will unnecessarily increase test time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for your comments, i have removed config reload and used other method to reconfigure the acl.

@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/acl/test_stress_acl.py:10:1: F401 'tests.common.config_reload.config_reload' imported but unused
tests/acl/test_stress_acl.py:39:1: E302 expected 2 blank lines, found 1
tests/acl/test_stress_acl.py:40:34: E231 missing whitespace after ','

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>

@wangxin wangxin merged commit adf8ead into sonic-net:master Jan 13, 2024
wangxin pushed a commit that referenced this pull request Oct 25, 2024
What is the motivation for this PR?
MX failed to fetch acl port due to DATAACL table in running config is removed by this PR: #11250

How did you do it?
Fetch acl port from mg_facts

How did you verify/test it?
Run test
mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Oct 25, 2024
What is the motivation for this PR?
MX failed to fetch acl port due to DATAACL table in running config is removed by this PR: sonic-net#11250

How did you do it?
Fetch acl port from mg_facts

How did you verify/test it?
Run test
mssonicbld pushed a commit that referenced this pull request Oct 25, 2024
What is the motivation for this PR?
MX failed to fetch acl port due to DATAACL table in running config is removed by this PR: #11250

How did you do it?
Fetch acl port from mg_facts

How did you verify/test it?
Run test
sreejithsreekumaran pushed a commit to sreejithsreekumaran/sonic-mgmt that referenced this pull request Nov 15, 2024
What is the motivation for this PR?
MX failed to fetch acl port due to DATAACL table in running config is removed by this PR: sonic-net#11250

How did you do it?
Fetch acl port from mg_facts

How did you verify/test it?
Run test
yutongzhang-microsoft pushed a commit to yutongzhang-microsoft/sonic-mgmt that referenced this pull request Nov 21, 2024
What is the motivation for this PR?
MX failed to fetch acl port due to DATAACL table in running config is removed by this PR: sonic-net#11250

How did you do it?
Fetch acl port from mg_facts

How did you verify/test it?
Run test
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.

3 participants