Files
simple-ca/run-tests.sh

19 lines
578 B
Bash
Executable File

#!/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