aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xscripts/test.sh10
1 files changed, 6 insertions, 4 deletions
diff --git a/scripts/test.sh b/scripts/test.sh
index cff1acf..c26a118 100755
--- a/scripts/test.sh
+++ b/scripts/test.sh
@@ -27,7 +27,7 @@ input_file=example.lst
tmp_dir=$(mktemp -d)
out_dir=data/$(date +%Y%m%d-%H%M%S)
mullvad_wait_s=5
-timeout=30s
+timeout_s=30
set -eu
function main() {
@@ -39,12 +39,14 @@ function main() {
debug "tmp_dir=$tmp_dir"
debug "out_dir=$out_dir"
debug "mullvad_wait_s=$mullvad_wait_s"
- debug "timeout=$timeout"
+ debug "timeout_s=$timeout_s"
num_test=$(( ${#limits[@]} * ${#relays[@]} ))
debug "about to start $num_test tests"
runtime_s=0
+ wait_mullvad_s=$(( $num_test * $mullvad_wait_s ))
+ wait_onion_grab_s=$(( $num_test * $timeout_s * 2 ))
for limit in ${limits[@]}; do
for relay in ${relays[@]}; do
seconds=$(( $num_sites / $limit ))
@@ -52,7 +54,7 @@ function main() {
done
done
now=$(date +%s)
- estimated_done=$(( $now + $runtime_s ))
+ estimated_done=$(( $now + $runtime_s + $wait_mullvad_s + $wait_onion_grab_s ))
debug "estimated done? earliest $(date -d @$estimated_done +"%Y-%m-%d %H:%M:%S %Z")"
i=1
@@ -69,7 +71,7 @@ function main() {
shuf -o "$tmp_dir/input.lst" "$input_file"
stdout_file=$tmp_dir/$relay-$limit.stdout
stderr_file=$tmp_dir/$relay-$limit.stderr
- onion-grab -i "$tmp_dir/input.lst" -t "$timeout" -l "$limit" -w "$num_workers" >"$stdout_file" 2>"$stderr_file"
+ onion-grab -i "$tmp_dir/input.lst" -t "$timeout_s"s -l "$limit" -w "$num_workers" >"$stdout_file" 2>"$stderr_file"
i=$(( $i + 1 ))
done