diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-02-26 13:46:58 +0100 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2018-05-30 07:59:07 +0200 |
commit | 12a619f9e6840e8242e41586498cbd39f067f052 (patch) | |
tree | 0dfff6a0aec30503a1adf99ece075c34a8b507ba /src/test/test-hash.c | |
parent | 746dd725294bda772acdfb819feb60015bddec4f (diff) |
khash: try to detect broken AF_ALG support in centos kernels
Fixes: #8278
Diffstat (limited to 'src/test/test-hash.c')
-rw-r--r-- | src/test/test-hash.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/test/test-hash.c b/src/test/test-hash.c index a08771abb..0d627a425 100644 --- a/src/test/test-hash.c +++ b/src/test/test-hash.c @@ -35,12 +35,15 @@ int main(int argc, char *argv[]) { assert_se(khash_new(&h, NULL) == -EINVAL); assert_se(khash_new(&h, "") == -EINVAL); - r = khash_new(&h, "foobar"); - if (r == -EAFNOSUPPORT) { + + r = khash_supported(); + assert_se(r >= 0); + if (r == 0) { puts("khash not supported on this kernel, skipping"); return EXIT_TEST_SKIP; } - assert_se(r == -EOPNOTSUPP); + + assert_se(khash_new(&h, "foobar") == -EOPNOTSUPP); /* undefined hash function */ assert_se(khash_new(&h, "sha256") >= 0); assert_se(khash_get_size(h) == 32); |