aboutsummaryrefslogtreecommitdiffstats
path: root/test/suite_dissectors/dissectorstest.py
AgeCommit message (Collapse)AuthorFilesLines
2023-06-05Tests: Remove unittest dependency (asterix)João Valverde1-19/+16
2023-05-10Tests: Require pytest support and remove compatibility layerJoão Valverde1-5/+7
Remove the pytest compatibility layer and require the real thing. Fix running tests with pytest and Python 3.11+. Pytest strongly favors using fixtures instead of setup/teardown methods so use that. This fixes the test suite with pytest and Python 3.11 and has the added benefit of removing the dependency on a private unittest property. We remove the dedicated log file code in SubprocessTestCase and just write to standard out. This presumes to leverage the pytest logging features, such as writing to a log file. To make the system more useful we should probably rely on logging calls instead of writing to stdout. The teardown log file cleanup logic and filename_from_id() method are replaced with pytest fixtures and native temporary path support. They are cleaner to use and do not require messy teadown logic. The temporary files are created in the system temporary directory. By default the last three runs are kept. More work is needed to complete remove the unittest module dependency. Fixes #18740.
2020-11-05Tools+test: Call python3 explicitly.Gerald Combs1-2/+0
PEP 394[1] says, "In cases where the script is expected to be executed outside virtual environments, developers will need to be aware of the following discrepancies across platforms and installation methods: * Older Linux distributions will provide a python command that refers to Python 2, and will likely not provide a python2 command. * Some newer Linux distributions will provide a python command that refers to Python 3. * Some Linux distributions will not provide a python command at all by default, but will provide a python3 command by default." Debian has forced the issue by choosing the third option[2]: "NOTE: Debian testing (bullseye) has removed the "python" package and the '/usr/bin/python' symlink due to the deprecation of Python 2." Switch our shebang from "#!/usr/bin/env python" to "#!/usr/bin/env python3" in some places. Remove some 2/3 version checks if we know we're running under Python 3. Remove the "coding: utf-8" in a bunch of places since that's the default in Python 3. [1]https://www.python.org/dev/peps/pep-0394/#for-python-script-publishers [2]https://wiki.debian.org/Python
2019-01-04test/dissectorstest: assert that text2pcap and tshark runsPeter Wu1-2/+2
Fail early if these commands fail. Change-Id: I6ba6cfa4b0b68c7282b79204b4f2bfedfefa4326 Reviewed-on: https://code.wireshark.org/review/31352 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-12-26Added a generic dissector validator and some ASTERIX unit tests that use it.Atli Guðmundsson1-0/+119
This patch extends the test suite with: * a way for tests to check if a given byte sequence dissects into an expected dissection result. Unit tests included: * ASTERIX I019 * ASTERIX I063 * ASTERIX I065 Change-Id: Ib168382ec15b0b610ff5913806120ba1bf1d1503 Reviewed-on: https://code.wireshark.org/review/31083 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>