bwrap tweaks:

in scripts/ocsp.test, don't call ping.test when $AM_BWRAPPED = yes (ping is setuid, so fails under bwrap);

in scripts/unit.test.in, don't bwrap if $AM_BWRAPPED = yes (double-bwrapping always fails);

in testsuite/testsuite.c testsuite_test(), build tempName using tempDir, and try to assign tempDir from XGETENV("TMPDIR"), fallback to hardcoded "/tmp".
This commit is contained in:
Daniel Pouzzner
2022-02-10 15:54:39 -06:00
parent 91578df19d
commit c581e13380
4 changed files with 49 additions and 22 deletions
+17 -8
View File
@@ -26,11 +26,15 @@ OUTPUT=$(eval "./examples/client/client -S check")
if [ "$OUTPUT" = "SNI is: ON" ]; then
printf '\n\n%s\n\n' "SNI is on, proceed with globalsign test"
# is our desired server there?
"${SCRIPT_DIR}/ping.test" $server 2
RESULT=$?
if [ $RESULT -ne 0 ]; then
GL_UNREACHABLE=1
if [ "$AM_BWRAPPED" != "yes" ]; then
# is our desired server there?
"${SCRIPT_DIR}/ping.test" $server 2
RESULT=$?
if [ $RESULT -ne 0 ]; then
GL_UNREACHABLE=1
fi
else
RESULT=0
fi
if [ $RESULT -eq 0 ]; then
@@ -50,9 +54,14 @@ fi
server=www.google.com
ca=${SCRIPT_DIR}/../certs/external/ca-google-root.pem
# is our desired server there?
${SCRIPT_DIR}/ping.test $server 2
RESULT=$?
if [ "$AM_BWRAPPED" != "yes" ]; then
# is our desired server there?
${SCRIPT_DIR}/ping.test $server 2
RESULT=$?
else
RESULT=0
fi
if [ $RESULT -eq 0 ]; then
# client test against the server
echo "./examples/client/client -X -C -h $server -p 443 -A "$ca" -g -o -N"
+8 -4
View File
@@ -1,8 +1,12 @@
#!/bin/sh
bwrap_path="$(command -v bwrap)"
if [ -n "$bwrap_path" ]; then
exec "$bwrap_path" --unshare-net --dev-bind / / "@builddir@/tests/unit.test" "$@"
if [ "${AM_BWRAPPED-}" != "yes" ]; then
bwrap_path="$(command -v bwrap)"
if [ -n "$bwrap_path" ]; then
exec "$bwrap_path" --unshare-net --dev-bind / / "@builddir@/tests/unit.test" "$@"
else
exec "@builddir@/tests/unit.test" "$@"
fi
else
exec "@builddir@/tests/unit.test" "$@"
exec "@builddir@/tests/unit.test" "$@"
fi