Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 03 Sep 2019 14:07:44 -0000
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r346614 - head/tests/sys/opencrypto
Message-ID:  <201904240010.x3O0ALqJ019371@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Wed Apr 24 00:10:21 2019
New Revision: 346614
URL: https://svnweb.freebsd.org/changeset/base/346614

Log:
  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.
  
  Reviewed by:	cem
  MFC after:	1 month
  Sponsored by:	Chelsio Communications
  Differential Revision:	https://reviews.freebsd.org/D20034

Modified:
  head/tests/sys/opencrypto/cryptotest.py

Modified: head/tests/sys/opencrypto/cryptotest.py
==============================================================================
--- head/tests/sys/opencrypto/cryptotest.py	Tue Apr 23 22:43:47 2019	(r346613)
+++ head/tests/sys/opencrypto/cryptotest.py	Wed Apr 24 00:10:21 2019	(r346614)
@@ -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' ]





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201904240010.x3O0ALqJ019371>