summaryrefslogtreecommitdiff
path: root/tests/scripts/common.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/scripts/common.sh')
-rw-r--r--tests/scripts/common.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/scripts/common.sh b/tests/scripts/common.sh
index 4615770f6b..8662d93cf1 100644
--- a/tests/scripts/common.sh
+++ b/tests/scripts/common.sh
@@ -195,3 +195,14 @@ else
LOCKFILE="lockfile global.lock"
UNLOCKFILE="rm -f global.lock"
fi
+
+create_testdir() {
+ local PREFIX=$1
+ d=`mktemp -d -t ${PREFIX}.XXXXXX`
+ if test $? -ne 0; then
+ d=${TMPDIR}/${PREFIX}.$$
+ mkdir "$d" || exit 1
+ fi
+ trap "test -e \"$d\" && rm -rf \"$d\"" 1 15 2
+ echo "$d"
+}