[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 09/26] tests/docker: add test-fuzz
From: |
Alex Bennée |
Subject: |
[PATCH v2 09/26] tests/docker: add test-fuzz |
Date: |
Mon, 26 Jun 2023 22:59:09 +0100 |
Running the fuzzer requires some hoop jumping and some problems only
show up in containers. This basically replicates the build-oss-fuzz
job from our CI so we can run in the same containers we use in CI.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
tests/docker/test-fuzz | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
create mode 100755 tests/docker/test-fuzz
diff --git a/tests/docker/test-fuzz b/tests/docker/test-fuzz
new file mode 100755
index 0000000000..7e506ae1f6
--- /dev/null
+++ b/tests/docker/test-fuzz
@@ -0,0 +1,28 @@
+#!/bin/bash -e
+#
+# Compile and check with oss-fuzz.
+#
+# Copyright (c) 2023 Linaro Ltd.
+#
+# Authors:
+# Alex Bennée <alex.bennee@linaro.org>
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+. common.rc
+
+requires_binary clang
+
+# the build script runs out of $src so we need to copy across
+cd "$BUILD_DIR"
+cp -a $QEMU_SRC .
+cd src
+mkdir build-oss-fuzz
+export LSAN_OPTIONS=suppressions=scripts/oss-fuzz/lsan_suppressions.txt
+env CC="clang" CXX="clang++" CFLAGS="-fsanitize=address"
./scripts/oss-fuzz/build.sh
+export ASAN_OPTIONS="fast_unwind_on_malloc=0"
+for fuzzer in $(find ./build-oss-fuzz/DEST_DIR/ -executable -type f | grep -v
slirp); do
+ grep "LLVMFuzzerTestOneInput" ${fuzzer} > /dev/null 2>&1 || continue ;
+ echo Testing ${fuzzer} ... ;
+ "${fuzzer}" -runs=1 -seed=1 || exit 1 ;
+done
--
2.39.2
- [PATCH v2 00/26] maintainer omnibus: testing, fuzz, plugins, documentation, Alex Bennée, 2023/06/26
- [PATCH v2 02/26] gitlab: ensure coverage job also publishes meson log, Alex Bennée, 2023/06/26
- [PATCH v2 01/26] gitlab: explicit set artifacts publishing criteria, Alex Bennée, 2023/06/26
- [PATCH v2 03/26] gitlab: reduce testing scope of check-gcov, Alex Bennée, 2023/06/26
- [PATCH v2 08/26] tests/qtests: clean-up and fix leak in generic_fuzz, Alex Bennée, 2023/06/26
- Re: [PATCH v2 08/26] tests/qtests: clean-up and fix leak in generic_fuzz, Alexander Bulekov, 2023/06/27
- [PATCH v2 09/26] tests/docker: add test-fuzz,
Alex Bennée <=
- [PATCH v2 11/26] tests/lcitool: update to latest version, Alex Bennée, 2023/06/26
- [PATCH v2 04/26] docs/devel: remind developers to run CI container pipeline when updating images, Alex Bennée, 2023/06/26
- [PATCH v2 06/26] qemu-keymap: properly check return from xkb_keymap_mod_get_index, Alex Bennée, 2023/06/26
- [PATCH v2 10/26] Makefile: add lcitool-refresh to UNCHECKED_GOALS, Alex Bennée, 2023/06/26
- [PATCH v2 14/26] tests/lcitool: introduce qemu-minimal, Alex Bennée, 2023/06/26
- [PATCH v2 07/26] scripts/oss-fuzz: add a suppression for keymap, Alex Bennée, 2023/06/26
- [PATCH v2 12/26] tests/lcitool: Bump fedora container versions, Alex Bennée, 2023/06/26
- [PATCH v2 19/26] plugins: update lockstep to use g_memdup2, Alex Bennée, 2023/06/26