diff options
author | Gerald Combs <gerald@wireshark.org> | 2014-10-07 10:11:45 -0700 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2014-10-08 18:54:13 +0000 |
commit | c55d69780b70d9cce78a4ec65b7276a9bca0efb6 (patch) | |
tree | 40c79704ad8da6702e3a5f661f392a7c57e88012 | |
parent | 70ba2f88d1e9ebab3c535d5e787d7172ca665c9f (diff) |
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 <gerald@wireshark.org>
-rwxr-xr-x | test/suite-capture.sh | 23 |
1 files changed, 14 insertions, 9 deletions
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 } |