Refactor fixture recover_acl_rule and and use it in module cacl/test_cacl_function.py.#9312
Conversation
|
The pre-commit check detected issues in the files touched by this pull request. Detailed pre-commit check results: To run the pre-commit checks locally, you can follow below steps:
|
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
| "interface_ref": | ||
| { | ||
| "config": { | ||
| "interface": "Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet4,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet8" |
There was a problem hiding this comment.
@yutongzhang-microsoft use the same interfaces for different topology?
There was a problem hiding this comment.
No, this is set by pre_acl_rules
Description of PR PR #9199 modified the template acl.json under folder tests/crm/templates and added a key input_interface in this template. Only backend topo supports this key, so it will generate an error log in non-backend topo. In this PR, I revert the change to this template. And for recovery, we have another template in PR #9312 . What is the motivation for this PR? PR #9199 modified the template acl.json under folder tests/crm/templates and added a key input_interface in this template. Only backend topo supports this key, so it will generate an error log in non-backend topo. In this PR, I revert the change to this template. And for recovery, we have another template in PR #9312 How did you do it? Revert the change to template acl json. Signed-off-by: Yutong Zhang <yutongzhang@microsoft.com>
| "vlan_id": "1000" | ||
| } | ||
| }, | ||
| "input_interface": { |
There was a problem hiding this comment.
According to #9346, should remove input_interface here?
There was a problem hiding this comment.
No, this template only be used by backend topo, and backend topo support this config.
Description of PR PR sonic-net#9199 modified the template acl.json under folder tests/crm/templates and added a key input_interface in this template. Only backend topo supports this key, so it will generate an error log in non-backend topo. In this PR, I revert the change to this template. And for recovery, we have another template in PR sonic-net#9312 . What is the motivation for this PR? PR sonic-net#9199 modified the template acl.json under folder tests/crm/templates and added a key input_interface in this template. Only backend topo supports this key, so it will generate an error log in non-backend topo. In this PR, I revert the change to this template. And for recovery, we have another template in PR sonic-net#9312 How did you do it? Revert the change to template acl json. Signed-off-by: Yutong Zhang <yutongzhang@microsoft.com>
Description of PR PR sonic-net#9199 modified the template acl.json under folder tests/crm/templates and added a key input_interface in this template. Only backend topo supports this key, so it will generate an error log in non-backend topo. In this PR, I revert the change to this template. And for recovery, we have another template in PR sonic-net#9312 . What is the motivation for this PR? PR sonic-net#9199 modified the template acl.json under folder tests/crm/templates and added a key input_interface in this template. Only backend topo supports this key, so it will generate an error log in non-backend topo. In this PR, I revert the change to this template. And for recovery, we have another template in PR sonic-net#9312 How did you do it? Revert the change to template acl json. Signed-off-by: Yutong Zhang <yutongzhang@microsoft.com>
Description of PR PR sonic-net#9199 modified the template acl.json under folder tests/crm/templates and added a key input_interface in this template. Only backend topo supports this key, so it will generate an error log in non-backend topo. In this PR, I revert the change to this template. And for recovery, we have another template in PR sonic-net#9312 . What is the motivation for this PR? PR sonic-net#9199 modified the template acl.json under folder tests/crm/templates and added a key input_interface in this template. Only backend topo supports this key, so it will generate an error log in non-backend topo. In this PR, I revert the change to this template. And for recovery, we have another template in PR sonic-net#9312 How did you do it? Revert the change to template acl json. Signed-off-by: Yutong Zhang <yutongzhang@microsoft.com>
Description of PR PR #9199 modified the template acl.json under folder tests/crm/templates and added a key input_interface in this template. Only backend topo supports this key, so it will generate an error log in non-backend topo. In this PR, I revert the change to this template. And for recovery, we have another template in PR #9312 . What is the motivation for this PR? PR #9199 modified the template acl.json under folder tests/crm/templates and added a key input_interface in this template. Only backend topo supports this key, so it will generate an error log in non-backend topo. In this PR, I revert the change to this template. And for recovery, we have another template in PR #9312 How did you do it? Revert the change to template acl json. Signed-off-by: Yutong Zhang <yutongzhang@microsoft.com>
Description of PR PR #9199 modified the template acl.json under folder tests/crm/templates and added a key input_interface in this template. Only backend topo supports this key, so it will generate an error log in non-backend topo. In this PR, I revert the change to this template. And for recovery, we have another template in PR #9312 . What is the motivation for this PR? PR #9199 modified the template acl.json under folder tests/crm/templates and added a key input_interface in this template. Only backend topo supports this key, so it will generate an error log in non-backend topo. In this PR, I revert the change to this template. And for recovery, we have another template in PR #9312 How did you do it? Revert the change to template acl json. Signed-off-by: Yutong Zhang <yutongzhang@microsoft.com>
Description of PR PR #9199 modified the template acl.json under folder tests/crm/templates and added a key input_interface in this template. Only backend topo supports this key, so it will generate an error log in non-backend topo. In this PR, I revert the change to this template. And for recovery, we have another template in PR #9312 . What is the motivation for this PR? PR #9199 modified the template acl.json under folder tests/crm/templates and added a key input_interface in this template. Only backend topo supports this key, so it will generate an error log in non-backend topo. In this PR, I revert the change to this template. And for recovery, we have another template in PR #9312 How did you do it? Revert the change to template acl json. Signed-off-by: Yutong Zhang <yutongzhang@microsoft.com>
|
@yutongzhang-microsoft PR conflicts with 202012 branch |
|
@yutongzhang-microsoft PR conflicts with 202205 branch |
…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 <yutongzhang@microsoft.com>
|
Cherry-pick PR to 202305: #9524 |
…st_cacl_function.py`. (#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 #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 #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 <yutongzhang@microsoft.com>
Description of PR PR #9312 will try to get DATAACL in running config in fixture recover_acl_rule. But if param enable_data_acl is set false when deploying minigraph, DATAACL will not appear in running config. Which may cause key error in fixture recover_acl_rule. In this PR, we fix this issue. What is the motivation for this PR? PR #9312 will try to get DATAACL in running config in fixture recover_acl_rule. But if param enable_data_acl is set false when deploying minigraph, DATAACL will not appear in running config. Which may cause key error in fixture recover_acl_rule. In this PR, we fix this issue. How did you do it? Run TC on testbed which enable_data_acl is false when deploying minigraph. Signed-off-by: Yutong Zhang <yutongzhang@microsoft.com>
Description of PR PR sonic-net#9199 modified the template acl.json under folder tests/crm/templates and added a key input_interface in this template. Only backend topo supports this key, so it will generate an error log in non-backend topo. In this PR, I revert the change to this template. And for recovery, we have another template in PR sonic-net#9312 . What is the motivation for this PR? PR sonic-net#9199 modified the template acl.json under folder tests/crm/templates and added a key input_interface in this template. Only backend topo supports this key, so it will generate an error log in non-backend topo. In this PR, I revert the change to this template. And for recovery, we have another template in PR sonic-net#9312 How did you do it? Revert the change to template acl json. Signed-off-by: Yutong Zhang <yutongzhang@microsoft.com>
…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 <yutongzhang@microsoft.com>
Description of PR PR sonic-net#9312 will try to get DATAACL in running config in fixture recover_acl_rule. But if param enable_data_acl is set false when deploying minigraph, DATAACL will not appear in running config. Which may cause key error in fixture recover_acl_rule. In this PR, we fix this issue. What is the motivation for this PR? PR sonic-net#9312 will try to get DATAACL in running config in fixture recover_acl_rule. But if param enable_data_acl is set false when deploying minigraph, DATAACL will not appear in running config. Which may cause key error in fixture recover_acl_rule. In this PR, we fix this issue. How did you do it? Run TC on testbed which enable_data_acl is false when deploying minigraph. Signed-off-by: Yutong Zhang <yutongzhang@microsoft.com>
Description of PR
In module
cacl/test_cacl_function.py, it will use commandacl-loader deleteto 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 fixturerecover_acl_ruleto recovery acl rules. So in this PR, I refactor this fixture and use this fixture to recover acl rules in modulecacl/test_cacl_function.py.Summary:
Fixes # (issue)
Type of change
Back port request
Approach
What is the motivation for this PR?
In module
cacl/test_cacl_function.py, it will use commandacl-loader deleteto 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 fixturerecover_acl_ruleto recovery acl rules. So in this PR, I refactor this fixture and use this fixture to recover acl rules in modulecacl/test_cacl_function.py.How did you do it?
Move fixture
recover_acl_ruleto tests/conftest.py and use this fixture to recover acl rules in modulecacl/test_cacl_function.py.How did you verify/test it?
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation