Skip to content
Snippets Groups Projects
Unverified Commit c2a62fb1 authored by Humorous Baby's avatar Humorous Baby
Browse files

tests: fix failing `secrets` test

When docker secrets are used, no dhparams are generated/present (unless
the user mounts some). This prevents `inspircd` from starting up.
Additionally, some newer versions of openssl now include spaces around
the `=` in `OU=...`, so the `grep` pattern was updated.
parent 2e002ded
No related branches found
No related tags found
No related merge requests found
...@@ -49,9 +49,13 @@ time_stamping_key ...@@ -49,9 +49,13 @@ time_stamping_key
EOF EOF
/usr/bin/certtool --generate-privkey --bits 4096 --sec-param normal --outfile $INSPIRCD_ROOT/conf/key.pem /usr/bin/certtool --generate-privkey --bits 4096 --sec-param normal --outfile $INSPIRCD_ROOT/conf/key.pem
/usr/bin/certtool --generate-self-signed --load-privkey $INSPIRCD_ROOT/conf/key.pem --outfile $INSPIRCD_ROOT/conf/cert.pem --template /tmp/cert.template /usr/bin/certtool --generate-self-signed --load-privkey $INSPIRCD_ROOT/conf/key.pem --outfile $INSPIRCD_ROOT/conf/cert.pem --template /tmp/cert.template
/usr/bin/certtool --generate-dh-params --sec-param normal --outfile $INSPIRCD_ROOT/conf/dhparams.pem
rm /tmp/cert.template rm /tmp/cert.template
fi fi
# Make sure dhparams are present
if [ ! -e $INSPIRCD_ROOT/conf/dhparams.pem ]; then
/usr/bin/certtool --generate-dh-params --sec-param normal --outfile $INSPIRCD_ROOT/conf/dhparams.pem
fi
cd $INSPIRCD_ROOT cd $INSPIRCD_ROOT
exec env INSPIRCD_ROOT=$INSPIRCD_ROOT $INSPIRCD_ROOT/bin/inspircd --nofork $@ exec env INSPIRCD_ROOT=$INSPIRCD_ROOT $INSPIRCD_ROOT/bin/inspircd --nofork $@
...@@ -52,7 +52,7 @@ SECRETKEY=$(docker secret create test-secrets-key /tmp/test-secrets-key.pem) ...@@ -52,7 +52,7 @@ SECRETKEY=$(docker secret create test-secrets-key /tmp/test-secrets-key.pem)
DOCKERSERVICE=$(docker service create -q -d -p "${CLIENT_PORT}:6667" -p "${TLS_CLIENT_PORT}:6697" --secret source=test-secrets-key,target=inspircd.key --secret source=test-secrets-cert,target=inspircd.crt inspircd:testing) DOCKERSERVICE=$(docker service create -q -d -p "${CLIENT_PORT}:6667" -p "${TLS_CLIENT_PORT}:6697" --secret source=test-secrets-key,target=inspircd.key --secret source=test-secrets-cert,target=inspircd.crt inspircd:testing)
sleep 35 sleep 35
# Make sure TLS is working # Make sure TLS is working
TLSCHECK=$(echo quit | timeout 10 openssl s_client -ign_eof -connect "localhost:${TLS_CLIENT_PORT}" 2>/dev/null | grep -c "OU=Secret Server Admins") TLSCHECK=$(echo quit | timeout 10 openssl s_client -ign_eof -connect "localhost:${TLS_CLIENT_PORT}" 2>/dev/null | grep -c "OU\s*=\s*Secret Server Admins")
[ "$TLSCHECK" -gt 0 ] || exit 1 [ "$TLSCHECK" -gt 0 ] || exit 1
sleep 5 sleep 5
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment