Removing null characters while decoding from syseeprom #338
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR will track the resolution for failure seen on Mellanox devices with SONiC management test failure for test_pmon_syseepromd_kill_and_start_status test case. The testcase is failing with the below error:
Motivation and Context
Overall, the testcase failed on Mellanox since the syseeprom has some fields wherein the string is appended by null characters. When the above testcase is executed, the null characters in the string are causing the error seen.
We observed that other platforms have string not terminated with null characters for various fields and the length mentioned in the EEPROM is same that of the string on EEPROM.
The below o/p was taken from Mellanox 3800 and it can be seen that the length of string is 20 which includes multiple null characters (^@ is 1 null character). The actual length of the string is 13 and there are 7 additional null characters.
root@str2-sn3800-02:/home/admin# sonic-db-cli STATE_DB HGETALL "EEPROM_INFO|0x22" | cat --show-nonprinting
{'Name': 'Part Number', 'Len': '20', 'Value': 'MSN3800-CS2FO^@^@^@^@^@^@^@'}
root@str2-sn3800-02:/home/admin#
How Has This Been Tested?
Please refer to the below for the details related to the tests performed
test_pmon_syseepromd_kill_and_start_status_test.txt
Additional Information (Optional)
Signed-off-by: Mihir Patel patelmi@microsoft.com