aboutsummaryrefslogtreecommitdiffstats
path: root/test/suite-capture.sh
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2014-10-01 12:44:14 -0700
committerGerald Combs <gerald@wireshark.org>2014-10-01 22:30:33 +0000
commit58cde5c74accbb7ad843e4b97e64c2b9f74b8854 (patch)
tree52808e0e80d4c7c7621960d392f4dc0b1e049464 /test/suite-capture.sh
parentb5aa0d2a4f6b70c16323e5ea69412c3cc861379e (diff)
Add tests for the Qt UI.
Make sure the Qt UI quits if WIRESHARK_QUIT_AFTER_CAPTURE is set. Make sure Bourne shell scripts (*.sh) have UNIX/POSIX line endings. Reduce some time values so that the tests run faster. Change-Id: I81df7c6f72d7d807d1856863cbea1bb6326ca711 Reviewed-on: https://code.wireshark.org/review/4407 Tested-by: Gerald Combs <gerald@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'test/suite-capture.sh')
-rwxr-xr-xtest/suite-capture.sh34
1 files changed, 32 insertions, 2 deletions
diff --git a/test/suite-capture.sh b/test/suite-capture.sh
index 71dec1a26e..c92a957162 100755
--- a/test/suite-capture.sh
+++ b/test/suite-capture.sh
@@ -27,6 +27,7 @@ EXIT_OK=0
EXIT_COMMAND_LINE=1
EXIT_ERROR=2
+WIRESHARK_CMD="$WIRESHARK -o gui.update.enabled:FALSE -k"
WIRESHARK_GTK_CMD="$WIRESHARK_GTK -o gui.update.enabled:FALSE -k"
capture_test_output_print() {
@@ -58,7 +59,7 @@ traffic_gen_ping() {
*) # *BSD, Linux
ping -c 1 -s $x www.wireshark.org ;;
esac
- sleep 1
+ sleep 0.1
done
date
} > ./testout_ping.txt 2>&1 &
@@ -202,7 +203,7 @@ capture_step_fifo() {
# capture packets via a fifo
capture_step_stdin() {
CONSOLE_LOG_ARGS=""
- if [ "$DUT" == "$WIRESHARK_GTK_CMD" -a "$WS_SYSTEM" == "Windows" ] ; then
+ if [[ ( "$DUT" == "$WIRESHARK_CMD" || "$DUT" == "$WIRESHARK_GTK_CMD" ) && "$WS_SYSTEM" == "Windows" ]] ; then
CONSOLE_LOG_ARGS="-o console.log.level:127"
fi
@@ -413,6 +414,34 @@ wireshark_capture_suite() {
# WIRESHARK_QUIT_AFTER_CAPTURE needs to be set.
#
+ # NOTE: This may not do the right thing if we use toolkits
+ # that use Wayland or Mir directly, unless they also depend
+ # on the DISPLAY environment variable.
+ #
+ if [[ $WS_SYSTEM != Windows && $WS_SYSTEM != Darwin ]] && [ -z "$DISPLAY" ]; then
+ echo -n ' (X server not available)'
+ test_step_skipped
+ return
+ fi
+
+ DUT="$WIRESHARK_CMD"
+ test_step_add "Capture 10 packets" capture_step_10packets
+ # piping to stdout doesn't work with Wireshark and capturing!
+ #test_step_add "Capture 10 packets using stdout: -w -" capture_step_10packets_stdout
+ if [ $TEST_FIFO ]; then
+ test_step_add "Capture via fifo" capture_step_fifo
+ fi
+ test_step_add "Capture via stdin" capture_step_stdin
+ # read filter doesn't work with Wireshark and capturing!
+ #test_step_add "Capture read filter (${TRAFFIC_CAPTURE_DURATION}s)" capture_step_read_filter
+ test_step_add "Capture snapshot length 68 bytes (${TRAFFIC_CAPTURE_DURATION}s)" capture_step_snapshot
+}
+
+wireshark_gtk_capture_suite() {
+ # k: start capture immediately
+ # WIRESHARK_QUIT_AFTER_CAPTURE needs to be set.
+
+ #
# NOTE: if, on OS X, we start using a native-Quartz toolkit,
# this would need to change to check for WS_SYSTEM being
# "Darwin" and, if it is, check whether the standard output
@@ -484,6 +513,7 @@ capture_suite() {
test_suite_add "Dumpcap capture" dumpcap_capture_suite
test_suite_add "TShark capture" tshark_capture_suite
test_suite_add "Wireshark capture" wireshark_capture_suite
+ test_suite_add "Wireshark 1 capture" wireshark_gtk_capture_suite
}
#