Hi all
I run several docker containers I need to run mutiple iperf servers and clients, I am using shell script.
I do not know can I write the script for all containers. it gives me error Error: No such container: mn.sta
for example for server I use
base_port=5000
NAME=$1
Command line input: number of servers
E.g. 5
num_servers=$1
shift
Command line input: base report file name
E.g. report
report_base=$1
shift
Optional command line input: other iperf options
E.g. -u
iperf_options=“$*”
Run iperf multiple times
for i in seq 1 $num_servers
; do
# Set server port
server_port=$(($base_port+$i));
# Report file includes server port
report_file=${report_base}-${server_port}.txt
# Run iperf
docker exec -t mn.sta$NAME iperf -s -p $server_port $iperf_options &> $report_file &
done