[SLOF] [PATCH 4/4] Add testprograms

Stefan Berger stefanb at linux.ibm.com
Thu Jul 8 01:23:08 AEST 2021


On 7/7/21 3:47 AM, Alexey Kardashevskiy wrote:
>
>
> On 07/07/2021 07:32, Stefan Berger wrote:
>>
>> On 7/1/21 12:11 AM, Alexey Kardashevskiy wrote:
>>>
>>>
>>> On 30/06/2021 22:26, Stefan Berger wrote:
>>>>
>>>> On 6/29/21 11:10 PM, Alexey Kardashevskiy wrote:
>>>>> What does this actually test? It runs sha384/etc but it is not 
>>>>> comparing the outcome with known good values or anything like this.
>>>>>
>>>> I visually compared the results against the expected results from 
>>>> test vectors or results from  command line output of echo -n "..." 
>>>> | sha512sum for example.
>>>
>>> if would make more sense if you hardcoded those outputs to the test 
>>> and compared, then the next reader won't have questions and will 
>>> know exactly what it tests.
>>>
>>
>> So you really want to keep these test cases then? If so, can we use 
>> glib to make tings a bit easier for invoking external programs and 
>> getting results back?
>
> I want to replace printing the hashes in main() with memcmp() to what 
> external program would produce for the same sequence. I definitely do 
> not want neither new external programs to run from the test nor glib 
> in SLOF.


So we can hard code expected results or link with OpenSSL's -lcrypto and 
call the hash functions from there to compare the result. This would be 
possible to do since the hash functions from -lcrypto are in capital 
letters while the ones in SLOF are lower case. But my guess it you 
wouldn't want to link with -lcrypto in SLOF either. So hard coding 
expected results is the way to go then ?


>
>
>


More information about the SLOF mailing list