hw-test/scripts/test-iperf

43 lines
822 B
Text
Raw Normal View History

2017-01-26 21:43:03 -06:00
#!/bin/bash
source scan-netdev
#VLANS='110 218 222 226 306 321 480'
2021-09-23 05:21:51 -05:00
CTLPLANE=110
MY_DATE=`date +%Y-%m-%d_%H-%M-%S`
2017-01-26 21:43:03 -06:00
mkdir -p $OUTPUT_DIR/iperf
2021-09-23 05:21:51 -05:00
if [[ -n $1 ]] ; then
LABEL=".$1"
fi
MY_PORT=`grep $SERVER_SERIAL /etc/netdev/vlan.$CTLPLANE.csv \
| cut -d ',' -f 3 | cut -d '.' -f 4`
2017-01-26 21:43:03 -06:00
if [[ -z $MY_PORT ]] ; then
echo "My Port empty"
exit 27
fi
for VLAN in {10..4000} ; do
2017-01-26 21:43:03 -06:00
if [[ -f /etc/netdev/vlan.$VLAN.csv ]] ; then
VLAN_CONF=`grep $SERVER_SERIAL \
/etc/netdev/vlan.$VLAN.csv`
else
continue
2017-01-26 21:43:03 -06:00
fi
if [[ -z $VLAN_CONF ]] ; then
continue
fi
2021-09-23 05:21:51 -05:00
IP_LIST=`sed 's/#.*$//' /etc/netdev/vlan.$VLAN.csv \
2017-01-26 21:43:03 -06:00
| cut -d ',' -f 3 \
| grep '^[0-9]' | sort`
for IP in $IP_LIST; do
echo -n "$IP - "
iperf3 -P 4 -p 52$MY_PORT \
2021-09-23 05:21:51 -05:00
--logfile $OUTPUT_DIR/iperf/client.$IP$LABEL.log \
2017-01-26 21:43:03 -06:00
-c $IP
echo $?
done
done