Bug 245825 - sys.opencrypto.blake2_test.blake2{b,s}_vectors_x86 failed after r359374
Summary: sys.opencrypto.blake2_test.blake2{b,s}_vectors_x86 failed after r359374
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: tests (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-testing (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-22 14:21 UTC by Li-Wen Hsu
Modified: 2020-04-22 20:53 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Li-Wen Hsu freebsd_committer 2020-04-22 14:21:49 UTC
https://ci.freebsd.org/job/FreeBSD-head-amd64-test/14710/testReport/junit/sys.opencrypto/blake2_test/blake2b_vectors_x86/

/usr/src/tests/sys/opencrypto/blake2_test.c:108: alg 29 keylen 64, errno=45 (Operation not supported)

https://ci.freebsd.org/job/FreeBSD-head-amd64-test/14710/testReport/junit/sys.opencrypto/blake2_test/blake2s_vectors_x86/

/usr/src/tests/sys/opencrypto/blake2_test.c:108: alg 30 keylen 32, errno=45 (Operation not supported)
Comment 1 Li-Wen Hsu freebsd_committer 2020-04-22 14:23:09 UTC
jhb, cem: are these two modules still relevant?
Comment 2 commit-hook freebsd_committer 2020-04-22 14:45:46 UTC
A commit references this bug:

Author: lwhsu
Date: Wed Apr 22 14:45:00 UTC 2020
New revision: 360198
URL: https://svnweb.freebsd.org/changeset/base/360198

Log:
  Temporarily skip sys.opencrypto.blake2_test.blake2{b,s}_vectors_x86 in CI

  PR:		245825
  Sponsored by:	The FreeBSD Foundation

Changes:
  head/tests/sys/opencrypto/blake2_test.c
Comment 3 John Baldwin freebsd_committer freebsd_triage 2020-04-22 15:43:14 UTC
Oh, it just needs to use FLAG_SOFTWARE still instead of FLAG_HARDWARE as these are accelerated software rather than accelerated hardware.

Alternatively, this should really be doing a lookup by name of "blake0" and using the returned 'crid' instead of the flag.  That's probably the real solution actually as it's meant to test that specific backend and not, say, some hardware offload that supports blake in the future.
Comment 4 Li-Wen Hsu freebsd_committer 2020-04-22 16:58:55 UTC
(In reply to John Baldwin from comment #3)
Thanks for the analysis. I've tried with CRYPTO_FLAG_SOFTWARE but they failed with another message:

blake2_test:blake2b_vectors_x86  ->  failed: /usr/home/lwhsu/freebsd-src/tests/sys/opencrypto/blake2_test.c:108: alg 29 keylen 64, errno=22 (Invalid argument)
blake2_test:blake2s_vectors_x86  ->  failed: /usr/home/lwhsu/freebsd-src/tests/sys/opencrypto/blake2_test.c:108: alg 30 keylen 32, errno=22 (Invalid argument)

Haven't tried the "real solution" yet.
Comment 5 John Baldwin freebsd_committer freebsd_triage 2020-04-22 19:28:03 UTC
I have a stab at what I think is the real fix at https://reviews.freebsd.org/D24540.  It compiles, but I haven't run-tested it yet.
Comment 6 commit-hook freebsd_committer 2020-04-22 20:43:35 UTC
A commit references this bug:

Author: jhb
Date: Wed Apr 22 20:43:18 UTC 2020
New revision: 360203
URL: https://svnweb.freebsd.org/changeset/base/360203

Log:
  Update blake2 accelerated software tests to work after OCF refactoring.

  - Lookup device drivers to test by name instead of assuming that the
    software / hardware flags will select specific drivers.
  - Set the sysctl to permit software /dev/crypto requests when testing
    the accelerated software blake2 driver.

  PR:		245825
  Reported by:	lwhsu
  Reviewed by:	cem, lwhsu
  Sponsored by:	Chelsio Communications
  Differential Revision:	https://reviews.freebsd.org/D24540

Changes:
  head/tests/sys/opencrypto/blake2_test.c