test-journal-flush: provide at least *some* logs
Ubunut autopkgtest fails with: 405/501 test-journal-flush FAIL 0.74 s (killed by signal 6 SIGABRT) --- command --- SYSTEMD_KBD_MODEL_MAP='/tmp/autopkgtest.BgjJJv/build.yAM/systemd/src/locale/kbd-model-map' SYSTEMD_LANGUAGE_FALLBACK_MAP='/tmp/autopkgtest.BgjJJv/build.yAM/systemd/src/locale/language-fallback-map' PATH='/tmp/autopkgtest.BgjJJv/build.yAM/systemd/build-deb:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games' /tmp/autopkgtest.BgjJJv/build.yAM/systemd/build-deb/test-journal-flush --- stderr --- Assertion 'r >= 0' failed at src/journal/test-journal-flush.c:48, function main(). Aborting. ------- It's hard to say what is going on here without any error messages whatsoever. The test goes into deep details of journal file handling, so it needs to also do logging on its own.
This commit is contained in:
@@ -42,13 +42,16 @@ int main(int argc, char *argv[]) {
|
||||
assert_se(f && f->current_offset > 0);
|
||||
|
||||
r = journal_file_move_to_object(f, OBJECT_ENTRY, f->current_offset, &o);
|
||||
if (r < 0)
|
||||
log_error_errno(r, "journal_file_move_to_object failed: %m");
|
||||
assert_se(r >= 0);
|
||||
|
||||
r = journal_file_copy_entry(f, new_journal, o, f->current_offset);
|
||||
if (r < 0)
|
||||
log_error_errno(r, "journal_file_copy_entry failed: %m");
|
||||
assert_se(r >= 0);
|
||||
|
||||
n++;
|
||||
if (n > 10000)
|
||||
if (++n >= 10000)
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user