Changeset e3cbda4 in mod_gnutls


Ignore:
Timestamp:
Nov 16, 2013, 2:46:50 AM (9 years ago)
Author:
Daniel Kahn Gillmor <dkg@…>
Branches:
asyncio, debian/master, debian/stretch-backports, jessie-backports, main, master, proxy-ticket, upstream
Children:
07889ab
Parents:
cf2b905
git-author:
Daniel Kahn Gillmor <dkg@…> (01/30/13 04:15:32)
git-committer:
Daniel Kahn Gillmor <dkg@…> (11/16/13 02:46:50)
Message:

MSVA: include in test framework

Location:
t
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • t/.gitignore

    rcf2b905 re3cbda4  
    1111server.uid
    1212server.template
     13msva.gnupghome
  • t/Makefile

    rcf2b905 re3cbda4  
    1010# chosen at random:
    1111export TEST_PORT ?= 9932
     12export MSVA_PORT ?= 9933
    1213
    1314export TEST_GAP ?= 1.5
     
    7172        certtool --generate-certificate --load-ca-certificate=authority/x509.pem --load-ca-privkey=authority/secret.key --load-request=$(dir $@)cert-request --template=$< > $@
    7273
    73 setup.done: $(all_tokens)
     74msva.gnupghome/trustdb.gpg: authority/minimal.pgp client/cert.pgp
     75        mkdir -m 0700 $(dir $@)
     76        GNUPGHOME=$(dir $@) gpg --import < $<
     77        printf "%s:6:\n" "$$(GNUPGHOME=authority gpg --with-colons --list-secret-keys --fingerprint | grep ^fpr: | cut -f 10 -d :)" | GNUPGHOME=$(dir $@) gpg --import-ownertrust
     78        GNUPGHOME=$(dir $@) gpg --import < client/cert.pgp
     79        printf "keyserver does-not-exist.example\n" > msva.gnupghome/gpg.conf
     80
     81
     82setup.done: $(all_tokens) msva.gnupghome/trustdb.gpg
    7483        mkdir -p logs cache outputs
    7584        touch setup.done
     
    7786
    7887clean:
    79         rm -rf server client authority logs cache outputs setup.done server.template
     88        rm -rf server client authority logs cache outputs setup.done server.template msva.gnupghome
    8089
    8190.PHONY: all clean
  • t/runtests

    rcf2b905 re3cbda4  
    88
    99BADVARS=0
    10 for v in TEST_HOST TEST_IP TEST_PORT TEST_QUERY_DELAY TEST_GAP; do
     10for v in TEST_HOST TEST_IP TEST_PORT TEST_QUERY_DELAY TEST_GAP MSVA_PORT; do
    1111    if [ ! -v "$v" ]; then
    1212        printf "You need to set the %s environment variable\n" "$v" >&2
     
    2424fi
    2525
     26function stop_msva() {
     27    kill %1
     28}
     29
    2630function apache_down_err() {
    2731    printf "FAILURE: %s\n" "$TEST_NAME"
     
    3337    printf "\nApache error logs:\n"
    3438    tail "../../logs/${TEST_NAME}.error.log"
     39    stop_msva
    3540}
    3641
     
    4146fi
    4247
     48GNUPGHOME=$(pwd)/msva.gnupghome MSVA_KEYSERVER_POLICY=never monkeysphere-validation-agent &
     49
     50trap stop_msva EXIT
     51
     52sleep "$TEST_GAP"
     53
     54printf "TESTING: initial MSVA verification\n"
     55MONKEYSPHERE_VALIDATION_AGENT_SOCKET="http://127.0.0.1:$MSVA_PORT" msva-query-agent https "$(cat client.uid)" x509pem client < client/x509.pem 
     56printf "\nSUCCESS: initial MSVA verification\n"
     57
    4358for t in $tests; do
     59    sleep "$TEST_GAP"
    4460    export TEST_NAME="$(basename "$t")"
    4561    output="../../outputs/${TEST_NAME}.output"
     
    5369    printf "TESTING: %s%s\n" "$TEST_NAME" "$EXPECTED_FAILURE"
    5470    trap apache_down_err EXIT
    55     /usr/sbin/apache2 -f "$(pwd)/apache.conf" -k start || [ -e fail.server ]
     71    MONKEYSPHERE_VALIDATION_AGENT_SOCKET="http://127.0.0.1:$MSVA_PORT" /usr/sbin/apache2 -f "$(pwd)/apache.conf" -k start || [ -e fail.server ]
    5672
    5773    if (sed "s/__HOSTNAME__/${TEST_HOST}/" < ./input && sleep "$TEST_QUERY_DELAY") | \
     
    7288    fi
    7389    /usr/sbin/apache2 -f "$(pwd)/apache.conf" -k stop || [ -e fail.server ]
    74     trap - EXIT
     90    trap stop_msva EXIT
    7591    printf "SUCCESS: %s\n" "$TEST_NAME"
    7692    cd ../..
    77     sleep "$TEST_GAP"
    7893done
     94
     95stop_msva
Note: See TracChangeset for help on using the changeset viewer.