diff options
author | Hadriel Kaplan <hadrielk@yahoo.com> | 2015-01-25 14:30:13 -0500 |
---|---|---|
committer | Hadriel Kaplan <hadrielk@yahoo.com> | 2015-01-27 15:14:12 +0000 |
commit | ceb8d954d25211d5cb4766ece277c15aa53578d5 (patch) | |
tree | 859ad1b08e44c140728311e9ed60fd3444cd2054 /test/suite-wslua.sh | |
parent | 9bbc33730622e117d9edfa3f393da883624510f1 (diff) | |
download | wireshark-ceb8d954d25211d5cb4766ece277c15aa53578d5.tar.gz wireshark-ceb8d954d25211d5cb4766ece277c15aa53578d5.tar.bz2 wireshark-ceb8d954d25211d5cb4766ece277c15aa53578d5.zip |
Lua: Expose tcp_dissect_pdus() to Lua
Provide a way for Lua-based dissectors to invoke tcp_dissect_pdus()
to make TCP-based dissection easier.
Bug: 9851
Change-Id: I91630ebf1f1fc1964118b6750cc34238e18a8ad3
Reviewed-on: https://code.wireshark.org/review/6778
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Tested-by: Hadriel Kaplan <hadrielk@yahoo.com>
Diffstat (limited to 'test/suite-wslua.sh')
-rwxr-xr-x | test/suite-wslua.sh | 40 |
1 files changed, 35 insertions, 5 deletions
diff --git a/test/suite-wslua.sh b/test/suite-wslua.sh index 76a6bf3c3d..d45062427c 100755 --- a/test/suite-wslua.sh +++ b/test/suite-wslua.sh @@ -67,7 +67,7 @@ wslua_step_dissector_test() { if [ ! $RETURNVALUE -eq $EXIT_OK ]; then echo cat ./testin.txt - test_step_failed "subtest-1 exit status of $DUT: $RETURNVALUE" + test_step_failed "subtest-2 exit status of $DUT: $RETURNVALUE" return fi @@ -77,7 +77,7 @@ wslua_step_dissector_test() { if [ $? -ne 0 ]; then cat ./testin.txt cat ./testout.txt - test_step_failed "subtest-1 didn't find pass marker" + test_step_failed "subtest-2 didn't find pass marker" fi # run tshark with the dissector script again, but in mode 3. @@ -86,19 +86,49 @@ wslua_step_dissector_test() { if [ ! $RETURNVALUE -eq $EXIT_OK ]; then echo cat ./testin.txt - test_step_failed "subtest-1 exit status of $DUT: $RETURNVALUE" + test_step_failed "subtest-3 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 + grep -q "All tests passed!" testout.txt + if [ $? -ne 0 ]; then + cat ./testin.txt + cat ./testout.txt + test_step_failed "subtest-3 didn't find pass marker" + return + fi + + # then run tshark again with the verification script. (it internally reads in testin.txt) + $TSHARK -r $CAPTURE_DIR/segmented_fpm.pcap -X lua_script:$TESTS_DIR/lua/dissectFPM.lua -o fpm.dissect_tcp:true -V > testin.txt 2>&1 + RETURNVALUE=$? + if [ ! $RETURNVALUE -eq $EXIT_OK ]; then + echo + cat ./testin.txt + test_step_failed "subtest-4a exit status of $DUT: $RETURNVALUE" + return + fi + + $TSHARK -r $CAPTURE_DIR/segmented_fpm.pcap -X lua_script:$TESTS_DIR/lua/dissectFPM.lua -o fpm.dissect_tcp:false -V > testout.txt 2>&1 + RETURNVALUE=$? + if [ ! $RETURNVALUE -eq $EXIT_OK ]; then + echo + cat ./testout.txt + test_step_failed "subtest-4b exit status of $DUT: $RETURNVALUE" + return + fi + + # now compare the two files - they should be identical + if diff -q ./testin.txt ./testout.txt; then + rm ./testin.txt + rm ./testout.txt test_step_ok else echo cat ./testin.txt cat ./testout.txt - test_step_failed "didn't find pass marker" + test_step_failed "subtest-4 the new and old tcp dissection methods differed" fi } |