]> git.ipfire.org Git - thirdparty/systemd.git/blob - travis-ci/managers/fuzzbuzz.sh
0080b065d89cf201f06a2546ca782d1c393f67bd
[thirdparty/systemd.git] / travis-ci / managers / fuzzbuzz.sh
1 #!/bin/bash
2
3 set -e
4 set -x
5 set -u
6
7 REPO_ROOT=${REPO_ROOT:-$(pwd)}
8
9 sudo bash -c "echo 'deb-src http://archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse' >>/etc/apt/sources.list"
10 sudo apt-get update -y
11 sudo apt-get build-dep systemd -y
12 sudo apt-get install -y ninja-build python3-pip python3-setuptools
13 pip3 install meson
14
15 cd $REPO_ROOT
16 export PATH="$HOME/.local/bin/:$PATH"
17 tools/oss-fuzz.sh
18 timeout --preserve-status 5 ./out/fuzz-unit-file
19 git clean -dxff
20
21 wget https://app.fuzzbuzz.io/releases/cli/latest/linux/fuzzbuzz
22 chmod +x fuzzbuzz
23 ./fuzzbuzz validate
24 ./fuzzbuzz target test fuzz-unit-file --all
25
26 git clone https://github.com/google/oss-fuzz /tmp/oss-fuzz
27 cd /tmp/oss-fuzz
28 sudo ./infra/helper.py pull_images
29
30 # docker doesn't like colons in filenames so let's create a directory
31 # whose name can be consumed by the -v option.
32 # https://github.com/google/oss-fuzz/issues/2428
33 t=$(mktemp -d)
34 sudo mount --bind "$REPO_ROOT" "$t"
35
36 # helper.py is wrapped in script to trick it into thinking it's "interactive"
37 # See https://github.com/systemd/systemd/pull/12542#issuecomment-491563572
38 sudo script -e -c "./infra/helper.py build_fuzzers --clean --sanitizer=memory systemd $t"
39 sudo script -e -c "./infra/helper.py check_build --sanitizer=memory -e ALLOWED_BROKEN_TARGETS_PERCENTAGE=0 systemd"