summaryrefslogtreecommitdiff
path: root/src/network/fuzz-netdev-parser.c
diff options
context:
space:
mode:
authorEvgeny Vereshchagin <evvers@ya.ru>2018-11-27 21:57:33 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2018-11-28 10:10:09 +0900
commit95ccf1aa5f440d8310050a71234ab57386ec223a (patch)
tree7df875278d9b1e2b5cd8abe21764e40b3326e630 /src/network/fuzz-netdev-parser.c
parente849ae95243e54fac05990ffab5ff386a5a881ff (diff)
downloadsystemd-95ccf1aa5f440d8310050a71234ab57386ec223a.tar.gz
systemd-95ccf1aa5f440d8310050a71234ab57386ec223a.tar.bz2
systemd-95ccf1aa5f440d8310050a71234ab57386ec223a.zip
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.
Diffstat (limited to 'src/network/fuzz-netdev-parser.c')
-rw-r--r--src/network/fuzz-netdev-parser.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/network/fuzz-netdev-parser.c b/src/network/fuzz-netdev-parser.c
index adc85549e5..207d67874f 100644
--- a/src/network/fuzz-netdev-parser.c
+++ b/src/network/fuzz-netdev-parser.c
@@ -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);