Added a test suite.

This commit is contained in:
2026-03-04 06:02:17 +01:00
parent 9e8c8d4edb
commit 48c1dcc79b

18
run-tests.sh Executable file
View File

@@ -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