asynciodebian/masterdebian/stretch-backportsjessie-backportsmainmsvaproxy-ticketupstream
Last change
on this file since 480aba1 was
4b53371,
checked in by Daniel Kahn Gillmor <dkg@…>, 10 years ago
|
initial testing framework, with one simple test.
|
-
Property mode set to
100755
|
File size:
1.3 KB
|
Line | |
---|
1 | #!/bin/bash |
---|
2 | |
---|
3 | # Set up the ability to do test suites. This should only be run from the current working directory! |
---|
4 | |
---|
5 | # Author: Daniel Kahn Gillmor <dkg@fifthhorseman.net> |
---|
6 | |
---|
7 | set -e |
---|
8 | |
---|
9 | if [ -z "$TEST_HOST" ]; then |
---|
10 | printf "You need to set the TEST_HOST environment variable\n" >&2 |
---|
11 | exit 1 |
---|
12 | fi |
---|
13 | |
---|
14 | if [ . != "$(dirname "$0")" ]; then |
---|
15 | printf "You should only run this mod-gnutls test suite from the t/ directory of the mod_gnutls source.\n" >&2 |
---|
16 | exit 1 |
---|
17 | fi |
---|
18 | |
---|
19 | genkey() { |
---|
20 | dir="$1" |
---|
21 | uid="$2" |
---|
22 | |
---|
23 | mkdir -p "$dir" |
---|
24 | chmod 0700 "$dir" |
---|
25 | |
---|
26 | certtool --generate-privkey > "$dir"/secret.key |
---|
27 | PEM2OPENPGP_EXPIRATION=86400 PEM2OPENPGP_USAGE_FLAGS=authenticate,certify pem2openpgp "$uid" < "$dir"/secret.key | GNUPGHOME="$dir" gpg --import |
---|
28 | fpr="$(GNUPGHOME="$dir" gpg --with-colons --list-secret-keys --fingerprint | grep ^fpr: | cut -f 10 -d :)" |
---|
29 | |
---|
30 | # set ultimate ownertrust on my own secret key: |
---|
31 | printf "%s:6:\n" "$fpr" | GNUPGHOME="$dir" gpg --import-ownertrust |
---|
32 | |
---|
33 | GNUPGHOME="$dir" ~/src/monkeysphere/msva-perl/openpgp2x509 "$uid" > "$dir"/x509.pem |
---|
34 | } |
---|
35 | |
---|
36 | genkey "$PWD/authority" "Testing Authority" |
---|
37 | genkey "$PWD/server" "https://${TEST_HOST}" |
---|
38 | genkey "$PWD/client" "Test User <test0@modgnutls.test>" |
---|
39 | |
---|
40 | certtool -q --load-privkey=server/secret.key --template=server.template > server/server.req |
---|
41 | |
---|
42 | |
---|
43 | mkdir -p logs cache outputs |
---|
44 | touch setup.done |
---|
Note: See
TracBrowser
for help on using the repository browser.