From 7cbbfa7c7e0fba134838c5c9c58d2d3174232882 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Thu, 19 Feb 2015 16:17:01 +0100 Subject: Make unit tests work again. Makefile target 'check' runs them. --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 2650806..9f50bd9 100644 --- a/Makefile +++ b/Makefile @@ -56,3 +56,7 @@ tests-stop: echo "halt()." | ./rel/bin/to_erl test/nodes/storage-1/ tests: tests-prepare tests-start tests-run tests-stop + +# Unit testing. +check: all + test/check.erl -- cgit v1.1 From 0886d0366ae96fc103b241c73127fdf903efd019 Mon Sep 17 00:00:00 2001 From: Magnus Ahltorp Date: Thu, 19 Feb 2015 12:52:30 +0100 Subject: Add fetching all certs to the list of tests --- Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 9f50bd9..274eae9 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ release: all test -d rel/catlfish/webroot/log || mkdir rel/catlfish/webroot/log tests-prepare: - -rm -r rel/known_roots + rm -r rel/known_roots || true mkdir rel/known_roots cp tools/testcerts/roots/* rel/known_roots @@ -34,7 +34,7 @@ tests-prepare: mkdir -p test/nodes/storage-2/log cp test/config/frontend-1.config rel cp test/config/storage-1.config rel - -rm -r rel/tests + rm -r rel/tests || true mkdir -p rel/tests/machine/machine-1/db printf "0" > rel/tests/machine/machine-1/db/treesize mkdir -p rel/tests/machine/machine-2/db @@ -48,7 +48,8 @@ tests-start: sleep 1 tests-run: - (cd tools ; python testcase1.py ) || echo "Tests failed" + @(cd tools ; python testcase1.py ) || echo "Tests failed" + @(cd tools ; python fetchallcerts.py https://127.0.0.1:8080/) || echo "Verification failed" tests-stop: sleep 5 -- cgit v1.1 From 93b37a60e4faf21abbc65a7e9d4b323302b32942 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Fri, 27 Feb 2015 01:51:54 +0100 Subject: Don't start erl with `-name'. That's for distributed nodes and we don't do that. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 274eae9..56064ad 100644 --- a/Makefile +++ b/Makefile @@ -43,8 +43,8 @@ tests-prepare: touch rel/tests/machine/machine-1/db/newentries tests-start: - (cd rel ; bin/run_erl -daemon ../test/nodes/frontend-1/ ../test/nodes/frontend-1/log/ "exec bin/erl -config frontend-1 -name frontend-1") - (cd rel ; bin/run_erl -daemon ../test/nodes/storage-1/ ../test/nodes/storage-1/log/ "exec bin/erl -config storage-1 -name storage-1") + (cd rel ; bin/run_erl -daemon ../test/nodes/frontend-1/ ../test/nodes/frontend-1/log/ "exec bin/erl -config frontend-1") + (cd rel ; bin/run_erl -daemon ../test/nodes/storage-1/ ../test/nodes/storage-1/log/ "exec bin/erl -config storage-1") sleep 1 tests-run: -- cgit v1.1 From 103e0ee850404a5c8dc69bbbf79b2508a9c55d7a Mon Sep 17 00:00:00 2001 From: Magnus Ahltorp Date: Thu, 26 Feb 2015 16:54:26 +0100 Subject: Added authentication between frontend and storage nodes --- Makefile | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 56064ad..08f6584 100644 --- a/Makefile +++ b/Makefile @@ -34,6 +34,8 @@ tests-prepare: mkdir -p test/nodes/storage-2/log cp test/config/frontend-1.config rel cp test/config/storage-1.config rel + cp -r test/config/privatekeys rel + cp -r test/config/publickeys rel rm -r rel/tests || true mkdir -p rel/tests/machine/machine-1/db printf "0" > rel/tests/machine/machine-1/db/treesize -- cgit v1.1 From f87aba6cf765c3ba3f6b4cc097c63b567966de85 Mon Sep 17 00:00:00 2001 From: Magnus Ahltorp Date: Fri, 27 Feb 2015 15:49:48 +0100 Subject: Improve tests-start and tests-stop --- Makefile | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 08f6584..b63a11f 100644 --- a/Makefile +++ b/Makefile @@ -45,20 +45,33 @@ tests-prepare: touch rel/tests/machine/machine-1/db/newentries tests-start: - (cd rel ; bin/run_erl -daemon ../test/nodes/frontend-1/ ../test/nodes/frontend-1/log/ "exec bin/erl -config frontend-1") - (cd rel ; bin/run_erl -daemon ../test/nodes/storage-1/ ../test/nodes/storage-1/log/ "exec bin/erl -config storage-1") - sleep 1 + @for node in frontend-1 storage-1; do \ + (cd rel ; bin/run_erl -daemon ../test/nodes/$$node/ ../test/nodes/$$node/log/ "exec bin/erl -config $$node") \ + done + @for i in 1 2 3 4 5 6 7 8 9 10; do \ + echo "waiting for system to start" ; \ + sleep 0.5 ; \ + allstarted=1 ; \ + for testurl in https://127.0.0.1:8080/ https://127.0.0.1:8081/ https://127.0.0.1:8082/; do \ + if curl -s -k $$testurl > /dev/null ; then : ; else allstarted=0 ; fi ; \ + : ; \ + done ; \ + if [ $$allstarted == 1 ]; then break ; fi ; \ + done tests-run: @(cd tools ; python testcase1.py ) || echo "Tests failed" @(cd tools ; python fetchallcerts.py https://127.0.0.1:8080/) || echo "Verification failed" tests-stop: + @for node in frontend-1 storage-1; do \ + ./tools/halt.py ./rel/bin/to_erl test/nodes/$$node/ ; \ + done + +tests-wait: sleep 5 - echo "halt()." | ./rel/bin/to_erl test/nodes/frontend-1/ - echo "halt()." | ./rel/bin/to_erl test/nodes/storage-1/ -tests: tests-prepare tests-start tests-run tests-stop +tests: tests-prepare tests-start tests-run tests-wait tests-stop # Unit testing. check: all -- cgit v1.1 From 4558ede163d97b6a744feefbd1184ed3b0c7d360 Mon Sep 17 00:00:00 2001 From: Magnus Ahltorp Date: Sat, 28 Feb 2015 17:32:05 +0100 Subject: Move test nodes list to variables --- Makefile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index b63a11f..5b2cf9e 100644 --- a/Makefile +++ b/Makefile @@ -44,19 +44,22 @@ tests-prepare: touch rel/tests/machine/machine-1/db/index touch rel/tests/machine/machine-1/db/newentries +NODES=frontend-1 storage-1 +TESTURLS=https://127.0.0.1:8080/ https://127.0.0.1:8081/ https://127.0.0.1:8082/ + tests-start: - @for node in frontend-1 storage-1; do \ + @for node in $(NODES); do \ (cd rel ; bin/run_erl -daemon ../test/nodes/$$node/ ../test/nodes/$$node/log/ "exec bin/erl -config $$node") \ done @for i in 1 2 3 4 5 6 7 8 9 10; do \ echo "waiting for system to start" ; \ sleep 0.5 ; \ allstarted=1 ; \ - for testurl in https://127.0.0.1:8080/ https://127.0.0.1:8081/ https://127.0.0.1:8082/; do \ + for testurl in $(TESTURLS); do \ if curl -s -k $$testurl > /dev/null ; then : ; else allstarted=0 ; fi ; \ : ; \ done ; \ - if [ $$allstarted == 1 ]; then break ; fi ; \ + if [ $$allstarted -eq 1 ]; then break ; fi ; \ done tests-run: @@ -64,7 +67,7 @@ tests-run: @(cd tools ; python fetchallcerts.py https://127.0.0.1:8080/) || echo "Verification failed" tests-stop: - @for node in frontend-1 storage-1; do \ + @for node in $(NODES); do \ ./tools/halt.py ./rel/bin/to_erl test/nodes/$$node/ ; \ done -- cgit v1.1 From 06987aac6ea50e40915a59c0d3d52c84ae7e5498 Mon Sep 17 00:00:00 2001 From: Magnus Ahltorp Date: Mon, 2 Mar 2015 19:11:16 +0100 Subject: Move to external signing --- Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 5b2cf9e..d124325 100644 --- a/Makefile +++ b/Makefile @@ -32,8 +32,10 @@ tests-prepare: mkdir -p test/nodes/frontend-1/log mkdir -p test/nodes/storage-1/log mkdir -p test/nodes/storage-2/log + mkdir -p test/nodes/signing-1/log cp test/config/frontend-1.config rel cp test/config/storage-1.config rel + cp test/config/signing-1.config rel cp -r test/config/privatekeys rel cp -r test/config/publickeys rel rm -r rel/tests || true @@ -44,8 +46,8 @@ tests-prepare: touch rel/tests/machine/machine-1/db/index touch rel/tests/machine/machine-1/db/newentries -NODES=frontend-1 storage-1 -TESTURLS=https://127.0.0.1:8080/ https://127.0.0.1:8081/ https://127.0.0.1:8082/ +NODES=frontend-1 storage-1 signing-1 +TESTURLS=https://127.0.0.1:8080/ https://127.0.0.1:8081/ https://127.0.0.1:8082/ https://127.0.0.1:8088/ tests-start: @for node in $(NODES); do \ -- cgit v1.1