From 889d280a4ef85a6941f096fde55d6a2d4e2276a9 Mon Sep 17 00:00:00 2001 From: Jerome Charaoui Date: Fri, 13 Jul 2018 10:20:40 -0400 Subject: [PATCH] tests: Mount temporary test directories in tmpfs --- test/test.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/test.sh b/test/test.sh index 0d0a07e..6be8d78 100755 --- a/test/test.sh +++ b/test/test.sh @@ -30,6 +30,11 @@ apt-get -qq install bats mailutils faketime TMPDIR=$(mktemp -t -d bntest.XXXXXX) export TMPDIR +# Mount temporary directories in tmpfs +# this should speed up the tests a little bit +mount -t tmpfs tmpfs "$TMPDIR" +mount -t tmpfs tmpfs /var/backups + # Run actual tests for t in "$(dirname "$0")"/*.bats; do echo "# $(basename -s .bats "$t")" @@ -38,6 +43,8 @@ for t in "$(dirname "$0")"/*.bats; do done # Clean up -rm -rf "${TMPDIR}" +umount "$TMPDIR" +umount /var/backups +rmdir "$TMPDIR" exit 0