Skip to content

[CRM] Wait more time for CRM stats to update - 201811 branch#1053

Merged
yxieca merged 1 commit intosonic-net:201811from
wangxin:crm-wait-201811
Aug 5, 2019
Merged

[CRM] Wait more time for CRM stats to update - 201811 branch#1053
yxieca merged 1 commit intosonic-net:201811from
wangxin:crm-wait-201811

Conversation

@wangxin
Copy link
Copy Markdown
Collaborator

@wangxin wangxin commented Aug 4, 2019

Description of PR

Summary:
Fixes # (issue)

CRM testing may fail because CRM stats was not updated yet
while checking the counters. Main purpose of this change is
to increase the time waiting for CRM update from 2 seconds
to 4 seconds. Two other improvements:

  • Decrease the time waiting for CRM counters update from
    300 seconds to 30 seconds. The 300 seconds waiting is
    unnecessary.
  • Use a single redis-cli command to get used and available
    counters rather than two commands.

Because there was conflict merging PR #1027 to 201811 branch, I resolved the conflicts, tested again and created this PR to the 201811 branch.

Type of change

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

Approach

How did you do it?

  • Increase the time waiting for CRM counters update from 2 seconds to 4 seconds.
  • Decrease the time waiting for CRM counters update from 300 seconds to 30 seconds.
  • Use a single redis-cli command to get used and available counters rather than two commands.

How did you verify/test it?

Tested on Mellanox platform.

