aboutsummaryrefslogtreecommitdiffstats
path: root/test/lua
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2018-04-30 15:17:39 -0700
committerGerald Combs <gerald@wireshark.org>2018-05-02 00:35:20 +0000
commit44537199a2cdd831f1d6ecab1231784c479b2bc8 (patch)
treeefe543572d3e865f5b6da7deb7e65cbfae7df72e /test/lua
parent74fd56901883d29a68cc2bcb65f2ba44007d4107 (diff)
Test: Add wslua.
Change-Id: I904796d13550c04df1958715d6528548385c3109 Reviewed-on: https://code.wireshark.org/review/27241 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'test/lua')
-rw-r--r--test/lua/verify_dissector.lua12
1 files changed, 9 insertions, 3 deletions
diff --git a/test/lua/verify_dissector.lua b/test/lua/verify_dissector.lua
index 3d613a8c28..28c3aa5ec0 100644
--- a/test/lua/verify_dissector.lua
+++ b/test/lua/verify_dissector.lua
@@ -2,7 +2,8 @@
-- This script runs inside tshark.
-- FIRST run tshark with the "dns_dissector.lua" plugin, with the dns_port.pcap file,
-- and with full tree output (-V switch). Pipe that to a file named testin.txt.
--- This verify script then reads in that testin.txt.
+-- This verify script then reads in that testin.txt. The filename can be specified
+-- using the "verify_file" argument.
--
-- tshark -r bogus.cap -X lua_script:<path_to_testdir>/lua/verify_dns_dissector.lua
@@ -138,12 +139,17 @@ local numtests = 1 + #lines[1] + #lines[2] + #lines[3] + #lines[4]
local hasHeuristic = true
+local verify_file = "testin.txt"
+
-- grab passed-in arguments
local args = { ... }
if #args > 0 then
for _, arg in ipairs(args) do
+ local name, value = arg:match("(.+)=(.+)")
if arg == "no_heur" then
numtests = numtests - 1
+ elseif name == "verify_file" and value then
+ verify_file = value
end
end
end
@@ -151,8 +157,8 @@ end
print("going to run "..numtests.." tests")
-- for an example of what we're reading through to verify, look at end of this file
-print("opening file testin.txt")
-local file = io.open("testin.txt", "r")
+print("opening file "..verify_file)
+local file = io.open(verify_file, "r")
local line = file:read()
local pktidx = 1