| #!/bin/sh |
| |
| |
| |
| t_Log "Running $0 - TCPdump test to lo" |
| |
| |
| FILE='/var/tmp/lo_test.pcap' |
| COUNT='4' |
| |
| tcpdump -q -n -p -i lo -w $FILE & |
| |
| sleep 1 |
| ping -q -c $COUNT -i 0.25 127.0.0.1 > /dev/null 2>&1 |
| sleep 1 |
| killall -s SIGINT tcpdump |
| sleep 1 |
| |
| WORKING=$( tcpdump -r $FILE | grep -ci icmp ) |
| if [ $WORKING == $[COUNT*2] ] |
| then |
| ret_val=0 |
| else |
| t_Log "ping to loopback droped pakets!! This should not happen on loopback" |
| ret_val=1 |
| fi |
| |
| |
| /bin/rm $FILE |
| |
| t_CheckExitStatus $ret_val |