aboutsummaryrefslogtreecommitdiffstats
path: root/test/suite-wslua.sh
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2016-12-20 09:44:16 +0100
committerStig Bjørlykke <stig@bjorlykke.org>2017-03-14 13:58:18 +0000
commitba49a8526c2caf68b95511aa2f5235276796cf5d (patch)
tree9f92106c4535e8c3ce16d52b09f1156dc3f407fa /test/suite-wslua.sh
parent20d7669bbe9ca84597a371dd605385f5b9c88154 (diff)
Lua: Add some ProtoField tests.
Test usage of base.UNIT_STRING. Change-Id: I9c97b58b3cc6db65713e83609900880e157237f2 Reviewed-on: https://code.wireshark.org/review/19357 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Diffstat (limited to 'test/suite-wslua.sh')
-rwxr-xr-xtest/suite-wslua.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/suite-wslua.sh b/test/suite-wslua.sh
index 8e7e22dcac..49803036eb 100755
--- a/test/suite-wslua.sh
+++ b/test/suite-wslua.sh
@@ -334,6 +334,30 @@ wslua_step_proto_test() {
fi
}
+wslua_step_protofield_test() {
+ if [ $HAVE_LUA -ne 0 ]; then
+ test_step_skipped
+ return
+ fi
+
+ # Tshark catches lua script failures, so we have to parse the output.
+ # perform this twice: once with a tree, once without
+ $TSHARK -r $CAPTURE_DIR/dns_port.pcap -X lua_script:$TESTS_DIR/lua/protofield.lua -V > testout.txt 2>&1
+ grep -q "All tests passed!" testout.txt
+ if [ $? -ne 0 ]; then
+ cat testout.txt
+ test_step_failed "lua_args_test test 1 failed"
+ fi
+
+ $TSHARK -r $CAPTURE_DIR/dns_port.pcap -X lua_script:$TESTS_DIR/lua/protofield.lua > 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
+}
+
wslua_step_int64_test() {
if [ $HAVE_LUA -ne 0 ]; then
test_step_skipped
@@ -481,6 +505,7 @@ wslua_suite() {
test_step_add "wslua nstime" wslua_step_nstime_test
test_step_add "wslua pinfo" wslua_step_pinfo_test
test_step_add "wslua proto/protofield" wslua_step_proto_test
+ test_step_add "wslua protofield" wslua_step_protofield_test
test_step_add "wslua script arguments" wslua_step_args_test
test_step_add "wslua struct" wslua_step_struct_test
test_step_add "wslua tvb" wslua_step_tvb_test