3 # Tests to ensure that the monkeysphere is working
5 # Author: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
6 # Date: 2008-09-13 13:40:15-0400
8 # these tests might be best run under fakeroot, particularly the
9 # "server-side" tests. Using fakeroot, they should be able to be run
10 # as a non-privileged user.
12 # NOTE: these tests have *not* themselves been tested yet
13 # (2008-09-13). Please exercise with caution!
15 # these tests assume a commonly-trusted "Admin's key", a fake key
16 # permanently stored in ./admin:
19 GNUPGHOME=./admin gpg "$@"
28 # FIXME: how should we clear out the temporary $VARLIB?
30 # FIXME: clear out ssh client config file and known hosts.
33 ## set up some variables to ensure that we're operating strictly in
34 ## the tests, not system-wide:
36 # FIXME: can we override $VARLIB ?
37 # FIXME: can we override $ETC ?
39 # Use the local copy of executables first, instead of system ones.
40 # This should help us test without installing.
41 export PATH=$(pwd)/../src:$(pwd)/../src/keytrans:$PATH
42 export MONKEYSPHERE_SHARE=$(pwd)/../src
44 # create a new host key, certify it with the "Admin's Key".
46 echo | monkeysphere-server gen-key --expire 2d
48 HOSTKEYID=$( monkeysphere-server show-key | tail -n1 | cut -f3 -d\ )
50 monkeysphere-server gpg-authentication-cmd "--armor --export $HOSTKEYID" | gpgadmin --import
52 gpgadmin --sign-key "$HOSTKEYID"
54 # FIXME: how can we test publish-key without flooding junk into the
57 # indicate that the "Admin's" key is an identity certifier for the
60 monkeysphere-server add-identity-certifier ./admin/pubkey.gpg
62 # launch sshd with the new host key.
66 sshd -f ./sshd_config -i <>./ssh-socket
68 # connect to sample sshd host key, using monkeysphere to verify the
69 # identity before connection.
73 # create a new client side key, certify it with the "CA", use it to