Page MenuHomeFreeBSD

D16755.id46804.diff
No OneTemporary

D16755.id46804.diff

Index: tests/freebsd_test_suite/macros.h
===================================================================
--- tests/freebsd_test_suite/macros.h
+++ tests/freebsd_test_suite/macros.h
@@ -31,6 +31,7 @@
#include <sys/param.h>
#include <sys/module.h>
+#include <sys/stat.h>
#include <string.h>
#include <errno.h>
#include <stdio.h>
@@ -50,6 +51,17 @@
atf_tc_skip("module %s could not be resolved: %s", \
_mod_name, strerror(errno)); \
} \
+} while(0)
+
+#define ATF_REQUIRE_SYSCTL_INT(_mib_name, _required_value) do { \
+ int value; \
+ size_t size = sizeof(value); \
+ if (sysctlbyname(_mib_name, &value, &size, NULL, 0) == -1) { \
+ atf_tc_skip("sysctl for %s failed: %s", _mib_name, \
+ strerror(errno)); \
+ } \
+ if (value != _required_value) \
+ atf_tc_skip("requires %s=%d", _mib_name, _required_value); \
} while(0)
#define PLAIN_REQUIRE_FEATURE(_feature_name, _exit_code) do { \
Index: tests/sys/opencrypto/blake2_test.c
===================================================================
--- tests/sys/opencrypto/blake2_test.c
+++ tests/sys/opencrypto/blake2_test.c
@@ -43,6 +43,7 @@
#include <sys/param.h>
+#include <sys/sysctl.h>
#include <errno.h>
#include <fcntl.h>
#include <string.h>
@@ -172,12 +173,14 @@
ATF_TC_WITHOUT_HEAD(blake2b_vectors);
ATF_TC_BODY(blake2b_vectors, tc)
{
+ ATF_REQUIRE_SYSCTL_INT("kern.cryptodevallowsoft", 1);
test_blake2b_vectors(CRYPTO_FLAG_SOFTWARE, "nexus/cryptosoft");
}
ATF_TC_WITHOUT_HEAD(blake2s_vectors);
ATF_TC_BODY(blake2s_vectors, tc)
{
+ ATF_REQUIRE_SYSCTL_INT("kern.cryptodevallowsoft", 1);
test_blake2s_vectors(CRYPTO_FLAG_SOFTWARE, "nexus/cryptosoft");
}

File Metadata

Mime Type
text/plain
Expires
Sat, Sep 26, 6:45 PM (4 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
39684569
Default Alt Text
D16755.id46804.diff (1 KB)

Event Timeline