From 85f46c971b344712d97d1135563e608e84a6d5a2 Mon Sep 17 00:00:00 2001 From: Fabian Arrotin Date: Jun 30 2014 09:28:28 +0000 Subject: Fixed the tcpdump test to specify the interface (dynamically as interface name changes on c7) --- diff --git a/tests/p_tcpdump/01_tcpdump_nic.sh b/tests/p_tcpdump/01_tcpdump_nic.sh index ee232eb..9d21539 100755 --- a/tests/p_tcpdump/01_tcpdump_nic.sh +++ b/tests/p_tcpdump/01_tcpdump_nic.sh @@ -7,13 +7,15 @@ t_Log "Running $0 - TCPdump test to Default-GW with IPv4" # Grabing Default-Router if NIC IP=$(ip route list default | grep 'default via ') regex='.*via\ (.*)\ dev.*' +eth_int=$(ip addr|grep -B 1 "link/ether"|head -n 1|awk '{print $2}'|tr -d ':') + if [[ $IP =~ $regex ]] then t_Log "Found Default-GW - starting tcpdump test" #Dumping 4 pings via NIC to file FILE='/var/tmp/nic_test.pcap' COUNT='4' - tcpdump -q -n -p -w $FILE & + tcpdump -i $eth_int -q -n -p -w $FILE & # If we don't wait a short time, the first paket will be missed by tcpdump sleep 1 ping -q -c $COUNT -i 0.25 ${BASH_REMATCH[1]} > /dev/null 2>&1