tests: suppress "unwanted log lines" in several fuzzers

According to https://oss-fuzz.com/fuzzer-stats/by-fuzzer/fuzzer/libFuzzer/job/libfuzzer_asan_systemd,
fuzz-network-parser, fuzz-netdev-parser and fuzz-journal-remote produce
a lot of unwanted log lines. Let's set the maximum log level to LOG_CRIT
as we do in the other fuzzers.
This commit is contained in:
Evgeny Vereshchagin 2018-11-27 21:57:33 +01:00 committed by Yu Watanabe
parent e849ae9524
commit 95ccf1aa5f
3 changed files with 9 additions and 0 deletions

View File

@ -29,6 +29,9 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
if (size <= 2)
return 0;
if (!getenv("SYSTEMD_LOG_LEVEL"))
log_set_max_level(LOG_CRIT);
assert_se((fdin = memfd_new_and_map("fuzz-journal-remote", size, &mem)) >= 0);
memcpy(mem, data, size);
assert_se(munmap(mem, size) == 0);

View File

@ -11,6 +11,9 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
_cleanup_fclose_ FILE *f = NULL;
_cleanup_(unlink_tempfilep) char netdev_config[] = "/tmp/fuzz-networkd.XXXXXX";
if (!getenv("SYSTEMD_LOG_LEVEL"))
log_set_max_level(LOG_CRIT);
assert_se(fmkostemp_safe(netdev_config, "r+", &f) == 0);
if (size != 0)
assert_se(fwrite(data, size, 1, f) == 1);

View File

@ -11,6 +11,9 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
_cleanup_fclose_ FILE *f = NULL;
_cleanup_(unlink_tempfilep) char network_config[] = "/tmp/fuzz-networkd.XXXXXX";
if (!getenv("SYSTEMD_LOG_LEVEL"))
log_set_max_level(LOG_CRIT);
assert_se(fmkostemp_safe(network_config, "r+", &f) == 0);
if (size != 0)
assert_se(fwrite(data, size, 1, f) == 1);