1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2025-12-17 14:37:02 +00:00

Improve bash quoting, and other similar best practices

This patch updates the shell scripts with some of the common best
practices, which should make them more resilient to unusual failures and
unexpected environments (in particular, directories with spaces).

Most of these were identified by shellcheck.
This commit is contained in:
Alberto Bertogli
2022-11-13 00:37:28 +00:00
parent e2481b07a9
commit 948cee1ce1
32 changed files with 133 additions and 126 deletions

View File

@@ -1,7 +1,7 @@
#!/bin/bash
set -e
. $(dirname ${0})/../util/lib.sh
. "$(dirname "$0")/../util/lib.sh"
init
@@ -14,18 +14,18 @@ mkdir -p .logs
chasquid -v=-1 --logfile=.logs/chasquid.log --config_dir=config &
wait_until_ready 1025
echo Peak RAM: `chasquid_ram_peak`
echo "Peak RAM: $(chasquid_ram_peak)"
if ! loadgen -logtime -addr=localhost:1025 -run_for=3s -noop; then
fail
fail "loadgen -noop error"
fi
echo Peak RAM: `chasquid_ram_peak`
echo "Peak RAM: $(chasquid_ram_peak)"
if ! loadgen -logtime -addr=localhost:1025 -run_for=3s; then
fail
fail "loadgen error"
fi
echo Peak RAM: `chasquid_ram_peak`
echo "Peak RAM: $(chasquid_ram_peak)"
success