sonic-net / sonic-mgmt

Configuration management examples for SONiC
Other
200 stars 732 forks source link

stdout of “show platform syseeprom” is not same with output from eeprom.py #3258

Open nhe-NV opened 3 years ago

nhe-NV commented 3 years ago

Description

The output of the "show platform syseeprom" is not same with the outout get with the eeprom.py. In test_show_platform.py:test_show_platform_syseeprom, when compare the outputs, will get failure. Here is the outputs:

{"stderr_lines": [], "cmd": ["show", "platform", "syseeprom"], "end": "2021-03-31 20:22:14.904018", "_ansible_no_log": false, "stdout": "TlvInfo Header:\n Id String: TlvInfo\n Version: 1\n Total Length: 595\nTLV Name Code Len Value\n---------------- ------ ----- ----------------------\nProduct Name 0x21 64 MSN4600\nPart Number 0x22 20 MSN4600-VS2FO\nSerial Number 0x23 24 MT2025X00262\nBase MAC Address 0x24 6 1C:34:DA:1E:95:00\nManufacture Date 0x25 19 06/22/2020 14:04:56\nDevice Version 0x26 1 0\nPlatform Name 0x28 64 x86_64-mlnx_msn4600-r0\nONIE Version 0x29 21 2019.11-5.2.0019-9600\nMAC Addresses 0x2A 2 254\nManufacturer 0x2B 8 Mellanox\nVendor Extension 0xFD 36\nVendor Extension 0xFD 164\nVendor Extension 0xFD 36\nVendor Extension 0xFD 36\nVendor Extension 0xFD 36\nVendor Extension 0xFD 20\nCRC-32 0xFE 4 0x0A826CE8\n\n(checksum valid)", "changed": true, "rc": 0, "start": "2021-03-31 20:22:14.283388", "stderr": "", "delta": "0:00:00.620630", "invocation": {"module_args": {"warn": true, "executable": null, "_uses_shell": false, "strip_empty_ends": true, "_raw_params": "show platform syseeprom", "removes": null, "argv": null, "creates": null, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["TlvInfo Header:", " Id String: TlvInfo", " Version: 1", " Total Length: 595", "TLV Name Code Len Value", "---------------- ------ ----- ----------------------", "Product Name 0x21 64 MSN4600", "Part Number 0x22 20 MSN4600-VS2FO", "Serial Number 0x23 24 MT2025X00262", "Base MAC Address 0x24 6 1C:34:DA:1E:95:00", "Manufacture Date 0x25 19 06/22/2020 14:04:56", "Device Version 0x26 1 0", "Platform Name 0x28 64 x86_64-mlnx_msn4600-r0", "ONIE Version 0x29 21 2019.11-5.2.0019-9600", "MAC Addresses 0x2A 2 254", "Manufacturer 0x2B 8 Mellanox", "Vendor Extension 0xFD 36", "Vendor Extension 0xFD 164", "Vendor Extension 0xFD 36", "Vendor Extension 0xFD 36", "Vendor Extension 0xFD 36", "Vendor Extension 0xFD 20", "CRC-32 0xFE 4 0x0A826CE8", "", "(checksum valid)"], "failed": false}

{"stderr_lines": [], "cmd": ["sudo", "python", "-c", "import imp; m = imp.load_source('eeprom', '/usr/share/sonic/device/x86_64-mlnx_msn4600-r0/plugins/eeprom.py'); t = m.board('board', '', '', ''); e = t.read_eeprom(); t.decode_eeprom(e)"], "end": "2021-03-31 20:22:16.275207", "_ansible_no_log": false, "stdout": "TlvInfo Header:\n Id String: TlvInfo\n Version: 1\n Total Length: 595\nTLV Name Code Len Value\n-------------------- ---- --- -----\nProduct Name 0x21 64 MSN4600\nPart Number 0x22 20 MSN4600-VS2FO\nSerial Number 0x23 24 MT2025X00262\nBase MAC Address 0x24 6 1C:34:DA:1E:95:00\nManufacture Date 0x25 19 06/22/2020 14:04:56\nDevice Version 0x26 1 0\nMAC Addresses 0x2A 2 254\nManufacturer 0x2B 8 Mellanox\nVendor Extension 0xFD 36 \nVendor Extension 0xFD 164 \nVendor Extension 0xFD 36 \nVendor Extension 0xFD 36 \nVendor Extension 0xFD 36 \nVendor Extension 0xFD 20 \nPlatform Name 0x28 64 x86_64-mlnx_msn4600-r0\nONIE Version 0x29 21 2019.11-5.2.0019-9600\nCRC-32 0xFE 4 0x0A826CE8", "changed": true, "rc": 0, "start": "2021-03-31 20:22:15.138922", "stderr": "", "delta": "0:00:01.136285", "invocation": {"module_args": {"warn": true, "executable": null, "_uses_shell": false, "strip_empty_ends": true, "_raw_params": "sudo python -c \"import imp; m = imp.load_source('eeprom', '/usr/share/sonic/device/x86_64-mlnx_msn4600-r0/plugins/eeprom.py'); t = m.board('board', '', '', ''); e = t.read_eeprom(); t.decode_eeprom(e)\"", "removes": null, "argv": null, "creates": null, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["TlvInfo Header:", " Id String: TlvInfo", " Version: 1", " Total Length: 595", "TLV Name Code Len Value", "-------------------- ---- --- -----", "Product Name 0x21 64 MSN4600", "Part Number 0x22 20 MSN4600-VS2FO", "Serial Number 0x23 24 MT2025X00262", "Base MAC Address 0x24 6 1C:34:DA:1E:95:00", "Manufacture Date 0x25 19 06/22/2020 14:04:56", "Device Version 0x26 1 0", "MAC Addresses 0x2A 2 254", "Manufacturer 0x2B 8 Mellanox", "Vendor Extension 0xFD 36 ", "Vendor Extension 0xFD 164 ", "Vendor Extension 0xFD 36 ", "Vendor Extension 0xFD 36 ", "Vendor Extension 0xFD 36 ", "Vendor Extension 0xFD 20 ", "Platform Name 0x28 64 x86_64-mlnx_msn4600-r0", "ONIE Version 0x29 21 2019.11-5.2.0019-9600", "CRC-32 0xFE 4 0x0A826CE8"], "warnings": ["Consider using 'become', 'become_method', and 'become_user' rather than running sudo"], "failed": false}

The failure:

for line in utility_cmd_output["stdout_lines"]: pytest_assert(line in syseeprom_output, "Line '{}' was not found in output on '{}'".format(line, duthost.hostname)) Failed: Line 'TLV Name Code Len Value' was not found in output on 'r-liger-02'

Steps to reproduce the issue: Run the test case test_show_platform_syseeprom in test_show_platform.py

Describe the results you received:

for line in utility_cmd_output["stdout_lines"]: pytest_assert(line in syseeprom_output, "Line '{}' was not found in output on '{}'".format(line, duthost.hostname)) Failed: Line 'TLV Name Code Len Value' was not found in output on 'r-liger-02'

Describe the results you expected: The test case is passed

Output of show version:

```
SONiC Software Version: SONiC.SONIC.master.105-67c57990_Internal
Distribution: Debian 10.9
Kernel: 4.19.0-12-2-amd64
Build commit: 67c57990
Build date: Tue Mar 30 15:58:57 UTC 2021
Built by: sw-r2d2-bot@r-build-sonic-ci03

Platform: x86_64-mlnx_msn4600-r0
HwSKU: ACS-MSN4600
ASIC: mellanox
ASIC Count: 1
Serial Number: MT2025X00262
Uptime: 03:03:07 up  2:05,  1 user,  load average: 0.82, 1.68, 1.74
```

Attach debug file sudo generate_dump: sonic_dump_r-liger-02_20210401_030904.tar.gz

```
(paste your output here)
```
bingwang-ms commented 3 years ago

@nhe-NV I verified on mellanox and none mellanox platforms, and no failure was found. Can you verify again if the issue has been addressed? The SONiC version is

SONiC Software Version: SONiC.20201231.beta.17
Distribution: Debian 10.9
Kernel: 4.19.0-12-2-amd64
Build commit: 2efb4ce682
Build date: Tue Apr  6 01:38:25 UTC 2021
Built by: sonicbld@new-worker-20