diff --git a/tests/api-test-2.c b/tests/api-test-2.c index 6e3ccdd0..57e6dd99 100644 --- a/tests/api-test-2.c +++ b/tests/api-test-2.c @@ -4144,8 +4144,11 @@ int main(int argc, char *argv[]) register_cleanup(_cleanup); _cleanup(); - if (_setup()) - goto out; + if (_setup()) { + printf("Cannot set test devices.\n"); + _cleanup(); + exit(77); + } crypt_set_debug_level(_debug ? CRYPT_DEBUG_JSON : CRYPT_DEBUG_NONE); @@ -4171,7 +4174,6 @@ int main(int argc, char *argv[]) RUN_(Luks2Flags, "LUKS2 persistent flags"); RUN_(Luks2Reencryption, "LUKS2 reencryption"); RUN_(Luks2Repair, "LUKS2 repair"); // test disables metadata locking. Run always last! -out: - _cleanup(); + return 0; } diff --git a/tests/api-test.c b/tests/api-test.c index 0f58ce82..cf02aa7f 100644 --- a/tests/api-test.c +++ b/tests/api-test.c @@ -1888,8 +1888,11 @@ int main(int argc, char *argv[]) register_cleanup(_cleanup); _cleanup(); - if (_setup()) - goto out; + if (_setup()) { + printf("Cannot set test devices.\n"); + _cleanup(); + exit(77); + } crypt_set_debug_level(_debug ? CRYPT_DEBUG_ALL : CRYPT_DEBUG_NONE); @@ -1908,7 +1911,6 @@ int main(int argc, char *argv[]) RUN_(VerityTest, "DM verity"); RUN_(TcryptTest, "Tcrypt API"); RUN_(IntegrityTest, "Integrity API"); -out: - _cleanup(); + return 0; }