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

[pretest] Testcase to validate backend acl load #12510

Merged
merged 2 commits into from
Apr 22, 2024

Conversation

neethajohn
Copy link
Contributor

@neethajohn neethajohn commented Apr 18, 2024

Description of PR

Summary:
Fixes #12048

Type of change

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

Back port request

  • 201911
  • 202012
  • 202205
  • 202305
  • 202311

Approach

What is the motivation for this PR?

Add an explicit testcase to validate that acl is loaded successfully on the backend T0 testbed. Without this case, acl load failure was determined by examining the nighly run failures on the backend testbed

How did you verify/test it?

Ran the test against a backend T0 testbed with the fix to load acl correctly and it passed
Ran the test against a non backend T0 testbed and it is skipped

test_pretest.py::test_features_state[str2-7050qx-32s-acs-02] PASSED                                                                    [  7%]
test_pretest.py::test_cleanup_testbed[str2-7050qx-32s-acs-02] PASSED                                                                   [ 14%]
test_pretest.py::test_disable_container_autorestart[str2-7050qx-32s-acs-02] PASSED                                                     [ 21%]
test_pretest.py::test_disable_rsyslog_rate_limit[str2-7050qx-32s-acs-02] PASSED                                                        [ 28%]
test_pretest.py::test_connect_to_internal_nameserver[str2-7050qx-32s-acs-02] PASSED                                                    [ 35%]
test_pretest.py::test_update_buffer_template[str2-7050qx-32s-acs-02] PASSED                                                            [ 42%]
test_pretest.py::test_backend_acl_load[str2-7050qx-32s-acs-02] PASSED                                                                  [ 50%]
test_pretest.py::test_cleanup_cache PASSED                                                                                             [ 57%]
test_pretest.py::test_update_testbed_metadata 
--------------------------------------------------------------- live log call ----------------------------------------------------------------
19:55:47 test_pretest.prepare_autonegtest_params  L0358 WARNING| skipped to create autoneg test datafile because of no ports selected
PASSED                                                                                                                                 [ 64%]
test_pretest.py::test_collect_testbed_prio PASSED                                                                                      [ 71%]
test_pretest.py::test_collect_pfc_pause_delay_params PASSED                                                                            [ 78%]
test_pretest.py::test_update_saithrift_ptf SKIPPED (No URL specified for python saithrift package)                                     [ 85%]
test_pretest.py::test_conn_graph_valid PASSED                                                                                          [ 92%]
test_pretest.py::test_generate_running_golden_config PASSED                                                                            [100%]


test_pretest.py::test_backend_acl_load[str2-7050qx-32s-acs-03] SKIPPED (Skip 'test_backend_acl_load' on non t0-backend testbeds.)      [100%]

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

t0-backend

@bingwang-ms
Copy link
Collaborator

The test case looks good to me, but can we put the test case in the acl folder? It's because we usually put some utility function in pre test.

Copy link
Contributor

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

@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/test_pretest.py:379:13: E129 visually indented line with same indent as next logical line

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>

@neethajohn
Copy link
Contributor Author

The test case looks good to me, but can we put the test case in the acl folder? It's because we usually put some utility function in pre test.

wanted to have this as a pretest check for backend testbed since all nightly runs depend on this acl being setup properly.

@bingwang-ms
Copy link
Collaborator

The test case looks good to me, but can we put the test case in the acl folder? It's because we usually put some utility function in pre test.

wanted to have this as a pretest check for backend testbed since all nightly runs depend on this acl being setup properly.

I see. So if test test_backend_acl_load failed, then all the other test cases won't be executed. If that's the expectation, I'm good to put it in pre test.

bingwang-ms
bingwang-ms previously approved these changes Apr 19, 2024
@yxieca yxieca merged commit 89a3ea3 into sonic-net:master Apr 22, 2024
13 checks passed
mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Apr 24, 2024
* Testcase to validate backend acl load

Signed-off-by: Neetha John <[email protected]>
mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Apr 24, 2024
* Testcase to validate backend acl load

Signed-off-by: Neetha John <[email protected]>
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202311: #12576

@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202305: #12577

@neethajohn
Copy link
Contributor Author

Testing was done against 202305 image on t0-backend and non t0-backend

mssonicbld pushed a commit that referenced this pull request Apr 24, 2024
* Testcase to validate backend acl load

Signed-off-by: Neetha John <[email protected]>
mssonicbld pushed a commit that referenced this pull request Apr 24, 2024
* Testcase to validate backend acl load

Signed-off-by: Neetha John <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ACL] Add a testcase for DATAACL rule validation on backend testbeds
5 participants