summaryrefslogtreecommitdiffstats
path: root/fuzz/tests
diff options
context:
space:
mode:
authorAndrei Pavel <andrei@isc.org>2024-10-15 11:41:41 +0200
committerAndrei Pavel <andrei@isc.org>2024-10-23 15:40:31 +0200
commita96168e7625541f15fc58811104c8da0303646f4 (patch)
treeae63bde11d86d1276c6efe4bb000a24c5e6486c7 /fuzz/tests
parent[#3605] Remove extra semis (diff)
downloadkea-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.am16
l---------fuzz/tests/setup.sh1
-rwxr-xr-xfuzz/tests/test-fuzz-config-kea-dhcp4.sh11
-rwxr-xr-xfuzz/tests/test-fuzz-config-kea-dhcp6.sh11
-rwxr-xr-xfuzz/tests/test-fuzz-http-endpoint.sh11
-rwxr-xr-xfuzz/tests/test-fuzz-packets-kea-dhcp4.sh11
-rwxr-xr-xfuzz/tests/test-fuzz-packets-kea-dhcp6.sh11
-rwxr-xr-xfuzz/tests/test-fuzz-unix-socket-kea-dhcp4.sh11
-rwxr-xr-xfuzz/tests/test-fuzz-unix-socket-kea-dhcp6.sh11
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}"