aboutsummaryrefslogtreecommitdiff
path: root/tests/stress_tests/parallel_cp.sh
diff options
context:
space:
mode:
authora13460542021-08-31 17:01:47 +0000
committerrfjakob2021-09-01 10:22:01 +0200
commitc63f7e9f64ee394b3311edb7f36f56fd786d145a (patch)
tree84dec7ad0b4759532f622174c008e3aa645c5a29 /tests/stress_tests/parallel_cp.sh
parentc505e73a13d8e2083b53c5c1af1f937b46665abd (diff)
shell scripts: fix shellcheck warnings
Diffstat (limited to 'tests/stress_tests/parallel_cp.sh')
-rwxr-xr-xtests/stress_tests/parallel_cp.sh16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/stress_tests/parallel_cp.sh b/tests/stress_tests/parallel_cp.sh
index ad98e5e..cd08d31 100755
--- a/tests/stress_tests/parallel_cp.sh
+++ b/tests/stress_tests/parallel_cp.sh
@@ -18,32 +18,32 @@ if [[ -z $TMPDIR ]]; then
fi
cd "$(dirname "$0")"
-MYNAME=$(basename $0)
+MYNAME=$(basename "$0")
source ../fuse-unmount.bash
# Set the GOPATH variable to the default if it is empty
GOPATH=$(go env GOPATH)
# Backing directory
-DIR=$(mktemp -d $TMPDIR/$MYNAME.XXX)
-$GOPATH/bin/gocryptfs -q -init -extpass "echo test" -scryptn=10 $DIR
+DIR=$(mktemp -d "$TMPDIR/$MYNAME.XXX")
+$GOPATH/bin/gocryptfs -q -init -extpass "echo test" -scryptn=10 "$DIR"
# Mountpoint
MNT="$DIR.mnt"
-mkdir $MNT
-$GOPATH/bin/gocryptfs -q -extpass "echo test" -nosyslog $DIR $MNT
+mkdir "$MNT"
+$GOPATH/bin/gocryptfs -q -extpass "echo test" -nosyslog "$DIR" "$MNT"
echo "Mounted gocryptfs $DIR at $MNT"
# Cleanup trap
trap "cd / ; fuse-unmount -z $MNT ; rm -rf $DIR $MNT" EXIT
-cd $MNT
+cd "$MNT"
SECONDS=0
echo "creating files with dd"
mkdir -p origin
for i in $(seq 1 778) ; do
- dd if=/dev/zero of=origin/file_$i bs=8192 count=1 status=none
+ dd if=/dev/zero of="origin/file_$i" bs=8192 count=1 status=none
done
# Perform the shell expansion only once and store the list
ORIGIN_FILES=origin/*
@@ -51,7 +51,7 @@ ORIGIN_FILES=origin/*
echo -n "cp starting: "
for i in $(seq 1 100) ; do
echo -n "$i "
- (mkdir sub_$i && cp $ORIGIN_FILES sub_$i ; echo -n "$i ") &
+ (mkdir "sub_$i" && cp $ORIGIN_FILES "sub_$i" ; echo -n "$i ") &
done
echo