CSIT-687: Directory structure reorganization
[csit.git] / tests / nsh_sfc / sfc_scripts / start_tcpdump.sh
diff --git a/tests/nsh_sfc/sfc_scripts/start_tcpdump.sh b/tests/nsh_sfc/sfc_scripts/start_tcpdump.sh
new file mode 100755 (executable)
index 0000000..46f8217
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+ROOTDIR=/tmp/openvpp-testing
+PWDDIR=$(pwd)
+
+cd ${ROOTDIR}/nsh_sfc_tests/sfc_scripts/
+sudo rm -f temp_packet.pcap
+
+sudo /usr/sbin/tcpdump -i $1 -c 1 -w temp_packet.pcap dst host $2 &
+
+if [ ! $? -eq 0 ]; then
+    echo "Start the tcpdump failed!!!"
+    exit 1
+fi
+
+cd ${PWDDIR}