Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 May 2019 19:18:21 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r348191 - stable/12/tests/sys/opencrypto
Message-ID:  <201905231918.x4NJILg7090628@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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' ]



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