Skip to content

[action] [PR:9312] Refactor fixture recover_acl_rule and and use it in module cacl/test_cacl_function.py.#9524

Merged
mssonicbld merged 1 commit intosonic-net:202305from
mssonicbld:cherry/202305/9312
Aug 18, 2023
Merged

[action] [PR:9312] Refactor fixture recover_acl_rule and and use it in module cacl/test_cacl_function.py.#9524
mssonicbld merged 1 commit intosonic-net:202305from
mssonicbld:cherry/202305/9312

Conversation

@mssonicbld
Copy link
Collaborator

Description of PR

In module cacl/test_cacl_function.py, it will use command acl-loader delete to delete all acl rules, no matter if the testbed has DATAACL rules before test or not. If this testbed has DATAACL rules before, this deletion will cause inconsistent between previous running config and current running config, and will cause unnecessary config reload. In PR #9199 , we have a fixture recover_acl_rule to recovery acl rules. So in this PR, I refactor this fixture and use this fixture to recover acl rules in module cacl/test_cacl_function.py.

Summary:
Fixes # (issue)

Type of change

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

Back port request

  • 201911
  • 202012
  • 202205

Approach

What is the motivation for this PR?

In module cacl/test_cacl_function.py, it will use command acl-loader delete to delete all acl rules, no matter if the testbed has DATAACL rules before test or not. If this testbed has DATAACL rules before, this deletion will cause inconsistent between previous running config and current running config, and will cause unnecessary config reload. In PR #9199 , we have a fixture recover_acl_rule to recovery acl rules. So in this PR, I refactor this fixture and use this fixture to recover acl rules in module cacl/test_cacl_function.py.

How did you do it?

Move fixture recover_acl_rule to tests/conftest.py and use this fixture to recover acl rules in module cacl/test_cacl_function.py.

How did you verify/test it?

07:34:42 conftest.core_dump_and_config_check L1893 INFO | Core dump and config check passed for cacl/test_cacl_function.py

Any platform specific information?

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

Documentation

…st_cacl_function.py`. (sonic-net#9312)

Description of PR
In module cacl/test_cacl_function.py, it will use command acl-loader delete to delete all acl rules, no matter if the testbed has DATAACL rules before test or not. If this testbed has DATAACL rules before, this deletion will cause inconsistent between previous running config and current running config, and will cause unnecessary config reload. In PR sonic-net#9199 , we have a fixture recover_acl_rule to recovery acl rules. So in this PR, I refactor this fixture and use this fixture to recover acl rules in module cacl/test_cacl_function.py.

What is the motivation for this PR?
In module cacl/test_cacl_function.py, it will use command acl-loader delete to delete all acl rules, no matter if the testbed has DATAACL rules before test or not. If this testbed has DATAACL rules before, this deletion will cause inconsistent between previous running config and current running config, and will cause unnecessary config reload. In PR sonic-net#9199 , we have a fixture recover_acl_rule to recovery acl rules. So in this PR, I refactor this fixture and use this fixture to recover acl rules in module cacl/test_cacl_function.py.

How did you do it?
Move fixture recover_acl_rule to tests/conftest.py and use this fixture to recover acl rules in module cacl/test_cacl_function.py.

How did you verify/test it?
```
07:34:42 conftest.core_dump_and_config_check      L1893 INFO   | Core dump and config check passed for cacl/test_cacl_function.py
```

Signed-off-by: Yutong Zhang <[email protected]>
@mssonicbld
Copy link
Collaborator Author

Original PR: #9312

@wangxin
Copy link
Collaborator

wangxin commented Aug 18, 2023

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld mssonicbld merged commit e215d04 into sonic-net:202305 Aug 18, 2023
@mssonicbld mssonicbld deleted the cherry/202305/9312 branch February 4, 2024 09:35
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.

3 participants