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

View File

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

View File

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

View File

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

View File

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