Skip to content

Commit

Permalink
[wget2] Prepare for new fuzzers, don't execute network tests (google#930
Browse files Browse the repository at this point in the history
)
  • Loading branch information
rockdaboot authored and oliverchang committed Oct 30, 2017
1 parent 61a5763 commit ceaa1f2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 deletions.
2 changes: 1 addition & 1 deletion projects/wget2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ RUN git clone --depth=1 https://git.lysator.liu.se/nettle/nettle.git
RUN git clone --depth=1 https://gitlab.com/gnutls/gnutls.git
RUN git clone --depth=1 --recursive https://gnunet.org/git/libmicrohttpd.git

RUN git clone --depth=1 --recursive https://gitlab.com/gnuwget/wget2.git
RUN git clone --recursive https://gitlab.com/gnuwget/wget2.git

WORKDIR wget2
COPY build.sh $SRC/
33 changes: 21 additions & 12 deletions projects/wget2/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,24 +84,33 @@ export ASAN_OPTIONS=detect_leaks=0

cd $SRC/wget2
./bootstrap

# build and run non-networking tests
LIBS="-lgnutls -lnettle -lhogweed -lidn2 -lunistring" \
./configure -C --enable-static --disable-shared --disable-doc --without-plugin-support
make clean
make -j$(nproc)
make -j$(nproc) -C unit-tests check
make -j$(nproc) -C fuzz check

# build for fuzzing
LIBS="-lgnutls -lnettle -lhogweed -lidn2 -lunistring" \
./configure --enable-static --disable-shared --disable-doc --without-plugin-support
./configure -C --enable-fuzzing --enable-static --disable-shared --disable-doc --without-plugin-support
make clean
make -j$(nproc) all check
make -j$(nproc) -C lib
make -j$(nproc) -C include
make -j$(nproc) -C libwget
make -j$(nproc) -C src

# build fuzzers
cd fuzz
CXXFLAGS="$CXXFLAGS -L$WGET2_DEPS_PATH/lib/" make oss-fuzz

find . -name '*_fuzzer' -exec cp -v '{}' $OUT ';'
find . -name '*_fuzzer.dict' -exec cp -v '{}' $OUT ';'
find . -name '*_fuzzer.options' -exec cp -v '{}' $OUT ';'

for fuzzer in *_fuzzer; do
cp -p "${fuzzer}" "$OUT"

if [ -f "$SRC/${fuzzer}_seed_corpus.zip" ]; then
cp "$SRC/${fuzzer}_seed_corpus.zip" "$OUT/"
fi

if [ -d "${fuzzer}.in/" ]; then
zip -rj "$OUT/${fuzzer}_seed_corpus.zip" "${fuzzer}.in/"
fi
for dir in *_fuzzer.in; do
fuzzer=$(basename $dir .in)
zip -rj "$OUT/${fuzzer}_seed_corpus.zip" "${dir}/"
done

0 comments on commit ceaa1f2

Please sign in to comment.