X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=dpdk-tests%2Fdpdk_scripts%2Fcleanup_dpdk.sh;h=48e1a29b63946160c0cc2cd68699912c205c8c51;hp=3533a1a580aadd268bca4c6c14c9ff16a651f570;hb=afa3def247a11985b17f310e58b6f5fae16dc306;hpb=ec059708c78fe3563bc89507739a2712adc062f3 diff --git a/dpdk-tests/dpdk_scripts/cleanup_dpdk.sh b/dpdk-tests/dpdk_scripts/cleanup_dpdk.sh index 3533a1a580..48e1a29b63 100755 --- a/dpdk-tests/dpdk_scripts/cleanup_dpdk.sh +++ b/dpdk-tests/dpdk_scripts/cleanup_dpdk.sh @@ -3,7 +3,7 @@ set -x # Setting variables -DPDK_VERSION=dpdk-17.02 +DPDK_VERSION=dpdk-17.05 ROOTDIR=/tmp/openvpp-testing TESTPMDLOG=screenlog.0 PWDDIR=$(pwd) @@ -41,15 +41,42 @@ else echo "testpmd is not running" fi +#also kill the l3fwd +sudo pgrep l3fwd +if [ $? -eq "0" ]; then + success=false + sudo pkill l3fwd + echo "RC = $?" + for attempt in {1..5}; do + echo "Checking if l3fwd is still alive, attempt nr ${attempt}" + sudo pgrep l3fwd + if [ $? -eq "1" ]; then + echo "l3fwd is dead" + success=true + break + fi + echo "l3fwd is still alive, waiting 1 second" + sleep 1 + done + if [ "$success" = false ]; then + echo "The command sudo pkill l3fwd failed" + sudo pkill -9 l3fwd + echo "RC = $?" + exit 1 + fi +else + echo "l3fwd is not running" +fi + # Remove hugepages sudo rm -f /dev/hugepages/* # Unbind interfaces cd ${ROOTDIR}/${DPDK_VERSION}/ sudo ./usertools/dpdk-devbind.py -b ${port1_driver} ${port1_pci} || \ - echo "Unbind ${port1_pci} failed" || exit 1 + { echo "Unbind ${port1_pci} failed"; exit 1; } sudo ./usertools/dpdk-devbind.py -b ${port2_driver} ${port2_pci} || \ - echo "Unbind ${port1_pci} failed" || exit 1 + { echo "Unbind ${port1_pci} failed"; exit 1; } sleep 2 @@ -58,6 +85,6 @@ if2_name=`./usertools/dpdk-devbind.py --s | grep "${port2_pci}" | sed -n 's/.*if # Remove igb_uio driver rmmod igb_uio || \ - echo "Removing igb_uio failed" || exit 1 + { echo "Removing igb_uio failed"; exit 1; } cd ${PWDDIR}