Skip to content

Commit

Permalink
fuzz-journal-remote: try all output modes
Browse files Browse the repository at this point in the history
  • Loading branch information
keszybz committed May 29, 2018
1 parent 50fc5be commit b7da7eb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/fuzz/fuzz-journal-remote.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
int fdin; /* will be closed by journal_remote handler after EOF */
_cleanup_close_ int fdout = -1;
sd_journal *j;
OutputMode mode;
int r;

if (size <= 2)
Expand Down Expand Up @@ -52,8 +53,13 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
r = sd_journal_open_files(&j, (const char**) STRV_MAKE(name), 0);
assert_se(r >= 0);

r = show_journal(stdout, j, OUTPUT_VERBOSE, 0, 0, -1, 0, NULL);
assert_se(r >= 0);
for (mode = 0; mode < _OUTPUT_MODE_MAX; mode++) {
r = show_journal(stdout, j, mode, 0, 0, -1, 0, NULL);
assert_se(r >= 0);

r = sd_journal_seek_head(j);
assert_se(r >= 0);
}

sd_journal_close(j);
unlink(name);
Expand Down

0 comments on commit b7da7eb

Please sign in to comment.