From: Jason Ish Date: Mon, 2 Jun 2025 22:42:58 +0000 (-0600) Subject: lua/streaming: update tests for changes to output streaming X-Git-Tag: suricata-7.0.11~46 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=10bc2aa15b7d598f299fd32524a6393eb8d381cb;p=thirdparty%2Fsuricata-verify.git lua/streaming: update tests for changes to output streaming Handle the stream data passed as arguments to the log function. --- diff --git a/tests/lua-output-streaming/streaming-http.lua b/tests/lua-output-streaming/streaming-http.lua index f105df39a..e998a7f8e 100644 --- a/tests/lua-output-streaming/streaming-http.lua +++ b/tests/lua-output-streaming/streaming-http.lua @@ -17,8 +17,8 @@ function log(args) f = flow.get() ts = f:timestring_legacy() ipver, srcip, dstip, proto, sp, dp = f:tuple() - data, data_open, data_close = SCStreamingBuffer() - logger.notice("called with data_open " .. tostring(data_open) .. " data_close " .. tostring(data_close)); + local stream = args["stream"] + logger.notice("called with data_open " .. tostring(stream["open"]) .. " data_close " .. tostring(stream["close"]) .. " to_server " .. tostring(stream["to_server"]) .. " to_client " .. tostring(stream["to_client"])); filename = filepath .. "/http-" .. proto .. "-" .. srcip .. "-" .. dstip .. "-" .. sp .. "-" .. dp file_mode = "a" @@ -27,7 +27,7 @@ function log(args) end file = assert(io.open(filename, file_mode)) - file:write (data) + file:write (stream["data"]) file:flush() file.close(file) end diff --git a/tests/lua-output-streaming/streaming-tcp.lua b/tests/lua-output-streaming/streaming-tcp.lua index 3cae85a0f..11ef65bac 100644 --- a/tests/lua-output-streaming/streaming-tcp.lua +++ b/tests/lua-output-streaming/streaming-tcp.lua @@ -17,16 +17,16 @@ function log(args) f = flow.get() ts = f:timestring_legacy() ipver, srcip, dstip, proto, sp, dp = f:tuple() - data, data_open, data_close = SCStreamingBuffer() + local stream = args["stream"] filename = filepath .. "/" .. proto .. "-" .. srcip .. "-" .. dstip .. "-" .. sp .. "-" .. dp file_mode = "a" - if (data_open == true) then + if (stream["open"] == true) then file_mode = "w" end file = assert(io.open(filename, file_mode)) - file:write (data) + file:write (stream["data"]) file:flush() file.close(file) end