wireshark/test
Huang Qiangxiong cd2d35c1d2 Protobuf: fix bugs that parsing complex syntax .proto files
Some .proto files contain complex syntax that does not be described in protobuf official site
(https://developers.google.com/protocol-buffers/docs/reference/proto3-spec).

1. Update 'epan/protobuf_lang_parser.lemon' to:
1) Support complex option names format (EBNF):
    optionName = ( ident | "(" fullIdent ")" ) { "." ( ident | "(" fullIdent ")" ) }
for example, "option (complex_opt2).(grault) = 654;".
2) Make enum body support 'reserved' section (EBNF):
    enumBody = "{" { reserved | option | enumField | emptyStatement } "}"
3) Allow the value of field or enumValue option to be "{ ... }" other than constant:
    enumValueOption = optionName  "=" ( constant | customOptionValue ) ";"
    fieldOption = optionName  "=" ( constant | customOptionValue ) ";"
4) Allow 'group' section missing 'label' (for example, in 'oneof' section).
5) Make 'oneof' section support 'option' and 'group' sections (BNF):
    oneof = "oneof" oneofName "{" { oneofField | option | group | emptyStatement } "}"
6) Ignore unused 'extend' section.
7) Fix the bug of one string being splitted into multi-lines.

2. Update 'epan/protobuf_lang_tree.c' to:
8) Fix the bug of parsing repeated option.

3. Update 'test/suite_dissection.py' to add test case for parsing complex syntax .proto files:
  test/protobuf_lang_files/complex_proto_files/unittest_custom_options.proto
  test/protobuf_lang_files/complex_proto_files/complex_syntax.proto
and dependency files:
  test/protobuf_lang_files/well_know_types/google/protobuf/any.proto
  test/protobuf_lang_files/well_know_types/google/protobuf/descriptor.proto

Refer to issue #17046
2020-12-27 11:32:10 +00:00
..
baseline QT+epan: Set FI_BITS_OFFSET and FI_BITS_SIZE flags on [u]ints and bitmasks 2020-11-19 12:00:46 +00:00
captures Protobuf/gRPC: add test cases for Protobuf and gRPC 2020-12-01 12:06:43 +00:00
config dot11decrypt: Fix WEP decryption 2020-10-21 11:03:44 +00:00
keys
lua Lua: Add get_preference() and set_preference() utility functions. 2020-12-08 22:56:50 +00:00
protobuf_lang_files Protobuf: fix bugs that parsing complex syntax .proto files 2020-12-27 11:32:10 +00:00
suite_dfilter Tools+test: Call python3 explicitly. 2020-11-05 06:46:35 +00:00
suite_dissectors Tools+test: Call python3 explicitly. 2020-11-05 06:46:35 +00:00
README.test Qt: Add a packet diagram view. 2020-08-10 18:17:50 +00:00
conftest.py Tools+test: Call python3 explicitly. 2020-11-05 06:46:35 +00:00
fixtures.py Tools+test: Call python3 explicitly. 2020-11-05 06:46:35 +00:00
fixtures_ws.py Protobuf/gRPC: add test cases for Protobuf and gRPC 2020-12-01 12:06:43 +00:00
hosts.custom
hosts.global
hosts.personal
matchers.py Tools+test: Call python3 explicitly. 2020-11-05 06:46:35 +00:00
sampleif.py test: fix sampleif.py on weird systems using Python 3.6 and older 2019-04-16 03:28:43 +00:00
subprocesstest.py Tools+test: Call python3 explicitly. 2020-11-05 06:46:35 +00:00
suite_capture.py Tools+test: Call python3 explicitly. 2020-11-05 06:46:35 +00:00
suite_clopts.py Tools+test: Call python3 explicitly. 2020-11-05 06:46:35 +00:00
suite_decryption.py Avoid python deprecation warning 2020-11-21 18:58:21 +00:00
suite_dissection.py Protobuf: fix bugs that parsing complex syntax .proto files 2020-12-27 11:32:10 +00:00
suite_extcaps.py Tools+test: Call python3 explicitly. 2020-11-05 06:46:35 +00:00
suite_fileformats.py Tools+test: Call python3 explicitly. 2020-11-05 06:46:35 +00:00
suite_follow.py Tools+test: Call python3 explicitly. 2020-11-05 06:46:35 +00:00
suite_io.py Tools+test: Call python3 explicitly. 2020-11-05 06:46:35 +00:00
suite_mergecap.py Tools+test: Call python3 explicitly. 2020-11-05 06:46:35 +00:00
suite_nameres.py Tools+test: Call python3 explicitly. 2020-11-05 06:46:35 +00:00
suite_outputformats.py Tools+test: Call python3 explicitly. 2020-11-05 06:46:35 +00:00
suite_release.py Tools+test: Call python3 explicitly. 2020-11-05 06:46:35 +00:00
suite_sharkd.py Tools+test: Call python3 explicitly. 2020-11-05 06:46:35 +00:00
suite_text2pcap.py Tools+test: Call python3 explicitly. 2020-11-05 06:46:35 +00:00
suite_unittests.py Tools+test: Call python3 explicitly. 2020-11-05 06:46:35 +00:00
suite_wslua.py Lua: Add get_preference() and set_preference() utility functions. 2020-12-08 22:56:50 +00:00
test.py Tools+test: Call python3 explicitly. 2020-11-05 06:46:35 +00:00
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