aboutsummaryrefslogtreecommitdiffstats
path: root/test/suite_wslua.py
AgeCommit message (Collapse)AuthorFilesLines
2021-03-26Lua: add DissectorTable.try_heuristics() functionDaniel Dulaney1-0/+4
Add DissectorTable.try_heuristics(name, tvb, pinfo, tree). Previously, there was no way for a Lua plugin to run an existing heuristic dissector. Based on Gerrit change 18718. Closes #17220.
2020-12-08Lua: Add get_preference() and set_preference() utility functions.Stig Bjørlykke1-0/+4
Support uint, bool, enum, string, range, filename and directory preferences. Added apply_preferences() to write to file and apply changes.
2020-11-05Tools+test: Call python3 explicitly.Gerald Combs1-1/+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-28tests: Skip Lua related tests when Lua is not presentVasil Velichkov1-1/+1
Change-Id: I46ea83c0295d53f3b0b1d7f372c4fef2fb292e6c Reviewed-on: https://code.wireshark.org/review/31785 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-12-29test: add tests for Unicode paths in Lua and tshark -G foldersPeter Wu1-0/+38
Check for potential Unicode-related problems on Windows. Change-Id: I147c07749c5073a9ae00f07914dd80347d17c40f Ping-Bug: 15118 Reviewed-on: https://code.wireshark.org/review/31154 Tested-by: Petri Dish Buildbot Petri-Dish: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-11-14test: convert some more tests to use fixturesPeter Wu1-83/+92
Continue the conversion from use of globals (the config module) to fixtures. If a program (like wmem_test or tshark) is unavailable, it will be skipped now rather than failing the test. The general conversion pattern is: - Decorate each class with `@fixtures.uses_fixtures` and (for tests that run tshark) `@fixtures.mark_usefixtures('test_env')`. - Convert all `config.cmd_*` to `cmd_*` and add an argument. - Convert all `config.*_dir` to `dirs.*_dir` and add an argument. - Convert users of `os.path.join(dirs.capture_file, ...)` to use a new 'capture_file' fixture to reduce boilerplate code. Inline variables if possible (this conversion was done in an automated way using regexes). Some other changes: tests that do not require a test environment (like wmem_test) will use 'base_env' which avoids copying config files, `env=config.test_env` got removed since this is the default. Some test classes in suite_clopts were combined. Removed unused imports. Change-Id: Id5480ffaee7d8d56cf2cb3189a38ae9afa7605a1 Reviewed-on: https://code.wireshark.org/review/30591 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-02Test: Add wslua.Gerald Combs1-0/+269
Change-Id: I904796d13550c04df1958715d6528548385c3109 Reviewed-on: https://code.wireshark.org/review/27241 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org>