X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=dpdk-tests%2Fdpdk_scripts%2Frun_l2fwd.sh;fp=dpdk-tests%2Fdpdk_scripts%2Frun_l2fwd.sh;h=20c41d6d6fab9a1959b158b591cc68658c2d5abc;hp=31dc26d728ef862e370144718adfff9333d6d2a6;hb=afa3def247a11985b17f310e58b6f5fae16dc306;hpb=e6ae349af548635360216827349cfc1e1ee29cd5 diff --git a/dpdk-tests/dpdk_scripts/run_l2fwd.sh b/dpdk-tests/dpdk_scripts/run_l2fwd.sh index 31dc26d728..20c41d6d6f 100755 --- a/dpdk-tests/dpdk_scripts/run_l2fwd.sh +++ b/dpdk-tests/dpdk_scripts/run_l2fwd.sh @@ -41,6 +41,33 @@ else echo "testpmd is not running" fi +# Try to 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/*