scripts: fix tests for out of tree distcheck

Copying or using certs from directory relative to scripts source directory.
This commit is contained in:
Elms
2021-02-08 10:43:31 -08:00
parent e26f1529c0
commit 12eddee104
5 changed files with 19 additions and 9 deletions

View File

@ -1,6 +1,7 @@
#!/bin/sh
#!/bin/bash
#crl.test
CERT_DIR=certs
# if we can, isolate the network namespace to eliminate port collisions.
if [ "${AM_BWRAPPED-}" != "yes" ]; then
@ -70,7 +71,8 @@ run_test() {
# mutex lock, -c loads the revoked certificate. We capture the processid
# into the variable server_pid
./examples/server/server -R $ready_file -p $crl_port \
-c certs/server-revoked-cert.pem -k certs/server-revoked-key.pem &
-c ${CERT_DIR}/server-revoked-cert.pem \
-k ${CERT_DIR}/server-revoked-key.pem &
server_pid=$!
while [ ! -s $ready_file -a "$counter" -lt 20 ]; do

View File

@ -2,6 +2,8 @@
# ocsp-stapling-with-ca-as-responder.test
SCRIPT_DIR="$(dirname "$0")"
# if we can, isolate the network namespace to eliminate port collisions.
if [ "${AM_BWRAPPED-}" != "yes" ]; then
bwrap_path="$(command -v bwrap)"
@ -32,7 +34,7 @@ PARENTDIR="$PWD"
WORKSPACE="${PARENTDIR}/workspace.pid$$"
mkdir "${WORKSPACE}" || exit $?
cp -pR certs "${WORKSPACE}"/ || exit $?
cp -pR ${SCRIPT_DIR}/../certs "${WORKSPACE}"/ || exit $?
cd "$WORKSPACE" || exit $?
ln -s ../examples

View File

@ -5,6 +5,8 @@
# Note, this script makes connection(s) to the public Internet.
SCRIPT_DIR="$(dirname "$0")"
if [[ -z "${RETRIES_REMAINING-}" ]]; then
export RETRIES_REMAINING=2
fi
@ -51,7 +53,7 @@ PARENTDIR="$PWD"
WORKSPACE="${PARENTDIR}/workspace.pid$$"
mkdir "${WORKSPACE}" || exit $?
cp -pR certs "${WORKSPACE}"/ || exit $?
cp -pR ${SCRIPT_DIR}/../certs "${WORKSPACE}"/ || exit $?
cd "$WORKSPACE" || exit $?
ln -s ../examples
@ -270,7 +272,7 @@ sleep 0.1
# client test against the server
server=login.live.com
#ca=certs/external/baltimore-cybertrust-root.pem
ca=certs/external/ca_collection.pem
ca=./certs/external/ca_collection.pem
if [[ "$V4V6" == "4" ]]; then
./examples/client/client -C -h $server -p 443 -A $ca -g -W 1

View File

@ -3,6 +3,8 @@
# ocsp-stapling2.test
# Test requires HAVE_OCSP and HAVE_CERTIFICATE_STATUS_REQUEST_V2
SCRIPT_DIR="$(dirname "$0")"
# if we can, isolate the network namespace to eliminate port collisions.
if [ "${AM_BWRAPPED-}" != "yes" ]; then
bwrap_path="$(command -v bwrap)"
@ -51,7 +53,7 @@ PARENTDIR="$PWD"
WORKSPACE="${PARENTDIR}/workspace.pid$$"
mkdir "${WORKSPACE}" || exit $?
cp -pR certs "${WORKSPACE}"/ || exit $?
cp -pR ${SCRIPT_DIR}/../certs "${WORKSPACE}"/ || exit $?
cd "$WORKSPACE" || exit $?
ln -s ../examples

View File

@ -4,6 +4,8 @@
# Note, this script makes connection(s) to the public Internet.
SCRIPT_DIR="$(dirname "$0")"
server=www.globalsign.com
ca=certs/external/ca-globalsign-root.pem
@ -25,7 +27,7 @@ if [ "$OUTPUT" = "SNI is: ON" ]; then
printf '\n\n%s\n\n' "SNI is on, proceed with globalsign test"
# is our desired server there?
./scripts/ping.test $server 2
${SCRIPT_DIR}/ping.test $server 2
RESULT=$?
if [ $RESULT -ne 0 ]; then
GL_UNREACHABLE=1
@ -45,10 +47,10 @@ else
fi
server=www.google.com
ca=certs/external/ca-google-root.pem
ca=${SCRIPT_DIR}/../certs/external/ca-google-root.pem
# is our desired server there?
./scripts/ping.test $server 2
${SCRIPT_DIR}/ping.test $server 2
RESULT=$?
if [ $RESULT -eq 0 ]; then
# client test against the server