diff options
author | Hadriel Kaplan <hadriel@128technology.com> | 2014-12-29 20:49:05 -0500 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2014-12-31 16:01:51 +0000 |
commit | f7b6dcc58ca52af222cd14404c56b741abe64738 (patch) | |
tree | 3bdb56d7abea70a3e1d14b45a5a79555ff8d448d /test/suite-wslua.sh | |
parent | 11212887a1d6b0ed21ed50b4c9b233aed4ab40c3 (diff) |
Lua: allow a Dissector object to be passed in for register_heuristic
Bug: 10695
Change-Id: I81181b2d00fcb5f0c25ab89bbe4968897f47a3a6
Reviewed-on: https://code.wireshark.org/review/6131
Petri-Dish: Hadriel Kaplan <hadrielk@yahoo.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'test/suite-wslua.sh')
-rwxr-xr-x | test/suite-wslua.sh | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/test/suite-wslua.sh b/test/suite-wslua.sh index 04e7a70ca3..9b18de4072 100755 --- a/test/suite-wslua.sh +++ b/test/suite-wslua.sh @@ -48,12 +48,50 @@ wslua_step_dissector_test() { if [ ! $RETURNVALUE -eq $EXIT_OK ]; then echo cat ./testin.txt - test_step_failed "exit status of $DUT: $RETURNVALUE" + test_step_failed "subtest-1 exit status of $DUT: $RETURNVALUE" return fi # then run tshark again with the verification script. (it internally reads in testin.txt) $TSHARK -r $CAPTURE_DIR/empty.pcap -X lua_script:$TESTS_DIR/lua/verify_dissector.lua > testout.txt 2>&1 + grep -q "All tests passed!" testout.txt + if [ $? -ne 0 ]; then + cat ./testin.txt + cat ./testout.txt + test_step_failed "subtest-1 didn't find pass marker" + fi + + # run tshark with the dissector script again, but in mode 2. + $TSHARK -r $CAPTURE_DIR/dns_port.pcap -V -X lua_script:$TESTS_DIR/lua/dissector.lua -X lua_script1:heur_regmode=2 > testin.txt 2>&1 + RETURNVALUE=$? + if [ ! $RETURNVALUE -eq $EXIT_OK ]; then + echo + cat ./testin.txt + test_step_failed "subtest-1 exit status of $DUT: $RETURNVALUE" + return + fi + + # then run tshark again with the verification script. (it internally reads in testin.txt) + $TSHARK -r $CAPTURE_DIR/empty.pcap -X lua_script:$TESTS_DIR/lua/verify_dissector.lua -X lua_script1:no_heur > testout.txt 2>&1 + grep -q "All tests passed!" testout.txt + if [ $? -ne 0 ]; then + cat ./testin.txt + cat ./testout.txt + test_step_failed "subtest-1 didn't find pass marker" + fi + + # run tshark with the dissector script again, but in mode 3. + $TSHARK -r $CAPTURE_DIR/dns_port.pcap -V -X lua_script:$TESTS_DIR/lua/dissector.lua -X lua_script1:heur_regmode=3 > testin.txt 2>&1 + RETURNVALUE=$? + if [ ! $RETURNVALUE -eq $EXIT_OK ]; then + echo + cat ./testin.txt + test_step_failed "subtest-1 exit status of $DUT: $RETURNVALUE" + return + fi + + # then run tshark again with the verification script. (it internally reads in testin.txt) + $TSHARK -r $CAPTURE_DIR/empty.pcap -X lua_script:$TESTS_DIR/lua/verify_dissector.lua -X lua_script1:no_heur > testout.txt 2>&1 if grep -q "All tests passed!" testout.txt; then test_step_ok else |