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)
Wed, May 29, 11:17 AM
Unknown Object (File)
Tue, May 28, 2:27 AM
Unknown Object (File)
Tue, May 28, 2:27 AM
Unknown Object (File)
Tue, May 28, 2:27 AM
Unknown Object (File)
Sun, May 26, 8:16 AM
Unknown Object (File)
May 6 2024, 7:15 AM
Unknown Object (File)
May 2 2024, 2:43 PM
Unknown Object (File)
May 2 2024, 2:43 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

Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 23857
Build 22792: arc lint + arc unit

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.