Added a test suite.
This commit is contained in:
18
run-tests.sh
Executable file
18
run-tests.sh
Executable 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
|
||||
Reference in New Issue
Block a user