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 From e2404caabb5ce3f7dca21cdedddbf744f47e6c3e Mon Sep 17 00:00:00 2001 From: Magnus Ahltorp Date: Sun, 8 Mar 2015 12:39:40 +0100 Subject: Test more --- Makefile | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index d124325..1837422 100644 --- a/Makefile +++ b/Makefile @@ -67,6 +67,14 @@ tests-start: tests-run: @(cd tools ; python testcase1.py ) || echo "Tests failed" @(cd tools ; python fetchallcerts.py https://127.0.0.1:8080/) || echo "Verification failed" + @(cd tools ; python submitcert.py --store testcerts/cert1.txt --check-sct --sct-file=../rel/submittedcerts https://127.0.0.1:8080/) || echo "Submission failed" + @(cd tools ; python submitcert.py --store testcerts/cert2.txt --check-sct --sct-file=../rel/submittedcerts https://127.0.0.1:8080/) || echo "Submission failed" + @(cd tools ; python submitcert.py --store testcerts/cert3.txt --check-sct --sct-file=../rel/submittedcerts https://127.0.0.1:8080/) || echo "Submission failed" + @(cd tools ; python submitcert.py --store testcerts/cert4.txt --check-sct --sct-file=../rel/submittedcerts https://127.0.0.1:8080/) || echo "Submission failed" + @(cd tools ; python submitcert.py --store testcerts/cert5.txt --check-sct --sct-file=../rel/submittedcerts https://127.0.0.1:8080/) || echo "Submission failed" + +tests-run2: + @(cd tools ; python verifysct.py --sct-file=../rel/submittedcerts --parallel 1 https://127.0.0.1:8080/) || echo "Verification of SCT:s failed" tests-stop: @for node in $(NODES); do \ @@ -76,7 +84,17 @@ tests-stop: tests-wait: sleep 5 -tests: tests-prepare tests-start tests-run tests-wait tests-stop +tests: + @make tests-prepare + @make tests-start + @make tests-run + @make tests-wait + @make tests-stop + @make tests-wait + @make tests-start + @make tests-run2 + @make tests-wait + @make tests-stop # Unit testing. check: all -- cgit v1.1 From 1812b745e7a3d39b75d295edfa8b9287d2c6a479 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Sat, 21 Mar 2015 01:27:57 +0100 Subject: Add submission and verification of two precerts to the tests. One of them is signed by an ordinare cert, the other by a precertificate --- Makefile | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 1837422..e1a81fb 100644 --- a/Makefile +++ b/Makefile @@ -72,6 +72,9 @@ tests-run: @(cd tools ; python submitcert.py --store testcerts/cert3.txt --check-sct --sct-file=../rel/submittedcerts https://127.0.0.1:8080/) || echo "Submission failed" @(cd tools ; python submitcert.py --store testcerts/cert4.txt --check-sct --sct-file=../rel/submittedcerts https://127.0.0.1:8080/) || echo "Submission failed" @(cd tools ; python submitcert.py --store testcerts/cert5.txt --check-sct --sct-file=../rel/submittedcerts https://127.0.0.1:8080/) || echo "Submission failed" + @(cd tools ; python submitcert.py --store testcerts/pre1.txt --check-sct --sct-file=../rel/submittedcerts https://127.0.0.1:8080/) || echo "Submission failed" + @(cd tools ; python submitcert.py --store testcerts/pre2.txt --check-sct --sct-file=../rel/submittedcerts https://127.0.0.1:8080/) || echo "Submission failed" + @(cd tools ; python merge.py --baseurl https://127.0.0.1:8080/ --frontend https://127.0.0.1:8082/ --storage https://127.0.0.1:8081/ --mergedb ../rel/mergedb --signing https://127.0.0.1:8088/ --own-keyname merge-1 --own-keyfile ../rel/privatekeys/merge-1-private.pem) || echo "Merge failed" tests-run2: @(cd tools ; python verifysct.py --sct-file=../rel/submittedcerts --parallel 1 https://127.0.0.1:8080/) || echo "Verification of SCT:s failed" -- cgit v1.1