Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lower or Upper Case in EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL (Bugzilla Bug 4866) #235

Open
tianocore-issues opened this issue Oct 14, 2024 · 4 comments

Comments

@tianocore-issues
Copy link

This issue was created automatically with bugzilla2github

Bugzilla Bug 4866

Date: 2024-10-14T11:03:26+00:00
From: Heinrich Schuchardt <<xypron.glpk>>
To: Sam Kaynor <<Sam.Kaynor>>
CC: edhaya.chandran, gaojie, ilias.apalodimas, samer.el-haj-mahmoud, xypron.glpk

Last updated: 2024-12-15T05:19:40+00:00

@tianocore-issues
Copy link
Author

Comment 23449

Date: 2024-10-14 11:03:26 +0000
From: Heinrich Schuchardt <<xypron.glpk>>

  • Industry Specification: ---
  • Release Observed: EDK II Master
  • Releases to Fix: EDK II Master
  • Target OS: ---
  • Bugzilla Assignee(s): Sam Kaynor <<Sam.Kaynor>>

When running the SCT on U-Boot I see errors like:

EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL - ConvertDeviceNodeToText must correctly recover the converting ConvertTextToDeviceNode has acted on the device node string -- PASS
203B6963-5013-4683-958B-D4A21CCCBB8D
/home/user/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathToText/BlackBoxTest/DevicePathToTextBBTestCoverage.c:305: Convert result: MemoryMapped(0xe,0x123456789abcdef,0xfedcba9876543210) - Expected: MemoryMapped(14,0x123456789ABCDEF,0xFEDCBA9876543210)

EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL - ConvertDeviceNodeToText must correctly recover the converting ConvertTextToDeviceNode has acted on the device node string -- PASS
C05C7EBE-69A4-4FCC-B829-257754F3B43E
/home/user/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathToText/BlackBoxTest/DevicePathToTextBBTestCoverage.c:342: Convert result: VenHw(5af6c71e-1261-4637-9838-c4e9913d1dbb,0123456789abcdef) - Expected: VenHw(5AF6C71E-1261-4637-9838-C4E9913D1DBB,0123456789ABCDEF)

EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL - ConvertDeviceNodeToText must correctly recover the converting ConvertTextToDeviceNode has acted on the device node string -- PASS
36DE850B-B28D-4BFD-9EFF-BCD805A4A2F3
/home/user/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathToText/BlackBoxTest/DevicePathToTextBBTestCoverage.c:377: Convert result: Ctrl(0x1234abcd) - Expected: Ctrl(0x1234ABCD)

Appendix A - GUID AND TIME FORMATS has
"The pairs aa - pp are two characters in the range ‘0’-‘9’, ‘a’-‘f’ or ‘A’-F’, with each pair representing a single byte hexadecimal value."

So the "FAILED" in DevicePathToTextBBTestCoverage.c:342 is definitively a false positive.

I could not see any statement for the EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL requirement that hexadecimal numbers should be upper case. So the other two results seem to be false positives too.

Best regards

Heinrich

@tianocore-issues
Copy link
Author

Comment 23516

Date: 2024-11-07 10:26:18 +0000
From: Edhay <<edhaya.chandran>>

Thank you, Heinrich.
The issue is valid.
To be analyzed further and implemented.

Assigned to Sam Kaynor.

@tianocore-issues
Copy link
Author

Comment 23553

Date: 2024-12-05 15:28:59 +0000
From: Sam Kaynor <<Sam.Kaynor>>

Hi Heinrich,

After some offline discussion we've come to a couple conclusions about this issue.

The function ConvertDeviceNodeToText comes from the edk2 core and as such can't be easily changed for the purposes of edk2-test. However, the SctCompareMem function used for the test result is passing correctly as it is a strict byte to byte memory comparison (SctPkg/Library/SctLib/Mem.c:133).

As the passes are expected, the issue is in the output presented in the logs. This could be resolved by implementing a local function that simply converts the text output of ConvertDeviceNodeToText to all uppercase characters.

Would this solution address your concerns?

Thanks,

Sam

@tianocore-issues
Copy link
Author

Comment 23567

Date: 2024-12-15 05:19:40 +0000
From: Heinrich Schuchardt <<xypron.glpk>>

Hello Sam,

There is nothing wrong in the way the log is printed. The test results for U-Boot are wrong.

The SCT test should be relaxed to accept both lower case and upper case hexadecimal numbers as the UEFI specification does not require the one or the other.

The SCT should convert the actual and the expected result to the same case before calling memcmp().

Best regards

Heinrich

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant