source: mod_gnutls/t/Makefile @ 4b53371

debian/masterdebian/stretch-backportsjessie-backportsmsvaproxy-ticketupstream
Last change on this file since 4b53371 was 4b53371, checked in by Daniel Kahn Gillmor <dkg@…>, 7 years ago

initial testing framework, with one simple test.

  • Property mode set to 100644
File size: 2.1 KB
Line 
1#!/usr/bin/make -f
2
3# Author: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4
5# run these tests to ensure that mod_gnutls can handle a range of
6# simple configuration choices.
7
8export TEST_HOST ?= localhost
9export TEST_IP ?= ::1
10# chosen at random:
11export TEST_PORT ?= 9932
12
13export TEST_GAP ?= 1.5
14export TEST_QUERY_DELAY ?= 2
15
16all: setup.done
17        ./runtests
18
19t-%: setup.done
20        ./runtests $@
21
22
23
24
25
26### for setting up a little miniature CA + server + client environment:
27identities := server authority client imposter rogueca
28tokens := x509.pem pubring.gpg secret.key
29all_tokens := $(foreach id,$(identities),$(foreach token,$(tokens),$(id)/$(token)))
30
31%.template: %.template.in
32        sed s/__HOSTNAME__/$(TEST_HOST)/ < $< > $@
33
34server.uid: server.uid.in
35        sed s/__HOSTNAME__/$(TEST_HOST)/ < $< > $@
36
37%/secret.key:
38        mkdir -p $(dir $@)
39        chmod 0700 $(dir $@)
40        certtool --generate-privkey > $@
41
42%/pubring.gpg: %.uid %/secret.key
43        rm -f $(dir $@)pubring.gpg $(dir $@)secring.gpg $(dir $@)trustdb.gpg
44        PEM2OPENPGP_EXPIRATION=86400 PEM2OPENPGP_USAGE_FLAGS=authenticate,certify pem2openpgp "$$(cat $<)" < $(dir $@)secret.key | GNUPGHOME=$(dir $@) gpg --import
45        printf "%s:6:\n" "$$(GNUPGHOME=$(dir $@) gpg --with-colons --list-secret-keys --fingerprint | grep ^fpr: | cut -f 10 -d :)" | GNUPGHOME=$(dir $@) gpg --import-ownertrust
46
47authority/x509.pem: authority.template authority/secret.key
48        certtool --generate-self-signed --load-privkey=authority/secret.key --template=authority.template > $@
49rogueca/x509.pem: rogueca.template rogueca/secret.key
50        certtool --generate-self-signed --load-privkey=rogueca/secret.key --template=rogueca.template > $@
51
52%/cert-request: %.template %/secret.key
53        certtool --generate-request --load-privkey=$(dir $@)secret.key --template=$< > $@
54
55%/x509.pem: %.template %/cert-request authority/secret.key authority/x509.pem
56        certtool --generate-certificate --load-ca-certificate=authority/x509.pem --load-ca-privkey=authority/secret.key --load-request=$(dir $@)cert-request --template=$< > $@
57
58setup.done: $(all_tokens)
59        mkdir -p logs cache outputs
60        touch setup.done
61
62
63clean:
64        rm -rf server client authority logs cache outputs setup.done *.template
65
66.PHONY: all clean
Note: See TracBrowser for help on using the repository browser.