Mark API tests as skipped if setup phase fails.

This commit is contained in:
Milan Broz
2019-07-30 13:18:34 +02:00
parent 5e03f8c725
commit 8fde1b9f2c
2 changed files with 12 additions and 8 deletions

View File

@@ -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;
}

View File

@@ -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;
}