Skip to content

Commit

Permalink
test: add UDP benchmark
Browse files Browse the repository at this point in the history
Signed-off-by: Akihiro Suda <[email protected]>
  • Loading branch information
AkihiroSuda committed Dec 18, 2019
1 parent b0a0dce commit dec21d1
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions hack/test/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,29 @@ function benchmark::iperf3_reverse::main(){
benchmark::iperf3_reverse --net=slirp4netns --mtu=65520 --port-driver=builtin
set +x
}

function benchmark::iperf3_reverse_udp(){
statedir=$(mktemp -d)
INFO "[benchmark:iperf3_reverse_udp] $@"
$ROOTLESSKIT --state-dir=$statedir $@ iperf3 -s > /dev/null &
rkpid=$!
# wait for socket to be available
sleep 3
rootlessctl="rootlessctl --socket=$statedir/api.sock"
portids=$($rootlessctl add-ports 127.0.0.1:5201:5201/tcp 127.0.0.1:5201:5201/udp)
$rootlessctl list-ports
sleep 3
$IPERF3C -u 127.0.0.1
$rootlessctl remove-ports $portids
kill $rkpid
}

function benchmark::iperf3_reverse_udp::main(){
set -x
benchmark::iperf3_reverse_udp --net=slirp4netns --mtu=65520 --port-driver=builtin
set +x
}

benchmark::iperf3::main
benchmark::iperf3_reverse::main
benchmark::iperf3_reverse_udp::main

0 comments on commit dec21d1

Please sign in to comment.