diff --git a/.gitignore b/.gitignore index d3d0e2c..d1c8be9 100644 --- a/.gitignore +++ b/.gitignore @@ -6,5 +6,5 @@ /qrap /pasta.1 /seccomp.h -/s*.json +/c*.json README.plain.md diff --git a/test/lib/test b/test/lib/test index 115dd21..3ca5dbc 100755 --- a/test/lib/test +++ b/test/lib/test @@ -31,41 +31,37 @@ test_iperf3() { __procs="$((${1} - 1))"; shift __time="${1}"; shift - pane_or_context_run "${__sctx}" 'rm -f s*.json' + pane_or_context_run "${__cctx}" 'rm -f c*.json' pane_or_context_run_bg "${__sctx}" \ 'for i in $(seq 0 '${__procs}'); do' \ - ' (iperf3 -s1J -p'${__port}' -i'${__time} \ - ' > s${i}.json) &' \ - ' echo $! > s${i}.pid &' \ + ' (iperf3 -s1 -p'${__port}' -i'${__time}') &' \ + ' echo $! > s${i}.pid; ' \ 'done' \ sleep 1 # Wait for server to be ready - pane_or_context_run_bg "${__cctx}" \ + # A 1s wait for connection on what's basically a local link + # indicates something is pretty wrong + __timeout=1000 + pane_or_context_run "${__cctx}" \ '(' \ ' for i in $(seq 0 '${__procs}'); do' \ - ' iperf3 -c '${__dest}' -p '${__port} \ - ' -t'${__time}' -i0 -T s${i} '"${@}"' &' \ + ' iperf3 -J -c '${__dest}' -p '${__port} \ + ' --connect-timeout '${__timeout} \ + ' -t'${__time}' -i0 -T c${i} '"${@}" \ + ' > c${i}.json &' \ ' done;' \ ' wait' \ ')' - sleep $((__time + 5)) - - # If client fails to deliver control message, tell server we're done + # Kill the server, just in case -1 didn't work right pane_or_context_run "${__sctx}" 'kill -INT $(cat s*.pid); rm s*.pid' - sleep 1 # ...and wait for output to be flushed - __jval=".end.sum_received.bits_per_second" - for __opt in ${@}; do - # UDP test - [ "${__opt}" = "-u" ] && __jval=".intervals[0].sum.bits_per_second" - done - __bw=$(pane_or_context_output "${__sctx}" \ - 'cat s*.json | jq -rMs "map('${__jval}') | add"') + __bw=$(pane_or_context_output "${__cctx}" \ + 'cat c*.json | jq -rMs "map('${__jval}') | add"') TEST_ONE_subs="$(list_add_pair "${TEST_ONE_subs}" "__${__var}__" "${__bw}" )"