Переглянути джерело

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

Daniel Pouzzner 3 роки тому
батько
коміт
9df9fb7936
4 змінених файлів з 12 додано та 1 видалено
  1. 1 0
      Makefile.am
  2. 2 0
      scripts/include.am
  3. 9 0
      scripts/unit.test
  4. 0 1
      tests/include.am

+ 1 - 0
Makefile.am

@@ -201,6 +201,7 @@ TESTS += $(check_SCRIPTS)
 
 test: check
 tests/unit.log: testsuite/testsuite.log
+scripts/unit.log: testsuite/testsuite.log
 
 DISTCLEANFILES+= cyassl-config
 DISTCLEANFILES+= wolfssl-config

+ 2 - 0
scripts/include.am

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

+ 9 - 0
scripts/unit.test

@@ -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

+ 0 - 1
tests/include.am

@@ -4,7 +4,6 @@
 
 
 if BUILD_TESTS
-check_PROGRAMS += tests/unit.test
 noinst_PROGRAMS += tests/unit.test
 tests_unit_test_SOURCES = \
                   tests/unit.c \