m-a setup: take advantage of the new ability of pem2openpgp to generate its own key.
[monkeysphere.git] / tests / basic
index 455c0578fb90d4a80f35fe79fe926ab9b307abcc..470fffa9ff73c73d95d0ea99c9441c7991232fd7 100755 (executable)
@@ -17,7 +17,8 @@ set -e
 # piped commands should return the code of the first non-zero return
 set -o pipefail
 
-export TESTDIR=$(dirname "$0")
+# make sure the TESTDIR is an absolute path, not a relative one.
+export TESTDIR=$(cd $(dirname "$0") && pwd)
 
 source "$TESTDIR"/common
 
@@ -32,6 +33,7 @@ which socat >/dev/null || { echo "You must have socat installed to run this test
 
 # gpg command for test admin user
 gpgadmin() {
+    chmod 0700 "$TEMPDIR"/admin
     GNUPGHOME="$TEMPDIR"/admin/.gnupg gpg "$@"
 }
 
@@ -90,7 +92,7 @@ trap failed_cleanup EXIT
 
 # make temp dir
 mkdir -p "$TESTDIR"/tmp
-TEMPDIR=$(mktemp -d ${TMPDIR:-$(cd "$TESTDIR" && printf "%s" $(pwd)/tmp)}/monkeyspheretest.XXXXXXX)
+TEMPDIR=$(mktemp -d "${TMPDIR:-$TESTDIR/tmp}/monkeyspheretest.XXXXXXX)"
 
 # Use the local copy of executables first, instead of system ones.
 # This should help us test without installing.