[test_crm] Fix test_acl_counter and test_crm_nexthop_group in test_crm#2272
[test_crm] Fix test_acl_counter and test_crm_nexthop_group in test_crm#2272bingwang-ms merged 3 commits intosonic-net:masterfrom
Conversation
Because the acl counter is relatively large in some DUT, and even 1% of the acl counter will be larger than the avaliable acl entry. This PR adds a limit to the acl entry that are applied to DUT.
|
This pull request fixes 1 alert when merging 8ac823c into 30180c9 - view on LGTM.com fixed alerts:
|
tests/crm/test_crm.py
Outdated
| if used_percent < 1: | ||
| logger.warning("CRM used entries is < 1 percent") | ||
| if used_percent < 1 or used_percent >= 100: | ||
| logger.warning("CRM used entries is < 1 or >= 100 percent") |
There was a problem hiding this comment.
Can you add used_percent in the debug output?
Also, the wording is a bit confusing, is this intended use percentage or used percentage?
If this is intended use percentage, can we change the test to test a smaller number instead of skipping?
There was a problem hiding this comment.
Thanks. I've updated the log and added the used_percentage.
The test script is to configure the crm threshold type to percentage, and then insert a number of acl rules to trigger acm WARNING log. Therefore, the least used percentage is 1% to do the test. If we are limited to the available acl entry number, and can't add enough acl rules, the used percentage of acl group counter will be below 1%, then the verification has to be skipped.
|
This pull request fixes 1 alert when merging 7e0a246 into d190bb2 - view on LGTM.com fixed alerts:
|
|
retest vsimage please |
The test case will attempt to insert more nexthop members than the total available number on some devices. As a result, SAI will return error. This commit add a check and get the min value between avaiable nexthop_group_member and nexthop_group_object before inserting new nexthops.
|
An update is post to fix similar issue in test_crm_nexthop_group |
|
This pull request fixes 1 alert when merging d3b2770 into d190bb2 - view on LGTM.com fixed alerts:
|
|
@yvolynets-mlnx Could you help to review? Thanks! |
Thanks. I've merged. |
… advance submodule head (sonic-net#11518) sairedis: * 38c0bb1 2022-07-21 | [sairedis] Fix reopen recoding file (sonic-net#1087) (HEAD -> 202205, github/202205) [Kamil Cudnik] platform-daemon: * 17587b6 2022-07-22 | [ycabled] add secure channel support for grpc dualtor active-active connectivity (sonic-net#275) (HEAD -> 202205, github/202205) [vdahiya12] linkmgrd: * c911ec7 2022-07-21 | Avoid unnecessary error logs from `handleGetServerMacAddressNotification` (sonic-net#96) (HEAD -> 202205) [Jing Zhang] * bbae81d 2022-07-18 | Add support for reconciliation after warm restart (sonic-net#76) [Jing Zhang] utilities: * bcc1206 2022-07-20 | Change db_migrator major version on master branch from version 2 to 3 (sonic-net#2272) (HEAD -> 202205) [Vaibhav Hemant Dixit] * ad40697 2022-07-21 | Fix test for pfcwd_sw_enable in db_migrator_test (sonic-net#2253) [bingwang-ms] * 886f612 2022-07-22 | Revert "show commands for SYSTEM READY (sonic-net#1851) (sonic-net#2261)" (sonic-net#2274) (github/202205) [Ying Xie] * a6404b7 2022-07-17 | show commands for SYSTEM READY (sonic-net#1851) (sonic-net#2261) [Senthil Kumar Guruswamy] swss-common: * 509b265 2022-07-06 | Add device global table definition (sonic-net#645) (HEAD -> 202205) [tjchadaga] Signed-off-by: Ying Xie <ying.xie@microsoft.com>
Description of PR
Summary:
Fixes # (issue)
This PR is to fix test_acl_counter in test_crm script.
Type of change
Approach
What is the motivation for this PR?
This PR is to fix
test_acl_counterandtest_crm_nexthop_groupin test_crm script.Because the acl counter is relatively large in some DUT, and even 1% of the acl counter will be larger than the avaliable acl entry.
We can check that with crm show resources acl table
On Arista 7260
On Celestica-DX010
We can tell that the avaliable acl_counter on Arista-7260 is relatively large, and even 1% of that figure will be larger that the total available acl_entry. Some exception will happen if we attempt to insert more acl rules than the available count.
This PR adds a limit to the acl entry, and if the acl_counter is too large, the check for percentage will be skipped.
Similar issue exists in
test_crm_nexthop_group. On Celestica-DX010, the total available nexthop group member is much larger than nexthop group objectIf we attempt to insert 1% of 16736, that is 167 nexthop members, SAI will return errors and cause exception in orchagent.
How did you do it?
Adds a limit to the acl entry and nexthop group member/object.
How did you verify/test it?
Verified on both Arista 7260 and Celestica-DX010.
Result of test_acl_counter on Arista 7260
Result of test_acl_counter on Celestica-DX010:
Result of test_crm_nexthop_group on Celestica-DX010:
Any platform specific information?
No.
Supported testbed topology if it's a new test case?
No.
Documentation
No.