mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 22:58:20 +00:00

This commit adds script/c++ documentation and fixes a few loose ends. It also adds tests for corner cases and massively improves error messages. This also actually introduces type-compatibility checking and introduces a new attribute that lets a user override this if they really know what they are doing. I am not quite sure if we should really let that stay in - but it can be very convenient to have this functionality. One test is continuing to fail - the expiry test is very flaky. This is, I think, caused by delays of the broker store forwarding. I am unsure if we can actually do anything about that.
38 lines
739 B
Text
38 lines
739 B
Text
# @TEST-PORT: BROKER_PORT
|
|
|
|
# @TEST-EXEC: zeek -B broker -b one.zeek > output1
|
|
# @TEST-EXEC-FAIL: zeek -B broker -b two.zeek > output2
|
|
# @TEST-EXEC: btest-diff .stderr
|
|
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff .stderr
|
|
|
|
# the first test writes out the sqlite files...
|
|
|
|
@TEST-START-FILE one.zeek
|
|
|
|
module TestModule;
|
|
|
|
global t: table[string] of string &backend=Broker::SQLITE;
|
|
|
|
event zeek_init()
|
|
{
|
|
t["a"] = "a";
|
|
t["b"] = "b";
|
|
t["c"] = "c";
|
|
print t;
|
|
}
|
|
|
|
@TEST-END-FILE
|
|
@TEST-START-FILE two.zeek
|
|
|
|
# the second one reads them in again. Or not because the types are incompatible.
|
|
|
|
module TestModule;
|
|
|
|
global t: table[count] of count &backend=Broker::SQLITE;
|
|
|
|
|
|
event zeek_init()
|
|
{
|
|
print t;
|
|
}
|
|
@TEST-END-FILE
|