ff6046
From 4bb9ba2cc0a64fc522d131f9a6cc5befe42d33bb Mon Sep 17 00:00:00 2001
ff6046
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
ff6046
Date: Sat, 7 Jul 2018 17:43:40 +0200
ff6046
Subject: [PATCH] fuzz: rename "fuzz-corpus" directory to just "fuzz"
ff6046
ff6046
Also, all corpus subdirectories are named exactly the same as the fuzzer they
ff6046
are for. This makes the paths a bit longer, but easier.
ff6046
ff6046
(cherry picked from commit 93b575b26605c347a717b2aa24ddf9cad08b8080)
ff6046
ff6046
Resolves: #1696224
ff6046
---
ff6046
 test/{fuzz-corpus => fuzz}/.gitattributes           |   0
ff6046
 .../fuzz-dhcp-server}/discover-existing             | Bin
ff6046
 .../fuzz-dhcp-server}/discover-new                  | Bin
ff6046
 .../dhcp-server => fuzz/fuzz-dhcp-server}/release   | Bin
ff6046
 .../fuzz-dhcp-server}/request-existing              | Bin
ff6046
 .../fuzz-dhcp-server}/request-new                   | Bin
ff6046
 .../fuzz-dhcp-server}/request-reboot                | Bin
ff6046
 .../fuzz-dhcp-server}/request-renew                 | Bin
ff6046
 .../fuzz-journal-remote}/invalid-ts.txt             | Bin
ff6046
 .../fuzz-journal-remote}/sample.txt                 |   0
ff6046
 .../dev-mapper-fedora_krowka\\x2dswap.swap"         |   0
ff6046
 .../fuzz-unit-file}/directives.service              |   0
ff6046
 .../unit-file => fuzz/fuzz-unit-file}/empty.scope   |   0
ff6046
 .../unit-file => fuzz/fuzz-unit-file}/machine.slice |   0
ff6046
 .../proc-sys-fs-binfmt_misc.automount               |   0
ff6046
 .../unit-file => fuzz/fuzz-unit-file}/syslog.socket |   0
ff6046
 .../systemd-ask-password-console.path               |   0
ff6046
 .../fuzz-unit-file}/systemd-machined.service        |   0
ff6046
 .../fuzz-unit-file}/systemd-resolved.service        |   0
ff6046
 .../fuzz-unit-file}/systemd-tmpfiles-clean.timer    |   0
ff6046
 .../unit-file => fuzz/fuzz-unit-file}/timers.target |   0
ff6046
 .../fuzz-unit-file}/var-lib-machines.mount          |   0
ff6046
 tools/oss-fuzz.sh                                   |   6 ++++--
ff6046
 23 files changed, 4 insertions(+), 2 deletions(-)
ff6046
 rename test/{fuzz-corpus => fuzz}/.gitattributes (100%)
ff6046
 rename test/{fuzz-corpus/dhcp-server => fuzz/fuzz-dhcp-server}/discover-existing (100%)
ff6046
 rename test/{fuzz-corpus/dhcp-server => fuzz/fuzz-dhcp-server}/discover-new (100%)
ff6046
 rename test/{fuzz-corpus/dhcp-server => fuzz/fuzz-dhcp-server}/release (100%)
ff6046
 rename test/{fuzz-corpus/dhcp-server => fuzz/fuzz-dhcp-server}/request-existing (100%)
ff6046
 rename test/{fuzz-corpus/dhcp-server => fuzz/fuzz-dhcp-server}/request-new (100%)
ff6046
 rename test/{fuzz-corpus/dhcp-server => fuzz/fuzz-dhcp-server}/request-reboot (100%)
ff6046
 rename test/{fuzz-corpus/dhcp-server => fuzz/fuzz-dhcp-server}/request-renew (100%)
ff6046
 rename test/{fuzz-corpus/journal-remote => fuzz/fuzz-journal-remote}/invalid-ts.txt (100%)
ff6046
 rename test/{fuzz-corpus/journal-remote => fuzz/fuzz-journal-remote}/sample.txt (100%)
ff6046
 rename "test/fuzz-corpus/unit-file/dev-mapper-fedora_krowka\\x2dswap.swap" => "test/fuzz/fuzz-unit-file/dev-mapper-fedora_krowka\\x2dswap.swap" (100%)
ff6046
 rename test/{fuzz-corpus/unit-file => fuzz/fuzz-unit-file}/directives.service (100%)
ff6046
 rename test/{fuzz-corpus/unit-file => fuzz/fuzz-unit-file}/empty.scope (100%)
ff6046
 rename test/{fuzz-corpus/unit-file => fuzz/fuzz-unit-file}/machine.slice (100%)
ff6046
 rename test/{fuzz-corpus/unit-file => fuzz/fuzz-unit-file}/proc-sys-fs-binfmt_misc.automount (100%)
ff6046
 rename test/{fuzz-corpus/unit-file => fuzz/fuzz-unit-file}/syslog.socket (100%)
