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 run tests with a UN*X toolchain:
pip install pytest pytest-xdist
make as needed.
If building with Microsoft Visual Studio the analogous steps are:
python -m pip install pytest pytest-xdist
msbuild /m /p:Configuration=RelWithDebInfo Wireshark.sln
msbuild /m /p:Configuration=RelWithDebInfo test-programs.vcxproj
python -m pytest
Depending on your PATH, you may need to run the pytest module as a
script from your Python interpreter, e.g,
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
List available tests with
pytest --collectonly. Enable verbose output
pytest --verbose. For more details, see Section 13.3, “Listing And Running Tests”.
You can also run the "ninja test" target instead of invoking pytest directly. This will automatically build the test programs dependency, so it may be preferred for that reason.