mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Merge remote-tracking branch 'origin/topic/awelzel/btest-no-bare-at-test'
* origin/topic/awelzel/btest-no-bare-at-test: pre-commit: Ensure testing files have @TEST lines commented testing/btest/*js: Comment all @TEST lines testing/btest/*test: Comment all @TEST lines testing/btest/*evt: Comment all @TEST lines testing/btest/*zeek: Comment all @TEST lines
This commit is contained in:
commit
0cb5ec735a
329 changed files with 1359 additions and 1340 deletions
|
@ -12,6 +12,12 @@ repos:
|
|||
types: [file]
|
||||
exclude: '^(testing/btest/(Baseline|plugins|spicy|scripts)/.*|testing/builtin-plugins/.*)$'
|
||||
|
||||
- id: btest-command-commented
|
||||
name: Check that all BTest command lines are commented out
|
||||
entry: '^\s*@TEST-'
|
||||
language: pygrep
|
||||
files: '^testing/btest/.*$'
|
||||
|
||||
- repo: https://github.com/pre-commit/mirrors-clang-format
|
||||
rev: v20.1.0
|
||||
hooks:
|
||||
|
|
12
CHANGES
12
CHANGES
|
@ -1,3 +1,15 @@
|
|||
7.2.0-dev.554 | 2025-04-17 16:56:34 +0200
|
||||
|
||||
* pre-commit: Ensure testing files have @TEST lines commented (Arne Welzel, Corelight)
|
||||
|
||||
* testing/btest/*js: Comment all @TEST lines (Arne Welzel, Corelight)
|
||||
|
||||
* testing/btest/*test: Comment all @TEST lines (Arne Welzel, Corelight)
|
||||
|
||||
* testing/btest/*evt: Comment all @TEST lines (Arne Welzel, Corelight)
|
||||
|
||||
* testing/btest/*zeek: Comment all @TEST lines (Arne Welzel, Corelight)
|
||||
|
||||
7.2.0-dev.548 | 2025-04-17 15:20:27 +0200
|
||||
|
||||
* Remove finish_run() (Jan Grashoefer, Corelight)
|
||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
7.2.0-dev.548
|
||||
7.2.0-dev.554
|
||||
|
|
|
@ -6,27 +6,27 @@ event zeek_init()
|
|||
print cat_sep();
|
||||
}
|
||||
|
||||
@TEST-START-NEXT
|
||||
# @TEST-START-NEXT
|
||||
event zeek_init()
|
||||
{
|
||||
print cat_sep("sep");
|
||||
}
|
||||
|
||||
@TEST-START-NEXT
|
||||
# @TEST-START-NEXT
|
||||
# bad types 1
|
||||
event zeek_init()
|
||||
{
|
||||
print cat_sep("sep", 1);
|
||||
}
|
||||
|
||||
@TEST-START-NEXT
|
||||
# @TEST-START-NEXT
|
||||
# bad types 2
|
||||
event zeek_init()
|
||||
{
|
||||
print cat_sep(1, "default");
|
||||
}
|
||||
|
||||
@TEST-START-NEXT
|
||||
# @TEST-START-NEXT
|
||||
event zeek_init()
|
||||
{
|
||||
print cat_sep([$a=1], "default");
|
||||
|
|
|
@ -15,8 +15,8 @@ for pcap in $(cd $TRACES/communityid && ls *.pcap); do
|
|||
btest-diff $pcap.out
|
||||
done
|
||||
|
||||
@TEST-START-FILE test-community-id-v1.zeek
|
||||
# @TEST-START-FILE test-community-id-v1.zeek
|
||||
event connection_state_remove(c: connection) {
|
||||
print c$id, community_id_v1(c$id);
|
||||
}
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -38,22 +38,22 @@ print "find_in_zeekpath pkg1.zeek", find_in_zeekpath("pkg1.zeek");
|
|||
print "find_in_zeekpath pkg2", find_in_zeekpath("pkg2");
|
||||
print "find_in_zeekpath pkg3", find_in_zeekpath("pkg3");
|
||||
|
||||
@TEST-START-FILE pkg1.zeek
|
||||
# @TEST-START-FILE pkg1.zeek
|
||||
event zeek_init()
|
||||
{
|
||||
print "pkg1!";
|
||||
}
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE pkg2/__load__.zeek
|
||||
# @TEST-START-FILE pkg2/__load__.zeek
|
||||
event zeek_init()
|
||||
{
|
||||
print "pkg2!";
|
||||
}
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE errors.zeek
|
||||
# @TEST-START-FILE errors.zeek
|
||||
# Using relative and absolute paths is an error (empty string)
|
||||
print "relative", find_in_zeekpath("./pkg1.zeek");
|
||||
print "absolute", find_in_zeekpath("/pkg1");
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -38,21 +38,21 @@ event zeek_init()
|
|||
print from_json(json, Foo);
|
||||
}
|
||||
|
||||
@TEST-START-NEXT
|
||||
# @TEST-START-NEXT
|
||||
# argument type mismatch
|
||||
event zeek_init()
|
||||
{
|
||||
print from_json("[]", 10);
|
||||
}
|
||||
|
||||
@TEST-START-NEXT
|
||||
# @TEST-START-NEXT
|
||||
# JSON parse error
|
||||
event zeek_init()
|
||||
{
|
||||
print from_json("{\"hel", string_vec);
|
||||
}
|
||||
|
||||
@TEST-START-NEXT
|
||||
# @TEST-START-NEXT
|
||||
type bool_t: bool;
|
||||
type Foo: record {
|
||||
a: bool;
|
||||
|
@ -65,14 +65,14 @@ event zeek_init()
|
|||
print from_json("{\"a\": \"hello\"}", Foo);
|
||||
}
|
||||
|
||||
@TEST-START-NEXT
|
||||
# @TEST-START-NEXT
|
||||
# type unsupport error
|
||||
event zeek_init()
|
||||
{
|
||||
print from_json("[]", table_string_of_string);
|
||||
}
|
||||
|
||||
@TEST-START-NEXT
|
||||
# @TEST-START-NEXT
|
||||
type port_t: port;
|
||||
# additional & incorrect port formats
|
||||
event zeek_init()
|
||||
|
@ -84,7 +84,7 @@ event zeek_init()
|
|||
print from_json("{}", port_t);
|
||||
}
|
||||
|
||||
@TEST-START-NEXT
|
||||
# @TEST-START-NEXT
|
||||
type set_t: set[int, bool];
|
||||
# index type doesn't match
|
||||
event zeek_init()
|
||||
|
@ -93,7 +93,7 @@ event zeek_init()
|
|||
print from_json("[[1, false], [2, 1]]", set_t);
|
||||
}
|
||||
|
||||
@TEST-START-NEXT
|
||||
# @TEST-START-NEXT
|
||||
type pattern_t: pattern;
|
||||
# pattern compile error
|
||||
event zeek_init()
|
||||
|
@ -101,7 +101,7 @@ event zeek_init()
|
|||
print from_json("\"/([[:print:]]{-}[[:alnum:]]foo)/\"", pattern_t);
|
||||
}
|
||||
|
||||
@TEST-START-NEXT
|
||||
# @TEST-START-NEXT
|
||||
type Color: enum {
|
||||
Red = 10
|
||||
};
|
||||
|
@ -111,7 +111,7 @@ event zeek_init()
|
|||
print from_json("\"Yellow\"", Color);
|
||||
}
|
||||
|
||||
@TEST-START-NEXT
|
||||
# @TEST-START-NEXT
|
||||
# container null
|
||||
event zeek_init()
|
||||
{
|
||||
|
@ -119,7 +119,7 @@ event zeek_init()
|
|||
print from_json("[\"1\",null,\"3\",\"4\"]", string_vec);
|
||||
}
|
||||
|
||||
@TEST-START-NEXT
|
||||
# @TEST-START-NEXT
|
||||
type Foo: record {
|
||||
hello: string;
|
||||
t: bool;
|
||||
|
@ -131,7 +131,7 @@ event zeek_init()
|
|||
print from_json("{\"hello\": null, \"t\": true}", Foo);
|
||||
}
|
||||
|
||||
@TEST-START-NEXT
|
||||
# @TEST-START-NEXT
|
||||
type Foo: record {
|
||||
hello: string;
|
||||
};
|
||||
|
@ -141,7 +141,7 @@ event zeek_init()
|
|||
print from_json("{\"hello\": \"Hello!\", \"t\": true}", Foo);
|
||||
}
|
||||
|
||||
@TEST-START-NEXT
|
||||
# @TEST-START-NEXT
|
||||
type Foo: record {
|
||||
id_field: string;
|
||||
};
|
||||
|
@ -154,7 +154,7 @@ event zeek_init()
|
|||
});
|
||||
}
|
||||
|
||||
@TEST-START-NEXT
|
||||
# @TEST-START-NEXT
|
||||
# From: https://www.rfc-editor.org/rfc/rfc8520#section-9
|
||||
global input:string = "{\"ietf-mud:mud\":{\"mud-version\":1,\"mud-url\":\"https://lighting.example.com/lightbulb2000\",\"last-update\":\"2019-01-28T11:20:51+01:00\",\"cache-validity\":48,\"is-supported\":true,\"systeminfo\":\"The BMS Example Light Bulb\",\"from-device-policy\":{\"access-lists\":{\"access-list\":[{\"name\":\"mud-76100-v6fr\"}]}},\"to-device-policy\":{\"access-lists\":{\"access-list\":[{\"name\":\"mud-76100-v6to\"}]}}},\"ietf-access-control-list:acls\":{\"acl\":[{\"name\":\"mud-76100-v6to\",\"type\":\"ipv6-acl-type\",\"aces\":{\"ace\":[{\"name\":\"cl0-todev\",\"matches\":{\"ipv6\":{\"ietf-acldns:src-dnsname\":\"test.example.com\",\"protocol\":6},\"tcp\":{\"ietf-mud:direction-initiated\":\"from-device\",\"source-port\":{\"operator\":\"eq\",\"port\":443}}},\"actions\":{\"forwarding\":\"accept\"}}]}},{\"name\":\"mud-76100-v6fr\",\"type\":\"ipv6-acl-type\",\"aces\":{\"ace\":[{\"name\":\"cl0-frdev\",\"matches\":{\"ipv6\":{\"ietf-acldns:dst-dnsname\":\"test.example.com\",\"protocol\":6},\"tcp\":{\"ietf-mud:direction-initiated\":\"from-device\",\"destination-port\":{\"operator\":\"eq\",\"port\":443}}},\"actions\":{\"forwarding\":\"accept\"}}]}}]}}";
|
||||
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
#
|
||||
# @TEST-EXEC: zeek -b -s mysig %INPUT
|
||||
|
||||
@TEST-START-FILE mysig.sig
|
||||
# @TEST-START-FILE mysig.sig
|
||||
signature my_ftp_client {
|
||||
ip-proto == tcp
|
||||
payload /(|.*[\n\r]) *[uU][sS][eE][rR] /
|
||||
tcp-state originator
|
||||
event "matched my_ftp_client"
|
||||
}
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
event zeek_init()
|
||||
{
|
||||
|
|
|
@ -14,13 +14,13 @@
|
|||
|
||||
@load base/frameworks/cluster
|
||||
|
||||
@TEST-START-FILE cluster-layout.zeek
|
||||
# @TEST-START-FILE cluster-layout.zeek
|
||||
redef Cluster::nodes = {
|
||||
["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT1"))],
|
||||
["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT2")), $manager="manager-1"],
|
||||
["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT3")), $manager="manager-1"],
|
||||
};
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
redef Log::default_rotation_interval = 0secs;
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
# @TEST-EXEC: zeek -b order_base | sort >out.2
|
||||
# @TEST-EXEC: cmp out.1 out.2
|
||||
|
||||
@TEST-START-FILE order_rand.zeek
|
||||
# @TEST-START-FILE order_rand.zeek
|
||||
|
||||
print unique_id("A-");
|
||||
print unique_id_from(5, "E-");
|
||||
|
@ -12,9 +12,9 @@ print unique_id_from(4, "D-");
|
|||
print unique_id("C-");
|
||||
print unique_id_from(5, "F-");
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE order_base.zeek
|
||||
# @TEST-START-FILE order_base.zeek
|
||||
|
||||
print unique_id("A-");
|
||||
print unique_id("B-");
|
||||
|
@ -23,5 +23,5 @@ print unique_id_from(4, "D-");
|
|||
print unique_id_from(5, "E-");
|
||||
print unique_id_from(5, "F-");
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
# @TEST-EXEC: btest-diff recv/recv.out
|
||||
# @TEST-EXEC: btest-diff send/send.out
|
||||
|
||||
@TEST-START-FILE send.zeek
|
||||
# @TEST-START-FILE send.zeek
|
||||
|
||||
# Using btest's environment settings for connect/listen retry of 1sec.
|
||||
redef exit_only_after_terminate = T;
|
||||
|
@ -47,10 +47,10 @@ event pong(msg: string, n: count)
|
|||
send_event();
|
||||
}
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
|
||||
@TEST-START-FILE recv.zeek
|
||||
# @TEST-START-FILE recv.zeek
|
||||
|
||||
redef exit_only_after_terminate = T;
|
||||
|
||||
|
@ -97,4 +97,4 @@ event ping(msg: string, n: count)
|
|||
Broker::publish("zeek/event/my_topic", pong, msg, n);
|
||||
}
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# @TEST-EXEC: btest-diff recv/recv.out
|
||||
# @TEST-EXEC: btest-diff recv2/recv2.out
|
||||
|
||||
@TEST-START-FILE send.zeek
|
||||
# @TEST-START-FILE send.zeek
|
||||
|
||||
redef exit_only_after_terminate = T;
|
||||
|
||||
|
@ -58,10 +58,10 @@ event Broker::endpoint_unreachable(endpoint: Broker::EndpointInfo, msg: string)
|
|||
terminate();
|
||||
}
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
|
||||
@TEST-START-FILE recv.zeek
|
||||
# @TEST-START-FILE recv.zeek
|
||||
|
||||
redef exit_only_after_terminate = T;
|
||||
|
||||
|
@ -99,4 +99,4 @@ event Broker::endpoint_unreachable(endpoint: Broker::EndpointInfo, msg: string)
|
|||
print "endpoint unreachable", msg;
|
||||
}
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
# @TEST-EXEC: btest-diff send.out
|
||||
#
|
||||
|
||||
@TEST-START-FILE send.zeek
|
||||
# @TEST-START-FILE send.zeek
|
||||
|
||||
redef exit_only_after_terminate = T;
|
||||
|
||||
|
@ -38,5 +38,5 @@ event zeek_init()
|
|||
}
|
||||
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
# @TEST-EXEC: btest-diff recv/recv.out
|
||||
# @TEST-EXEC: btest-diff send/send.out
|
||||
|
||||
@TEST-START-FILE send.zeek
|
||||
# @TEST-START-FILE send.zeek
|
||||
|
||||
global event_count = 0;
|
||||
|
||||
|
@ -61,10 +61,10 @@ event zeek_init()
|
|||
disable_module_events("TestDumpEvents");
|
||||
}
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
|
||||
@TEST-START-FILE recv.zeek
|
||||
# @TEST-START-FILE recv.zeek
|
||||
|
||||
redef exit_only_after_terminate = T;
|
||||
|
||||
|
@ -116,4 +116,4 @@ event zeek_init()
|
|||
disable_module_events("TestDumpEvents");
|
||||
}
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
# @TEST-EXEC: btest-diff recv/recv.out
|
||||
# @TEST-EXEC: btest-diff send/send.out
|
||||
|
||||
@TEST-START-FILE common.zeek
|
||||
# @TEST-START-FILE common.zeek
|
||||
type ResultTable: table[string] of count;
|
||||
type ResultSet : set[count];
|
||||
|
||||
|
@ -20,9 +20,9 @@ global pong: event(msg: string, t: ResultTable) &is_used;
|
|||
|
||||
global ping_set: event(msg: string, s: ResultSet) &is_used;
|
||||
global pong_set: event(msg: string, s: ResultSet) &is_used;
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE send.zeek
|
||||
# @TEST-START-FILE send.zeek
|
||||
@load ./common.zeek
|
||||
|
||||
redef exit_only_after_terminate = T;
|
||||
|
@ -72,10 +72,10 @@ event pong_set(msg: string, s: ResultSet)
|
|||
if ( event_count % 4 == 0 )
|
||||
send_events();
|
||||
}
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
|
||||
@TEST-START-FILE recv.zeek
|
||||
# @TEST-START-FILE recv.zeek
|
||||
@load ./common.zeek
|
||||
|
||||
redef exit_only_after_terminate = T;
|
||||
|
@ -118,4 +118,4 @@ event ping_set(msg: string, s: ResultSet)
|
|||
print "ping_set", msg, |s|;
|
||||
Broker::publish("zeek/event/my_topic", pong_set, msg, s);
|
||||
}
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# @TEST-EXEC: TEST_DIFF_CANONIFIER= btest-diff recv/.stdout
|
||||
# @TEST-EXEC: TEST_DIFF_CANONIFIER= btest-diff send/.stdout
|
||||
|
||||
@TEST-START-FILE send.zeek
|
||||
# @TEST-START-FILE send.zeek
|
||||
|
||||
global new_conn_added: event(c: connection) &is_used;
|
||||
global conn_removed: event(c: connection) &is_used;
|
||||
|
@ -81,10 +81,10 @@ event echo_from_python(what: string, c: connection) &is_used
|
|||
++events_from_python;
|
||||
print network_time(), "from_python", events_from_python, what, c$uid, c$id;
|
||||
}
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
|
||||
@TEST-START-FILE recv.py
|
||||
# @TEST-START-FILE recv.py
|
||||
"""
|
||||
Python script subscribing to TOPIC
|
||||
"""
|
||||
|
@ -134,4 +134,4 @@ with ( broker.Endpoint() as ep,
|
|||
|
||||
other_event = broker.zeek.Event("echo_from_python", my_event.name(), conn)
|
||||
ep.publish(broker_topic, other_event)
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
# @TEST-EXEC: btest-diff recv/recv.out
|
||||
# @TEST-EXEC: btest-diff send/send.out
|
||||
|
||||
@TEST-START-FILE send.zeek
|
||||
# @TEST-START-FILE send.zeek
|
||||
|
||||
redef exit_only_after_terminate = T;
|
||||
|
||||
|
@ -54,10 +54,10 @@ event pong(msg: string, n: count)
|
|||
send_event();
|
||||
}
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
|
||||
@TEST-START-FILE recv.zeek
|
||||
# @TEST-START-FILE recv.zeek
|
||||
|
||||
redef exit_only_after_terminate = T;
|
||||
|
||||
|
@ -104,4 +104,4 @@ event zeek_done()
|
|||
print get_broker_stats();
|
||||
}
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
# @TEST-EXEC: btest-diff recv/recv.out
|
||||
# @TEST-EXEC: btest-diff send/send.out
|
||||
|
||||
@TEST-START-FILE send.zeek
|
||||
# @TEST-START-FILE send.zeek
|
||||
|
||||
redef exit_only_after_terminate = T;
|
||||
|
||||
|
@ -57,10 +57,10 @@ event pong(msg: string, n: any)
|
|||
send_event();
|
||||
}
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
|
||||
@TEST-START-FILE recv.zeek
|
||||
# @TEST-START-FILE recv.zeek
|
||||
|
||||
redef exit_only_after_terminate = T;
|
||||
|
||||
|
@ -112,4 +112,4 @@ event zeek_done()
|
|||
print get_broker_stats();
|
||||
}
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
# @TEST-EXEC: btest-diff recv/recv.out
|
||||
# @TEST-EXEC: btest-diff send/send.out
|
||||
|
||||
@TEST-START-FILE send.zeek
|
||||
# @TEST-START-FILE send.zeek
|
||||
|
||||
redef exit_only_after_terminate = T;
|
||||
|
||||
|
@ -49,10 +49,10 @@ event pong(msg: string, n: count)
|
|||
send_event();
|
||||
}
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
|
||||
@TEST-START-FILE recv.zeek
|
||||
# @TEST-START-FILE recv.zeek
|
||||
|
||||
redef exit_only_after_terminate = T;
|
||||
|
||||
|
@ -95,4 +95,4 @@ event ping(msg: string, n: count)
|
|||
event pong(msg, n);
|
||||
}
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
# @TEST-EXEC: btest-bg-wait 45
|
||||
# @TEST-EXEC: btest-diff recv/recv.out
|
||||
|
||||
@TEST-START-FILE common.zeek
|
||||
# @TEST-START-FILE common.zeek
|
||||
redef exit_only_after_terminate = T;
|
||||
|
||||
type MyRecord: record {
|
||||
|
@ -52,9 +52,9 @@ global tablefunction: event(x: TableFunction);
|
|||
global tablepattern: event(x: TablePattern);
|
||||
|
||||
global done: event();
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE send.zeek
|
||||
# @TEST-START-FILE send.zeek
|
||||
@load ./common.zeek
|
||||
|
||||
event zeek_init()
|
||||
|
@ -81,9 +81,9 @@ event Broker::peer_added(endpoint: Broker::EndpointInfo, msg: string)
|
|||
|
||||
event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string)
|
||||
{ terminate(); }
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE recv.zeek
|
||||
# @TEST-START-FILE recv.zeek
|
||||
@load ./common.zeek
|
||||
|
||||
event set1(x: Set1)
|
||||
|
@ -123,4 +123,4 @@ event done()
|
|||
|
||||
event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string)
|
||||
{ terminate(); }
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
# @TEST-EXEC: btest-diff send/send.out
|
||||
|
||||
|
||||
@TEST-START-FILE cert.1.pem
|
||||
# @TEST-START-FILE cert.1.pem
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDOjCCAiICCQDz7oMOR7Wm7jANBgkqhkiG9w0BAQsFADBkMQswCQYDVQQGEwJV
|
||||
UzELMAkGA1UECAwCQ0ExETAPBgNVBAcMCEJlcmtlbGV5MSMwIQYDVQQKDBpBQ01F
|
||||
|
@ -33,9 +33,9 @@ NosoTmGCV0HecWN4l38ojnXd44aSktQIND9iCLus3S6++nFnX5DHGZiv6/SnSO/6
|
|||
+Op7nV0A6zKVcMOYQ0SGZPD8UQs5wDJgrR9LY29Ox5QBwu/5NqyvNSrMQaTop5vb
|
||||
wkMInaq5lLxEYQDSLBc=
|
||||
-----END CERTIFICATE-----
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE cert.2.pem
|
||||
# @TEST-START-FILE cert.2.pem
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDOjCCAiICCQDz7oMOR7Wm7TANBgkqhkiG9w0BAQsFADBkMQswCQYDVQQGEwJV
|
||||
UzELMAkGA1UECAwCQ0ExETAPBgNVBAcMCEJlcmtlbGV5MSMwIQYDVQQKDBpBQ01F
|
||||
|
@ -56,9 +56,9 @@ hJVdY6LXh27O0ZUllhQ/ig9c+dYFh6AHoZU7WjiNKIyWuyl4IAOkQ4IEdsBvst+l
|
|||
XZvT6+i8fWvkGv18iunm23Yu+8Zf08wTXnbqXvmMda5upAYLmwD0YKIVYC3ycihh
|
||||
mkYCYI6PVeH63a2/zxw=
|
||||
-----END CERTIFICATE-----
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE key.1.pem
|
||||
# @TEST-START-FILE key.1.pem
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIEogIBAAKCAQEAx6G3HAEEKm2QDXTncfOdlv51MxnMKbqzovM24fcgsTMJxTKI
|
||||
FvQLKihJ3bMqVegIf3CM+OTwIAnRIPtaXNgxu/hNPkJVeAoTcAg7pPhUlgeqajEw
|
||||
|
@ -86,9 +86,9 @@ Dwd/AoGAILn8pVC9dIFac2BDOFU5y9ZvMmZAvwRxh9vEWewNvkzg27vdYc+rCHNm
|
|||
I7H0S/RqfqVeo0ApE5PQ8Sll6RvxN/mbSQo9YeCDGQ1r1rNe4Vs12GAYXAbE4ipf
|
||||
BTdqMbieumB/zL97iK5baHUFEJ4VRtLQhh/SOXgew/BF8ccpilI=
|
||||
-----END RSA PRIVATE KEY-----
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE key.2.pem
|
||||
# @TEST-START-FILE key.2.pem
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIEpQIBAAKCAQEAxvXwL1vap4YxkZi6QPvkbzh2nrLuzYlEL8X9heoBdqyyVdP/
|
||||
g0gPz87RL9ViWhoYCUmhKlI2h5Nx2NhCpWxlxD4dZsaoD2Q+aZRpbuHXU8LrcQsc
|
||||
|
@ -116,9 +116,9 @@ K8ZK3KECgYEApNoI5Mr5tmtjq4sbZrgQq6cMlfkIj9gUubOzFCryUb6NaB38Xqkp
|
|||
2N3/jqdkR+5ZiKOYhsYj+Iy6U3jyqiEl9VySYTfEIfP/ky1CD0a8/EVC9HR4iG8J
|
||||
im6G7/osaSBYAZctryLqVJXObTelgEy/EFwW9jW8HVph/G+ljmHOmuQ=
|
||||
-----END RSA PRIVATE KEY-----
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE ca.pem
|
||||
# @TEST-START-FILE ca.pem
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDmzCCAoOgAwIBAgIJAPLZ3e3WR0LLMA0GCSqGSIb3DQEBCwUAMGQxCzAJBgNV
|
||||
BAYTAlVTMQswCQYDVQQIDAJDQTERMA8GA1UEBwwIQmVya2VsZXkxIzAhBgNVBAoM
|
||||
|
@ -141,9 +141,9 @@ WmElijr1Tzuzd59rWPqC/tVIsh42vQ+P6g8Y1PDmo8eTUFveZ+wcr/eEPW6IOMrg
|
|||
OW7tATcrgzNuXZ1umiuGgAPuIVqPfr9ssZHBqi9UOK9L/8MQrnOxecNUpPohcTFR
|
||||
vq+Zqu15QV9T4BVWKHv0
|
||||
-----END CERTIFICATE-----
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE send.zeek
|
||||
# @TEST-START-FILE send.zeek
|
||||
|
||||
redef exit_only_after_terminate = T;
|
||||
|
||||
|
@ -188,10 +188,10 @@ event pong(msg: string, n: count)
|
|||
send_event();
|
||||
}
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
|
||||
@TEST-START-FILE recv.zeek
|
||||
# @TEST-START-FILE recv.zeek
|
||||
|
||||
redef exit_only_after_terminate = T;
|
||||
|
||||
|
@ -241,4 +241,4 @@ event zeek_done()
|
|||
print get_broker_stats();
|
||||
}
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -43,7 +43,7 @@ event my_event(msg: string) &is_used
|
|||
}
|
||||
|
||||
|
||||
@TEST-START-FILE client.py
|
||||
# @TEST-START-FILE client.py
|
||||
"""
|
||||
Python script sending timestamped and non-timestamped event to TOPIC
|
||||
"""
|
||||
|
@ -91,4 +91,4 @@ with broker.Endpoint() as ep, \
|
|||
|
||||
ep.shutdown()
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
# @TEST-EXEC: btest-bg-wait 45
|
||||
# @TEST-EXEC: btest-diff recv/recv.out
|
||||
|
||||
@TEST-START-FILE send.zeek
|
||||
# @TEST-START-FILE send.zeek
|
||||
|
||||
redef exit_only_after_terminate = T;
|
||||
|
||||
|
@ -41,9 +41,9 @@ event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string)
|
|||
terminate();
|
||||
}
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE recv.zeek
|
||||
# @TEST-START-FILE recv.zeek
|
||||
|
||||
redef exit_only_after_terminate = T;
|
||||
|
||||
|
@ -104,4 +104,4 @@ event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string)
|
|||
terminate();
|
||||
}
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
# @TEST-EXEC: btest-bg-wait 45
|
||||
# @TEST-EXEC: btest-diff recv/recv.out
|
||||
|
||||
@TEST-START-FILE send.zeek
|
||||
# @TEST-START-FILE send.zeek
|
||||
|
||||
const test_var = "init" &redef;
|
||||
|
||||
|
@ -29,9 +29,9 @@ event Broker::peer_added(endpoint: Broker::EndpointInfo, msg: string)
|
|||
Broker::publish_id("zeek/ids/test", "test_var");
|
||||
}
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE recv.zeek
|
||||
# @TEST-START-FILE recv.zeek
|
||||
|
||||
const test_var = "init" &redef;
|
||||
|
||||
|
@ -65,4 +65,4 @@ event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string)
|
|||
terminate();
|
||||
}
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
# @TEST-EXEC: btest-diff send/send.out
|
||||
# @TEST-EXEC: btest-diff send/test.log
|
||||
|
||||
@TEST-START-FILE common.zeek
|
||||
# @TEST-START-FILE common.zeek
|
||||
|
||||
redef exit_only_after_terminate = T;
|
||||
|
||||
|
@ -37,9 +37,9 @@ event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string)
|
|||
terminate();
|
||||
}
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE recv.zeek
|
||||
# @TEST-START-FILE recv.zeek
|
||||
|
||||
|
||||
@load ./common
|
||||
|
@ -55,9 +55,9 @@ event Broker::peer_removed(endpoint: Broker::EndpointInfo, msg: string)
|
|||
terminate();
|
||||
}
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE send.zeek
|
||||
# @TEST-START-FILE send.zeek
|
||||
|
||||
|
||||
|
||||
|
@ -97,4 +97,4 @@ event Broker::peer_added(endpoint: Broker::EndpointInfo, msg: string)
|
|||
}
|
||||
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
# @TEST-EXEC: btest-diff send/send.out
|
||||
# @TEST-EXEC: btest-diff send/test.log
|
||||
|
||||
@TEST-START-FILE common.zeek
|
||||
# @TEST-START-FILE common.zeek
|
||||
|
||||
redef exit_only_after_terminate = T;
|
||||
|
||||
|
@ -42,9 +42,9 @@ event quit()
|
|||
terminate();
|
||||
}
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE recv.zeek
|
||||
# @TEST-START-FILE recv.zeek
|
||||
|
||||
|
||||
@load ./common
|
||||
|
@ -60,9 +60,9 @@ event Broker::peer_removed(endpoint: Broker::EndpointInfo, msg: string)
|
|||
terminate();
|
||||
}
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE send.zeek
|
||||
# @TEST-START-FILE send.zeek
|
||||
|
||||
@load ./common
|
||||
|
||||
|
@ -104,4 +104,4 @@ event Broker::log_flush()
|
|||
Broker::publish("zeek/quit", quit);
|
||||
}
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
# @TEST-EXEC: btest-diff send/send.out
|
||||
# @TEST-EXEC: btest-diff send/test.log
|
||||
|
||||
@TEST-START-FILE common.zeek
|
||||
# @TEST-START-FILE common.zeek
|
||||
|
||||
redef exit_only_after_terminate = T;
|
||||
|
||||
|
@ -37,9 +37,9 @@ event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string)
|
|||
terminate();
|
||||
}
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE recv.zeek
|
||||
# @TEST-START-FILE recv.zeek
|
||||
|
||||
|
||||
@load ./common
|
||||
|
@ -55,9 +55,9 @@ event Broker::peer_removed(endpoint: Broker::EndpointInfo, msg: string)
|
|||
terminate();
|
||||
}
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE send.zeek
|
||||
# @TEST-START-FILE send.zeek
|
||||
|
||||
|
||||
|
||||
|
@ -104,4 +104,4 @@ event Broker::peer_added(endpoint: Broker::EndpointInfo, msg: string)
|
|||
}
|
||||
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# @TEST-EXEC: cat recv/test.log | grep -v '#close' | grep -v '#open' >recv/test.log.filtered
|
||||
# @TEST-EXEC: diff -u send/test.log.filtered recv/test.log.filtered
|
||||
|
||||
@TEST-START-FILE common.zeek
|
||||
# @TEST-START-FILE common.zeek
|
||||
|
||||
redef exit_only_after_terminate = T;
|
||||
|
||||
|
@ -57,9 +57,9 @@ event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string)
|
|||
terminate();
|
||||
}
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE recv.zeek
|
||||
# @TEST-START-FILE recv.zeek
|
||||
|
||||
@load ./common
|
||||
|
||||
|
@ -74,9 +74,9 @@ event quit_receiver()
|
|||
terminate();
|
||||
}
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE send.zeek
|
||||
# @TEST-START-FILE send.zeek
|
||||
|
||||
@load ./common
|
||||
|
||||
|
@ -133,4 +133,4 @@ event Broker::log_flush()
|
|||
Broker::publish("zeek/", quit_receiver);
|
||||
}
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
# @TEST-EXEC: btest-bg-wait 45
|
||||
# @TEST-EXEC: btest-diff send/send.out
|
||||
|
||||
@TEST-START-FILE ca.pem
|
||||
# @TEST-START-FILE ca.pem
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDmzCCAoOgAwIBAgIJAPLZ3e3WR0LLMA0GCSqGSIb3DQEBCwUAMGQxCzAJBgNV
|
||||
BAYTAlVTMQswCQYDVQQIDAJDQTERMA8GA1UEBwwIQmVya2VsZXkxIzAhBgNVBAoM
|
||||
|
@ -39,10 +39,10 @@ WmElijr1Tzuzd59rWPqC/tVIsh42vQ+P6g8Y1PDmo8eTUFveZ+wcr/eEPW6IOMrg
|
|||
OW7tATcrgzNuXZ1umiuGgAPuIVqPfr9ssZHBqi9UOK9L/8MQrnOxecNUpPohcTFR
|
||||
vq+Zqu15QV9T4BVWKHv0
|
||||
-----END CERTIFICATE-----
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
|
||||
@TEST-START-FILE cert.1.pem
|
||||
# @TEST-START-FILE cert.1.pem
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDOjCCAiICCQDz7oMOR7Wm7jANBgkqhkiG9w0BAQsFADBkMQswCQYDVQQGEwJV
|
||||
UzELMAkGA1UECAwCQ0ExETAPBgNVBAcMCEJlcmtlbGV5MSMwIQYDVQQKDBpBQ01F
|
||||
|
@ -63,9 +63,9 @@ NosoTmGCV0HecWN4l38ojnXd44aSktQIND9iCLus3S6++nFnX5DHGZiv6/SnSO/6
|
|||
+Op7nV0A6zKVcMOYQ0SGZPD8UQs5wDJgrR9LY29Ox5QBwu/5NqyvNSrMQaTop5vb
|
||||
wkMInaq5lLxEYQDSLBc=
|
||||
-----END CERTIFICATE-----
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE key.1.pem
|
||||
# @TEST-START-FILE key.1.pem
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIEogIBAAKCAQEAx6G3HAEEKm2QDXTncfOdlv51MxnMKbqzovM24fcgsTMJxTKI
|
||||
FvQLKihJ3bMqVegIf3CM+OTwIAnRIPtaXNgxu/hNPkJVeAoTcAg7pPhUlgeqajEw
|
||||
|
@ -93,9 +93,9 @@ Dwd/AoGAILn8pVC9dIFac2BDOFU5y9ZvMmZAvwRxh9vEWewNvkzg27vdYc+rCHNm
|
|||
I7H0S/RqfqVeo0ApE5PQ8Sll6RvxN/mbSQo9YeCDGQ1r1rNe4Vs12GAYXAbE4ipf
|
||||
BTdqMbieumB/zL97iK5baHUFEJ4VRtLQhh/SOXgew/BF8ccpilI=
|
||||
-----END RSA PRIVATE KEY-----
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE send-check.zeek
|
||||
# @TEST-START-FILE send-check.zeek
|
||||
# This script just confirms the process running recv.zeek has listen()'d
|
||||
|
||||
event zeek_init()
|
||||
|
@ -108,9 +108,9 @@ event Broker::peer_added(endpoint: Broker::EndpointInfo, msg: string)
|
|||
terminate();
|
||||
}
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE send.zeek
|
||||
# @TEST-START-FILE send.zeek
|
||||
|
||||
# This is expected to generate the error condition and be unable to connect
|
||||
# do to SSL authentication failure.
|
||||
|
@ -143,9 +143,9 @@ event Broker::error(code: Broker::ErrorCode, msg: string)
|
|||
terminate();
|
||||
}
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE recv.zeek
|
||||
# @TEST-START-FILE recv.zeek
|
||||
|
||||
# No cert here.
|
||||
#
|
||||
|
@ -178,4 +178,4 @@ event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string)
|
|||
print fmt("receiver lost peer: endpoint=%s msg=%s", endpoint$network$address, msg);
|
||||
}
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
# @TEST-EXEC: btest-diff master.out
|
||||
# @TEST-EXEC: btest-diff clonetwo.out
|
||||
|
||||
@TEST-START-FILE common.zeek
|
||||
# @TEST-START-FILE common.zeek
|
||||
redef exit_only_after_terminate = T;
|
||||
|
||||
global tablestore: opaque of Broker::Store;
|
||||
|
@ -36,9 +36,9 @@ event dump_tables()
|
|||
|
||||
event do_terminate()
|
||||
{ terminate(); }
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE master.zeek
|
||||
# @TEST-START-FILE master.zeek
|
||||
|
||||
event zeek_init()
|
||||
{
|
||||
|
@ -84,9 +84,9 @@ event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string)
|
|||
if ( peers == 0 )
|
||||
terminate();
|
||||
}
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE cloneone.zeek
|
||||
# @TEST-START-FILE cloneone.zeek
|
||||
event zeek_init()
|
||||
{
|
||||
Broker::subscribe("cloneone");
|
||||
|
@ -120,9 +120,9 @@ event Broker::peer_added(endpoint: Broker::EndpointInfo, msg: string)
|
|||
setstore = Broker::create_clone("set");
|
||||
recordstore = Broker::create_clone("rec");
|
||||
}
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE clonetwo.zeek
|
||||
# @TEST-START-FILE clonetwo.zeek
|
||||
event zeek_init()
|
||||
{
|
||||
Broker::subscribe("clonetwo");
|
||||
|
@ -147,4 +147,4 @@ event Broker::peer_added(endpoint: Broker::EndpointInfo, msg: string)
|
|||
setstore = Broker::create_clone("set");
|
||||
recordstore = Broker::create_clone("rec");
|
||||
}
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
#
|
||||
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-sort btest-diff clone.out
|
||||
|
||||
@TEST-START-FILE common.zeek
|
||||
# @TEST-START-FILE common.zeek
|
||||
redef exit_only_after_terminate = T;
|
||||
redef table_expire_interval = 0.5sec;
|
||||
|
||||
|
@ -49,9 +49,9 @@ function change_r(tbl: any, tpe: TableChange, idx: string, idxb: testrec)
|
|||
global t: table[string] of count &broker_store="table" &create_expire=4sec &on_change=change_t;
|
||||
global s: table[string] of count &broker_store="set" &write_expire=3sec &on_change=change_s;
|
||||
global r: table[string] of testrec &broker_allow_complex_type &broker_store="rec" &write_expire=5sec &on_change=change_r;
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE master.zeek
|
||||
# @TEST-START-FILE master.zeek
|
||||
event zeek_init()
|
||||
{
|
||||
Broker::listen("127.0.0.1", to_port(getenv("BROKER_PORT")));
|
||||
|
@ -97,9 +97,9 @@ event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string)
|
|||
print "Terminating";
|
||||
terminate();
|
||||
}
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE clone.zeek
|
||||
# @TEST-START-FILE clone.zeek
|
||||
|
||||
event zeek_init()
|
||||
{
|
||||
|
@ -139,4 +139,4 @@ event Broker::peer_added(endpoint: Broker::EndpointInfo, msg: string)
|
|||
recordstore = Broker::create_clone("rec");
|
||||
schedule 0.1sec { check_all_set() };
|
||||
}
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
# @TEST-EXEC: diff output1 output2
|
||||
# @TEST-EXEC: diff output2 output3
|
||||
|
||||
@TEST-START-FILE common.zeek
|
||||
# @TEST-START-FILE common.zeek
|
||||
global tablestore: opaque of Broker::Store;
|
||||
global setstore: opaque of Broker::Store;
|
||||
global recordstore: opaque of Broker::Store;
|
||||
|
@ -29,11 +29,11 @@ type testrec: record {
|
|||
global t: table[string] of count &broker_store="table";
|
||||
global s: set[string] &broker_store="set";
|
||||
global r: table[string] of testrec &broker_allow_complex_type &broker_store="rec";
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
# the first test writes out the sqlite files...
|
||||
|
||||
@TEST-START-FILE one.zeek
|
||||
# @TEST-START-FILE one.zeek
|
||||
redef exit_only_after_terminate = T;
|
||||
|
||||
event zeek_init()
|
||||
|
@ -58,8 +58,8 @@ event zeek_init()
|
|||
terminate();
|
||||
}
|
||||
|
||||
@TEST-END-FILE
|
||||
@TEST-START-FILE two.zeek
|
||||
# @TEST-END-FILE
|
||||
# @TEST-START-FILE two.zeek
|
||||
redef exit_only_after_terminate = T;
|
||||
|
||||
# read in again - and serve to clones
|
||||
|
@ -80,9 +80,9 @@ event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string)
|
|||
terminate();
|
||||
}
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE three.zeek
|
||||
# @TEST-START-FILE three.zeek
|
||||
redef exit_only_after_terminate = T;
|
||||
|
||||
# get copy from master
|
||||
|
@ -117,4 +117,4 @@ event Broker::peer_added(endpoint: Broker::EndpointInfo, msg: string)
|
|||
}
|
||||
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
# the first test writes out the sqlite files...
|
||||
|
||||
@TEST-START-FILE common.zeek
|
||||
# @TEST-START-FILE common.zeek
|
||||
global tablestore: opaque of Broker::Store;
|
||||
global setstore: opaque of Broker::Store;
|
||||
global recordstore: opaque of Broker::Store;
|
||||
|
@ -20,9 +20,9 @@ type testrec: record {
|
|||
global t: table[string] of count &broker_store="table";
|
||||
global s: set[string] &broker_store="set";
|
||||
global r: table[string] of testrec &broker_allow_complex_type &broker_store="rec";
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE one.zeek
|
||||
# @TEST-START-FILE one.zeek
|
||||
|
||||
event zeek_init()
|
||||
{
|
||||
|
@ -45,8 +45,8 @@ event zeek_init()
|
|||
print sort_table(r);
|
||||
}
|
||||
|
||||
@TEST-END-FILE
|
||||
@TEST-START-FILE two.zeek
|
||||
# @TEST-END-FILE
|
||||
# @TEST-START-FILE two.zeek
|
||||
|
||||
# the second one reads them in again
|
||||
|
||||
|
@ -59,4 +59,4 @@ event zeek_init()
|
|||
print sort_set(s);
|
||||
print sort_table(r);
|
||||
}
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
# @TEST-EXEC: btest-diff clone.out
|
||||
|
||||
@TEST-START-FILE common.zeek
|
||||
# @TEST-START-FILE common.zeek
|
||||
redef exit_only_after_terminate = T;
|
||||
|
||||
global tablestore: opaque of Broker::Store;
|
||||
|
@ -22,9 +22,9 @@ type testrec: record {
|
|||
global t: table[string] of count &broker_store="table";
|
||||
global s: set[string, string] &broker_store="set";
|
||||
global r: table[string] of testrec &broker_allow_complex_type &broker_store="rec";
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE master.zeek
|
||||
# @TEST-START-FILE master.zeek
|
||||
event zeek_init()
|
||||
{
|
||||
tablestore = Broker::create_master("table");
|
||||
|
@ -64,9 +64,9 @@ event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string)
|
|||
terminate();
|
||||
}
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE clone.zeek
|
||||
# @TEST-START-FILE clone.zeek
|
||||
event zeek_init()
|
||||
{
|
||||
Broker::peer("127.0.0.1", to_port(getenv("BROKER_PORT")));
|
||||
|
@ -96,4 +96,4 @@ event Broker::peer_added(endpoint: Broker::EndpointInfo, msg: string)
|
|||
recordstore = Broker::create_clone("rec");
|
||||
schedule 0.1sec { check_all_set() };
|
||||
}
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -11,12 +11,12 @@
|
|||
|
||||
@load policy/frameworks/cluster/experimental
|
||||
|
||||
@TEST-START-FILE cluster-layout.zeek
|
||||
# @TEST-START-FILE cluster-layout.zeek
|
||||
redef Cluster::nodes = {
|
||||
["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT1"))],
|
||||
["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT2")), $manager="manager-1"],
|
||||
};
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
function change_handler(t: table[string, count] of count, tpe: TableChange,
|
||||
k0: string, k1: count, v: count)
|
||||
|
|
|
@ -10,16 +10,16 @@
|
|||
# @TEST-EXEC: TEST_DIFF_CANONIFIER="$SCRIPTS/diff-sort" btest-diff worker-1/err.log
|
||||
# @TEST-EXEC: TEST_DIFF_CANONIFIER="$SCRIPTS/diff-sort" btest-diff worker-2/err.log
|
||||
|
||||
@TEST-START-FILE cluster-layout.zeek
|
||||
# @TEST-START-FILE cluster-layout.zeek
|
||||
redef Cluster::nodes = {
|
||||
["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT1"))],
|
||||
["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT2")), $manager="manager-1"],
|
||||
["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT3")), $manager="manager-1"],
|
||||
};
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
|
||||
@TEST-START-FILE master.zeek
|
||||
# @TEST-START-FILE master.zeek
|
||||
@load base/frameworks/cluster
|
||||
redef exit_only_after_terminate = T;
|
||||
|
||||
|
@ -52,9 +52,9 @@ event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string)
|
|||
terminate();
|
||||
}
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE clone.zeek
|
||||
# @TEST-START-FILE clone.zeek
|
||||
@load base/frameworks/cluster
|
||||
@load base/frameworks/reporter
|
||||
redef exit_only_after_terminate = T;
|
||||
|
@ -78,4 +78,4 @@ event reporter_error(t: time, msg: string, location: string)
|
|||
if ( errors == 2 )
|
||||
terminate();
|
||||
}
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -12,15 +12,15 @@
|
|||
# @TEST-EXEC: diff master.out clone.out
|
||||
# @TEST-EXEC: diff master.out clone2.out
|
||||
|
||||
@TEST-START-FILE cluster-layout.zeek
|
||||
# @TEST-START-FILE cluster-layout.zeek
|
||||
redef Cluster::nodes = {
|
||||
["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT1"))],
|
||||
["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT2")), $manager="manager-1"],
|
||||
["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT3")), $manager="manager-1"],
|
||||
};
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE common.zeek
|
||||
# @TEST-START-FILE common.zeek
|
||||
@load base/frameworks/cluster
|
||||
|
||||
redef exit_only_after_terminate = T;
|
||||
|
@ -47,9 +47,9 @@ function all_stores_set(): bool
|
|||
{
|
||||
return "whatever" in t && "hi" in s && "b" in r;
|
||||
}
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE master.zeek
|
||||
# @TEST-START-FILE master.zeek
|
||||
|
||||
event Broker::peer_added(endpoint: Broker::EndpointInfo, msg: string) &priority=1
|
||||
{
|
||||
|
@ -66,9 +66,9 @@ event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string)
|
|||
terminate();
|
||||
}
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE clone.zeek
|
||||
# @TEST-START-FILE clone.zeek
|
||||
|
||||
global has_node_up: bool = F;
|
||||
global has_announce_masters: bool = F;
|
||||
|
@ -115,9 +115,9 @@ event Broker::announce_masters(masters: set[string])
|
|||
if ( has_node_up )
|
||||
event dump_tables();
|
||||
}
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE clone2.zeek
|
||||
# @TEST-START-FILE clone2.zeek
|
||||
event dump_tables()
|
||||
{
|
||||
print sort_table(t);
|
||||
|
@ -145,5 +145,5 @@ event Cluster::node_up(name: string, id: string)
|
|||
Reporter::info(fmt("Node Up: %s", name));
|
||||
schedule 0.1sec { check_all_set() };
|
||||
}
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
|
|
|
@ -12,15 +12,15 @@
|
|||
# @TEST-EXEC: diff master.out clone.out
|
||||
# @TEST-EXEC: diff master.out clone2.out
|
||||
|
||||
@TEST-START-FILE cluster-layout.zeek
|
||||
# @TEST-START-FILE cluster-layout.zeek
|
||||
redef Cluster::nodes = {
|
||||
["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT1"))],
|
||||
["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT2")), $manager="manager-1"],
|
||||
["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT3")), $manager="manager-1"],
|
||||
};
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE common.zeek
|
||||
# @TEST-START-FILE common.zeek
|
||||
@load base/frameworks/cluster
|
||||
@load base/frameworks/broker
|
||||
|
||||
|
@ -38,9 +38,9 @@ global t: table[string] of count &backend=Broker::MEMORY;
|
|||
global s: set[string] &backend=Broker::MEMORY;
|
||||
global r: table[string] of testrec &broker_allow_complex_type &backend=Broker::MEMORY;
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE master.zeek
|
||||
# @TEST-START-FILE master.zeek
|
||||
event zeek_init()
|
||||
{
|
||||
t["a"] = 5;
|
||||
|
@ -69,9 +69,9 @@ event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string)
|
|||
terminate();
|
||||
}
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE clone.zeek
|
||||
# @TEST-START-FILE clone.zeek
|
||||
|
||||
event dump_tables()
|
||||
{
|
||||
|
@ -94,4 +94,4 @@ event Cluster::node_up(name: string, id: string)
|
|||
{
|
||||
schedule 0.1sec { check_all_set() };
|
||||
}
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
# the first test writes out the sqlite files...
|
||||
|
||||
@TEST-START-FILE one.zeek
|
||||
# @TEST-START-FILE one.zeek
|
||||
|
||||
module TestModule;
|
||||
|
||||
|
@ -21,8 +21,8 @@ event zeek_init()
|
|||
print t;
|
||||
}
|
||||
|
||||
@TEST-END-FILE
|
||||
@TEST-START-FILE two.zeek
|
||||
# @TEST-END-FILE
|
||||
# @TEST-START-FILE two.zeek
|
||||
|
||||
# the second one reads them in again. Or not because the types are incompatible.
|
||||
|
||||
|
@ -35,4 +35,4 @@ event zeek_init()
|
|||
{
|
||||
print t;
|
||||
}
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -13,23 +13,23 @@
|
|||
# @TEST-EXEC: diff master.out clone.out
|
||||
# @TEST-EXEC: diff master.out clone2.out
|
||||
|
||||
@TEST-START-FILE cluster-layout.zeek
|
||||
# @TEST-START-FILE cluster-layout.zeek
|
||||
redef Cluster::nodes = {
|
||||
["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT1"))],
|
||||
["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT2")), $manager="manager-1"],
|
||||
["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT3")), $manager="manager-1"],
|
||||
};
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE common.zeek
|
||||
# @TEST-START-FILE common.zeek
|
||||
type testrec: record {
|
||||
a: count;
|
||||
b: string;
|
||||
c: set[string];
|
||||
};
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE preseed-sqlite.zeek
|
||||
# @TEST-START-FILE preseed-sqlite.zeek
|
||||
global t: table[string] of count &backend=Broker::SQLITE;
|
||||
global s: set[string] &backend=Broker::SQLITE;
|
||||
global r: table[string] of testrec &broker_allow_complex_type &backend=Broker::SQLITE;
|
||||
|
@ -59,9 +59,9 @@ event zeek_init()
|
|||
print rt;
|
||||
}
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE master.zeek
|
||||
# @TEST-START-FILE master.zeek
|
||||
@load base/frameworks/cluster
|
||||
|
||||
redef exit_only_after_terminate = T;
|
||||
|
@ -98,9 +98,9 @@ event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string)
|
|||
terminate();
|
||||
}
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE clone.zeek
|
||||
# @TEST-START-FILE clone.zeek
|
||||
@load base/frameworks/cluster
|
||||
|
||||
redef exit_only_after_terminate = T;
|
||||
|
@ -140,4 +140,4 @@ event Cluster::node_up(name: string, id: string)
|
|||
{
|
||||
schedule 0.1sec { check_all_set() };
|
||||
}
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
# @TEST-EXEC: btest-diff clone/clone.out
|
||||
# @TEST-EXEC: btest-diff master/master.out
|
||||
|
||||
@TEST-START-FILE master-main.zeek
|
||||
# @TEST-START-FILE master-main.zeek
|
||||
|
||||
redef exit_only_after_terminate = T;
|
||||
global query_timeout = 1sec;
|
||||
|
@ -72,10 +72,10 @@ event Broker::peer_added(endpoint: Broker::EndpointInfo, msg: string)
|
|||
schedule 4secs { insert_more() };
|
||||
}
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
|
||||
@TEST-START-FILE clone-main.zeek
|
||||
# @TEST-START-FILE clone-main.zeek
|
||||
|
||||
redef exit_only_after_terminate = T;
|
||||
|
||||
|
@ -145,4 +145,4 @@ event Broker::peer_added(endpoint: Broker::EndpointInfo, msg: string)
|
|||
schedule 2secs { lookup(1) };
|
||||
}
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# @TEST-EXEC: btest-diff recv/broker.filtered.log
|
||||
# @TEST-EXEC: btest-diff send/broker.filtered.log
|
||||
|
||||
@TEST-START-FILE send.zeek
|
||||
# @TEST-START-FILE send.zeek
|
||||
|
||||
redef exit_only_after_terminate = T;
|
||||
|
||||
|
@ -51,10 +51,10 @@ event Broker::peer_added(endpoint: Broker::EndpointInfo, msg: string)
|
|||
}
|
||||
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
|
||||
@TEST-START-FILE recv.zeek
|
||||
# @TEST-START-FILE recv.zeek
|
||||
|
||||
redef exit_only_after_terminate = T;
|
||||
|
||||
|
@ -76,4 +76,4 @@ event zeek_init()
|
|||
}
|
||||
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -61,7 +61,7 @@ event pong(msg: string, n: count) &is_used
|
|||
}
|
||||
|
||||
|
||||
@TEST-START-FILE client.py
|
||||
# @TEST-START-FILE client.py
|
||||
import asyncio, datetime, websockets, os, time, json, sys
|
||||
|
||||
ws_port = os.environ['BROKER_PORT'].split('/')[0]
|
||||
|
@ -149,4 +149,4 @@ async def do_run():
|
|||
loop = asyncio.get_event_loop()
|
||||
loop.run_until_complete(do_run())
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -52,7 +52,7 @@ event pong(msg: string, n: count) &is_used
|
|||
}
|
||||
|
||||
|
||||
@TEST-START-FILE client.py
|
||||
# @TEST-START-FILE client.py
|
||||
import asyncio, websockets, os, time, json, sys
|
||||
|
||||
ws_port = os.environ['BROKER_PORT'].split('/')[0]
|
||||
|
@ -125,4 +125,4 @@ async def do_run():
|
|||
loop = asyncio.get_event_loop()
|
||||
loop.run_until_complete(do_run())
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
# @TEST-EXEC: btest-diff recv/recv.out
|
||||
# @TEST-EXEC: btest-diff send/send.out
|
||||
|
||||
@TEST-START-FILE send.zeek
|
||||
# @TEST-START-FILE send.zeek
|
||||
|
||||
redef Cluster::backend = Cluster::CLUSTER_BACKEND_BROKER;
|
||||
redef exit_only_after_terminate = T;
|
||||
|
@ -56,10 +56,10 @@ event pong(msg: string, n: count)
|
|||
send_event();
|
||||
}
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
|
||||
@TEST-START-FILE recv.zeek
|
||||
# @TEST-START-FILE recv.zeek
|
||||
|
||||
redef Cluster::backend = Cluster::CLUSTER_BACKEND_BROKER;
|
||||
redef exit_only_after_terminate = T;
|
||||
|
@ -103,4 +103,4 @@ event ping(msg: string, n: count)
|
|||
|
||||
Cluster::publish("zeek/event/my_topic", pong, msg, n);
|
||||
}
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -12,22 +12,22 @@
|
|||
# @TEST-EXEC: btest-diff ./manager/.stdout
|
||||
# @TEST-EXEC: btest-diff ./worker-1/.stdout
|
||||
|
||||
@TEST-START-FILE cluster-layout.zeek
|
||||
# @TEST-START-FILE cluster-layout.zeek
|
||||
redef Cluster::nodes = {
|
||||
["manager"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT1"))],
|
||||
["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT2")), $manager="manager"],
|
||||
};
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
# @TEST-START-FILE common.zeek
|
||||
# # @TEST-START-FILE common.zeek
|
||||
redef Log::default_rotation_interval = 0sec;
|
||||
|
||||
global finish: event() &is_used;
|
||||
global ping: event(c: count, what: string, val: any) &is_used;
|
||||
global pong: event(c: count, what: string, val: any) &is_used;
|
||||
# @TEST-END-FILE
|
||||
# # @TEST-END-FILE
|
||||
|
||||
# @TEST-START-FILE manager.zeek
|
||||
# # @TEST-START-FILE manager.zeek
|
||||
@load ./common.zeek
|
||||
|
||||
global i = 0;
|
||||
|
@ -81,10 +81,10 @@ event Cluster::node_down(name: string, id: string)
|
|||
{
|
||||
terminate();
|
||||
}
|
||||
# @TEST-END-FILE
|
||||
# # @TEST-END-FILE
|
||||
|
||||
|
||||
# @TEST-START-FILE worker.zeek
|
||||
# # @TEST-START-FILE worker.zeek
|
||||
@load ./common.zeek
|
||||
|
||||
event ping(c: count, what: string, val: any)
|
||||
|
@ -104,4 +104,4 @@ event finish()
|
|||
print "got finish!";
|
||||
terminate();
|
||||
}
|
||||
# @TEST-END-FILE
|
||||
# # @TEST-END-FILE
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
# @TEST-EXEC: sort -n rr2.log > rr2.log.sorted
|
||||
# @TEST-EXEC: btest-diff rr2.log.sorted
|
||||
|
||||
# @TEST-START-FILE common.zeek
|
||||
# # @TEST-START-FILE common.zeek
|
||||
@load ./zeromq-test-bootstrap.zeek
|
||||
|
||||
redef Log::default_rotation_interval = 0sec;
|
||||
|
@ -62,9 +62,9 @@ event finish()
|
|||
{
|
||||
terminate();
|
||||
}
|
||||
# @TEST-END-FILE
|
||||
# # @TEST-END-FILE
|
||||
|
||||
# @TEST-START-FILE manager.zeek
|
||||
# # @TEST-START-FILE manager.zeek
|
||||
@load ./common.zeek
|
||||
|
||||
event check_ready()
|
||||
|
@ -103,10 +103,10 @@ event Cluster::node_down(name: string, id: string)
|
|||
if ( |nodes_down| == 4 ) # both loggers down
|
||||
terminate();
|
||||
}
|
||||
# @TEST-END-FILE
|
||||
# # @TEST-END-FILE
|
||||
|
||||
|
||||
# @TEST-START-FILE worker.zeek
|
||||
# # @TEST-START-FILE worker.zeek
|
||||
@load ./common.zeek
|
||||
|
||||
global do_write2 = F;
|
||||
|
@ -147,9 +147,9 @@ event zeek_init()
|
|||
event write_log1(0);
|
||||
}
|
||||
|
||||
# @TEST-END-FILE
|
||||
# # @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE check-log.sh
|
||||
# @TEST-START-FILE check-log.sh
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# This script regularly checks for the loggers rr1.log file until
|
||||
|
@ -174,4 +174,4 @@ done
|
|||
echo "DONE"
|
||||
echo "DONE" > DONE
|
||||
exit 0
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
# @TEST-EXEC: btest-diff ./client/out
|
||||
# @TEST-EXEC: btest-diff ./client/.stderr
|
||||
|
||||
# @TEST-START-FILE manager.zeek
|
||||
# # @TEST-START-FILE manager.zeek
|
||||
@load ./zeromq-test-bootstrap
|
||||
redef exit_only_after_terminate = T;
|
||||
|
||||
|
@ -55,10 +55,10 @@ event Cluster::websocket_client_lost(info: Cluster::EndpointInfo)
|
|||
print "Cluster::websocket_client_lost";
|
||||
terminate();
|
||||
}
|
||||
# @TEST-END-FILE
|
||||
# # @TEST-END-FILE
|
||||
|
||||
|
||||
@TEST-START-FILE client.py
|
||||
# @TEST-START-FILE client.py
|
||||
import json, os, time
|
||||
from websockets.sync.client import connect
|
||||
|
||||
|
@ -123,4 +123,4 @@ def main():
|
|||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
# @TEST-EXEC: btest-diff ./client/out
|
||||
# @TEST-EXEC: btest-diff ./client/.stderr
|
||||
|
||||
# @TEST-START-FILE manager.zeek
|
||||
# # @TEST-START-FILE manager.zeek
|
||||
@load ./zeromq-test-bootstrap
|
||||
redef exit_only_after_terminate = T;
|
||||
|
||||
|
@ -56,10 +56,10 @@ event Cluster::websocket_client_lost(info: Cluster::EndpointInfo)
|
|||
if ( lost == 4 )
|
||||
terminate();
|
||||
}
|
||||
# @TEST-END-FILE
|
||||
# # @TEST-END-FILE
|
||||
|
||||
|
||||
@TEST-START-FILE client.py
|
||||
# @TEST-START-FILE client.py
|
||||
import json, os, time
|
||||
from websockets.sync.client import connect
|
||||
|
||||
|
@ -99,4 +99,4 @@ def main():
|
|||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
# @TEST-EXEC: btest-diff ./client/out
|
||||
# @TEST-EXEC: btest-diff ./client/.stderr
|
||||
|
||||
# @TEST-START-FILE manager.zeek
|
||||
# # @TEST-START-FILE manager.zeek
|
||||
@load ./zeromq-test-bootstrap
|
||||
redef exit_only_after_terminate = T;
|
||||
|
||||
|
@ -58,10 +58,10 @@ event Cluster::websocket_client_lost(info: Cluster::EndpointInfo)
|
|||
print "Cluster::websocket_client_lost";
|
||||
terminate();
|
||||
}
|
||||
# @TEST-END-FILE
|
||||
# # @TEST-END-FILE
|
||||
|
||||
|
||||
@TEST-START-FILE client.py
|
||||
# @TEST-START-FILE client.py
|
||||
import json, os, time
|
||||
import websockets.exceptions
|
||||
from websockets.sync.client import connect
|
||||
|
@ -98,4 +98,4 @@ def main():
|
|||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
# @TEST-EXEC: btest-diff ./client/out
|
||||
# @TEST-EXEC: btest-diff ./client/.stderr
|
||||
|
||||
# @TEST-START-FILE manager.zeek
|
||||
# # @TEST-START-FILE manager.zeek
|
||||
@load ./zeromq-test-bootstrap
|
||||
redef exit_only_after_terminate = T;
|
||||
|
||||
|
@ -70,10 +70,10 @@ event Cluster::websocket_client_lost(info: Cluster::EndpointInfo)
|
|||
if ( lost == 3 )
|
||||
terminate();
|
||||
}
|
||||
# @TEST-END-FILE
|
||||
# # @TEST-END-FILE
|
||||
|
||||
|
||||
@TEST-START-FILE client.py
|
||||
# @TEST-START-FILE client.py
|
||||
import json, os, time
|
||||
from websockets.sync.client import connect
|
||||
|
||||
|
@ -108,4 +108,4 @@ def main():
|
|||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
# @TEST-EXEC: btest-diff ./client/out
|
||||
# @TEST-EXEC: btest-diff ./client/.stderr
|
||||
|
||||
# @TEST-START-FILE manager.zeek
|
||||
# # @TEST-START-FILE manager.zeek
|
||||
@load ./zeromq-test-bootstrap
|
||||
redef exit_only_after_terminate = T;
|
||||
|
||||
|
@ -58,10 +58,10 @@ event Cluster::websocket_client_lost(info: Cluster::EndpointInfo)
|
|||
print "Cluster::websocket_client_lost";
|
||||
terminate();
|
||||
}
|
||||
# @TEST-END-FILE
|
||||
# # @TEST-END-FILE
|
||||
|
||||
|
||||
@TEST-START-FILE client.py
|
||||
# @TEST-START-FILE client.py
|
||||
import json, os, time
|
||||
from websockets.sync.client import connect
|
||||
|
||||
|
@ -120,4 +120,4 @@ def main():
|
|||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
# @TEST-EXEC: btest-diff ./client/out
|
||||
# @TEST-EXEC: btest-diff ./client/.stderr
|
||||
|
||||
# @TEST-START-FILE manager.zeek
|
||||
# # @TEST-START-FILE manager.zeek
|
||||
@load ./zeromq-test-bootstrap
|
||||
redef exit_only_after_terminate = T;
|
||||
|
||||
|
@ -58,10 +58,10 @@ event Cluster::websocket_client_lost(info: Cluster::EndpointInfo)
|
|||
print "Cluster::websocket_client_lost";
|
||||
terminate();
|
||||
}
|
||||
# @TEST-END-FILE
|
||||
# # @TEST-END-FILE
|
||||
|
||||
|
||||
@TEST-START-FILE client.py
|
||||
# @TEST-START-FILE client.py
|
||||
import json, os, time
|
||||
from websockets.sync.client import connect
|
||||
|
||||
|
@ -117,4 +117,4 @@ def main():
|
|||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
# @TEST-EXEC: btest-diff ./client/out
|
||||
# @TEST-EXEC: btest-diff ./client/.stderr
|
||||
|
||||
# @TEST-START-FILE manager.zeek
|
||||
# # @TEST-START-FILE manager.zeek
|
||||
@load ./zeromq-test-bootstrap
|
||||
redef exit_only_after_terminate = T;
|
||||
|
||||
|
@ -74,10 +74,10 @@ event zeek_init()
|
|||
Cluster::listen_websocket([$listen_host="127.0.0.1", $listen_port=to_port(getenv("WEBSOCKET_PORT"))]);
|
||||
Cluster::subscribe("/test/manager");
|
||||
}
|
||||
# @TEST-END-FILE
|
||||
# # @TEST-END-FILE
|
||||
|
||||
|
||||
@TEST-START-FILE client.py
|
||||
# @TEST-START-FILE client.py
|
||||
import json, os, time
|
||||
from websockets.sync.client import connect
|
||||
|
||||
|
@ -146,4 +146,4 @@ def main():
|
|||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
# @TEST-EXEC: btest-diff ./client/out
|
||||
# @TEST-EXEC: btest-diff ./client/.stderr
|
||||
|
||||
# @TEST-START-FILE manager.zeek
|
||||
# # @TEST-START-FILE manager.zeek
|
||||
@load ./zeromq-test-bootstrap
|
||||
redef exit_only_after_terminate = T;
|
||||
|
||||
|
@ -72,10 +72,10 @@ event Cluster::websocket_client_lost(info: Cluster::EndpointInfo)
|
|||
print "Cluster::websocket_client_lost";
|
||||
terminate();
|
||||
}
|
||||
# @TEST-END-FILE
|
||||
# # @TEST-END-FILE
|
||||
|
||||
|
||||
@TEST-START-FILE client.py
|
||||
# @TEST-START-FILE client.py
|
||||
import asyncio, json, os, socket, time
|
||||
from websockets.asyncio.client import connect
|
||||
|
||||
|
@ -135,17 +135,17 @@ def main():
|
|||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
# The cert and key were generated with OpenSSL using the following command,
|
||||
# taken from https://letsencrypt.org/docs/certificates-for-localhost/
|
||||
#
|
||||
# The test will generate the script, but the certificate is valid
|
||||
# for 10 years.
|
||||
@TEST-START-FILE gen-localhost-certs.sh
|
||||
# @TEST-START-FILE gen-localhost-certs.sh
|
||||
#!/usr/bin/env bash
|
||||
openssl req -x509 -out localhost.crt -keyout localhost.key \
|
||||
-newkey rsa:2048 -nodes -sha256 -days 3650 \
|
||||
-subj '/CN=localhost' -extensions EXT -config <( \
|
||||
printf "[dn]\nCN=localhost\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:localhost\nbasicConstraints=CA:TRUE")
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
# @TEST-EXEC: btest-diff ./client/out
|
||||
# @TEST-EXEC: btest-diff ./client/.stderr
|
||||
|
||||
# @TEST-START-FILE manager.zeek
|
||||
# # @TEST-START-FILE manager.zeek
|
||||
@load ./zeromq-test-bootstrap
|
||||
redef exit_only_after_terminate = T;
|
||||
|
||||
|
@ -106,10 +106,10 @@ event zeek_init()
|
|||
Cluster::listen_websocket([$listen_host="127.0.0.1", $listen_port=to_port(getenv("WEBSOCKET_PORT"))]);
|
||||
Cluster::subscribe("/test/manager");
|
||||
}
|
||||
# @TEST-END-FILE
|
||||
# # @TEST-END-FILE
|
||||
|
||||
|
||||
@TEST-START-FILE client.py
|
||||
# @TEST-START-FILE client.py
|
||||
import json, os, time
|
||||
from websockets.sync.client import connect
|
||||
|
||||
|
@ -176,4 +176,4 @@ def main():
|
|||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -25,15 +25,15 @@
|
|||
# @TEST-EXEC: btest-diff ./client/out
|
||||
# @TEST-EXEC: btest-diff ./client/.stderr
|
||||
|
||||
@TEST-START-FILE common.zeek
|
||||
# @TEST-START-FILE common.zeek
|
||||
@load ./zeromq-test-bootstrap
|
||||
|
||||
global ping: event(msg: string, c: count) &is_used;
|
||||
global pong: event(msg: string, c: count) &is_used;
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
# @TEST-START-FILE manager.zeek
|
||||
# # @TEST-START-FILE manager.zeek
|
||||
@load ./common.zeek
|
||||
|
||||
redef Log::enable_local_logging = T;
|
||||
|
@ -84,9 +84,9 @@ event Cluster::websocket_client_lost(info: Cluster::EndpointInfo)
|
|||
if ( lost == 3 )
|
||||
terminate();
|
||||
}
|
||||
# @TEST-END-FILE
|
||||
# # @TEST-END-FILE
|
||||
|
||||
# @TEST-START-FILE worker.zeek
|
||||
# # @TEST-START-FILE worker.zeek
|
||||
@load ./common.zeek
|
||||
|
||||
event zeek_init()
|
||||
|
@ -109,10 +109,10 @@ event ping(msg: string, n: count)
|
|||
{
|
||||
print fmt("got ping: %s, %s", msg, n);
|
||||
}
|
||||
# @TEST-END-FILE
|
||||
# # @TEST-END-FILE
|
||||
|
||||
|
||||
@TEST-START-FILE client.py
|
||||
# @TEST-START-FILE client.py
|
||||
import json, os, time
|
||||
from websockets.sync.client import connect
|
||||
|
||||
|
@ -175,4 +175,4 @@ def main():
|
|||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -59,7 +59,7 @@ event zeek_init() {
|
|||
tbl[k] = k;
|
||||
}
|
||||
|
||||
@TEST-START-FILE 1.seeds
|
||||
# @TEST-START-FILE 1.seeds
|
||||
3569182667
|
||||
3864322632
|
||||
2737717875
|
||||
|
@ -81,9 +81,9 @@ event zeek_init() {
|
|||
3834222442
|
||||
2355333979
|
||||
113403102
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE 2.seeds
|
||||
# @TEST-START-FILE 2.seeds
|
||||
4013930712
|
||||
1835775324
|
||||
3393047106
|
||||
|
@ -105,4 +105,4 @@ event zeek_init() {
|
|||
348858887
|
||||
14638654
|
||||
4267481449
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -18,7 +18,7 @@ event new_connection(c: connection) {
|
|||
recent_conns[c$id] = c$uid;
|
||||
}
|
||||
|
||||
@TEST-START-FILE 1.seeds
|
||||
# @TEST-START-FILE 1.seeds
|
||||
3569182667
|
||||
3864322632
|
||||
2737717875
|
||||
|
@ -40,9 +40,9 @@ event new_connection(c: connection) {
|
|||
3834222442
|
||||
2355333979
|
||||
113403102
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE 2.seeds
|
||||
# @TEST-START-FILE 2.seeds
|
||||
4013930712
|
||||
1835775324
|
||||
3393047106
|
||||
|
@ -64,4 +64,4 @@ event new_connection(c: connection) {
|
|||
348858887
|
||||
14638654
|
||||
4267481449
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
# @TEST-EXEC: zeek -b -C -r $TRACES/icmp/icmp-destunreach-udp.pcap discarder-icmp.zeek >>output
|
||||
# @TEST-EXEC: btest-diff output
|
||||
|
||||
@TEST-START-FILE discarder-ip.zeek
|
||||
# @TEST-START-FILE discarder-ip.zeek
|
||||
|
||||
event zeek_init()
|
||||
{
|
||||
|
@ -24,9 +24,9 @@ event new_packet(c: connection, p: pkt_hdr)
|
|||
print c$id;
|
||||
}
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE discarder-tcp.zeek
|
||||
# @TEST-START-FILE discarder-tcp.zeek
|
||||
|
||||
event zeek_init()
|
||||
{
|
||||
|
@ -46,9 +46,9 @@ event new_packet(c: connection, p: pkt_hdr)
|
|||
print c$id;
|
||||
}
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE discarder-udp.zeek
|
||||
# @TEST-START-FILE discarder-udp.zeek
|
||||
|
||||
event zeek_init()
|
||||
{
|
||||
|
@ -68,9 +68,9 @@ event new_packet(c: connection, p: pkt_hdr)
|
|||
print c$id;
|
||||
}
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE discarder-icmp.zeek
|
||||
# @TEST-START-FILE discarder-icmp.zeek
|
||||
|
||||
event zeek_init()
|
||||
{
|
||||
|
@ -89,4 +89,4 @@ event new_packet(c: connection, p: pkt_hdr)
|
|||
print c$id;
|
||||
}
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -7,21 +7,21 @@ event zeek_init()
|
|||
print "enable non existing event group", r;
|
||||
}
|
||||
|
||||
@TEST-START-NEXT
|
||||
# @TEST-START-NEXT
|
||||
event zeek_init()
|
||||
{
|
||||
local r = disable_event_group("my-group");
|
||||
print "disable non existing event group", r;
|
||||
}
|
||||
|
||||
@TEST-START-NEXT
|
||||
# @TEST-START-NEXT
|
||||
event zeek_init()
|
||||
{
|
||||
local r = enable_module_events("MyModule");
|
||||
print "enabling non existing module event group", r;
|
||||
}
|
||||
|
||||
@TEST-START-NEXT
|
||||
# @TEST-START-NEXT
|
||||
event zeek_init()
|
||||
{
|
||||
local r = disable_module_events("MyModule");
|
||||
|
|
|
@ -33,6 +33,6 @@ event zeek_init()
|
|||
|
||||
# This file triggers a binpac exception for PE that is reported through
|
||||
# analyzer_violation_info
|
||||
@TEST-START-FILE ./myfile.exe
|
||||
# @TEST-START-FILE ./myfile.exe
|
||||
MZ0000000000000000000000000000000000000000000000000000000000000
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -28,31 +28,31 @@
|
|||
# @TEST-EXEC-FAIL: zeek -b load_foo
|
||||
# @TEST-EXEC: rm foo.xyz
|
||||
|
||||
@TEST-START-FILE load_foo
|
||||
# @TEST-START-FILE load_foo
|
||||
@load foo
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE load_foo_xyz
|
||||
# @TEST-START-FILE load_foo_xyz
|
||||
@load foo.xyz
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
|
||||
@TEST-START-FILE x/foo.zeek
|
||||
# @TEST-START-FILE x/foo.zeek
|
||||
print "Zeek script loaded";
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE x/foo.xyz
|
||||
# @TEST-START-FILE x/foo.xyz
|
||||
print "Non-standard file extension script loaded";
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE x/foo/__load__.zeek
|
||||
# @TEST-START-FILE x/foo/__load__.zeek
|
||||
@load ./main
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE x/foo/main.zeek
|
||||
# @TEST-START-FILE x/foo/main.zeek
|
||||
print "Script package loaded";
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE x2/foo
|
||||
# @TEST-START-FILE x2/foo
|
||||
print "No file extension script loaded";
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -8,11 +8,11 @@
|
|||
# @TEST-EXEC: rm foo/__load__.zeek
|
||||
# @TEST-EXEC-FAIL: zeek -b foo
|
||||
|
||||
@TEST-START-FILE foo/__load__.zeek
|
||||
# @TEST-START-FILE foo/__load__.zeek
|
||||
@load ./test
|
||||
print "__load__.zeek loaded";
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE foo/test.zeek
|
||||
# @TEST-START-FILE foo/test.zeek
|
||||
print "test.zeek loaded";
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -3,22 +3,22 @@
|
|||
# @TEST-EXEC: zeek -b base/utils/site base/protocols/http addprefixes >output
|
||||
# @TEST-EXEC: btest-diff output
|
||||
|
||||
@TEST-START-FILE addprefixes.zeek
|
||||
# @TEST-START-FILE addprefixes.zeek
|
||||
@prefixes += lcl
|
||||
@prefixes += lcl2
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
# Since base/utils/site.zeek is a script, only a script with the original file
|
||||
# extension can be loaded here.
|
||||
@TEST-START-FILE lcl.base.utils.site.zeek
|
||||
# @TEST-START-FILE lcl.base.utils.site.zeek
|
||||
print "loaded lcl.base.utils.site.zeek";
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE lcl2.base.utils.site.zeek
|
||||
# @TEST-START-FILE lcl2.base.utils.site.zeek
|
||||
print "loaded lcl2.base.utils.site.zeek";
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
# For a script package like base/protocols/http/, verify the package can be loaded.
|
||||
@TEST-START-FILE lcl.base.protocols.http.zeek
|
||||
# @TEST-START-FILE lcl.base.protocols.http.zeek
|
||||
print "loaded lcl.base.protocols.http.zeek";
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -3,16 +3,16 @@
|
|||
# @TEST-EXEC: zeek -b foo/foo >output
|
||||
# @TEST-EXEC: btest-diff output
|
||||
|
||||
@TEST-START-FILE foo/foo.zeek
|
||||
# @TEST-START-FILE foo/foo.zeek
|
||||
@load ./bar
|
||||
@load ../baz
|
||||
print "foo loaded";
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE foo/bar.zeek
|
||||
# @TEST-START-FILE foo/bar.zeek
|
||||
print "bar loaded";
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE baz.zeek
|
||||
# @TEST-START-FILE baz.zeek
|
||||
print "baz loaded";
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -4,15 +4,15 @@
|
|||
# @TEST-EXEC: btest-diff output
|
||||
# @TEST-EXEC: grep dontloadme loaded_scripts.log && exit 1 || exit 0
|
||||
|
||||
@TEST-START-FILE unload.zeek
|
||||
# @TEST-START-FILE unload.zeek
|
||||
@unload dontloadme
|
||||
@unload pkg-dontloadme
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE dontloadme.zeek
|
||||
# @TEST-START-FILE dontloadme.zeek
|
||||
print "Loaded: dontloadme.zeek";
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE pkg-dontloadme/__load__.zeek
|
||||
# @TEST-START-FILE pkg-dontloadme/__load__.zeek
|
||||
print "Loaded: pkg-dontloadme/__load__.zeek";
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff worker/.stdout
|
||||
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff manager/.stdout
|
||||
|
||||
@TEST-START-FILE worker.zeek
|
||||
# @TEST-START-FILE worker.zeek
|
||||
|
||||
redef allow_network_time_forward = F;
|
||||
|
||||
|
@ -65,10 +65,10 @@ event zeek_done()
|
|||
{
|
||||
print network_time(), "zeek_done";
|
||||
}
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
|
||||
@TEST-START-FILE manager.zeek
|
||||
# @TEST-START-FILE manager.zeek
|
||||
# The manager waits for a peer to appear, then starts sending timer
|
||||
# ticks until the peer is gone again.
|
||||
global timer_tick: event(ts: time);
|
||||
|
@ -100,4 +100,4 @@ event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string)
|
|||
print "manager: peer lost, terminating";
|
||||
terminate();
|
||||
}
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -3,11 +3,11 @@
|
|||
|
||||
option testbool;
|
||||
|
||||
@TEST-START-NEXT
|
||||
# @TEST-START-NEXT
|
||||
|
||||
option testbool : bool;
|
||||
|
||||
@TEST-START-NEXT
|
||||
# @TEST-START-NEXT
|
||||
|
||||
option testopt = 5;
|
||||
testopt = 6;
|
||||
|
|
|
@ -8,17 +8,17 @@
|
|||
option A = 5;
|
||||
Option::set("B", 6);
|
||||
|
||||
@TEST-START-NEXT
|
||||
# @TEST-START-NEXT
|
||||
|
||||
option A = 5;
|
||||
Option::set("A", "hi");
|
||||
|
||||
@TEST-START-NEXT
|
||||
# @TEST-START-NEXT
|
||||
|
||||
const A = 5;
|
||||
Option::set("A", 6);
|
||||
|
||||
@TEST-START-NEXT:
|
||||
# @TEST-START-NEXT:
|
||||
|
||||
option A = 5;
|
||||
|
||||
|
@ -27,7 +27,7 @@ function option_changed(ID: string, new_value: bool): bool {
|
|||
|
||||
Option::set_change_handler("A", option_changed);
|
||||
|
||||
@TEST-START-NEXT:
|
||||
# @TEST-START-NEXT:
|
||||
|
||||
option A = 5;
|
||||
|
||||
|
@ -36,7 +36,7 @@ function option_changed(ID: string): bool {
|
|||
|
||||
Option::set_change_handler("A", option_changed);
|
||||
|
||||
@TEST-START-NEXT:
|
||||
# @TEST-START-NEXT:
|
||||
|
||||
option A : count = 5;
|
||||
|
||||
|
@ -45,7 +45,7 @@ function option_changed(ID: string, new_value: count): bool {
|
|||
|
||||
Option::set_change_handler("A", option_changed);
|
||||
|
||||
@TEST-START-NEXT:
|
||||
# @TEST-START-NEXT:
|
||||
|
||||
option A : count = 5;
|
||||
|
||||
|
@ -54,7 +54,7 @@ hook option_changed(ID: string, new_value: count) {
|
|||
|
||||
Option::set_change_handler("A", option_changed);
|
||||
|
||||
@TEST-START-NEXT:
|
||||
# @TEST-START-NEXT:
|
||||
|
||||
option A : count = 5;
|
||||
|
||||
|
@ -63,7 +63,7 @@ event option_changed(ID: string, new_value: count) {
|
|||
|
||||
Option::set_change_handler("A", option_changed);
|
||||
|
||||
@TEST-START-NEXT:
|
||||
# @TEST-START-NEXT:
|
||||
|
||||
function option_changed(ID: string, new_value: count) : count {
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ function option_changed(ID: string, new_value: count) : count {
|
|||
Option::set_change_handler("A", option_changed);
|
||||
|
||||
|
||||
@TEST-START-NEXT:
|
||||
# @TEST-START-NEXT:
|
||||
|
||||
const A : count = 5;
|
||||
|
||||
|
@ -80,13 +80,13 @@ function option_changed(ID: string, new_value: count) : count {
|
|||
|
||||
Option::set_change_handler("A", option_changed);
|
||||
|
||||
@TEST-START-NEXT:
|
||||
# @TEST-START-NEXT:
|
||||
|
||||
option A : count = 5;
|
||||
|
||||
Option::set_change_handler("A", A);
|
||||
|
||||
@TEST-START-NEXT:
|
||||
# @TEST-START-NEXT:
|
||||
|
||||
option A : count = 5;
|
||||
|
||||
|
@ -95,7 +95,7 @@ function option_changed(ID: string, new_value: count, location: count) : count {
|
|||
|
||||
Option::set_change_handler("A", option_changed);
|
||||
|
||||
@TEST-START-NEXT:
|
||||
# @TEST-START-NEXT:
|
||||
|
||||
option A : count = 5;
|
||||
|
||||
|
|
|
@ -6,10 +6,10 @@
|
|||
# @TEST-EXEC-FAIL: zeek -b -a test.zeek >invalid-sig-file 2>&1
|
||||
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff invalid-sig-file
|
||||
|
||||
@TEST-START-FILE test.zeek
|
||||
# @TEST-START-FILE test.zeek
|
||||
@load-sigs test.sig
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE test.sig
|
||||
# @TEST-START-FILE test.sig
|
||||
invalid
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
# @TEST-EXEC-FAIL: cat not-a.pcap | zeek -b -r - >output2 2>&1
|
||||
# @TEST-EXEC: btest-diff output2
|
||||
|
||||
@TEST-START-FILE ./not-a.pcap
|
||||
# @TEST-START-FILE ./not-a.pcap
|
||||
%PDF-1.5
|
||||
This isn't an actual pdf file, and neither a PCAP.
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -5,47 +5,47 @@
|
|||
# Bad syntax
|
||||
redef record M::Info$ts -= &log;
|
||||
|
||||
@TEST-START-NEXT
|
||||
# @TEST-START-NEXT
|
||||
# Really bad syntax
|
||||
redef record M::Info$ts -= { &log;
|
||||
|
||||
@TEST-START-NEXT
|
||||
# @TEST-START-NEXT
|
||||
# Not the right syntax
|
||||
redef record M::Info$ts -= [ &log ];
|
||||
|
||||
@TEST-START-NEXT
|
||||
# @TEST-START-NEXT
|
||||
# Can not make something optional
|
||||
redef record M::Info$ts += { &optional };
|
||||
|
||||
@TEST-START-NEXT
|
||||
# @TEST-START-NEXT
|
||||
# Can not add &default
|
||||
redef record M::Info$addl += { &log &default="default"};
|
||||
|
||||
@TEST-START-NEXT
|
||||
# @TEST-START-NEXT
|
||||
# Can not remove optional
|
||||
redef record M::Info$msg -= { &log &optional };
|
||||
|
||||
@TEST-START-NEXT
|
||||
# @TEST-START-NEXT
|
||||
# Not a record
|
||||
redef record M::ErrCode$msg += { &log };
|
||||
|
||||
@TEST-START-NEXT
|
||||
# @TEST-START-NEXT
|
||||
redef record M::Unknown$ts += { &log };
|
||||
|
||||
@TEST-START-NEXT
|
||||
# @TEST-START-NEXT
|
||||
redef record M::Unknown$ts -= { &log };
|
||||
|
||||
@TEST-START-NEXT
|
||||
# @TEST-START-NEXT
|
||||
redef record M::Info$no_such_field += { &log };
|
||||
|
||||
@TEST-START-NEXT
|
||||
# @TEST-START-NEXT
|
||||
redef record M::Info$no_such_field -= { &log };
|
||||
|
||||
@TEST-START-NEXT
|
||||
# @TEST-START-NEXT
|
||||
# This isn't reported very nicely: It's a syntax error rather than an unknown attribute
|
||||
redef record M::Info$ts += { &unknown };
|
||||
|
||||
# @TEST-START-FILE setup.zeek
|
||||
# # @TEST-START-FILE setup.zeek
|
||||
module M;
|
||||
export {
|
||||
type ErrCode: enum {
|
||||
|
|
|
@ -16,6 +16,6 @@
|
|||
#
|
||||
# @TEST-EXEC: btest-diff output
|
||||
|
||||
@TEST-START-FILE test.zeek
|
||||
# @TEST-START-FILE test.zeek
|
||||
event idontexist() { }
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff worker/.stdout
|
||||
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff manager/.stdout
|
||||
|
||||
@TEST-START-FILE worker.zeek
|
||||
# @TEST-START-FILE worker.zeek
|
||||
|
||||
event zeek_init()
|
||||
{
|
||||
|
@ -58,10 +58,10 @@ event zeek_done()
|
|||
{
|
||||
print network_time(), "zeek_done";
|
||||
}
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
|
||||
@TEST-START-FILE manager.zeek
|
||||
# @TEST-START-FILE manager.zeek
|
||||
# The manager waits for a peer and directly publishes do_continue_processing()
|
||||
# to it. It terminates when the peer is lost.
|
||||
global do_continue_processing: event();
|
||||
|
@ -82,4 +82,4 @@ event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string)
|
|||
print "manager: peer lost, terminating";
|
||||
terminate();
|
||||
}
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
@load base/frameworks/intel
|
||||
|
||||
|
||||
@TEST-START-FILE intel.dat
|
||||
# @TEST-START-FILE intel.dat
|
||||
#fields indicator indicator_type meta.source meta.desc meta.url
|
||||
putty.exe Intel::FILE_NAME source1 SSH utility https://www.putty.org
|
||||
zeek.exe Intel::FILE_NAME source1 A network monitor https://zeek.org
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
redef Intel::read_files += { "intel.dat" };
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ fi
|
|||
|
||||
python3 find_logs.py "${BROSCRIPTS}" | sort > out
|
||||
|
||||
@TEST-START-FILE find_logs.py
|
||||
# @TEST-START-FILE find_logs.py
|
||||
import os, sys
|
||||
import re
|
||||
|
||||
|
@ -70,4 +70,4 @@ for fname in find_scripts():
|
|||
if idx > 0:
|
||||
m = re.match('.*\$path\s*=\s*"?(\w+)"?.*', line[idx:])
|
||||
print(m.group(1))
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
# calls in some scripts.
|
||||
redef Cluster::backend = Cluster::CLUSTER_BACKEND_BROKER;
|
||||
|
||||
@TEST-START-FILE cluster-layout.zeek
|
||||
# @TEST-START-FILE cluster-layout.zeek
|
||||
redef Cluster::nodes = {
|
||||
["manager"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT1"))],
|
||||
["logger-1"] = [$node_type=Cluster::LOGGER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT2"))],
|
||||
|
@ -28,7 +28,7 @@ redef Cluster::nodes = {
|
|||
["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT4"))],
|
||||
};
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
# Make this a single-node cluster-layout so no connection attempts happen
|
||||
# to other nodes.
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
# This test will fail if new zeek scripts are added to the scripts/policy/
|
||||
# directory. Correcting that just involves updating
|
||||
# scripts/test-all-policy.zeek to @load the new zeek scripts.
|
||||
|
||||
@TEST-EXEC: test -e $DIST/scripts/test-all-policy.zeek
|
||||
@TEST-EXEC: test -d $DIST/scripts
|
||||
@TEST-EXEC: ( cd $DIST/scripts/policy && find . -name '*.zeek' ) | sort >"all scripts found"
|
||||
@TEST-EXEC: cat $DIST/scripts/test-all-policy.zeek | grep '@load' | sed 'sm^\( *# *\)\{0,\}@load *m./mg' | sort >test-all-policy.zeek
|
||||
@TEST-EXEC: diff -u "all scripts found" test-all-policy.zeek 1>&2
|
||||
#
|
||||
# @TEST-EXEC: test -e $DIST/scripts/test-all-policy.zeek
|
||||
# @TEST-EXEC: test -d $DIST/scripts
|
||||
# @TEST-EXEC: ( cd $DIST/scripts/policy && find . -name '*.zeek' ) | sort >"all scripts found"
|
||||
# @TEST-EXEC: cat $DIST/scripts/test-all-policy.zeek | grep '@load' | sed 'sm^\( *# *\)\{0,\}@load *m./mg' | sort >test-all-policy.zeek
|
||||
# @TEST-EXEC: diff -u "all scripts found" test-all-policy.zeek 1>&2
|
||||
|
|
|
@ -12,12 +12,12 @@
|
|||
# @TEST-EXEC: grep profiling-test cov.txt > step3.out
|
||||
# @TEST-EXEC: btest-diff step3.out
|
||||
|
||||
@TEST-START-FILE profiling-test1.zeek
|
||||
# @TEST-START-FILE profiling-test1.zeek
|
||||
event new_connection(c: connection)
|
||||
{ print "new conn"; }
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE profiling-test2.zeek
|
||||
# @TEST-START-FILE profiling-test2.zeek
|
||||
event new_connection(c: connection)
|
||||
{ print "new conn"; }
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -32,7 +32,7 @@ event zeek_init()
|
|||
}
|
||||
|
||||
|
||||
@TEST-START-FILE my-module.zeek
|
||||
# @TEST-START-FILE my-module.zeek
|
||||
module MyModule;
|
||||
|
||||
export {
|
||||
|
@ -42,10 +42,10 @@ export {
|
|||
};
|
||||
}
|
||||
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
|
||||
@TEST-START-FILE redef-it.zeek
|
||||
# @TEST-START-FILE redef-it.zeek
|
||||
module RedefIt;
|
||||
|
||||
export {
|
||||
|
@ -53,14 +53,14 @@ export {
|
|||
addl: string &log &default="dfl";
|
||||
};
|
||||
}
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE pkg1/__load__.zeek
|
||||
# @TEST-START-FILE pkg1/__load__.zeek
|
||||
@load ./redef-more.zeek
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
|
||||
@TEST-START-FILE pkg1/redef-more.zeek
|
||||
# @TEST-START-FILE pkg1/redef-more.zeek
|
||||
module RedefMore;
|
||||
|
||||
export {
|
||||
|
@ -68,4 +68,4 @@ export {
|
|||
more: string &log &default="more";
|
||||
};
|
||||
}
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
# @TEST-EXEC: unset ZEEK_DISABLE_ZEEKYGEN; zeek -b -X zeekygen.config %INPUT
|
||||
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff autogen-reST-enums.rst
|
||||
|
||||
@TEST-START-FILE zeekygen.config
|
||||
# @TEST-START-FILE zeekygen.config
|
||||
identifier TestEnum* autogen-reST-enums.rst
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
## There's tons of ways an enum can look...
|
||||
type TestEnum1: enum {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
# @TEST-EXEC: unset ZEEK_DISABLE_ZEEKYGEN; zeek -b -X zeekygen.config %INPUT
|
||||
# @TEST-EXEC: btest-diff example.rst
|
||||
|
||||
@TEST-START-FILE zeekygen.config
|
||||
# @TEST-START-FILE zeekygen.config
|
||||
script zeekygen/example.zeek example.rst
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@load zeekygen/example
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
# @TEST-EXEC: unset ZEEK_DISABLE_ZEEKYGEN; zeek -b -X zeekygen.config %INPUT
|
||||
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff autogen-reST-func-params.rst
|
||||
|
||||
@TEST-START-FILE zeekygen.config
|
||||
# @TEST-START-FILE zeekygen.config
|
||||
identifier test_func_params* autogen-reST-func-params.rst
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
## This is a global function declaration.
|
||||
##
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
# @TEST-EXEC: unset ZEEK_DISABLE_ZEEKYGEN; zeek -b -X zeekygen.config %INPUT Broker::default_port=$BROKER_PORT
|
||||
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff test.rst
|
||||
|
||||
@TEST-START-FILE zeekygen.config
|
||||
# @TEST-START-FILE zeekygen.config
|
||||
identifier ZeekygenExample::* test.rst
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@load zeekygen
|
||||
|
|
|
@ -9,6 +9,6 @@
|
|||
# @TEST-EXEC: unset ZEEK_DISABLE_ZEEKYGEN; zeek -b -X zeekygen.config %INPUT
|
||||
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff test.rst
|
||||
|
||||
@TEST-START-FILE zeekygen.config
|
||||
# @TEST-START-FILE zeekygen.config
|
||||
identifier Log::WRITER_ASCII test.rst
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
# @TEST-EXEC: unset ZEEK_DISABLE_ZEEKYGEN; zeek -b -X zeekygen.config %INPUT Broker::default_port=$BROKER_PORT
|
||||
# @TEST-EXEC: btest-diff test.rst
|
||||
|
||||
@TEST-START-FILE zeekygen.config
|
||||
# @TEST-START-FILE zeekygen.config
|
||||
package zeekygen test.rst
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@load zeekygen
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
# @TEST-EXEC: unset ZEEK_DISABLE_ZEEKYGEN; zeek -b -X zeekygen.config %INPUT Broker::default_port=$BROKER_PORT
|
||||
# @TEST-EXEC: btest-diff test.rst
|
||||
|
||||
@TEST-START-FILE zeekygen.config
|
||||
# @TEST-START-FILE zeekygen.config
|
||||
package_index zeekygen test.rst
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@load zeekygen
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
# @TEST-EXEC: unset ZEEK_DISABLE_ZEEKYGEN; zeek -b -X zeekygen.config %INPUT
|
||||
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff autogen-reST-records.rst
|
||||
|
||||
@TEST-START-FILE zeekygen.config
|
||||
# @TEST-START-FILE zeekygen.config
|
||||
identifier TestRecord* autogen-reST-records.rst
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
# undocumented record
|
||||
type TestRecord1: record {
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
# @TEST-EXEC: unset ZEEK_DISABLE_ZEEKYGEN; zeek -b -X zeekygen.config %INPUT Broker::default_port=$BROKER_PORT
|
||||
# @TEST-EXEC: btest-diff test.rst
|
||||
|
||||
@TEST-START-FILE zeekygen.config
|
||||
# @TEST-START-FILE zeekygen.config
|
||||
script_index zeekygen/* test.rst
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@load zeekygen
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
# @TEST-EXEC: unset ZEEK_DISABLE_ZEEKYGEN; zeek -b -X zeekygen.config %INPUT Broker::default_port=$BROKER_PORT
|
||||
# @TEST-EXEC: btest-diff test.rst
|
||||
|
||||
@TEST-START-FILE zeekygen.config
|
||||
# @TEST-START-FILE zeekygen.config
|
||||
script_summary zeekygen/example.zeek test.rst
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
@load zeekygen
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
# @TEST-EXEC: unset ZEEK_DISABLE_ZEEKYGEN; zeek -b -X zeekygen.config %INPUT
|
||||
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff autogen-reST-type-aliases.rst
|
||||
|
||||
@TEST-START-FILE zeekygen.config
|
||||
# @TEST-START-FILE zeekygen.config
|
||||
identifier ZeekygenTest::* autogen-reST-type-aliases.rst
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
module ZeekygenTest;
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
# @TEST-EXEC: unset ZEEK_DISABLE_ZEEKYGEN; zeek -b -X zeekygen.config %INPUT
|
||||
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff autogen-reST-vectors.rst
|
||||
|
||||
@TEST-START-FILE zeekygen.config
|
||||
# @TEST-START-FILE zeekygen.config
|
||||
identifier test_vector* autogen-reST-vectors.rst
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
||||
type TestRecord: record {
|
||||
field1: bool;
|
||||
|
|
|
@ -15,8 +15,8 @@ zeek.on('file_state_remove', (f) => {
|
|||
f.info.from_js = "Hello from JavaScript";
|
||||
});
|
||||
|
||||
@TEST-START-FILE ext.zeek
|
||||
// @TEST-START-FILE ext.zeek
|
||||
redef record Files::Info += {
|
||||
from_js: string &log &optional;
|
||||
};
|
||||
@TEST-END-FILE
|
||||
// @TEST-END-FILE
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* @TEST-EXEC: zeek -b -Cr $TRACES/http/get.trace main.zeek LogAscii::use_json=T
|
||||
* @TEST-EXEC: btest-diff http.log
|
||||
*/
|
||||
@TEST-START-FILE main.zeek
|
||||
// @TEST-START-FILE main.zeek
|
||||
@load base/protocols/http
|
||||
|
||||
# Extending log records only works in Zeek script.
|
||||
|
@ -14,9 +14,9 @@ redef record HTTP::Info += {
|
|||
|
||||
# Load the JavaScript pieces
|
||||
@load ./main.js
|
||||
@TEST-END-FILE
|
||||
// @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE main.js
|
||||
// @TEST-START-FILE main.js
|
||||
const crypto = require('crypto');
|
||||
|
||||
/*
|
||||
|
@ -27,4 +27,4 @@ const crypto = require('crypto');
|
|||
zeek.on('http_request', { priority: -10 }, (c, method, orig_URI, escaped_URI, version) => {
|
||||
c.http.uri_sha256 = crypto.createHash('sha256').update(orig_URI).digest().toString('hex');
|
||||
});
|
||||
@TEST-END-FILE
|
||||
// @TEST-END-FILE
|
||||
|
|
|
@ -5,12 +5,13 @@
|
|||
* @TEST-EXEC: zeek-cut < intel.log > intel.log.noheader
|
||||
* @TEST-EXEC: TEST_DIFF_CANONIFIER= btest-diff intel.log.noheader
|
||||
*
|
||||
* Following the intel file that we load via Intel::insert().
|
||||
@TEST-START-FILE intel.json_lines
|
||||
*/
|
||||
|
||||
// Following the intel file that we load via Intel::insert().
|
||||
// @TEST-START-FILE intel.json_lines
|
||||
{"indicator": "141.142.228.5", "indicator_type": "Intel::ADDR", "meta": {"source": "json1"}}
|
||||
{"indicator": "bro.org", "indicator_type": "Intel::DOMAIN", "meta": {"source": "json2"}}
|
||||
@TEST-END-FILE
|
||||
*/
|
||||
// @TEST-END-FILE
|
||||
const fs = require('fs');
|
||||
|
||||
zeek.on('zeek_init', () => {
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* @TEST-EXEC: zeek-cut -m ts uid id.orig_h id.resp_h new_field < http.log > http.log.cut
|
||||
* @TEST-EXEC: btest-diff http.log.cut
|
||||
*/
|
||||
@TEST-START-FILE main.zeek
|
||||
// @TEST-START-FILE main.zeek
|
||||
@load base/protocols/http
|
||||
|
||||
redef record HTTP::Info += {
|
||||
|
@ -15,9 +15,9 @@ redef record HTTP::Info += {
|
|||
|
||||
# Load the JavaScript pieces
|
||||
@load ./main.js
|
||||
@TEST-END-FILE
|
||||
// @TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE main.js
|
||||
// @TEST-START-FILE main.js
|
||||
zeek.hook('Log::log_stream_policy', (rec, id) => {
|
||||
if ( id != "HTTP::LOG" )
|
||||
return;
|
||||
|
@ -50,4 +50,4 @@ setTimeout(() => {
|
|||
console.error('force exit');
|
||||
process.exit(1);
|
||||
}, 5000);
|
||||
@TEST-END-FILE
|
||||
// @TEST-END-FILE
|
||||
|
|
|
@ -44,7 +44,7 @@ event zeek_init()
|
|||
event foo("A", "B");
|
||||
}
|
||||
|
||||
@TEST-START-FILE bad.zeek
|
||||
# @TEST-START-FILE bad.zeek
|
||||
global foo: event(a: string, b: string, c: string &default="C");
|
||||
global foo: event(c: string, b: string, a: string &default="A");
|
||||
@TEST-END-FILE bad.zeek
|
||||
# @TEST-END-FILE bad.zeek
|
||||
|
|
|
@ -37,11 +37,11 @@ event zeek_init()
|
|||
event myev("one", "two", "three");
|
||||
}
|
||||
|
||||
@TEST-START-FILE hide.zeek
|
||||
# @TEST-START-FILE hide.zeek
|
||||
event myev(a: string, c: string) &priority = 7
|
||||
{
|
||||
local ddd = vector(1,2,3);
|
||||
print "myev (new)", a, c, ddd;
|
||||
print b;
|
||||
}
|
||||
@TEST-END-FILE
|
||||
# @TEST-END-FILE
|
||||
|
|
|
@ -26,7 +26,7 @@ event zeek_init() &priority=-10
|
|||
}
|
||||
|
||||
|
||||
@TEST-START-NEXT
|
||||
# @TEST-START-NEXT
|
||||
# Do not allow to call variadic through a script-level variable.
|
||||
global f: function(x: any);
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue