zeek/testing/btest/spicy/protocol-analyzer-tcp-over-udp.spicy
Benjamin Bannier 8049d3a002 Speed up Spicy-related tests.
This patch changes invocations of `spicyz` and similar Spicy tools in
tests which perform compilation to use debug mode via passing `-d`. This
in turn leads to Spicy compiling generated C++ code in debug as opposed
to release mode which typically seems to require less CPU time and RAM.
For a local test running with `btest -j 16` and no caching via
`HILTI_CXX_COMPILER_LAUNCER` this sped up running of BTests under
`spicy/` by about 40s on my machine (120s vs 160s).
2023-05-25 14:59:10 +02:00

28 lines
652 B
Text

# @TEST-REQUIRES: have-spicy
#
# @TEST-EXEC: spicyz -d -o test.hlto %INPUT ./foo.evt
# @TEST-EXEC: zeek -Cr ${TRACES}/ssh/ssh-over-udp.pcap test.hlto
# @TEST-EXEC: btest-diff ssh.log
#
# @TEST-DOC: Pass data from inside a UDP analyzer to a Zeek analyzers that works on top of TCP. Regression tests for #92 and also #91.
#
module Foo;
import spicy;
import zeek;
public type Bar = unit {
on %init { zeek::protocol_begin("SSH"); }
data: bytes &eod { zeek::protocol_data_in(zeek::is_orig(), $$); }
};
# @TEST-START-FILE foo.evt
import zeek;
protocol analyzer spicy::Foo over UDP:
parse with Foo::Bar,
port 1234/udp;
# @TEST-END-FILE