diff options
author | Rado Radoulov <rad0x6f@gmail.com> | 2017-04-27 13:06:24 -0400 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2017-05-05 08:38:40 +0000 |
commit | ae8b18d6183538a4ffd5d18588be1b5e1a058206 (patch) | |
tree | e9b30127d9dfa9ac55d87fc1eb0cf4edcba89ffc /test/suite-wslua.sh | |
parent | ce8863c6efcee54655b7856002430bd1716a7776 (diff) |
New Lua function TreeItem:referenced(ProtoField | Dissector).
This function returns TRUE/FALSE depending whether the specified ProtoField/Dissector
needs to be dissected. By using this function in conjunction with the TreeItem.visible
attribute, Lua dissectors can be significantly sped up by making less C interop calls
which are relatively slow in terms of dissection especially when using sub-protocols
where the dissection of an entire protocol can be skipped.
Added tests for TreeItem:referenced to protofield.lua
Change-Id: I44feacb91a2a5b0e3c28c0ccd8d6b04cccd67261
Reviewed-on: https://code.wireshark.org/review/21387
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'test/suite-wslua.sh')
-rwxr-xr-x | test/suite-wslua.sh | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/test/suite-wslua.sh b/test/suite-wslua.sh index c788a7d81c..20745f449a 100755 --- a/test/suite-wslua.sh +++ b/test/suite-wslua.sh @@ -340,14 +340,25 @@ wslua_step_protofield_test() { return fi - # Tshark catches lua script failures, so we have to parse the output. - $TSHARK -r $CAPTURE_DIR/dns_port.pcap -X lua_script:$TESTS_DIR/lua/protofield.lua -V > testout.txt 2>&1 - if grep -q "All tests passed!" testout.txt; then - test_step_ok - else - cat testout.txt - test_step_failed "didn't find pass marker" - fi + # Tshark catches lua script failures, so we have to parse the output. + # Perform this twice: once with a tree, once without + + # Pass 1 (visible tree) + $TSHARK -r $CAPTURE_DIR/dns_port.pcap -X lua_script:$TESTS_DIR/lua/protofield.lua -V -Y "test.filtered==1" > testout.txt 2>&1 + grep -q "All tests passed!" testout.txt + if [ $? -ne 0 ]; then + cat testout.txt + test_step_failed "protofield_test: didn't find pass marker (pass 1)" + fi + + # Pass 2 (invisible tree) + $TSHARK -r $CAPTURE_DIR/dns_port.pcap -X lua_script:$TESTS_DIR/lua/protofield.lua -Y "test.filtered==1" > testout.txt 2>&1 + if grep -q "All tests passed!" testout.txt; then + test_step_ok + else + cat testout.txt + test_step_failed "protofield_test: didn't find pass marker (pass 2)" + fi } wslua_step_int64_test() { |