Skip to content

Commit

Permalink
Improve iperf tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tbarbette committed Jun 19, 2024
1 parent 3b4a6cb commit 8aa1c7c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
9 changes: 7 additions & 2 deletions tests/tcp/01-iperf-advanced.npf
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,17 @@ fastregression:TIME=2
%script@server
iperf -s

%script@client delay=1
%script@client jinja delay=1
//Launch the program, copy the output to a log
{% if CPU is not defined %}
iperf -c ${server:0:ip} -w ${WINDOW}k -t $TIME -P $PARALLEL $NODELAY -Z $CONGESTION 2>&1 | tee iperf.log
{% else %}
taskset -c 0-{{ CPU - 1 }} iperf -c ${server:0:ip} -w ${WINDOW}k -t $TIME -P $PARALLEL $NODELAY -Z $CONGESTION 2>&1 | tee iperf.log
{% endif %}

//Parse the log to find the throughput
result=$(cat iperf.log | grep -ioE "[0-9.]+ [kmg]?bits" | tail -n 1)
//Give the throughput to NPF through stdout
echo "RESULT-THROUGHPUT $result"

%import@server load
%-noload:import@server load
19 changes: 14 additions & 5 deletions tests/tcp/10-allperf.npf
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@ iperf:ZEROCOPY={-Z:with}
%netperf:script@server
netserver -D -4 &> /dev/null

%netperf:script@client delay=1 jinja
{% for P in range(PARALLEL) %}
result=$(netperf -f kbits -l $TIME $KEEPALIVE -v 0 -P 0 ${server:0:ip} )
echo "NETPERF RESULT-THROUGHPUT ${result}kbits"
fi
%netperf:script@client delay=1
result=$(netperf -f kbits -l $TIME -n $PARALLEL $KEEPALIVE -v 0 -P 0 ${server:0:ip} )
echo "NETPERF RESULT-THROUGHPUT ${result}kbits"

%iperf:script@server
iperf -s &> /dev/null
Expand All @@ -30,3 +28,14 @@ iperf -s &> /dev/null
iperf -c ${server:0:ip} -w ${WINDOW}k -t $TIME -P $PARALLEL $NODELAY -Z $CONGESTION 2>&1 | tee iperf.log
result=$(cat iperf.log | grep -ioE "[0-9.]+ [kmg]?bits" | tail -n 1)
echo "IPERF RESULT-THROUGHPUT $result"

%iperf3:script@server
iperf3 -s &> /dev/null

%iperf3:script@client delay=1
iperf3 -c ${server:0:ip} -w ${WINDOW}k -t $TIME -P $PARALLEL $NODELAY -Z $CONGESTION 2>&1 | tee iperf.log
result=$(cat iperf.log | grep -ioE "[0-9.]+ [kmg]?bits" | tail -n 1)
echo "IPERF RESULT-THROUGHPUT $result"


%import@server load

0 comments on commit 8aa1c7c

Please sign in to comment.