Page MenuHomeFreeBSD

Skip tests with missing test vectors instead of failing.
ClosedPublic

Authored by jhb on Apr 23 2019, 9:58 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 23 2024, 12:40 AM
Unknown Object (File)
Mar 23 2024, 12:40 AM
Unknown Object (File)
Mar 23 2024, 12:40 AM
Unknown Object (File)
Feb 22 2024, 7:19 AM
Unknown Object (File)
Jan 15 2024, 11:43 PM
Unknown Object (File)
Dec 23 2023, 9:33 PM
Unknown Object (File)
Dec 23 2023, 9:33 PM
Unknown Object (File)
Dec 23 2023, 9:33 PM
Subscribers

Details

Summary

This copes more gracefully when older version of the nist-kat package
are intalled that don't have newer test vectors such as CCM or plain
SHA.

If the nist-kat package is not installed at all, this still fails with
an error.

Test Plan
  • ran updated cryptotest.py with CCM and plain SHA support against older nist-kat package and now get skips instead of failures.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

I think this should go in before the CCM and plain SHA changes so that Jenkins doesn't blow up with new failures due to the updated nist-kat package not yet being available.

LGTM. I'm assuming the message is printed and not silently discarded if tests are skipped when running on the command line? I don't want silent "success" when KAT vectors are missing.

This revision is now accepted and ready to land.Apr 23 2019, 11:15 PM

By default you just get a 's' in output instead of '.' With '-v' you get the full message:

# python2.7 ./cryptotest.py
.s.s.s..s.s...
----------------------------------------------------------------------
Ran 14 tests in 5.735s

# python2.7 ./cryptotest.py -v
test_cbc (__main__.GendCryptoTestCase) ... ok
test_ccm (__main__.GendCryptoTestCase) ... skipped 'Missing ccmtestvectors test vectors'
test_gcm (__main__.GendCryptoTestCase) ... ok
test_sha (__main__.GendCryptoTestCase) ... skipped 'Missing shabytetestvectors test vectors'
test_sha1hmac (__main__.GendCryptoTestCase) ... ok
test_tdes (__main__.GendCryptoTestCase) ... skipped 'skipping DES on ccr0'
test_xts (__main__.GendCryptoTestCase) ... ok
test_cbc (__main__.GendCryptoTestCase) ... ok
test_ccm (__main__.GendCryptoTestCase) ... skipped 'Missing ccmtestvectors test vectors'
test_gcm (__main__.GendCryptoTestCase) ... ok
test_sha (__main__.GendCryptoTestCase) ... skipped 'Missing shabytetestvectors test vectors'
test_sha1hmac (__main__.GendCryptoTestCase) ... ok
test_tdes (__main__.GendCryptoTestCase) ... ok
test_xts (__main__.GendCryptoTestCase) ... ok

----------------------------------------------------------------------
Ran 14 tests in 5.699s

OK (skipped=5)
In D20034#430600, @jhb wrote:

By default you just get a 's' in output instead of '.' With '-v' you get the full message:

Works for me, thanks.

This revision was automatically updated to reflect the committed changes.