summaryrefslogtreecommitdiff
path: root/stress_tests/extractloop.bash
diff options
context:
space:
mode:
authorJakob Unterwurzacher2016-05-05 12:58:44 +0200
committerJakob Unterwurzacher2016-05-05 12:58:44 +0200
commite97962bd3f9ef8cb9fbd57bd2a2424b1cc28ec75 (patch)
tree150957e33806f92bac85b490cd214be55c364712 /stress_tests/extractloop.bash
parentcf29ce37627fd6ba4416dd9eb5e56bed44128131 (diff)
stress_tests: add stress test scripts
These were hosted at https://github.com/rfjakob/fsstress . To make them easier to use for gocryptfs users and developers, add them to the main repo.
Diffstat (limited to 'stress_tests/extractloop.bash')
-rwxr-xr-xstress_tests/extractloop.bash32
1 files changed, 32 insertions, 0 deletions
diff --git a/stress_tests/extractloop.bash b/stress_tests/extractloop.bash
new file mode 100755
index 0000000..3d43763
--- /dev/null
+++ b/stress_tests/extractloop.bash
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+set -eu
+
+# Setup
+cd /tmp
+wget -nv --show-progress -c https://www.kernel.org/pub/linux/kernel/v3.0/linux-3.0.tar.gz
+DIR1=$(mktemp -d)
+DIR2=$(mktemp -d)
+gocryptfs -q -init -extpass="echo test" $DIR1
+gocryptfs -q -extpass="echo test" -nosyslog $DIR1 $DIR2
+cd $DIR2
+
+# Cleanup trap
+# Note: gocryptfs may have already umounted itself because bash relays SIGINT
+# Just ignore fusermount errors.
+trap "cd /; fusermount -u -z $DIR2; rm -rf $DIR1 $DIR2" EXIT
+
+# Loop
+N=1
+while true
+do
+ echo -n "$N "
+ echo -n "extract "
+ tar xf /tmp/linux-3.0.tar.gz
+ echo -n "diff "
+ diff -ur linux-3.0 /tmp/linux-3.0
+ echo -n "rm "
+ rm -Rf linux-3.0
+ date
+ let N=$N+1
+done