Fix benchmarking script to use correct node parameter

This commit is contained in:
nom3ad 2024-01-02 23:41:02 +05:30 committed by Brian May
parent cd2d69ac08
commit b0799f8752

View File

@ -16,14 +16,14 @@ function with_set_x() {
benchmark() { benchmark() {
local sshuttle_bin="${1?:}" local sshuttle_bin="${1?:}"
local node="${2:-'node-1'}" local node="${2:-"node-1"}"
echo -e "\n======== Benchmarking sshuttle: $sshuttle_bin ========" echo -e "\n======== Benchmarking sshuttle: $sshuttle_bin ========"
./exec-sshuttle "$node" --sshuttle-bin="$sshuttle_bin" --listen 55771 & with_set_x ./exec-sshuttle "$node" --sshuttle-bin="$sshuttle_bin" --listen 55771 &
sshuttle_pid=$! sshuttle_pid=$!
trap 'kill -0 $sshuttle_pid &>/dev/null && kill -15 $sshuttle_pid' EXIT trap 'kill -0 $sshuttle_pid &>/dev/null && kill -15 $sshuttle_pid' EXIT
while ! nc -z localhost 55771; do sleep 0.1; done while ! nc -z localhost 55771; do sleep 0.1; done
sleep 1 sleep 1
./exec-tool iperf3 1 --time=4 ./exec-tool iperf3 "$node" --time=4
with_set_x kill -15 $sshuttle_pid with_set_x kill -15 $sshuttle_pid
wait $sshuttle_pid || true wait $sshuttle_pid || true
} }