test: convert capture tests to use fixtures, fix tests without dumpcap
authorPeter Wu <peter@lekensteyn.nl>
Thu, 15 Nov 2018 17:44:59 +0000 (18:44 +0100)
committerPeter Wu <peter@lekensteyn.nl>
Fri, 16 Nov 2018 13:55:28 +0000 (13:55 +0000)
commit3ab521118a0d068e0d5c795a5a57b13cd7790a75
tree72900c817752260ab91945cc85302b78f8eaffe6
parentcb9be3850da46ca1f706a00b16cdb65a95ce66a0
test: convert capture tests to use fixtures, fix tests without dumpcap

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>
test/conftest.py
test/fixtures.py
test/fixtures_ws.py
test/subprocesstest.py
test/suite_capture.py
test/suite_clopts.py
test/suite_fileformats.py
test/suite_io.py
test/suite_unittests.py
test/test.py