source: mod_gnutls/test/setup @ 52c3f68

debian/masterdebian/stretch-backportsjessie-backportsupstream
Last change on this file since 52c3f68 was e78bc78, checked in by Thomas Klute <thomas2.klute@…>, 5 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
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
7set -e
8
9if [ -z "$TEST_HOST" ]; then
10    printf "You need to set the TEST_HOST environment variable\n" >&2
11    exit 1
12fi
13
14if [ . != "$(dirname "$0")" ]; then
15    printf "You should only run this mod-gnutls test suite from the test/ directory of the mod_gnutls source.\n" >&2
16    exit 1
17fi
18
19genkey() {
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
36genkey "$PWD/authority" "Testing Authority"
37genkey "$PWD/server" "https://${TEST_HOST}"
38genkey "$PWD/client" "Test User <test0@modgnutls.test>"
39
40certtool -q --load-privkey server/secret.key  --template server.template > server/server.req
41
42
43mkdir -p logs cache outputs
44touch setup.done
Note: See TracBrowser for help on using the repository browser.