summaryrefslogtreecommitdiff
path: root/tests/sshfs-benchmark.bash
diff options
context:
space:
mode:
authora13460542021-08-31 17:01:47 +0000
committerrfjakob2021-09-01 10:22:01 +0200
commitc63f7e9f64ee394b3311edb7f36f56fd786d145a (patch)
tree84dec7ad0b4759532f622174c008e3aa645c5a29 /tests/sshfs-benchmark.bash
parentc505e73a13d8e2083b53c5c1af1f937b46665abd (diff)
shell scripts: fix shellcheck warnings
Diffstat (limited to 'tests/sshfs-benchmark.bash')
-rwxr-xr-xtests/sshfs-benchmark.bash16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/sshfs-benchmark.bash b/tests/sshfs-benchmark.bash
index 13c7a0f..4695f8d 100755
--- a/tests/sshfs-benchmark.bash
+++ b/tests/sshfs-benchmark.bash
@@ -2,7 +2,7 @@
set -eu
-function cleanup {
+cleanup() {
cd "$LOCAL_TMP"
fusermount -u gocryptfs.mnt
rm -Rf "$SSHFS_TMP"
@@ -11,22 +11,22 @@ function cleanup {
rm -Rf "$LOCAL_TMP"
}
-function prepare_mounts {
+prepare_mounts() {
LOCAL_TMP=$(mktemp -d -t "$MYNAME.XXX")
- cd $LOCAL_TMP
+ cd "$LOCAL_TMP"
echo "working directory: $PWD"
mkdir sshfs.mnt gocryptfs.mnt
- sshfs $HOST:/tmp sshfs.mnt
+ sshfs "$HOST:/tmp" sshfs.mnt
echo "sshfs mounted: $HOST:/tmp -> sshfs.mnt"
trap cleanup EXIT
SSHFS_TMP=$(mktemp -d "sshfs.mnt/$MYNAME.XXX")
- mkdir $SSHFS_TMP/gocryptfs.crypt
- gocryptfs -q -init -extpass "echo test" -scryptn=10 $SSHFS_TMP/gocryptfs.crypt
- gocryptfs -q -extpass "echo test" $SSHFS_TMP/gocryptfs.crypt gocryptfs.mnt
+ mkdir "$SSHFS_TMP/gocryptfs.crypt"
+ gocryptfs -q -init -extpass "echo test" -scryptn=10 "$SSHFS_TMP/gocryptfs.crypt"
+ gocryptfs -q -extpass "echo test" "$SSHFS_TMP/gocryptfs.crypt" gocryptfs.mnt
echo "gocryptfs mounted: $SSHFS_TMP/gocryptfs.crypt -> gocryptfs.mnt"
}
-function etime {
+etime() {
T=$(/usr/bin/time -f %e -o /dev/stdout "$@")
LC_ALL=C printf %20.2f "$T"
}