git » chasquid » commit 83e40da

test: Fix "run without certificates" test

author Alberto Bertogli
2018-03-02 15:08:18 UTC
committer Alberto Bertogli
2018-03-02 19:37:37 UTC
parent f4fb2153b840be2732f5c3706525121304e4d65c

test: Fix "run without certificates" test

The test to check that chasquid fails on startup if there are no valid
TLS certificates is passing, but for the wrong reasons: it fails because
there is no logging directory, not because there are no certificates.

This patch fixes the problem by moving the logs directory creation
before the first test.

test/t-01-simple_local/run.sh +2 -1

diff --git a/test/t-01-simple_local/run.sh b/test/t-01-simple_local/run.sh
index 88b4d19..aa47e64 100755
--- a/test/t-01-simple_local/run.sh
+++ b/test/t-01-simple_local/run.sh
@@ -5,6 +5,8 @@ set -e
 
 init
 
+mkdir -p .logs
+
 if ! chasquid --version > /dev/null; then
 	fail "chasquid --version failed"
 fi
@@ -19,7 +21,6 @@ generate_certs_for testserver
 add_user user@testserver secretpassword
 add_user someone@testserver secretpassword
 
-mkdir -p .logs
 chasquid -v=2 --logfile=.logs/chasquid.log --config_dir=config &
 wait_until_ready 1025