asynciodebian/masterdebian/stretch-backportsjessie-backportsproxy-ticketupstream
Last change
on this file since f21d2a6 was
e78bc78,
checked in by Thomas Klute <thomas2.klute@…>, 6 years ago
|
Adjust test tools and documentation to split tests and moved test dir
Paths, descriptions and an error message were adjusted in README and
setup. A bigger change was needed in the "newtest" script, which now
creates a script for "make check" to call. This script is not
automatically added to the list of tests in Makefile.am, but the user is
advised to add it when ready.
|
-
Property mode set to
100755
|
File size:
1.3 KB
|
Rev | Line | |
---|
[4b53371] | 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 |
---|
[e78bc78] | 15 | printf "You should only run this mod-gnutls test suite from the test/ directory of the mod_gnutls source.\n" >&2 |
---|
[4b53371] | 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 | |
---|
[c32240f] | 40 | certtool -q --load-privkey server/secret.key --template server.template > server/server.req |
---|
[4b53371] | 41 | |
---|
| 42 | |
---|
| 43 | mkdir -p logs cache outputs |
---|
| 44 | touch setup.done |
---|
Note: See
TracBrowser
for help on using the repository browser.