From c55d69780b70d9cce78a4ec65b7276a9bca0efb6 Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Tue, 7 Oct 2014 10:11:45 -0700 Subject: Try to speed up ping-dependent capture tests. Ping four times a second for ~60 seconds. Save the subprocess PID so that we can kill it when we're done with each test instead of waiting for it to finish. Change-Id: I64f889c700e8a6fa1bc1c3916ef045341ef59cc6 Reviewed-on: https://code.wireshark.org/review/4557 Reviewed-by: Gerald Combs --- test/suite-capture.sh | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'test/suite-capture.sh') diff --git a/test/suite-capture.sh b/test/suite-capture.sh index 8c6958a777..b624b7074b 100755 --- a/test/suite-capture.sh +++ b/test/suite-capture.sh @@ -30,6 +30,8 @@ EXIT_ERROR=2 WIRESHARK_CMD="$WIRESHARK -o gui.update.enabled:FALSE -k" WIRESHARK_GTK_CMD="$WIRESHARK_GTK -o gui.update.enabled:FALSE -k" +PING_PID= + capture_test_output_print() { wait for f in "$@"; do @@ -43,30 +45,33 @@ capture_test_output_print() { traffic_gen_ping() { # Generate some traffic for quiet networks. - # This will have to be adjusted for non-Windows systems. - - # the following will run in the background and return immediately + # The following will run in the background and return immediately { date - for (( x=28; x<=58; x++ )) # in effect: number the packets + for sweep_size in {1..240} # try to number the packets do # How does ping _not_ have a standard set of arguments? case $WS_SYSTEM in Windows) - ping -n 1 -l $x www.wireshark.org ;; + ping -n 1 -l $sweep_size www.wireshark.org ;; SunOS) - /usr/sbin/ping www.wireshark.org $x 1 ;; + /usr/sbin/ping www.wireshark.org $sweep_size 1 ;; *) # *BSD, Linux - ping -c 1 -s $x www.wireshark.org ;; + ping -c 1 -s $sweep_size www.wireshark.org ;; esac - sleep 0.1 + sleep 0.25 # 240 * 0.25 = 60-ish seconds done date } > ./testout_ping.txt 2>&1 & + PING_PID=$! } ping_cleanup() { - wait + if [ -n "$PING_PID" ] ; then + kill $PING_PID + PING_PID= + fi + wait 2> /dev/null rm -f ./testout_ping.txt } -- cgit v1.2.3