wireshark/test
Peter Wu 537705a8b2 wslua: prepare for split class/instance (meta)methods
Previously the metatables for classes were the same for the class and
its instances. This results in issues like calling __gc on the class
table on exit.

Make it possible to declare separate class methods (functions) and
instance methods. Observe that all attributes apply to the instances
only, so make these just available on the instance.

The attribute/methods lookup method (via __index/__newindex) have been
rewritten to use upvalues, removing the technical need for the
properties __getters/__setters/__methods. The "lua globals" test still
checks for these, but it could be removed in the future.

To fix bug 12968, the __gc method is removed from the class method.
Future patches should remove the WSLUA_REGISTER_CLASS,
WSLUA_REGISTER_META and WSLUA_REGISTER_ATTRIBUTES macros completely and
create split class functions/methods (such that __call for an instance
cannot accidentally be invoked on the class).

Removed duplicate "fragmented" property from Pinfo (which triggered an
error) and replaced exit() by g_error() for debugger friendliness.
Remove lua_shiftstring since checkstring always returns non-NULL.

Bug: 12968
Change-Id: I57f8a93d08bb84c79b0e94cf2c82d8402fc16646
Reviewed-on: https://code.wireshark.org/review/18026
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Balint Reczey <balint@balintreczey.hu>
2016-10-18 20:41:34 +00:00
..
baseline Remove svn:executable attribute. 2014-01-07 22:55:03 +00:00
captures ssl: fix TLS renegotiation, add test for this 2016-09-06 13:45:30 +00:00
config ssl,http: rename http-over-ssl to http-over-tls 2016-09-04 13:18:54 +00:00
keys ssl-utils: fix failing decryption for some RSA keys 2015-07-15 21:31:44 +00:00
lua wslua: prepare for split class/instance (meta)methods 2016-10-18 20:41:34 +00:00
README.test Add a test-programs target everywhere. 2015-03-13 22:41:40 +00:00
config.sh Remove nghttp2 code and use system' nghttp2 2016-10-13 19:26:10 +00:00
hosts.custom Continue to remove $Id$ from top of file 2014-03-31 18:48:06 +00:00
hosts.global Continue to remove $Id$ from top of file 2014-03-31 18:48:06 +00:00
hosts.personal Continue to remove $Id$ from top of file 2014-03-31 18:48:06 +00:00
run_and_catch_crashes Fix copyright. 2016-08-05 18:31:09 +00:00
suite-capture.sh Test: Revert debugging output. 2016-05-27 18:44:10 +00:00
suite-clopts.sh Allow test of the -D and -L options to succeed or fail with a permissions error. 2016-02-15 20:17:54 +00:00
suite-decryption.sh More wlan_mgt cleanup: 2016-10-16 14:03:55 +00:00
suite-fileformats.sh Use -r rather than -i for the "via stdin" tests. 2016-08-09 02:14:28 +00:00
suite-io.sh Suite test: fix modelines for bash script (emac) 2016-02-03 12:35:30 +00:00
suite-mergecap.sh suite-mergecap: fix indent (use tabs) 2016-02-03 12:36:46 +00:00
suite-nameres.sh Suite test: fix modelines for bash script (emac) 2016-02-03 12:35:30 +00:00
suite-text2pcap.sh [text2pcap] Fix parsing of hash sign at the end of the line 2016-02-04 05:13:16 +00:00
suite-unittests.sh Fix unit test location for out of tree autotools build 2016-08-15 10:00:59 +00:00
suite-wslua.sh Disable wslua GRegex unit test 2016-10-10 21:49:08 +00:00
test-backend.sh test.sh: Don't abort on failed test 2016-08-06 12:14:49 +00:00
test.sh test: ensure temporary directory outside source tree 2016-06-27 22:42:01 +00:00

README.test

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
 - build the "all" target
 - build the "test-programs" target
 - 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.