Table of Contents
The Wireshark sources include a collection of Python scripts that test
the features of Wireshark, TShark, Dumpcap, and other programs that
accompany Wireshark. These are located in the test
directory of the
Wireshark source tree.
The command line options of Wireshark and its companion command line tools are numerous. These tests help to ensure that we don’t introduce bugs as Wireshark grows and evolves.
The recommended steps to prepare for and to run tests:
pip install pytest pytest-xdist
ninja
ninja test-programs
pytest
Replace ninja test-programs
by make test-programs
as needed.
The test suite will attempt to test as much as possible and skip tests
when its dependencies are not satisfied. For example, packet capture
tests require a Loopback interface and capture privileges. To avoid
capture tests, pass the --disable-capture
option.
List available tests with pytest --collectonly
. Enable verbose output
with pytest --verbose
. For more details, see Section 13.4, “Listing And Running Tests (pytest)”.
If for whatever reason pytest
is too old or unavailable, you could use
a more limited test runner, test/test.py
. Use test/test.py --help
to
see all options. For more details, see Section 13.3, “Listing And Running Tests”.
CMake currently runs test/test.py
when the “test” target is built.