diff options
| author | Denys Fedoryshchenko <denys.f@collabora.com> | 2026-09-28 21:50:27 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-28 21:50:27 +0300 |
| commit | 50c54c477624d5a9b668225fde2b9844d362760a (patch) | |
| tree | d1fe53a3c637f8b963027aa483053ae7afb55b5e /tests/unit/run_safeguards.sh | |
| parent | c9d938173838d6955c824d141f24672d7037eb4e (diff) | |
| parent | 06aa0ef737d6993fd18e7db1bc8fc35601079505 (diff) | |
| download | accel-ppp-master.tar.gz accel-ppp-master.zip | |
Additional safeguards
Diffstat (limited to 'tests/unit/run_safeguards.sh')
| -rw-r--r-- | tests/unit/run_safeguards.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/unit/run_safeguards.sh b/tests/unit/run_safeguards.sh new file mode 100644 index 00000000..1c69efd7 --- /dev/null +++ b/tests/unit/run_safeguards.sh @@ -0,0 +1,21 @@ +#!/bin/sh +# Run from any directory, passing a configured CMake build directory. +set -eu +root=$(CDPATH= cd -- "$(dirname -- "$0")/../.." && pwd) +build=${1:?usage: run_safeguards.sh /path/to/cmake-build} +out=$(mktemp -d) +trap 'rm -rf "$out"' EXIT HUP INT TERM +cd "$root" +for name in dhcpv6 radius vrf lcp mempool; do + extra= + # LCP's global layer table retains the whole daemon under ASan; its test + # checks wire lengths with UBSan. The packet/VRF tests also use ASan. + if [ "$name" = lcp ]; then extra=-fno-sanitize=address; fi + ${CC:-cc} -O1 -g -Wall -Wno-unused-function -Wno-unused-result -D_GNU_SOURCE -DAP_SESSIONID_LEN=16 \ + -DOPENSSL_API_COMPAT=0x10100000L -fno-strict-aliasing \ + -ffunction-sections -fdata-sections -Wl,--gc-sections \ + -fsanitize=address,undefined -fno-sanitize-recover=all $extra \ + -I "$build" -I accel-pppd -I accel-pppd/include -I accel-pppd/triton \ + -o "$out/$name" "tests/unit/${name}_safeguards_test.c" -lcrypto -lpthread + "$out/$name" +done |
