summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2008-10-25 19:32:28 -0400
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>2008-10-25 19:32:28 -0400
commitc80b8027f8a266c6b9b0d6d8f5970aa1a0503289 (patch)
tree3fbd6ef1788258ef963429975ddcc8f55025eb9f
parent37045570e881c240c9ff597a6d0612589d7c26db (diff)
parent9719b46f11c197187551241fee4bd6cd733e0b24 (diff)
Merge commit 'jrollins/master'
-rwxr-xr-xtests/basic34
-rw-r--r--tests/home/admin/.gnupg/pubring.gpgbin4331 -> 5349 bytes
-rw-r--r--tests/home/admin/.gnupg/trustdb.gpgbin1760 -> 1920 bytes
3 files changed, 14 insertions, 20 deletions
diff --git a/tests/basic b/tests/basic
index 81f3b91..e97f998 100755
--- a/tests/basic
+++ b/tests/basic
@@ -15,26 +15,22 @@
# fail on fail
set -e
-# these tests assume a commonly-trusted "Admin's key", a fake key
-# permanently stored in ./home/admin/.gnupg:
+# gpg command for test admin user
gpgadmin() {
- GNUPGHOME="$TESTDIR"/home/admin/.gnupg gpg "$@"
+ GNUPGHOME="$TEMPDIR"/admin/.gnupg gpg "$@"
}
# cleanup:
cleanup() {
+ echo
read -p "press enter to cleanup and remove tmp:"
- # FIXME: stop the sshd process
+ echo "### stop sshd..."
+ kill "$SSHD_PID"
- echo
echo "### removing temp dir..."
rm -rf "$TEMPDIR"
-
- # FIXME: how should we clear out the temporary $VARLIB?
-
- # FIXME: clear out ssh client config file and known hosts.
}
## setup trap
@@ -66,6 +62,12 @@ export MONKEYSPHERE_CHECK_KEYSERVER=false
SSHD_CONFIG="$TEMPDIR"/sshd_config
export SOCKET="$TEMPDIR"/ssh-socket
+# copy in admin and testuser home to tmp
+echo "### copying admin and testuser homes..."
+cp -r "$TESTDIR"/home/admin "$TEMPDIR"/
+cp -r "$TESTDIR"/home/testuser "$TEMPDIR"/
+
+
### SERVER TESTS
@@ -96,11 +98,9 @@ echo y | gpgadmin --command-fd 0 --sign-key "$HOSTKEYID"
# FIXME: how can we test publish-key without flooding junk into the
# keyservers?
-# indicate that the "Admin's" key is an identity certifier for the
-# host
-
+# add admin as identity certifier for testhost
echo "### adding admin as certifier..."
-echo y | monkeysphere-server add-identity-certifier "$TESTDIR"/home/admin/.gnupg/pubkey.gpg
+echo y | monkeysphere-server add-identity-certifier "$TEMPDIR"/admin/.gnupg/pubkey.gpg
# initialize base sshd_config
cp etc/ssh/sshd_config "$SSHD_CONFIG"
@@ -113,14 +113,11 @@ EOF
# launch test sshd with the new host key.
echo "### starting sshd..."
socat EXEC:"/usr/sbin/sshd -f ${SSHD_CONFIG} -i -d -d -d -D -e" "UNIX-LISTEN:${SOCKET}" 2> "$TEMPDIR"/sshd.log &
+export SSHD_PID=$!
### TESTUSER TESTS
-# copy testuser home directory into temp dir
-echo "### seting up testuser home..."
-cp -r "$TESTDIR"/home/testuser "$TEMPDIR"/
-
# generate an auth subkey for the test user
echo "### generating key for testuser..."
MONKEYSPHERE_GNUPGHOME="$TEMPDIR"/testuser/.gnupg \
@@ -131,9 +128,6 @@ echo "### export server key to testuser..."
gpgadmin --armor --export "$HOSTKEYID" | \
GNUPGHOME="$TEMPDIR"/testuser/.gnupg gpg --import
-#GNUPGHOME="$TEMPDIR"/testuser/.gnupg gpg --list-keys
-#read -p "?"
-
# connect to test sshd, using monkeysphere to verify the identity
# before connection.
echo "### testuser connecting to sshd socket..."
diff --git a/tests/home/admin/.gnupg/pubring.gpg b/tests/home/admin/.gnupg/pubring.gpg
index 8e10c4a..d22babd 100644
--- a/tests/home/admin/.gnupg/pubring.gpg
+++ b/tests/home/admin/.gnupg/pubring.gpg
Binary files differ
diff --git a/tests/home/admin/.gnupg/trustdb.gpg b/tests/home/admin/.gnupg/trustdb.gpg
index 171a891..d46e25f 100644
--- a/tests/home/admin/.gnupg/trustdb.gpg
+++ b/tests/home/admin/.gnupg/trustdb.gpg
Binary files differ