ff6046
 rename test/{fuzz-corpus/unit-file => fuzz/fuzz-unit-file}/systemd-ask-password-console.path (100%)
ff6046
 rename test/{fuzz-corpus/unit-file => fuzz/fuzz-unit-file}/systemd-machined.service (100%)
ff6046
 rename test/{fuzz-corpus/unit-file => fuzz/fuzz-unit-file}/systemd-resolved.service (100%)
ff6046
 rename test/{fuzz-corpus/unit-file => fuzz/fuzz-unit-file}/systemd-tmpfiles-clean.timer (100%)
ff6046
 rename test/{fuzz-corpus/unit-file => fuzz/fuzz-unit-file}/timers.target (100%)
ff6046
 rename test/{fuzz-corpus/unit-file => fuzz/fuzz-unit-file}/var-lib-machines.mount (100%)
ff6046
ff6046
diff --git a/test/fuzz-corpus/.gitattributes b/test/fuzz/.gitattributes
ff6046
similarity index 100%
ff6046
rename from test/fuzz-corpus/.gitattributes
ff6046
rename to test/fuzz/.gitattributes
ff6046
diff --git a/test/fuzz-corpus/dhcp-server/discover-existing b/test/fuzz/fuzz-dhcp-server/discover-existing
ff6046
similarity index 100%
ff6046
rename from test/fuzz-corpus/dhcp-server/discover-existing
ff6046
rename to test/fuzz/fuzz-dhcp-server/discover-existing
ff6046
diff --git a/test/fuzz-corpus/dhcp-server/discover-new b/test/fuzz/fuzz-dhcp-server/discover-new
ff6046
similarity index 100%
ff6046
rename from test/fuzz-corpus/dhcp-server/discover-new
ff6046
rename to test/fuzz/fuzz-dhcp-server/discover-new
ff6046
diff --git a/test/fuzz-corpus/dhcp-server/release b/test/fuzz/fuzz-dhcp-server/release
ff6046
similarity index 100%
ff6046
rename from test/fuzz-corpus/dhcp-server/release
ff6046
rename to test/fuzz/fuzz-dhcp-server/release
ff6046
diff --git a/test/fuzz-corpus/dhcp-server/request-existing b/test/fuzz/fuzz-dhcp-server/request-existing
ff6046
similarity index 100%
ff6046
rename from test/fuzz-corpus/dhcp-server/request-existing
ff6046
rename to test/fuzz/fuzz-dhcp-server/request-existing
ff6046
diff --git a/test/fuzz-corpus/dhcp-server/request-new b/test/fuzz/fuzz-dhcp-server/request-new
ff6046
similarity index 100%
ff6046
rename from test/fuzz-corpus/dhcp-server/request-new
ff6046
rename to test/fuzz/fuzz-dhcp-server/request-new
ff6046
diff --git a/test/fuzz-corpus/dhcp-server/request-reboot b/test/fuzz/fuzz-dhcp-server/request-reboot
ff6046
similarity index 100%
ff6046
rename from test/fuzz-corpus/dhcp-server/request-reboot
ff6046
rename to test/fuzz/fuzz-dhcp-server/request-reboot
ff6046
diff --git a/test/fuzz-corpus/dhcp-server/request-renew b/test/fuzz/fuzz-dhcp-server/request-renew
ff6046
similarity index 100%
ff6046
rename from test/fuzz-corpus/dhcp-server/request-renew
ff6046
rename to test/fuzz/fuzz-dhcp-server/request-renew
ff6046
diff --git a/test/fuzz-corpus/journal-remote/invalid-ts.txt b/test/fuzz/fuzz-journal-remote/invalid-ts.txt
ff6046
similarity index 100%
ff6046
rename from test/fuzz-corpus/journal-remote/invalid-ts.txt
ff6046
rename to test/fuzz/fuzz-journal-remote/invalid-ts.txt
ff6046
diff --git a/test/fuzz-corpus/journal-remote/sample.txt b/test/fuzz/fuzz-journal-remote/sample.txt
ff6046
similarity index 100%
ff6046
rename from test/fuzz-corpus/journal-remote/sample.txt
ff6046
rename to test/fuzz/fuzz-journal-remote/sample.txt
ff6046
diff --git "a/test/fuzz-corpus/unit-file/dev-mapper-fedora_krowka\\x2dswap.swap" "b/test/fuzz/fuzz-unit-file/dev-mapper-fedora_krowka\\x2dswap.swap"
ff6046
similarity index 100%
ff6046
rename from "test/fuzz-corpus/unit-file/dev-mapper-fedora_krowka\\x2dswap.swap"
ff6046
rename to "test/fuzz/fuzz-unit-file/dev-mapper-fedora_krowka\\x2dswap.swap"
ff6046
diff --git a/test/fuzz-corpus/unit-file/directives.service b/test/fuzz/fuzz-unit-file/directives.service
ff6046
similarity index 100%
ff6046
rename from test/fuzz-corpus/unit-file/directives.service
ff6046
rename to test/fuzz/fuzz-unit-file/directives.service
ff6046
diff --git a/test/fuzz-corpus/unit-file/empty.scope b/test/fuzz/fuzz-unit-file/empty.scope
ff6046
similarity index 100%
ff6046
rename from test/fuzz-corpus/unit-file/empty.scope
ff6046
rename to test/fuzz/fuzz-unit-file/empty.scope
ff6046
diff --git a/test/fuzz-corpus/unit-file/machine.slice b/test/fuzz/fuzz-unit-file/machine.slice
ff6046
similarity index 100%
ff6046
rename from test/fuzz-corpus/unit-file/machine.slice
ff6046
rename to test/fuzz/fuzz-unit-file/machine.slice
ff6046
diff --git a/test/fuzz-corpus/unit-file/proc-sys-fs-binfmt_misc.automount b/test/fuzz/fuzz-unit-file/proc-sys-fs-binfmt_misc.automount
ff6046
similarity index 100%
ff6046
rename from test/fuzz-corpus/unit-file/proc-sys-fs-binfmt_misc.automount
ff6046
rename to test/fuzz/fuzz-unit-file/proc-sys-fs-binfmt_misc.automount
ff6046
diff --git a/test/fuzz-corpus/unit-file/syslog.socket b/test/fuzz/fuzz-unit-file/syslog.socket
ff6046
similarity index 100%
ff6046
rename from test/fuzz-corpus/unit-file/syslog.socket
ff6046
rename to test/fuzz/fuzz-unit-file/syslog.socket
ff6046
diff --git a/test/fuzz-corpus/unit-file/systemd-ask-password-console.path b/test/fuzz/fuzz-unit-file/systemd-ask-password-console.path
ff6046
similarity index 100%
ff6046
rename from test/fuzz-corpus/unit-file/systemd-ask-password-console.path
ff6046
rename to test/fuzz/fuzz-unit-file/systemd-ask-password-console.path
ff6046
diff --git a/test/fuzz-corpus/unit-file/systemd-machined.service b/test/fuzz/fuzz-unit-file/systemd-machined.service
ff6046
similarity index 100%
ff6046
rename from test/fuzz-corpus/unit-file/systemd-machined.service
ff6046
rename to test/fuzz/fuzz-unit-file/systemd-machined.service
ff6046
diff --git a/test/fuzz-corpus/unit-file/systemd-resolved.service b/test/fuzz/fuzz-unit-file/systemd-resolved.service
ff6046
similarity index 100%
ff6046
rename from test/fuzz-corpus/unit-file/systemd-resolved.service
ff6046
rename to test/fuzz/fuzz-unit-file/systemd-resolved.service
ff6046
diff --git a/test/fuzz-corpus/unit-file/systemd-tmpfiles-clean.timer b/test/fuzz/fuzz-unit-file/systemd-tmpfiles-clean.timer
ff6046
similarity index 100%
ff6046
rename from test/fuzz-corpus/unit-file/systemd-tmpfiles-clean.timer
ff6046
rename to test/fuzz/fuzz-unit-file/systemd-tmpfiles-clean.timer
ff6046
diff --git a/test/fuzz-corpus/unit-file/timers.target b/test/fuzz/fuzz-unit-file/timers.target
ff6046
similarity index 100%
ff6046
rename from test/fuzz-corpus/unit-file/timers.target
ff6046
rename to test/fuzz/fuzz-unit-file/timers.target
ff6046
diff --git a/test/fuzz-corpus/unit-file/var-lib-machines.mount b/test/fuzz/fuzz-unit-file/var-lib-machines.mount
ff6046
similarity index 100%
ff6046
rename from test/fuzz-corpus/unit-file/var-lib-machines.mount
ff6046
rename to test/fuzz/fuzz-unit-file/var-lib-machines.mount
ff6046
diff --git a/tools/oss-fuzz.sh b/tools/oss-fuzz.sh
ff6046
index 200407fcca..451cc665ce 100755
ff6046
--- a/tools/oss-fuzz.sh
ff6046
+++ b/tools/oss-fuzz.sh
ff6046
@@ -35,8 +35,10 @@ fi
ff6046
 meson $build -D$fuzzflag -Db_lundef=false
ff6046
 ninja -C $build fuzzers
ff6046
 
ff6046
-for d in "$(dirname "$0")/../test/fuzz-corpus/"*; do
ff6046
-        zip -jqr $OUT/fuzz-$(basename "$d")_seed_corpus.zip "$d"
ff6046
+# The seed corpus is a separate flat archive for each fuzzer,
ff6046
+# with a fixed name ${fuzzer}_seed_corpus.zip.
ff6046
+for d in "$(dirname "$0")/../test/fuzz/fuzz-"*; do
ff6046
+        zip -jqr $OUT/$(basename "$d")_seed_corpus.zip "$d"
ff6046
 done
ff6046
 
ff6046
 # get fuzz-dns-packet corpus