Merge remote-tracking branch 'origin/topic/robin/gh-3083-export-fix'

* origin/topic/robin/gh-3083-export-fix:
  Register test analyzer only for required ports.
  Fix disappearing unit fields in Spicy type export.
This commit is contained in:
Robin Sommer 2023-05-30 14:59:00 +02:00
commit cfbb7eb8ee
No known key found for this signature in database
GPG key ID: D8187293B3FFE5D0
3 changed files with 35 additions and 1 deletions

View file

@ -0,0 +1,3 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
[x=71]
[x=72]

View file

@ -0,0 +1,31 @@
# @TEST-REQUIRES: have-spicy
#
# @TEST-EXEC: spicyz -do export.hlto export.spicy export.evt
# @TEST-EXEC: zeek -Cr $TRACES/http/pipelined-requests.trace export.hlto %INPUT >>output
# @TEST-EXEC: test '!' -e reporter.log
# @TEST-EXEC: btest-diff output
#
# @TEST-DOC: Test type export end-to-end, with access from the Zeek side. Regression test for #3083.
# @TEST-START-FILE export.spicy
module foo;
public type X = unit {
x: uint8;
};
# @TEST-END-FILE
# @TEST-START-FILE export.evt
import foo;
protocol analyzer FOO over TCP:
parse with foo::X,
port 80/tcp;
export foo::X;
on foo::X -> event foo::hello(self);
# @TEST-END-FILE
event foo::hello(x: foo::X)
{ print x; }