hw-test/scripts/test-iperf

36 lines
708 B
Bash
Executable file

#!/bin/bash
source scan-netdev
mkdir -p $OUTPUT_DIR/iperf
MY_PORT=`cat /etc/netdev/vlan.400.csv \
| grep $SERVER_SERIAL \
| cut -d ',' -f 3 \
| cut -d '.' -f 4`
if [[ -z $MY_PORT ]] ; then
echo "My Port empty"
exit 27
fi
for VLAN in 401 402 403 404 406 ; do
if [[ -f /etc/netdev/vlan.$VLAN.csv ]] ; then
VLAN_CONF=`grep $SERVER_SERIAL \
/etc/netdev/vlan.$VLAN.csv`
fi
if [[ -z $VLAN_CONF ]] ; then
continue
fi
IP_LIST=`cat /etc/netdev/vlan.$VLAN.csv \
| grep -v 'STOC' \
| cut -d ',' -f 3 \
| grep '^[0-9]' | sort`
for IP in $IP_LIST; do
echo -n "$IP - "
iperf3 -P 4 -p 52$MY_PORT \
--logfile $OUTPUT_DIR/iperf/client.$IP.slave.2.log \
-c $IP
echo $?
done
done