aboutsummaryrefslogtreecommitdiffstats
path: root/tests/run_download_cert_test.sh
diff options
context:
space:
mode:
authorThomas Vanbesien <tvanbesi@proton.me>2026-02-18 22:30:06 +0100
committerThomas Vanbesien <tvanbesi@proton.me>2026-02-18 22:32:08 +0100
commit5f5e172cd2392952162398c85b07e6f6b7e69398 (patch)
tree65cd56e0e18d5e16dc5abf6c6d912a13d53aff68 /tests/run_download_cert_test.sh
parent77e70beff33d89f30082f3e5d513cd657fa529ea (diff)
downloadBobinkCOpcUa-5f5e172cd2392952162398c85b07e6f6b7e69398.tar.gz
BobinkCOpcUa-5f5e172cd2392952162398c85b07e6f6b7e69398.zip
Move certificates into per-test directories
Each secure test now has its own certs/ subfolder with per-identity subdirectories and a single shared trust store. Configs reference paths relative to the project root (e.g. tests/secure_anonymous/ certs/ServerLDS/cert.der). Cert generation logic removed from test scripts since certs are now pre-generated and committed.
Diffstat (limited to 'tests/run_download_cert_test.sh')
-rwxr-xr-xtests/run_download_cert_test.sh22
1 files changed, 2 insertions, 20 deletions
diff --git a/tests/run_download_cert_test.sh b/tests/run_download_cert_test.sh
index 9bcc750..f20609c 100755
--- a/tests/run_download_cert_test.sh
+++ b/tests/run_download_cert_test.sh
@@ -20,24 +20,6 @@ TMPFILE=""
DOWNLOADED_CERT=""
FAILURES=0
-# ── ensure certificates exist ─────────────────────────────────
-CERT_DIR=certs
-GEN_CERT=tools/generate_certificate.sh
-
-for identity in ServerLDS Client; do
- if [ ! -f "$CERT_DIR/${identity}_cert.der" ]; then
- "$GEN_CERT" "$CERT_DIR" "$identity"
- fi
-done
-
-for store in server_lds client; do
- mkdir -p "$CERT_DIR/trust/$store"
- for identity in ServerLDS Client; do
- cert="$CERT_DIR/${identity}_cert.der"
- [ -f "$cert" ] && cp -n "$cert" "$CERT_DIR/trust/$store/"
- done
-done
-
# ── cleanup ────────────────────────────────────────────────────
cleanup() {
[ -n "$LDS_PID" ] && kill "$LDS_PID" 2>/dev/null && wait "$LDS_PID" 2>/dev/null
@@ -100,8 +82,8 @@ echo "$DC_OUTPUT" | grep -q "Certificate saved to"
check "download-cert output contains 'Certificate saved to'" $?
# ── compare with original ─────────────────────────────────────
-cmp -s "$DOWNLOADED_CERT" "certs/ServerLDS_cert.der"
-check "downloaded certificate matches certs/ServerLDS_cert.der" $?
+cmp -s "$DOWNLOADED_CERT" "$CONFIG_DIR/certs/ServerLDS/cert.der"
+check "downloaded certificate matches $CONFIG_DIR/certs/ServerLDS/cert.der" $?
# ── result ─────────────────────────────────────────────────────
if [ "$FAILURES" -ne 0 ]; then