# test ssh connection
# first argument is expected return code from ssh connection
ssh_test() {
+ local RETURN=0
+
umask 0077
CODE=${1:-0}
# Use the local copy of executables first, instead of system ones.
# This should help us test without installing.
-export PATH="$TESTDIR"/../src:"$TESTDIR"/../src/keytrans:"$PATH"
+export PATH="$TESTDIR"/../src:"$PATH"
export MONKEYSPHERE_SYSDATADIR="$TEMPDIR"
export MONKEYSPHERE_SYSCONFIGDIR="$TEMPDIR"
export MONKEYSPHERE_CORE_KEYLENGTH=1024
export MONKEYSPHERE_PROMPT=false
+# unset SUBKEYS_FOR_AGENT variable which, if set, would confuse the
+# into trying to use the user's key, instead of the testuser's key
+unset MONKEYSPHERE_SUBKEYS_FOR_AGENT
+
export SSHD_CONFIG="$TEMPDIR"/sshd_config
export SOCKET="$TEMPDIR"/ssh-socket
# *anything* with any running X11 session.
export DISPLAY=monkeys
-## make sure that the version number matches the debian changelog
-## (don't bother if this is being run from the tests).
-
-if [ -f "$TESTDIR"/../packaging/debian/changelog ]; then
- echo
- echo "##################################################"
- echo "### checking version string match..."
- repver=$(monkeysphere version)
- debver=$(head -n1 "$TESTDIR"/../packaging/debian/changelog | sed 's/.*(\([^-]*\)-.*/\1/')
- if [ "$repver" = "$debver" ] ; then
- echo "Versions match!"
- else
- printf "reported version string (%s) does not match debian changelog (%s)\n" "$repver" "$debver"
- exit 1
- fi
-fi
######################################################################
### CONFIGURE ENVIRONMENTS
echo
echo "##################################################"
echo "### configuring testuser home..."
-cp -a "$TESTDIR"/home/testuser "$TEMPDIR"/
+(cd "$TESTDIR"/home && find testuser | cpio -pdu "$TEMPDIR")
+
# set up environment for testuser
export TESTHOME="$TEMPDIR"/testuser
export GNUPGHOME="$TESTHOME"/.gnupg
echo
echo "##################################################"
echo "### configuring admin home..."
-cp -a "$TESTDIR"/home/admin "$TEMPDIR"/
+(cd "$TESTDIR"/home && find admin | cpio -pdu "$TEMPDIR")
# set up sshd
echo
# FIXME: this is maybe not failing properly for:
# ms: improper group or other writability on path '/tmp'.
-
######################################################################
### TESTS