1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
#!/bin/bash
# Test IO NIC function
. ./common
trap "_uninit; exit \$status" 0 1 2 3 15
_uninit()
{
iptables -D INPUT -p tcp --sport 8001 -j DROP
iptables -D INPUT -p tcp --dport 8001 -j DROP
}
_need_to_be_root
for i in `seq 0 5`; do
_start_sheep $i "-i host=127.0.0.1,port=$((8000+$i))"
done
_wait_for_sheep 6
_cluster_format -c 6
_vdi_create test 100M
dd if=/dev/zero | $DOG vdi write test &
# simulate IO NIC down of sheep 1
iptables -A INPUT -p tcp --sport 8001 -j DROP
iptables -A INPUT -p tcp --dport 8001 -j DROP
# wait for dog to finish
wait
# Logger flush in 1 second internval. We need assure log is flushed.
sleep 1
if [ "`grep fallback $STORE/0/sheep.log`" ];then
echo fallback done
fi
$DOG vdi check test 2> /dev/null
status=0
|