forked from osmocom/wireshark
0662a3f6ac
We amend the :<numeric> pattern to not eat the leading colon. Because the colon can be part of the value (with IPv6 addresses for example) we want to avoid doing that. IPv6 addresses are covered by their own rules but this removes the requirement in the future to handle any special cases and avoids surprises. For this reason the colon-prefix syntax is already explicitly defined to work only for byte arrays and there is currently no universal syntax for all literal values or even all numbers. Other numbers can keep using the lexical type "unparsed". ``` run/dftest "_ws.ftypes.uint8 == :fd" Filter: _ws.ftypes.uint8 == :fd dftest: ":fd" is not a valid number. _ws.ftypes.uint8 == :fd ^~~ run/dftest "_ws.ftypes.uint8 == fd" Filter: _ws.ftypes.uint8 == fd dftest: "fd" is not a valid number. _ws.ftypes.uint8 == fd ^~ run/dftest "_ws.ftypes.uint8 == 0xfd" Filter: _ws.ftypes.uint8 == 0xfd Syntax tree: 0 TEST_ANY_EQ: 1 FIELD(_ws.ftypes.uint8 <FT_UINT8>) 1 FVALUE(253 <FT_UINT8>) Instructions: 00000 READ_TREE _ws.ftypes.uint8 <FT_UINT8> -> reg#0 00001 IF_FALSE_GOTO 3 00002 ANY_EQ reg#0 == 253 <FT_UINT8> 00003 RETURN run/dftest "_ws.ftypes.bytes == fd" Filter: _ws.ftypes.bytes == fd Syntax tree: 0 TEST_ANY_EQ: 1 FIELD(_ws.ftypes.bytes <FT_BYTES>) 1 FVALUE(fd <FT_BYTES>) Instructions: 00000 READ_TREE _ws.ftypes.bytes <FT_BYTES> -> reg#0 00001 IF_FALSE_GOTO 3 00002 ANY_EQ reg#0 == fd <FT_BYTES> 00003 RETURN run/dftest "_ws.ftypes.bytes == :fd" Filter: _ws.ftypes.bytes == :fd Syntax tree: 0 TEST_ANY_EQ: 1 FIELD(_ws.ftypes.bytes <FT_BYTES>) 1 FVALUE(fd <FT_BYTES>) Instructions: 00000 READ_TREE _ws.ftypes.bytes <FT_BYTES> -> reg#0 00001 IF_FALSE_GOTO 3 00002 ANY_EQ reg#0 == fd <FT_BYTES> 00003 RETURN ``` |
||
---|---|---|
.. | ||
baseline | ||
captures | ||
config | ||
keys | ||
lua | ||
protobuf_lang_files | ||
suite_dfilter | ||
suite_dissectors | ||
README.test | ||
conftest.py | ||
fixtures.py | ||
fixtures_ws.py | ||
hosts.custom | ||
hosts.global | ||
hosts.personal | ||
matchers.py | ||
sampleif.py | ||
subprocesstest.py | ||
suite_capture.py | ||
suite_clopts.py | ||
suite_decryption.py | ||
suite_dissection.py | ||
suite_extcaps.py | ||
suite_external.py | ||
suite_fileformats.py | ||
suite_follow.py | ||
suite_follow_dccp.py | ||
suite_follow_multistream.py | ||
suite_io.py | ||
suite_mergecap.py | ||
suite_nameres.py | ||
suite_netperfmeter.py | ||
suite_outputformats.py | ||
suite_release.py | ||
suite_sharkd.py | ||
suite_text2pcap.py | ||
suite_unittests.py | ||
suite_wslua.py | ||
test.py | ||
travis-upload-artifacts.sh | ||
util_dump_dhcp_pcap.py |
README.test
Wireshark Tests The recommended steps to prepare for and to run tests: * Install two Python packages, pytest: `pip install pytest pytest-xdist` * Build programs (“wireshark”, “tshark”, etc.): `ninja` * Build additional programs for the “unittests” suite: `ninja test-programs` * Run tests in the build directory: `pytest` Replace `ninja test-programs` by `make test-programs` as needed. See the “Wireshark Tests” chapter of the Developer's Guide for details: https://www.wireshark.org/docs/wsdg_html_chunked/ChapterTests.html If you need to update the baseline files use the following commands (on a Linux system) mkdir ~/.config/wireshark/profiles/ctest TZ=UTC WIRESHARK_RUN_FROM_BUILD_DIRECTORY=1 build/run/tshark -C ctest -T ek -r test/captures/dhcp.pcap > test/baseline/dhcp.ek TZ=UTC WIRESHARK_RUN_FROM_BUILD_DIRECTORY=1 build/run/tshark -C ctest -T json -r test/captures/dhcp.pcap > test/baseline/dhcp.json TZ=UTC WIRESHARK_RUN_FROM_BUILD_DIRECTORY=1 build/run/tshark -C ctest -T jsonraw -r test/captures/dhcp.pcap > test/baseline/dhcp.jsonraw TZ=UTC WIRESHARK_RUN_FROM_BUILD_DIRECTORY=1 build/run/tshark -C ctest -T ek -r test/captures/dhcp.pcap -x > test/baseline/dhcp-raw.ek