summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorMagnus Ahltorp <map@kth.se>2015-03-04 22:48:40 +0100
committerMagnus Ahltorp <map@kth.se>2015-03-04 22:48:40 +0100
commita706e79fa722f681320fe1b05824352b6b9a63fc (patch)
tree41907841f09f19d93adfab91eb314bb0789851f9 /Makefile
parentf800e5fae8f9579328477b3bc3e939d9f4369d32 (diff)
parente0f11a58033d52c70bc76b4b5611cb88485d4653 (diff)
Merge branch 'extsign'
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile36
1 files changed, 30 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 0b4384d..d124325 100644
--- a/Makefile
+++ b/Makefile
@@ -32,8 +32,12 @@ 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
mkdir -p rel/tests/machine/machine-1/db
printf "0" > rel/tests/machine/machine-1/db/treesize
@@ -42,18 +46,38 @@ tests-prepare:
touch rel/tests/machine/machine-1/db/index
touch rel/tests/machine/machine-1/db/newentries
+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:
- (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")
- sleep 1
+ @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 $(TESTURLS); do \
+ if curl -s -k $$testurl > /dev/null ; then : ; else allstarted=0 ; fi ; \
+ : ; \
+ done ; \
+ if [ $$allstarted -eq 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 $(NODES); 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
+ test/check.erl