Author: jhb
Date: Thu May 23 19:18:21 2019
New Revision: 348191
URL: https://svnweb.freebsd.org/changeset/base/348191

Log:
  MFC 346614: Skip tests with missing test vectors instead of failing.
  
  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.

Modified:
  stable/12/tests/sys/opencrypto/cryptotest.py
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/tests/sys/opencrypto/cryptotest.py
==============================================================================
--- stable/12/tests/sys/opencrypto/cryptotest.py        Thu May 23 19:13:38 
2019        (r348190)
+++ stable/12/tests/sys/opencrypto/cryptotest.py        Thu May 23 19:18:21 
2019        (r348191)
@@ -42,7 +42,9 @@ from glob import iglob
 katdir = '/usr/local/share/nist-kat'
 
 def katg(base, glob):
-       assert os.path.exists(os.path.join(katdir, base)), "Please 'pkg install 
nist-kat'"
+       assert os.path.exists(katdir), "Please 'pkg install nist-kat'"
+       if not os.path.exists(os.path.join(katdir, base)):
+               raise unittest.SkipTest("Missing %s test vectors" % (base))
        return iglob(os.path.join(katdir, base, glob))
 
 aesmodules = [ 'cryptosoft0', 'aesni0', 'ccr0', 'ccp0' ]
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to