unit.test: add bwrap wrapper script at scripts/unit.test.

This commit is contained in:
Daniel Pouzzner
2020-09-16 22:38:40 -05:00
parent 5ed2fe8092
commit 9df9fb7936
4 changed files with 12 additions and 1 deletions

View File

@@ -84,6 +84,8 @@ if BUILD_OCSP
dist_noinst_SCRIPTS+= scripts/ocsp.test
endif
dist_noinst_SCRIPTS+= scripts/unit.test
endif
endif

9
scripts/unit.test Executable file
View File

@@ -0,0 +1,9 @@
#!/bin/sh
DIRNAME="$(dirname "$0")"
bwrap_path="$(command -v bwrap)"
if [ -n "$bwrap_path" ]; then
exec "$bwrap_path" --unshare-net --dev-bind / / "$DIRNAME/../tests/unit.test" "$@"
else
exec "$DIRNAME/../tests/unit.test" "$@"
fi