diff --git a/run-tests.sh b/run-tests.sh new file mode 100755 index 0000000..b38b8b3 --- /dev/null +++ b/run-tests.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +# This script runs all the test required to verify the functionality of the simple CA implementation. +set -e + +# Load the certificate functions +source "$(dirname "$BASH_SOURCE[0]")/cert-functions.sh" + +# Create a temporary directory for the test certificates +TEMP_CERT_DIR=$(mktemp -d) +# Ensure the temporary directory is cleaned up on exit or interruption +trap "rm -rf $TEMP_CERT_DIR" EXIT KILL HUP INT QUIT + +# Create a standalone CA for testing purposes +if ! make_ca "$TEMP_CERT_DIR" "Test CA"; then + echo "ERROR: Failed to create CA." >&2 + exit 1 +fi