]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-journal-flush: provide at least *some* logs
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 2 Aug 2019 13:07:56 +0000 (15:07 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 20 Aug 2019 10:01:23 +0000 (12:01 +0200)
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.

src/journal/test-journal-flush.c

index 50500222ad9bd50ccc37c516d580106ef91b6c5e..5fedd3ed20464ad70e23261f85c7123c12346dc8 100644 (file)
@@ -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;
         }