diff options
author | Andrei Pavel <andrei@isc.org> | 2024-10-15 11:41:41 +0200 |
---|---|---|
committer | Andrei Pavel <andrei@isc.org> | 2024-10-23 15:40:31 +0200 |
commit | a96168e7625541f15fc58811104c8da0303646f4 (patch) | |
tree | ae63bde11d86d1276c6efe4bb000a24c5e6486c7 /fuzz/tests | |
parent | [#3605] Remove extra semis (diff) | |
download | kea-a96168e7625541f15fc58811104c8da0303646f4.tar.xz kea-a96168e7625541f15fc58811104c8da0303646f4.zip |
[#3605] Integrate a new fuzzing solution in Kea
The solution is based on clusterfuzzlite, libfuzzer, and oss-fuzz
technologies.
- Add the .clusterfuzzlite directory.
- Add the fuzz CI stage and fuzzing CI jobs.
- Add the fuzzing targets in the fuzz directory.
- Document fuzzing in doxygen.
Diffstat (limited to 'fuzz/tests')
-rw-r--r-- | fuzz/tests/Makefile.am | 16 | ||||
l--------- | fuzz/tests/setup.sh | 1 | ||||
-rwxr-xr-x | fuzz/tests/test-fuzz-config-kea-dhcp4.sh | 11 | ||||
-rwxr-xr-x | fuzz/tests/test-fuzz-config-kea-dhcp6.sh | 11 | ||||
-rwxr-xr-x | fuzz/tests/test-fuzz-http-endpoint.sh | 11 | ||||
-rwxr-xr-x | fuzz/tests/test-fuzz-packets-kea-dhcp4.sh | 11 | ||||
-rwxr-xr-x | fuzz/tests/test-fuzz-packets-kea-dhcp6.sh | 11 | ||||
-rwxr-xr-x | fuzz/tests/test-fuzz-unix-socket-kea-dhcp4.sh | 11 | ||||
-rwxr-xr-x | fuzz/tests/test-fuzz-unix-socket-kea-dhcp6.sh | 11 |
9 files changed, 94 insertions, 0 deletions
diff --git a/fuzz/tests/Makefile.am b/fuzz/tests/Makefile.am new file mode 100644 index 0000000000..3727d137db --- /dev/null +++ b/fuzz/tests/Makefile.am @@ -0,0 +1,16 @@ +SUBDIRS = . + +if FUZZING + +check_SCRIPTS = +check_SCRIPTS += test-fuzz-config-kea-dhcp4.sh +check_SCRIPTS += test-fuzz-config-kea-dhcp6.sh +check_SCRIPTS += test-fuzz-http-endpoint.sh +check_SCRIPTS += test-fuzz-packets-kea-dhcp4.sh +check_SCRIPTS += test-fuzz-packets-kea-dhcp6.sh +check_SCRIPTS += test-fuzz-unix-socket-kea-dhcp4.sh +check_SCRIPTS += test-fuzz-unix-socket-kea-dhcp6.sh + +TESTS = $(check_SCRIPTS) + +endif # FUZZING diff --git a/fuzz/tests/setup.sh b/fuzz/tests/setup.sh new file mode 120000 index 0000000000..1664189fbb --- /dev/null +++ b/fuzz/tests/setup.sh @@ -0,0 +1 @@ +../setup.sh
\ No newline at end of file diff --git a/fuzz/tests/test-fuzz-config-kea-dhcp4.sh b/fuzz/tests/test-fuzz-config-kea-dhcp4.sh new file mode 100755 index 0000000000..fcbebc1fe8 --- /dev/null +++ b/fuzz/tests/test-fuzz-config-kea-dhcp4.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +if ! sudo -n true; then exec sudo -E -- "${0}" "${@}"; fi + +script_path=$(cd "$(dirname "${0}")" && pwd) + +script_basename=$(basename "${0}") + +tested_binary=$(printf '%s' "${script_basename}" | sed 's/test-//g;s/.sh//g') + +"${script_path}/../${tested_binary}" diff --git a/fuzz/tests/test-fuzz-config-kea-dhcp6.sh b/fuzz/tests/test-fuzz-config-kea-dhcp6.sh new file mode 100755 index 0000000000..fcbebc1fe8 --- /dev/null +++ b/fuzz/tests/test-fuzz-config-kea-dhcp6.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +if ! sudo -n true; then exec sudo -E -- "${0}" "${@}"; fi + +script_path=$(cd "$(dirname "${0}")" && pwd) + +script_basename=$(basename "${0}") + +tested_binary=$(printf '%s' "${script_basename}" | sed 's/test-//g;s/.sh//g') + +"${script_path}/../${tested_binary}" diff --git a/fuzz/tests/test-fuzz-http-endpoint.sh b/fuzz/tests/test-fuzz-http-endpoint.sh new file mode 100755 index 0000000000..fcbebc1fe8 --- /dev/null +++ b/fuzz/tests/test-fuzz-http-endpoint.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +if ! sudo -n true; then exec sudo -E -- "${0}" "${@}"; fi + +script_path=$(cd "$(dirname "${0}")" && pwd) + +script_basename=$(basename "${0}") + +tested_binary=$(printf '%s' "${script_basename}" | sed 's/test-//g;s/.sh//g') + +"${script_path}/../${tested_binary}" diff --git a/fuzz/tests/test-fuzz-packets-kea-dhcp4.sh b/fuzz/tests/test-fuzz-packets-kea-dhcp4.sh new file mode 100755 index 0000000000..fcbebc1fe8 --- /dev/null +++ b/fuzz/tests/test-fuzz-packets-kea-dhcp4.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +if ! sudo -n true; then exec sudo -E -- "${0}" "${@}"; fi + +script_path=$(cd "$(dirname "${0}")" && pwd) + +script_basename=$(basename "${0}") + +tested_binary=$(printf '%s' "${script_basename}" | sed 's/test-//g;s/.sh//g') + +"${script_path}/../${tested_binary}" diff --git a/fuzz/tests/test-fuzz-packets-kea-dhcp6.sh b/fuzz/tests/test-fuzz-packets-kea-dhcp6.sh new file mode 100755 index 0000000000..fcbebc1fe8 --- /dev/null +++ b/fuzz/tests/test-fuzz-packets-kea-dhcp6.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +if ! sudo -n true; then exec sudo -E -- "${0}" "${@}"; fi + +script_path=$(cd "$(dirname "${0}")" && pwd) + +script_basename=$(basename "${0}") + +tested_binary=$(printf '%s' "${script_basename}" | sed 's/test-//g;s/.sh//g') + +"${script_path}/../${tested_binary}" diff --git a/fuzz/tests/test-fuzz-unix-socket-kea-dhcp4.sh b/fuzz/tests/test-fuzz-unix-socket-kea-dhcp4.sh new file mode 100755 index 0000000000..fcbebc1fe8 --- /dev/null +++ b/fuzz/tests/test-fuzz-unix-socket-kea-dhcp4.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +if ! sudo -n true; then exec sudo -E -- "${0}" "${@}"; fi + +script_path=$(cd "$(dirname "${0}")" && pwd) + +script_basename=$(basename "${0}") + +tested_binary=$(printf '%s' "${script_basename}" | sed 's/test-//g;s/.sh//g') + +"${script_path}/../${tested_binary}" diff --git a/fuzz/tests/test-fuzz-unix-socket-kea-dhcp6.sh b/fuzz/tests/test-fuzz-unix-socket-kea-dhcp6.sh new file mode 100755 index 0000000000..fcbebc1fe8 --- /dev/null +++ b/fuzz/tests/test-fuzz-unix-socket-kea-dhcp6.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +if ! sudo -n true; then exec sudo -E -- "${0}" "${@}"; fi + +script_path=$(cd "$(dirname "${0}")" && pwd) + +script_basename=$(basename "${0}") + +tested_binary=$(printf '%s' "${script_basename}" | sed 's/test-//g;s/.sh//g') + +"${script_path}/../${tested_binary}" |