[Test Gap] Cover all cacl protocols in GCU test_cacl#13543
[Test Gap] Cover all cacl protocols in GCU test_cacl#13543wangxin merged 2 commits intosonic-net:masterfrom
Conversation
Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
|
Hi, @ZhaohuiS, did you test these new added scripts on kvm testbed? Can they be added in PR checker? |
No yet, I don't have kvm test env. But yes, we can add it into PR test, which is only kernel and sw related, not require specific hw. |
Can you try to add in onborading_ set in |
Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
Done, all of this script cases were passed on PR test on t0 topo. |
|
@ZhaohuiS PR conflicts with 202405 branch |
|
@ZhaohuiS PR conflicts with 202311 branch |
Cherry pick #13543 into 202311 Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
Cherry pick #13543 into 202405 Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
What is the motivation for this PR? Original test_cacl only covers parts of SNMP or SSH protocol test, sonic-net/sonic-host-services#9 introduce EXTERNAL_CLIENT, we have to cover it in GCU test_cacl How did you do it? Enhance many functions to support different protocols and add a fixture cacl_protocol to test SSH, SNMP,NTP, EXTERNAL_CLIENT one by one. Also add T1 topology in mark topology list. Test steps: TC1 cacl table: 1. Test to add a new cacl table, which should expect success 2. test add duplicated cacl table, which should expect success 3. Test replace some variable in existing cacl table, which should expect success 4. Test add invalid cacl table, which should expect failure 5. Test remove non-existed cacl table, which should expect failure 6. Test remove cacl table, , which should expect success, 7. Test previous steps for SSH, SNMP,NTP, EXTERNAL_CLIENT one by one TC2 cacl rule: 1. Test to add a new cacl rule, which should expect success and iptables rules are expected 2. test add duplicated cacl rule, which should expect success and iptables rules are expected 3. Test replace some variable in existing cacl rule, which should expect success and iptables rules are expected 4. Test add cacl rule into non-existed cacl table, which should expect failure 5. Test remove cacl table which has cacl rules, which should expect failure 6. Test remove non-existed cacl rule, which should expect success, 7. Test remove ACL_RULE path, which should expect success and none of unexpected iptables rules exists 8. Test previous steps for SSH, SNMP,NTP, EXTERNAL_CLIENT one by one How did you verify/test it? collected 8 items generic_config_updater/test_cacl.py::test_cacl_tc1_acl_table_suite[SSH] PASSED [ 12%] generic_config_updater/test_cacl.py::test_cacl_tc2_acl_rule_test[SSH] PASSED [ 25%] generic_config_updater/test_cacl.py::test_cacl_tc1_acl_table_suite[NTP] PASSED [ 37%] generic_config_updater/test_cacl.py::test_cacl_tc2_acl_rule_test[NTP] PASSED [ 50%] generic_config_updater/test_cacl.py::test_cacl_tc1_acl_table_suite[SNMP] PASSED [ 62%] generic_config_updater/test_cacl.py::test_cacl_tc2_acl_rule_test[SNMP] PASSED [ 75%] generic_config_updater/test_cacl.py::test_cacl_tc1_acl_table_suite[EXTERNAL_CLIENT] PASSED [ 87%] generic_config_updater/test_cacl.py::test_cacl_tc2_acl_rule_test[EXTERNAL_CLIENT] PASSED [100%] ============================================================================================================ warnings summary ============================================================================================================ Any platform specific information? Run tests/generic_config_updater/test_cacl.py Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
Description of PR
Summary:
Fixes # (issue)
Fix the test gap #12816
Type of change
Back port request
Approach
What is the motivation for this PR?
Original test_cacl only covers parts of SNMP or SSH protocol test, sonic-net/sonic-host-services#9 introduce EXTERNAL_CLIENT, we have to cover it in GCU test_cacl
How did you do it?
Enhance many functions to support different protocols and add a fixture cacl_protocol to test SSH, SNMP,NTP, EXTERNAL_CLIENT one by one.
Also add T1 topology in mark topology list.
Test steps:
TC1 cacl table:
TC2 cacl rule:
27868222
How did you verify/test it?
Any platform specific information?
Run
tests/generic_config_updater/test_cacl.pySupported testbed topology if it's a new test case?
Documentation