aboutsummaryrefslogtreecommitdiffstats
path: root/test/suite_unittests.py
AgeCommit message (Collapse)AuthorFilesLines
2018-11-16test: convert capture tests to use fixtures, fix tests without dumpcapPeter Wu1-4/+3
Add a new --capture-interface option to pytest, similar to test.py. It will grab some Ethernet interface on Windows. An empty value overrides this and disables capture tests. Remove the test.py --enable-capture option since that is implied by the --capture-interface option. Port the `test.py --program-path` option to pytest and additionally make the pytest look in the current working directory if neither WS_BIN_PATH nor --program-path are specified. Drop config.setProgramPath, this allows tests to be run even if not all binaries are available. With all capture tests converted to fixtures, it is now possible to run tests when Wireshark is not built with libpcap as tests that depend on cmd_dumpcap (or capture_interface) will be skipped. Bug: 14949 Change-Id: Ie802c07904936de4cd30a4c68b6a5139e6680fbd Reviewed-on: https://code.wireshark.org/review/30656 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-11-14test: convert some more tests to use fixturesPeter Wu1-22/+25
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-06-18Test+CMake: Make our test grouping more fine-grained.Gerald Combs1-8/+8
Split our tests by suite_*.group_* instead of suite_*. There are quite a few dfilter tests and this should make them more parallelizable. Change-Id: I52371409618cda70dc99811e8de1fb1ad9d9a3b6 Reviewed-on: https://code.wireshark.org/review/28329 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-05-06Test: Make sure we run our display filter tests.Gerald Combs1-0/+23
Change the test suite list in CMakeLists.txt to a static list. Add a CTest coverage unit test. Change-Id: I8459f320a2d0707618d6d56abdfce80274fddd2d Reviewed-on: https://code.wireshark.org/review/27377 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-05-05Test: Integrate ftsanity directly into our tests.Gerald Combs1-12/+48
Move tools/ftsanity.py to test/suite_unittests.py. Change-Id: I8582b19c0544d032eb0566bc1e82be385e904c11 Reviewed-on: https://code.wireshark.org/review/27341 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-04-30Test: Add unittests.Gerald Combs1-0/+59
Note that these require the "test-programs" target. Change-Id: I1bea381eaa48504fcd76f88e1c6f2edece0a78a2 Reviewed-on: https://code.wireshark.org/review/27231 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org>