lkl: tests: handler lkl_init failures

Check lkl_init for failures. Print the log buffer in case of failures,
to make debugging easier.

Signed-off-by: Octavian Purdila <tavip@google.com>
This commit is contained in:
Octavian Purdila
2025-04-09 18:09:08 -07:00
parent 79fd9f4ec0
commit 15a7be0d8a
3 changed files with 12 additions and 3 deletions

View File

@@ -780,7 +780,10 @@ int main(int argc, const char **argv)
lkl_host_ops.print = lkl_test_log;
lkl_init(&lkl_host_ops);
if (lkl_init(&lkl_host_ops) < 0) {
printf("%s\n", lkl_test_get_log());
return 1;
}
ret = lkl_test_run(tests, sizeof(tests)/sizeof(struct lkl_test),
"boot");

View File

@@ -109,7 +109,10 @@ int main(int argc, const char **argv)
lkl_host_ops.print = lkl_test_log;
lkl_init(&lkl_host_ops);
if (lkl_init(&lkl_host_ops) < 0) {
printf("%s\n", lkl_test_get_log());
return 1;
}
ret = lkl_test_run(tests, sizeof(tests) / sizeof(struct lkl_test),
"disk-vfio-pci %s", cla.fstype);

View File

@@ -189,7 +189,10 @@ int main(int argc, const char **argv)
lkl_host_ops.print = lkl_test_log;
lkl_init(&lkl_host_ops);
if (lkl_init(&lkl_host_ops) < 0) {
printf("%s\n", lkl_test_get_log());
return 1;
}
ret = lkl_test_run(tests, sizeof(tests)/sizeof(struct lkl_test),
"disk %s", cla.fstype);