TASK [test : debug] ************************************************************
task path: /root/code/sonic-mgmt/ansible/roles/test/tasks/test_sonic_by_testname.yml:44
Sunday 04 August 2019  03:46:17 +0000 (0:00:00.611)       0:29:06.041 ********* 
ok: [mtbc-sonic-03-2700-t0] => {
    "msg": [
        "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", 
        "!!!!!!!!!!!!!!!!!!!! end running test crm !!!!!!!!!!!!!!!!!!!!!!", 
        "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    ]
}

TASK [test : include] **********************************************************
task path: /root/code/sonic-mgmt/ansible/roles/test/tasks/main.yml:8
Sunday 04 August 2019  03:46:18 +0000 (0:00:00.158)       0:29:06.199 ********* 
skipping: [mtbc-sonic-03-2700-t0] => {"changed": false, "skip_reason": "Conditional check failed", "skipped": true}

PLAY ***************************************************************************
skipping: no hosts matched

PLAY RECAP *********************************************************************
mtbc-sonic-03-2700-t0      : ok=2390 changed=762  unreachable=0    failed=0   

Sunday 04 August 2019  03:46:18 +0000 (0:00:00.096)       0:29:06.296 ********* 
=============================================================================== 
TASK: test : Make sure CRM counters updated ---------------------------- 30.11s
TASK: test : Copy loganalyzer common match and ignore files to switch -- 15.24s
TASK: test : Copy loganalyzer common match and ignore files to switch -- 14.65s
TASK: test : Copy loganalyzer common match and ignore files to switch -- 14.29s
TASK: test : Copy loganalyzer common match and ignore files to switch -- 12.98s
TASK: test : Copy loganalyzer common match and ignore files to switch -- 11.11s
TASK: test : Copy loganalyzer common match and ignore files to switch --- 9.79s
TASK: test : Copy loganalyzer common match and ignore files to switch --- 9.47s
TASK: test : Copy loganalyzer common match and ignore files to switch --- 7.96s
TASK: test : Copy loganalyzer common match and ignore files to switch --- 7.90s
TASK: test : Get ethertype for ACL entry in order to match ACL which was configured --- 7.51s
TASK: test : Copy loganalyzer common match and ignore files to switch --- 7.08s
TASK: test : Get ethertype for ACL entry in order to match ACL which was configured --- 6.87s
TASK: test : Copy loganalyzer common match and ignore files to switch --- 6.36s
TASK: test : Copy loganalyzer common match and ignore files to switch --- 6.10s
TASK: test : Copy loganalyzer common match and ignore files to switch --- 6.08s
TASK: test : Copy loganalyzer common match and ignore files to switch --- 5.99s
TASK: test : Copy loganalyzer common match and ignore files to switch --- 5.59s
TASK: test : Copy loganalyzer common match and ignore files to switch --- 5.49s
TASK: test : Copy loganalyzer common match and ignore files to switch --- 5.44s

Any platform specific information?

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

Documentation

CRM testing may fail because CRM stats was not updated yet
while checking the counters. Main purpose of this change is
to increase the time waiting for CRM update from 2 seconds
to 4 seconds. Two other improvements:
* Decrease the time waiting for CRM counters update from
300 seconds to 30 seconds. The 300 seconds waiting is
unnecessary.
* Use a single redis-cli command to get used and available
counters rather than two commands.

Signed-off-by: Xin Wang <[email protected]>
@yxieca yxieca merged commit 374c5d1 into sonic-net:201811 Aug 5, 2019
@wangxin wangxin deleted the crm-wait-201811 branch September 26, 2019 12:35
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
Add watchdogutil to control the hw watchdog (sonic-net#945)
[db_migrator] Support migrating database regarding buffer
configuration for all Mellanox switches (sonic-net#1053)

Signed-off-by: Abhishek Dosi <[email protected]>
Pterosaur pushed a commit to Pterosaur/sonic-mgmt that referenced this pull request Mar 25, 2026
Pterosaur pushed a commit to Pterosaur/sonic-mgmt that referenced this pull request Mar 26, 2026
arawat-nexthop pushed a commit to nexthop-ai/sonic-mgmt that referenced this pull request Apr 9, 2026
… (0xFD) (sonic-net#1053)

### Description of PR
Our syseeprom uses multiple vendor extension fields:
```
admin@humm152:~$ show plat syseeprom
TlvInfo Header:
   Id String:    TlvInfo
   Version:      1
   Total Length: 170
TLV Name          Code      Len  Value
----------------  ------  -----  ----------------------------------------------------------------------------------------------
Product Name      0x21        9  NH-5010-F
Part Number       0x22       12  950-00004-01
Serial Number     0x23       14  NH-SMP2544003C
Base MAC Address  0x24        6  E8:E4:9D:10:14:2B
Device Version    0x26        1  0
Label Revision    0x27        2  P1
Platform Name     0x28       22  x86_64-nexthop_5010-r0
Manufacturer      0x2B       19  Nexthop Systems Inc
Vendor Name       0x2D       10  Nexthop AI
Service Tag       0x2F       14  www.nexthop.ai
Vendor Extension  0xFD       19  0x00 0x00 0xF6 0x62 0x01 0x4E 0x48 0x2D 0x53 0x4D 0x50 0x32 0x35 0x34 0x32 0x30 0x30 0x32 0x44
Vendor Extension  0xFD       12  0x00 0x00 0xF6 0x62 0x02 0x4E 0x48 0x32 0x35 0x2D 0x35 0x30
CRC-32            0xFE        4  0x9F510544

(checksum valid)
```
Having multiple vendor extension fields is supported by the ONIE EEPROM
format. We're not the only vendor that does this, NVIDIA does it too.

This PR updates test_chassis.py to handle multiple vendor extensions.

Summary:
Fixes https://nexthopai.atlassian.net/browse/NOS-4372 (and
https://nexthopai.atlassian.net/browse/MSFT-16)

### Type of change
- [ ] Bug fix
- [ ] Testbed and Framework(new/improvement)
- [ ] New Test case
    - [ ] Skipped for non-supported platforms
- [x] Test case improvement


### Back port request
- [x] 202505
- [x] 202511

### Approach
#### What is the motivation for this PR?
Currently test_chassis.py assumes there is only 1 vendor extension if it
exists. Updating the test to handle multiple vendor extensions.

#### How did you do it?
Handles the case where the host_vars (expected values) provides > 1
vendor extension and/or if the syseeprom on the DUT has > 1 vendor
extension.

#### How did you verify/test it?
Tested with the following host_vars:

1) Multiple vendor extensions:
```
roy@roy-vm:~/repos/nh/sonic-mgmt/ansible/host_vars$ cat humm152.yml
console_baudrate: 115200

syseeprom_info:
    "0x21": "NH-5010-F"
    "0x23": "NH-SMP2544003C"
    "0x2D": "Nexthop AI"
    "0xFD":
        - "0x00 0x00 0xF6 0x62 0x02 0x4E 0x48 0x32 0x35 0x2D 0x35 0x30"
        - "0x00 0x00 0xF6 0x62 0x01 0x4E 0x48 0x2D 0x53 0x4D 0x50 0x32 0x35 0x34 0x32 0x30 0x30 0x32 0x44"

testbed_extra_config: {"long_cables": false}
```

2) Single expected vendor extension:
```
roy@roy-vm:~/repos/nh/sonic-mgmt/ansible/host_vars$ cat humm152.yml
console_baudrate: 115200

syseeprom_info:
    "0x21": "NH-5010-F"
    "0x23": "NH-SMP2544003C"
    "0x2D": "Nexthop AI"
    "0xFD": "0x00 0x00 0xF6 0x62 0x01 0x4E 0x48 0x2D 0x53 0x4D 0x50 0x32 0x35 0x34 0x32 0x30 0x30 0x32 0x44"

testbed_extra_config: {"long_cables": false}
```

In both cases the test passed.
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