wireshark/test
Hadriel Kaplan 58fe488822 Lua: add ability for scripts loaded from command-line to be passed arguments
This change adds the ability to pass on to lua scripts loaded from the
command-line (tshark or wireshark) additional arguments supplied by the
command-line.  This will help us in our testsuites, but also might be
useful for user-created scripts.  The additional arguments are passed in
using the '-X' eXtension switch.

Change-Id: Ib94cdf1ffd194ca84692fee7816665e4ff95efbd
Reviewed-on: https://code.wireshark.org/review/156
Reviewed-by: Evan Huus <eapache@gmail.com>
Tested-by: Evan Huus <eapache@gmail.com>
2014-02-13 22:32:58 +00:00
..
baseline Remove svn:executable attribute. 2014-01-07 22:55:03 +00:00
captures Add test suite for Lua dissector-related functions 2014-02-09 19:55:43 +00:00
config From Ed Beroset via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9238 2013-10-09 17:21:30 +00:00
keys Remove svn:executable attribute. 2014-01-07 22:55:03 +00:00
lua Lua: add ability for scripts loaded from command-line to be passed arguments 2014-02-13 22:32:58 +00:00
README.test README update. Bug 9174 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9174) 2013-11-30 01:50:12 +00:00
config.sh Various fixes to the Lua int64 code 2014-02-04 00:59:07 +00:00
hosts.custom nameres.hosts_file_handling shouldn't affect loading the profile "hosts" 2013-05-31 21:40:26 +00:00
hosts.global nameres.hosts_file_handling shouldn't affect loading the profile "hosts" 2013-05-31 21:40:26 +00:00
hosts.personal nameres.hosts_file_handling shouldn't affect loading the profile "hosts" 2013-05-31 21:40:26 +00:00
suite-capture.sh From Peter Wu: on systems other than Windows, skip the GUI tests if the 2013-09-22 21:51:05 +00:00
suite-clopts.sh Whitespace changes: Convert spaces to tabs. Add modelines. 2013-03-01 16:13:44 +00:00
suite-decryption.sh Revert part of r53874 2013-12-11 20:52:05 +00:00
suite-fileformats.sh Whitespace changes: Convert spaces to tabs. Add modelines. 2013-03-01 16:13:44 +00:00
suite-io.sh From Peter Wu via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9174 2013-10-06 12:44:10 +00:00
suite-nameres.sh More tweaking of test suite path variables, trying to make everything play 2013-10-06 23:29:59 +00:00
suite-unittests.sh Lua: add ability for scripts loaded from command-line to be passed arguments 2014-02-13 22:32:58 +00:00
test-backend.sh From Ed Beroset via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9245 2013-10-08 15:09:59 +00:00
test.sh Slight simplification, inline a function only ever called once. 2013-10-09 17:24:16 +00:00

README.test

$Id$

What is it?
-----------
This is a collection of bash scripts which test the features of:

 - Wireshark
 - TShark
 - Dumpcap 

Motivation
----------

The command line options of Wireshark and the companion command line tools are 
numerous. This makes it hard to find newly introduced bugs doing manual testing 
(try and error) with source code changes.

The current way is to do some changes, testing some scenarios by hand and 
commit the code so other users will complain about new problems. This obviously 
is far from being optimal.

Limitations
-----------

The test set currently provided will only do some basic tests, but even that 
is far better than nothing. This may involve in time as new tests can be added
to fix problems reported by users. This will hopefully lead to a "complete" 
and reliable testset in the future.

The tests are limited to command line tests, other things like unit tests or 
GUI test are not included.

Prerequisites
-------------

What you'll need (to do):

 - edit the file config.sh to suit your configuration
 - obviously, compile the programs (wireshark, ...) to be tested
 - have a bash (cygwin should do well)
 - have tput (e.g. in the cygwin ncurses package)
 - you'll need a network interface with some network traffic 
   (so you can run the capture tests)
 - (for non-Windows platforms) An X server for running the capture tests with
   the graphical Wireshark program.

A Test Ride
-----------

The default configuration might not be suitable for your set-up. Most settings
can be adjusted by setting an environment variable matching or by editing the
setting in config.sh.

For instance, the first network interface might not be used for traffic (like an
unconnected Ethernet port). In that case, you might want to set the environment
variable TRAFFIC_CAPTURE_IFACE to pick another interface. Use `dumpcap -D` to
get a list of devices.

On Windows, it is assumed that the user is able to perform captures. On
non-Windows platforms, the opposite is assumed. If your dumpcap executable
allows you to perform captures (for example, when it has appropriate
capabilities), then you can override the default with:

    SKIP_CAPTURE=0

If you do not want to test the binaries in the build directory, you can override
it with:

    WS_BIN_PATH=/usr/bin

When your configuration is sane, you can start test.sh which should provide a
basic menu. Just press Enter to start all tests.

It should start all the available tests. Each test will throw out a line 
which should end with a green "Ok". If one of the tests fail, the script
will report it and stop at this test step.

Please remember to have some ICMP traffic on your network interface! The test
suite will ping to www.wireshark.org while running capture tests, but this will
slow down the tests.