summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile28
1 files changed, 27 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 261def1..d7b5ee3 100644
--- a/Makefile
+++ b/Makefile
@@ -9,13 +9,14 @@ release: all
mkdir $(RELDIR)
./makerelease.erl
mkdir $(RELDIR)/catlfish
- cp -r webroot $(RELDIR)/catlfish
-include test/test.mk
tests-prepare:
rm -r $(RELDIR)/tests || true
mkdir $(RELDIR)/tests
+ make tests-createca
+ make tests-createcert
mkdir $(RELDIR)/tests/keys
(cd $(RELDIR)/tests/keys ; ../../../tools/create-key.sh logkey)
mkdir $(RELDIR)/tests/mergedb
@@ -90,6 +91,31 @@ tests:
@make tests-wait
@make tests-stop
+tests-createca:
+ mkdir $(RELDIR)/tests/httpsca
+ ( cd $(RELDIR)/tests/httpsca ; \
+ mkdir -p demoCA/newcerts ; \
+ touch demoCA/index.txt ; \
+ echo 00 > demoCA/serial ; \
+ echo '[ req ]' > caconfig.txt ; \
+ echo 'distinguished_name = req_distinguished_name' >> caconfig.txt ; \
+ echo 'x509_extensions = v3_ca' >> caconfig.txt ; \
+ echo '[ req_distinguished_name ]' >> caconfig.txt ; \
+ echo '[ v3_ca ]' >> caconfig.txt ; \
+ echo 'basicConstraints=CA:true' >> caconfig.txt ; \
+ openssl req -newkey rsa:2048 -keyout key.pem -out req.csr -nodes -subj '/countryName=SE/stateOrProvinceName=Stockholm/organizationName=Test/commonName=ca/O=ca' -config caconfig.txt ; \
+ openssl ca -in req.csr -selfsign -keyfile key.pem -out demoCA/cacert.pem -batch \
+ )
+
+tests-createcert:
+ mkdir $(RELDIR)/tests/httpscert
+ openssl req -new -newkey rsa:2048 -keyout $(RELDIR)/tests/httpscert/httpskey-1.pem -out $(RELDIR)/tests/httpsca/httpscert-1.csr -nodes -subj '/countryName=SE/stateOrProvinceName=Stockholm/organizationName=Test/CN=localhost'
+ ( cd $(RELDIR)/tests/httpsca ; \
+ openssl ca -in httpscert-1.csr -keyfile key.pem -out httpscert-1.pem -batch \
+ )
+ cp $(RELDIR)/tests/httpsca/httpscert-1.pem $(RELDIR)/tests/httpscert/
+
+
# Unit testing.
check: all
test/check.erl