From: Tobias Brunner Date: Tue, 8 Dec 2015 15:16:51 +0000 (+0100) Subject: testing: Make sure tcpdump is actually terminated before analyzing/collecting logs X-Git-Tag: 5.5.0dr1~17^2~8 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=71424a2f850aeebe79e73261a0f297e6cf5a2b22;p=thirdparty%2Fstrongswan.git testing: Make sure tcpdump is actually terminated before analyzing/collecting logs --- diff --git a/testing/do-tests b/testing/do-tests index 2a424e523c..992f3f5d89 100755 --- a/testing/do-tests +++ b/testing/do-tests @@ -418,9 +418,9 @@ do function stop_tcpdump { echo "${1}# killall tcpdump" >> $CONSOLE_LOG - eval ssh $SSHCONF root@\$ipv4_${1} killall tcpdump + eval ssh $SSHCONF root@\$ipv4_${1} "\"killall tcpdump; while true; do killall -q -0 tcpdump || break; sleep 0.01; done;\"" eval TDUP_${1}="false" - echo "" + echo "" >> $CONSOLE_LOG } @@ -712,15 +712,9 @@ do for host in $TCPDUMPHOSTS do - eval HOSTLOGIN=root@\$ipv4_${host} - - scp $SSHCONF $HOSTLOGIN:/tmp/tcpdump.log \ - $TESTRESULTDIR/${host}.tcpdump.log > /dev/null 2>&1 - cat >> $TESTRESULTDIR/index.html <<@EOF
  • $host tcpdump.log
  • @EOF - done cat >> $TESTRESULTDIR/index.html <<@EOF @@ -802,10 +796,11 @@ do do if [ "`eval echo \\\$TDUP_${host}`" = "true" ] then - echo "${host}# killall tcpdump" >> $CONSOLE_LOG - eval ssh $SSHCONF root@\$ipv4_$host killall tcpdump - eval TDUP_${host}="false" + stop_tcpdump $host fi + eval HOSTLOGIN=root@\$ipv4_${host} + scp $SSHCONF $HOSTLOGIN:/tmp/tcpdump.log \ + $TESTRESULTDIR/${host}.tcpdump.log > /dev/null 2>&1 done ##########################################################################