3 # Configuration of the command line tests
5 # Wireshark - Network traffic analyzer
6 # By Gerald Combs <gerald@wireshark.org>
7 # Copyright 2005 Ulf Lamping
9 # SPDX-License-Identifier: GPL-2.0-or-later
12 # The files we want to test are in the build directory.
13 WIRESHARK_RUN_FROM_BUILD_DIRECTORY=1
14 export WIRESHARK_RUN_FROM_BUILD_DIRECTORY
16 # Set WS_SYSTEM to our system type, e.g. Windows, Linux, Darwin
17 # http://support.microsoft.com/kb/100843
18 if [ -n "${OS#Windows}" ] ; then
20 export CYGWIN="$CYGWIN error_start=c:\cygwin\bin\dumper.exe -d %1 %2"
28 echo -n I | od -to2 | awk '{ lastbit = substr($2,6,1); exit lastbit }'
29 if [ $? -eq 0 ] ; then
33 # Absolute path to the source tree
34 SOURCE_DIR="$(cd "$(dirname "$0")" && cd .. && pwd)"
36 # Absolute path to this test directory (for capture and config files)
37 TESTS_DIR="$SOURCE_DIR/test"
39 # Are we allowed to open interfaces or capture on this system?
40 SKIP_CAPTURE=${SKIP_CAPTURE:-1}
42 # Override the last two items if we're running Windows
43 if [ "$WS_SYSTEM" = "Windows" ] ; then
47 # Path to the Wireshark binaries, default to source dir if unset
48 WS_BIN_PATH=${WS_BIN_PATH:-$SOURCE_DIR}
50 # Tweak the following to your liking.
51 WIRESHARK=$WS_BIN_PATH/wireshark
52 TSHARK=$WS_BIN_PATH/tshark
53 RAWSHARK=$WS_BIN_PATH/rawshark
54 CAPINFOS=$WS_BIN_PATH/capinfos
55 MERGECAP=$WS_BIN_PATH/mergecap
56 TEXT2PCAP=$WS_BIN_PATH/text2pcap
57 DUMPCAP=$WS_BIN_PATH/dumpcap
59 # interface with at least a few packets/sec traffic on it
60 # (e.g. start a web radio to generate some traffic :-)
61 # an interfaces index (1 based) should do well for recent devbuilds
62 if [ "$WS_SYSTEM" = "Windows" -a -z "$TRAFFIC_CAPTURE_IFACE" ] ; then
63 # Try to fetch the first Ethernet interface.
64 TRAFFIC_CAPTURE_IFACE=`$TSHARK -D 2>&1 | \
65 egrep 'Ethernet|Network Connection|VMware|Intel|Realtek' | \
68 TRAFFIC_CAPTURE_IFACE=${TRAFFIC_CAPTURE_IFACE:-1}
70 # time to capture some traffic (in seconds)
71 # (you may increase this if you get errors caused by very low traffic)
72 TRAFFIC_CAPTURE_DURATION=10
74 # the default is to not capture in promiscuous mode
75 # (this makes known trouble with some Windows WLAN adapters)
76 # if you need promiscuous mode, comment this line out
77 TRAFFIC_CAPTURE_PROMISC=-p
79 # only test capturing from a fifo if we're not on Windows
80 # and we have a mkfifo. (Windows cygwin has a mkfifo but
81 # Windows dumpcap & etc use Windows named pipes which
82 # are different than the cygwin named pipes).
84 if [ "$WS_SYSTEM" != "Windows" ] && which mkfifo &>/dev/null ; then
88 # Tell Wireshark to quit after capuring packets.
89 export WIRESHARK_QUIT_AFTER_CAPTURE="True"
91 CAPTURE_DIR="$TESTS_DIR/captures/"
93 TSHARK_VERSION=$($TSHARK -v | tr '\n' ' ')
95 # Figure out if we were built with lua or not so we can skip the lua tests if we
97 echo "$TSHARK_VERSION" | grep -q "with Lua"
100 # Check whether we need to skip the HTTP2/HPACK decryption test.
101 echo "$TSHARK_VERSION" | grep -q "with nghttp2"
104 # Check whether we need to skip a certain decryption test.
105 # XXX What do we print for Nettle?
106 echo "$TSHARK_VERSION" | egrep -q "with MIT Kerberos|with Heimdal Kerberos"
109 # first version is "compiled with", second is "running on" version.
110 GCRY_VERSION=$(echo "$TSHARK_VERSION" | grep -oE 'Gcrypt [1-9]+(\.[1-9]+)?' | sed -n '1s/Gcrypt //p')
111 if [ -n "$GCRY_VERSION" ] && ! echo "$GCRY_VERSION" | grep -q '1\.[456]'; then
112 # Current minimum Gcrypt version is 1.4.2,
113 # assume 1.7 or newer if not 1,4, 1.5 or 1.6.
114 HAVE_LIBGCRYPT17=true
116 HAVE_LIBGCRYPT17=false
120 hash iconv 2>/dev/null && HAVE_ICONV="True"
122 # Display our environment
124 ##printf "\n ------- Info =-----------------\n"
125 ##printf "Syms :$WS_SYSTEM: :$TRAFFIC_CAPTURE_IFACE: :$SKIP_CAPTURE: :$TEST_FIFO:\n"
127 ##ls -l $WIRESHARK $TSHARK $DUMPCAP
128 ##ls -l $(which wireshark) $(which tshark) $(which dumpcap)
129 ##printf " ----------------------------------\n\n"
136 # indent-tabs-mode: t
139 # ex: set shiftwidth=8 tabstop=8 noexpandtab:
140 # :indentSize=8:tabSize=8:noTabs=false: