diff options
author | Martin Pitt <martin@piware.de> | 2017-03-02 23:42:01 +0100 |
---|---|---|
committer | Martin Pitt <martin@piware.de> | 2017-03-03 16:45:44 +0100 |
commit | 2e914f34eb9a4a56e3eb70dc0b4345588c9016e7 (patch) | |
tree | 19a6a06102d652450b8b43417f7dac45d2548f04 /src/test/test-id128.c | |
parent | Avoid strict DM interface version dependencies (#5519) (diff) | |
download | systemd-2e914f34eb9a4a56e3eb70dc0b4345588c9016e7.tar.xz systemd-2e914f34eb9a4a56e3eb70dc0b4345588c9016e7.zip |
test: skip instead of fail if crypto kmods are not available
Package build machines may have module loading disabled, thus AF_ALG
sockets are not available. Skip the tests that cover those (khash and
id128) instead of failing them in this case.
Fixes #5524
Diffstat (limited to '')
-rw-r--r-- | src/test/test-id128.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/test/test-id128.c b/src/test/test-id128.c index e8c4c3e550..e5f45206f1 100644 --- a/src/test/test-id128.c +++ b/src/test/test-id128.c @@ -154,11 +154,16 @@ int main(int argc, char *argv[]) { assert_se(id128_read_fd(fd, ID128_UUID, &id2) >= 0); assert_se(sd_id128_equal(id, id2)); - assert_se(sd_id128_get_machine_app_specific(SD_ID128_MAKE(f0,3d,aa,eb,1c,33,4b,43,a7,32,17,29,44,bf,77,2e), &id) >= 0); - assert_se(sd_id128_get_machine_app_specific(SD_ID128_MAKE(f0,3d,aa,eb,1c,33,4b,43,a7,32,17,29,44,bf,77,2e), &id2) >= 0); - assert_se(sd_id128_equal(id, id2)); - assert_se(sd_id128_get_machine_app_specific(SD_ID128_MAKE(51,df,0b,4b,c3,b0,4c,97,80,e2,99,b9,8c,a3,73,b8), &id2) >= 0); - assert_se(!sd_id128_equal(id, id2)); + r = sd_id128_get_machine_app_specific(SD_ID128_MAKE(f0,3d,aa,eb,1c,33,4b,43,a7,32,17,29,44,bf,77,2e), &id); + if (r == -EAFNOSUPPORT) { + log_info("khash not supported on this kernel, skipping sd_id128_get_machine_app_specific() checks"); + } else { + assert_se(r >= 0); + assert_se(sd_id128_get_machine_app_specific(SD_ID128_MAKE(f0,3d,aa,eb,1c,33,4b,43,a7,32,17,29,44,bf,77,2e), &id2) >= 0); + assert_se(sd_id128_equal(id, id2)); + assert_se(sd_id128_get_machine_app_specific(SD_ID128_MAKE(51,df,0b,4b,c3,b0,4c,97,80,e2,99,b9,8c,a3,73,b8), &id2) >= 0); + assert_se(!sd_id128_equal(id, id2)); + } /* Query the invocation ID */ r = sd_id128_get_invocation(&id); |