iperf and bonding tests

This commit is contained in:
Sandino Araico Sanchez 2017-01-26 21:43:03 -06:00
parent 1bcb6e9316
commit fbdf448efa
7 changed files with 191 additions and 8 deletions

16
scripts/scan-bonding Executable file
View file

@ -0,0 +1,16 @@
#!/bin/bash
source scan-netdev
#echo "scan-bonding: Ping test:"
test-ping | tee $OUTPUT_DIR/test-ping.out \
| grep error
for BOND_N in {0..4} ; do
BOND=bond$BOND_N
if [[ -d /sys/class/net/$BOND ]] ; then
cp /sys/class/net/$BOND/bonding/slaves \
$OUTPUT_DIR/netdev/$BOND.slaves
fi
done

55
scripts/setup-bonding-degraded Executable file
View file

@ -0,0 +1,55 @@
#!/bin/bash
source scan-netdev
sleep_5 () {
for WAIT in 1 2 3 4 5 ; do
echo -n '.'
sleep 1
done
echo
}
case "$1" in
"1")
SLAVE_NO=1
;;
"2")
SLAVE_NO=2
;;
*)
echo "usage: $0 <1|2> <up|down>"
exit 28
;;
esac
case "$2" in
"up")
echo -n "Inserting slave $SLAVE_NO..."
ACTION=
;;
"down")
echo -n "Removing slave $SLAVE_NO..."
ACTION="-d"
;;
*)
echo "usage: $0 <1|2> <up|down>"
exit 29
;;
esac
for BOND_N in {0..4} ; do
BOND=bond$BOND_N
[[ -d /sys/class/net/$BOND ]] || continue
if [[ ! -f $OUTPUT_DIR/netdev/$BOND.slaves ]] ; then
echo "Missing slaves cache file"
exit 30
fi
SLAVE=`cut -d ' ' -f $SLAVE_NO \
$OUTPUT_DIR/netdev/$BOND.slaves`
ifenslave $ACTION $BOND $SLAVE
echo -n " $? "
done
echo

12
scripts/setup-iperf Executable file
View file

@ -0,0 +1,12 @@
#!/bin/bash
source scan-dmidecode
mkdir -p $OUTPUT_DIR/iperf
for PORT in {5257..5261} ; do
iperf3 -p $PORT \
--logfile $OUTPUT_DIR/iperf/server.$PORT.log \
--server --daemon
done

29
scripts/setup-iperf-massive Executable file
View file

@ -0,0 +1,29 @@
#!/bin/bash
source scan-dmidecode
mkdir -p $OUTPUT_DIR/iperf
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
PORT=`echo $IP \
| cut -d '.' -f 3,4 \
| sed 's/\.//'`
iperf3 -p $PORT \
--logfile $OUTPUT_DIR/iperf/server.$PORT.log \
--server --daemon
done
done

View file

@ -3,21 +3,25 @@
source scan-dmidecode
source test-variables
#rm -f /output/hwtests/*/netdev/*.ethtool
source scan-netdev
#source scan-netdev
echo $$ > /run/batch.pid
echo -n "setup-netdev... "
setup-netdev >/dev/null &
sleep 1
jobs
disown
#scan-bonding
#echo -n "setup-netdev... "
#setup-netdev
#sleep 1
#jobs
#disown
#stat-bonding out > $OUTPUT_DIR/stat-bonding.pre.1.out
#test-bonding
#stat-bonding out > $OUTPUT_DIR/stat-bonding.post.1.out
# Take snapshot
#mkdir -p $SNAPSHOT_D
#cp -af $OUTPUT_DIR/* $SNAPSHOT_D/
mkdir -p $SNAPSHOT_D
cp -af $OUTPUT_DIR/* $SNAPSHOT_D/
rm -f /run/batch.pid
#echo '--'

36
scripts/test-iperf Executable file
View file

@ -0,0 +1,36 @@
#!/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

31
scripts/test-iperf-massive Executable file
View file

@ -0,0 +1,31 @@
#!/bin/bash
source scan-netdev
mkdir -p $OUTPUT_DIR/iperf
for VLAN in 402 403 404 406 ; do
if [[ -f /etc/netdev/vlan.$VLAN.csv ]] ; then
VLAN_CONF=`grep $SERVER_SERIAL \
/etc/netdev/vlan.$VLAN.csv`
fi
[[ -z $VLAN_CONF ]] && continue
MY_PORT=`echo $VLAN_CONF \
| cut -d ',' -f 3 \
| cut -d '.' -f 3,4 \
| sed 's/\.//'`
IP_LIST=`cat /etc/netdev/vlan.$VLAN.csv \
| grep 'STOC' \
| cut -d ',' -f 3 \
| grep '^[0-9]' | sort`
for IP in $IP_LIST; do
#echo "$IP - "
iperf3 -p $MY_PORT -t 60 \
--logfile $OUTPUT_DIR/iperf/client.$IP.massive.log \
-c $IP > /dev/null &
disown
#echo $?
done
done
#--bandwidth 250M \