mirror of
https://github.com/zeek/zeek.git
synced 2025-10-06 16:48:19 +00:00

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).
33 lines
728 B
Text
33 lines
728 B
Text
# @TEST-REQUIRES: have-spicy
|
|
#
|
|
# @TEST-EXEC: spicyz -d -o test.hlto ssh.spicy ./ssh-cond.evt
|
|
# @TEST-EXEC: zeek -r ${TRACES}/ssh/single-conn.trace test.hlto %INPUT | sort >output
|
|
# @TEST-EXEC: btest-diff output
|
|
|
|
event ssh::banner(i: int, software: string)
|
|
{
|
|
print i, software;
|
|
}
|
|
|
|
# @TEST-START-FILE ssh.spicy
|
|
module SSH;
|
|
|
|
public type Banner = unit {
|
|
magic : /SSH-/;
|
|
version : /[^-]*/;
|
|
dash : /-/;
|
|
software: /[^\r\n]*/;
|
|
};
|
|
# @TEST-END-FILE
|
|
|
|
# @TEST-START-FILE ssh-cond.evt
|
|
|
|
protocol analyzer spicy::SSH over TCP:
|
|
parse with SSH::Banner,
|
|
port 22/tcp,
|
|
replaces SSH;
|
|
|
|
on SSH::Banner -> event ssh::banner(1, self.software);
|
|
on SSH::Banner -> event ssh::banner(2, self.software);
|
|
|
|
# @TEST-END-FILE
|