mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
testing/btest/*zeek: Comment all @TEST lines
This commit is contained in:
parent
2f0be32f5f
commit
85b8c8866b
311 changed files with 1272 additions and 1272 deletions
|
@ -6,27 +6,27 @@ event zeek_init()
|
||||||
print cat_sep();
|
print cat_sep();
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
event zeek_init()
|
event zeek_init()
|
||||||
{
|
{
|
||||||
print cat_sep("sep");
|
print cat_sep("sep");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
# bad types 1
|
# bad types 1
|
||||||
event zeek_init()
|
event zeek_init()
|
||||||
{
|
{
|
||||||
print cat_sep("sep", 1);
|
print cat_sep("sep", 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
# bad types 2
|
# bad types 2
|
||||||
event zeek_init()
|
event zeek_init()
|
||||||
{
|
{
|
||||||
print cat_sep(1, "default");
|
print cat_sep(1, "default");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
event zeek_init()
|
event zeek_init()
|
||||||
{
|
{
|
||||||
print cat_sep([$a=1], "default");
|
print cat_sep([$a=1], "default");
|
||||||
|
|
|
@ -15,8 +15,8 @@ for pcap in $(cd $TRACES/communityid && ls *.pcap); do
|
||||||
btest-diff $pcap.out
|
btest-diff $pcap.out
|
||||||
done
|
done
|
||||||
|
|
||||||
@TEST-START-FILE test-community-id-v1.zeek
|
# @TEST-START-FILE test-community-id-v1.zeek
|
||||||
event connection_state_remove(c: connection) {
|
event connection_state_remove(c: connection) {
|
||||||
print c$id, community_id_v1(c$id);
|
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 pkg2", find_in_zeekpath("pkg2");
|
||||||
print "find_in_zeekpath pkg3", find_in_zeekpath("pkg3");
|
print "find_in_zeekpath pkg3", find_in_zeekpath("pkg3");
|
||||||
|
|
||||||
@TEST-START-FILE pkg1.zeek
|
# @TEST-START-FILE pkg1.zeek
|
||||||
event zeek_init()
|
event zeek_init()
|
||||||
{
|
{
|
||||||
print "pkg1!";
|
print "pkg1!";
|
||||||
}
|
}
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
@TEST-START-FILE pkg2/__load__.zeek
|
# @TEST-START-FILE pkg2/__load__.zeek
|
||||||
event zeek_init()
|
event zeek_init()
|
||||||
{
|
{
|
||||||
print "pkg2!";
|
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)
|
# Using relative and absolute paths is an error (empty string)
|
||||||
print "relative", find_in_zeekpath("./pkg1.zeek");
|
print "relative", find_in_zeekpath("./pkg1.zeek");
|
||||||
print "absolute", find_in_zeekpath("/pkg1");
|
print "absolute", find_in_zeekpath("/pkg1");
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
|
@ -38,21 +38,21 @@ event zeek_init()
|
||||||
print from_json(json, Foo);
|
print from_json(json, Foo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
# argument type mismatch
|
# argument type mismatch
|
||||||
event zeek_init()
|
event zeek_init()
|
||||||
{
|
{
|
||||||
print from_json("[]", 10);
|
print from_json("[]", 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
# JSON parse error
|
# JSON parse error
|
||||||
event zeek_init()
|
event zeek_init()
|
||||||
{
|
{
|
||||||
print from_json("{\"hel", string_vec);
|
print from_json("{\"hel", string_vec);
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
type bool_t: bool;
|
type bool_t: bool;
|
||||||
type Foo: record {
|
type Foo: record {
|
||||||
a: bool;
|
a: bool;
|
||||||
|
@ -65,14 +65,14 @@ event zeek_init()
|
||||||
print from_json("{\"a\": \"hello\"}", Foo);
|
print from_json("{\"a\": \"hello\"}", Foo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
# type unsupport error
|
# type unsupport error
|
||||||
event zeek_init()
|
event zeek_init()
|
||||||
{
|
{
|
||||||
print from_json("[]", table_string_of_string);
|
print from_json("[]", table_string_of_string);
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
type port_t: port;
|
type port_t: port;
|
||||||
# additional & incorrect port formats
|
# additional & incorrect port formats
|
||||||
event zeek_init()
|
event zeek_init()
|
||||||
|
@ -84,7 +84,7 @@ event zeek_init()
|
||||||
print from_json("{}", port_t);
|
print from_json("{}", port_t);
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
type set_t: set[int, bool];
|
type set_t: set[int, bool];
|
||||||
# index type doesn't match
|
# index type doesn't match
|
||||||
event zeek_init()
|
event zeek_init()
|
||||||
|
@ -93,7 +93,7 @@ event zeek_init()
|
||||||
print from_json("[[1, false], [2, 1]]", set_t);
|
print from_json("[[1, false], [2, 1]]", set_t);
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
type pattern_t: pattern;
|
type pattern_t: pattern;
|
||||||
# pattern compile error
|
# pattern compile error
|
||||||
event zeek_init()
|
event zeek_init()
|
||||||
|
@ -101,7 +101,7 @@ event zeek_init()
|
||||||
print from_json("\"/([[:print:]]{-}[[:alnum:]]foo)/\"", pattern_t);
|
print from_json("\"/([[:print:]]{-}[[:alnum:]]foo)/\"", pattern_t);
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
type Color: enum {
|
type Color: enum {
|
||||||
Red = 10
|
Red = 10
|
||||||
};
|
};
|
||||||
|
@ -111,7 +111,7 @@ event zeek_init()
|
||||||
print from_json("\"Yellow\"", Color);
|
print from_json("\"Yellow\"", Color);
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
# container null
|
# container null
|
||||||
event zeek_init()
|
event zeek_init()
|
||||||
{
|
{
|
||||||
|
@ -119,7 +119,7 @@ event zeek_init()
|
||||||
print from_json("[\"1\",null,\"3\",\"4\"]", string_vec);
|
print from_json("[\"1\",null,\"3\",\"4\"]", string_vec);
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
type Foo: record {
|
type Foo: record {
|
||||||
hello: string;
|
hello: string;
|
||||||
t: bool;
|
t: bool;
|
||||||
|
@ -131,7 +131,7 @@ event zeek_init()
|
||||||
print from_json("{\"hello\": null, \"t\": true}", Foo);
|
print from_json("{\"hello\": null, \"t\": true}", Foo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
type Foo: record {
|
type Foo: record {
|
||||||
hello: string;
|
hello: string;
|
||||||
};
|
};
|
||||||
|
@ -141,7 +141,7 @@ event zeek_init()
|
||||||
print from_json("{\"hello\": \"Hello!\", \"t\": true}", Foo);
|
print from_json("{\"hello\": \"Hello!\", \"t\": true}", Foo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
type Foo: record {
|
type Foo: record {
|
||||||
id_field: string;
|
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
|
# 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\"}}]}}]}}";
|
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-EXEC: zeek -b -s mysig %INPUT
|
||||||
|
|
||||||
@TEST-START-FILE mysig.sig
|
# @TEST-START-FILE mysig.sig
|
||||||
signature my_ftp_client {
|
signature my_ftp_client {
|
||||||
ip-proto == tcp
|
ip-proto == tcp
|
||||||
payload /(|.*[\n\r]) *[uU][sS][eE][rR] /
|
payload /(|.*[\n\r]) *[uU][sS][eE][rR] /
|
||||||
tcp-state originator
|
tcp-state originator
|
||||||
event "matched my_ftp_client"
|
event "matched my_ftp_client"
|
||||||
}
|
}
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
event zeek_init()
|
event zeek_init()
|
||||||
{
|
{
|
||||||
|
|
|
@ -14,13 +14,13 @@
|
||||||
|
|
||||||
@load base/frameworks/cluster
|
@load base/frameworks/cluster
|
||||||
|
|
||||||
@TEST-START-FILE cluster-layout.zeek
|
# @TEST-START-FILE cluster-layout.zeek
|
||||||
redef Cluster::nodes = {
|
redef Cluster::nodes = {
|
||||||
["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT1"))],
|
["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-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"],
|
["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;
|
redef Log::default_rotation_interval = 0secs;
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
# @TEST-EXEC: zeek -b order_base | sort >out.2
|
# @TEST-EXEC: zeek -b order_base | sort >out.2
|
||||||
# @TEST-EXEC: cmp out.1 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("A-");
|
||||||
print unique_id_from(5, "E-");
|
print unique_id_from(5, "E-");
|
||||||
|
@ -12,9 +12,9 @@ print unique_id_from(4, "D-");
|
||||||
print unique_id("C-");
|
print unique_id("C-");
|
||||||
print unique_id_from(5, "F-");
|
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("A-");
|
||||||
print unique_id("B-");
|
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, "E-");
|
||||||
print unique_id_from(5, "F-");
|
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 recv/recv.out
|
||||||
# @TEST-EXEC: btest-diff send/send.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.
|
# Using btest's environment settings for connect/listen retry of 1sec.
|
||||||
redef exit_only_after_terminate = T;
|
redef exit_only_after_terminate = T;
|
||||||
|
@ -47,10 +47,10 @@ event pong(msg: string, n: count)
|
||||||
send_event();
|
send_event();
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
|
|
||||||
@TEST-START-FILE recv.zeek
|
# @TEST-START-FILE recv.zeek
|
||||||
|
|
||||||
redef exit_only_after_terminate = T;
|
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);
|
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 recv/recv.out
|
||||||
# @TEST-EXEC: btest-diff recv2/recv2.out
|
# @TEST-EXEC: btest-diff recv2/recv2.out
|
||||||
|
|
||||||
@TEST-START-FILE send.zeek
|
# @TEST-START-FILE send.zeek
|
||||||
|
|
||||||
redef exit_only_after_terminate = T;
|
redef exit_only_after_terminate = T;
|
||||||
|
|
||||||
|
@ -58,10 +58,10 @@ event Broker::endpoint_unreachable(endpoint: Broker::EndpointInfo, msg: string)
|
||||||
terminate();
|
terminate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
|
|
||||||
@TEST-START-FILE recv.zeek
|
# @TEST-START-FILE recv.zeek
|
||||||
|
|
||||||
redef exit_only_after_terminate = T;
|
redef exit_only_after_terminate = T;
|
||||||
|
|
||||||
|
@ -99,4 +99,4 @@ event Broker::endpoint_unreachable(endpoint: Broker::EndpointInfo, msg: string)
|
||||||
print "endpoint unreachable", msg;
|
print "endpoint unreachable", msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
# @TEST-EXEC: btest-diff send.out
|
# @TEST-EXEC: btest-diff send.out
|
||||||
#
|
#
|
||||||
|
|
||||||
@TEST-START-FILE send.zeek
|
# @TEST-START-FILE send.zeek
|
||||||
|
|
||||||
redef exit_only_after_terminate = T;
|
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 recv/recv.out
|
||||||
# @TEST-EXEC: btest-diff send/send.out
|
# @TEST-EXEC: btest-diff send/send.out
|
||||||
|
|
||||||
@TEST-START-FILE send.zeek
|
# @TEST-START-FILE send.zeek
|
||||||
|
|
||||||
global event_count = 0;
|
global event_count = 0;
|
||||||
|
|
||||||
|
@ -61,10 +61,10 @@ event zeek_init()
|
||||||
disable_module_events("TestDumpEvents");
|
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;
|
redef exit_only_after_terminate = T;
|
||||||
|
|
||||||
|
@ -116,4 +116,4 @@ event zeek_init()
|
||||||
disable_module_events("TestDumpEvents");
|
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 recv/recv.out
|
||||||
# @TEST-EXEC: btest-diff send/send.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 ResultTable: table[string] of count;
|
||||||
type ResultSet : set[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 ping_set: event(msg: string, s: ResultSet) &is_used;
|
||||||
global pong_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
|
@load ./common.zeek
|
||||||
|
|
||||||
redef exit_only_after_terminate = T;
|
redef exit_only_after_terminate = T;
|
||||||
|
@ -72,10 +72,10 @@ event pong_set(msg: string, s: ResultSet)
|
||||||
if ( event_count % 4 == 0 )
|
if ( event_count % 4 == 0 )
|
||||||
send_events();
|
send_events();
|
||||||
}
|
}
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
|
|
||||||
@TEST-START-FILE recv.zeek
|
# @TEST-START-FILE recv.zeek
|
||||||
@load ./common.zeek
|
@load ./common.zeek
|
||||||
|
|
||||||
redef exit_only_after_terminate = T;
|
redef exit_only_after_terminate = T;
|
||||||
|
@ -118,4 +118,4 @@ event ping_set(msg: string, s: ResultSet)
|
||||||
print "ping_set", msg, |s|;
|
print "ping_set", msg, |s|;
|
||||||
Broker::publish("zeek/event/my_topic", pong_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 recv/.stdout
|
||||||
# @TEST-EXEC: TEST_DIFF_CANONIFIER= btest-diff send/.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 new_conn_added: event(c: connection) &is_used;
|
||||||
global conn_removed: 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;
|
++events_from_python;
|
||||||
print network_time(), "from_python", events_from_python, what, c$uid, c$id;
|
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
|
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)
|
other_event = broker.zeek.Event("echo_from_python", my_event.name(), conn)
|
||||||
ep.publish(broker_topic, other_event)
|
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 recv/recv.out
|
||||||
# @TEST-EXEC: btest-diff send/send.out
|
# @TEST-EXEC: btest-diff send/send.out
|
||||||
|
|
||||||
@TEST-START-FILE send.zeek
|
# @TEST-START-FILE send.zeek
|
||||||
|
|
||||||
redef exit_only_after_terminate = T;
|
redef exit_only_after_terminate = T;
|
||||||
|
|
||||||
|
@ -54,10 +54,10 @@ event pong(msg: string, n: count)
|
||||||
send_event();
|
send_event();
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
|
|
||||||
@TEST-START-FILE recv.zeek
|
# @TEST-START-FILE recv.zeek
|
||||||
|
|
||||||
redef exit_only_after_terminate = T;
|
redef exit_only_after_terminate = T;
|
||||||
|
|
||||||
|
@ -104,4 +104,4 @@ event zeek_done()
|
||||||
print get_broker_stats();
|
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 recv/recv.out
|
||||||
# @TEST-EXEC: btest-diff send/send.out
|
# @TEST-EXEC: btest-diff send/send.out
|
||||||
|
|
||||||
@TEST-START-FILE send.zeek
|
# @TEST-START-FILE send.zeek
|
||||||
|
|
||||||
redef exit_only_after_terminate = T;
|
redef exit_only_after_terminate = T;
|
||||||
|
|
||||||
|
@ -57,10 +57,10 @@ event pong(msg: string, n: any)
|
||||||
send_event();
|
send_event();
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
|
|
||||||
@TEST-START-FILE recv.zeek
|
# @TEST-START-FILE recv.zeek
|
||||||
|
|
||||||
redef exit_only_after_terminate = T;
|
redef exit_only_after_terminate = T;
|
||||||
|
|
||||||
|
@ -112,4 +112,4 @@ event zeek_done()
|
||||||
print get_broker_stats();
|
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 recv/recv.out
|
||||||
# @TEST-EXEC: btest-diff send/send.out
|
# @TEST-EXEC: btest-diff send/send.out
|
||||||
|
|
||||||
@TEST-START-FILE send.zeek
|
# @TEST-START-FILE send.zeek
|
||||||
|
|
||||||
redef exit_only_after_terminate = T;
|
redef exit_only_after_terminate = T;
|
||||||
|
|
||||||
|
@ -49,10 +49,10 @@ event pong(msg: string, n: count)
|
||||||
send_event();
|
send_event();
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
|
|
||||||
@TEST-START-FILE recv.zeek
|
# @TEST-START-FILE recv.zeek
|
||||||
|
|
||||||
redef exit_only_after_terminate = T;
|
redef exit_only_after_terminate = T;
|
||||||
|
|
||||||
|
@ -95,4 +95,4 @@ event ping(msg: string, n: count)
|
||||||
event pong(msg, n);
|
event pong(msg, n);
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
# @TEST-EXEC: btest-bg-wait 45
|
# @TEST-EXEC: btest-bg-wait 45
|
||||||
# @TEST-EXEC: btest-diff recv/recv.out
|
# @TEST-EXEC: btest-diff recv/recv.out
|
||||||
|
|
||||||
@TEST-START-FILE common.zeek
|
# @TEST-START-FILE common.zeek
|
||||||
redef exit_only_after_terminate = T;
|
redef exit_only_after_terminate = T;
|
||||||
|
|
||||||
type MyRecord: record {
|
type MyRecord: record {
|
||||||
|
@ -52,9 +52,9 @@ global tablefunction: event(x: TableFunction);
|
||||||
global tablepattern: event(x: TablePattern);
|
global tablepattern: event(x: TablePattern);
|
||||||
|
|
||||||
global done: event();
|
global done: event();
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
@TEST-START-FILE send.zeek
|
# @TEST-START-FILE send.zeek
|
||||||
@load ./common.zeek
|
@load ./common.zeek
|
||||||
|
|
||||||
event zeek_init()
|
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)
|
event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string)
|
||||||
{ terminate(); }
|
{ terminate(); }
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
@TEST-START-FILE recv.zeek
|
# @TEST-START-FILE recv.zeek
|
||||||
@load ./common.zeek
|
@load ./common.zeek
|
||||||
|
|
||||||
event set1(x: Set1)
|
event set1(x: Set1)
|
||||||
|
@ -123,4 +123,4 @@ event done()
|
||||||
|
|
||||||
event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string)
|
event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string)
|
||||||
{ terminate(); }
|
{ terminate(); }
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
# @TEST-EXEC: btest-diff send/send.out
|
# @TEST-EXEC: btest-diff send/send.out
|
||||||
|
|
||||||
|
|
||||||
@TEST-START-FILE cert.1.pem
|
# @TEST-START-FILE cert.1.pem
|
||||||
-----BEGIN CERTIFICATE-----
|
-----BEGIN CERTIFICATE-----
|
||||||
MIIDOjCCAiICCQDz7oMOR7Wm7jANBgkqhkiG9w0BAQsFADBkMQswCQYDVQQGEwJV
|
MIIDOjCCAiICCQDz7oMOR7Wm7jANBgkqhkiG9w0BAQsFADBkMQswCQYDVQQGEwJV
|
||||||
UzELMAkGA1UECAwCQ0ExETAPBgNVBAcMCEJlcmtlbGV5MSMwIQYDVQQKDBpBQ01F
|
UzELMAkGA1UECAwCQ0ExETAPBgNVBAcMCEJlcmtlbGV5MSMwIQYDVQQKDBpBQ01F
|
||||||
|
@ -33,9 +33,9 @@ NosoTmGCV0HecWN4l38ojnXd44aSktQIND9iCLus3S6++nFnX5DHGZiv6/SnSO/6
|
||||||
+Op7nV0A6zKVcMOYQ0SGZPD8UQs5wDJgrR9LY29Ox5QBwu/5NqyvNSrMQaTop5vb
|
+Op7nV0A6zKVcMOYQ0SGZPD8UQs5wDJgrR9LY29Ox5QBwu/5NqyvNSrMQaTop5vb
|
||||||
wkMInaq5lLxEYQDSLBc=
|
wkMInaq5lLxEYQDSLBc=
|
||||||
-----END CERTIFICATE-----
|
-----END CERTIFICATE-----
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
@TEST-START-FILE cert.2.pem
|
# @TEST-START-FILE cert.2.pem
|
||||||
-----BEGIN CERTIFICATE-----
|
-----BEGIN CERTIFICATE-----
|
||||||
MIIDOjCCAiICCQDz7oMOR7Wm7TANBgkqhkiG9w0BAQsFADBkMQswCQYDVQQGEwJV
|
MIIDOjCCAiICCQDz7oMOR7Wm7TANBgkqhkiG9w0BAQsFADBkMQswCQYDVQQGEwJV
|
||||||
UzELMAkGA1UECAwCQ0ExETAPBgNVBAcMCEJlcmtlbGV5MSMwIQYDVQQKDBpBQ01F
|
UzELMAkGA1UECAwCQ0ExETAPBgNVBAcMCEJlcmtlbGV5MSMwIQYDVQQKDBpBQ01F
|
||||||
|
@ -56,9 +56,9 @@ hJVdY6LXh27O0ZUllhQ/ig9c+dYFh6AHoZU7WjiNKIyWuyl4IAOkQ4IEdsBvst+l
|
||||||
XZvT6+i8fWvkGv18iunm23Yu+8Zf08wTXnbqXvmMda5upAYLmwD0YKIVYC3ycihh
|
XZvT6+i8fWvkGv18iunm23Yu+8Zf08wTXnbqXvmMda5upAYLmwD0YKIVYC3ycihh
|
||||||
mkYCYI6PVeH63a2/zxw=
|
mkYCYI6PVeH63a2/zxw=
|
||||||
-----END CERTIFICATE-----
|
-----END CERTIFICATE-----
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
@TEST-START-FILE key.1.pem
|
# @TEST-START-FILE key.1.pem
|
||||||
-----BEGIN RSA PRIVATE KEY-----
|
-----BEGIN RSA PRIVATE KEY-----
|
||||||
MIIEogIBAAKCAQEAx6G3HAEEKm2QDXTncfOdlv51MxnMKbqzovM24fcgsTMJxTKI
|
MIIEogIBAAKCAQEAx6G3HAEEKm2QDXTncfOdlv51MxnMKbqzovM24fcgsTMJxTKI
|
||||||
FvQLKihJ3bMqVegIf3CM+OTwIAnRIPtaXNgxu/hNPkJVeAoTcAg7pPhUlgeqajEw
|
FvQLKihJ3bMqVegIf3CM+OTwIAnRIPtaXNgxu/hNPkJVeAoTcAg7pPhUlgeqajEw
|
||||||
|
@ -86,9 +86,9 @@ Dwd/AoGAILn8pVC9dIFac2BDOFU5y9ZvMmZAvwRxh9vEWewNvkzg27vdYc+rCHNm
|
||||||
I7H0S/RqfqVeo0ApE5PQ8Sll6RvxN/mbSQo9YeCDGQ1r1rNe4Vs12GAYXAbE4ipf
|
I7H0S/RqfqVeo0ApE5PQ8Sll6RvxN/mbSQo9YeCDGQ1r1rNe4Vs12GAYXAbE4ipf
|
||||||
BTdqMbieumB/zL97iK5baHUFEJ4VRtLQhh/SOXgew/BF8ccpilI=
|
BTdqMbieumB/zL97iK5baHUFEJ4VRtLQhh/SOXgew/BF8ccpilI=
|
||||||
-----END RSA PRIVATE KEY-----
|
-----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-----
|
-----BEGIN RSA PRIVATE KEY-----
|
||||||
MIIEpQIBAAKCAQEAxvXwL1vap4YxkZi6QPvkbzh2nrLuzYlEL8X9heoBdqyyVdP/
|
MIIEpQIBAAKCAQEAxvXwL1vap4YxkZi6QPvkbzh2nrLuzYlEL8X9heoBdqyyVdP/
|
||||||
g0gPz87RL9ViWhoYCUmhKlI2h5Nx2NhCpWxlxD4dZsaoD2Q+aZRpbuHXU8LrcQsc
|
g0gPz87RL9ViWhoYCUmhKlI2h5Nx2NhCpWxlxD4dZsaoD2Q+aZRpbuHXU8LrcQsc
|
||||||
|
@ -116,9 +116,9 @@ K8ZK3KECgYEApNoI5Mr5tmtjq4sbZrgQq6cMlfkIj9gUubOzFCryUb6NaB38Xqkp
|
||||||
2N3/jqdkR+5ZiKOYhsYj+Iy6U3jyqiEl9VySYTfEIfP/ky1CD0a8/EVC9HR4iG8J
|
2N3/jqdkR+5ZiKOYhsYj+Iy6U3jyqiEl9VySYTfEIfP/ky1CD0a8/EVC9HR4iG8J
|
||||||
im6G7/osaSBYAZctryLqVJXObTelgEy/EFwW9jW8HVph/G+ljmHOmuQ=
|
im6G7/osaSBYAZctryLqVJXObTelgEy/EFwW9jW8HVph/G+ljmHOmuQ=
|
||||||
-----END RSA PRIVATE KEY-----
|
-----END RSA PRIVATE KEY-----
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
@TEST-START-FILE ca.pem
|
# @TEST-START-FILE ca.pem
|
||||||
-----BEGIN CERTIFICATE-----
|
-----BEGIN CERTIFICATE-----
|
||||||
MIIDmzCCAoOgAwIBAgIJAPLZ3e3WR0LLMA0GCSqGSIb3DQEBCwUAMGQxCzAJBgNV
|
MIIDmzCCAoOgAwIBAgIJAPLZ3e3WR0LLMA0GCSqGSIb3DQEBCwUAMGQxCzAJBgNV
|
||||||
BAYTAlVTMQswCQYDVQQIDAJDQTERMA8GA1UEBwwIQmVya2VsZXkxIzAhBgNVBAoM
|
BAYTAlVTMQswCQYDVQQIDAJDQTERMA8GA1UEBwwIQmVya2VsZXkxIzAhBgNVBAoM
|
||||||
|
@ -141,9 +141,9 @@ WmElijr1Tzuzd59rWPqC/tVIsh42vQ+P6g8Y1PDmo8eTUFveZ+wcr/eEPW6IOMrg
|
||||||
OW7tATcrgzNuXZ1umiuGgAPuIVqPfr9ssZHBqi9UOK9L/8MQrnOxecNUpPohcTFR
|
OW7tATcrgzNuXZ1umiuGgAPuIVqPfr9ssZHBqi9UOK9L/8MQrnOxecNUpPohcTFR
|
||||||
vq+Zqu15QV9T4BVWKHv0
|
vq+Zqu15QV9T4BVWKHv0
|
||||||
-----END CERTIFICATE-----
|
-----END CERTIFICATE-----
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
@TEST-START-FILE send.zeek
|
# @TEST-START-FILE send.zeek
|
||||||
|
|
||||||
redef exit_only_after_terminate = T;
|
redef exit_only_after_terminate = T;
|
||||||
|
|
||||||
|
@ -188,10 +188,10 @@ event pong(msg: string, n: count)
|
||||||
send_event();
|
send_event();
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
|
|
||||||
@TEST-START-FILE recv.zeek
|
# @TEST-START-FILE recv.zeek
|
||||||
|
|
||||||
redef exit_only_after_terminate = T;
|
redef exit_only_after_terminate = T;
|
||||||
|
|
||||||
|
@ -241,4 +241,4 @@ event zeek_done()
|
||||||
print get_broker_stats();
|
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
|
Python script sending timestamped and non-timestamped event to TOPIC
|
||||||
"""
|
"""
|
||||||
|
@ -91,4 +91,4 @@ with broker.Endpoint() as ep, \
|
||||||
|
|
||||||
ep.shutdown()
|
ep.shutdown()
|
||||||
|
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
# @TEST-EXEC: btest-bg-wait 45
|
# @TEST-EXEC: btest-bg-wait 45
|
||||||
# @TEST-EXEC: btest-diff recv/recv.out
|
# @TEST-EXEC: btest-diff recv/recv.out
|
||||||
|
|
||||||
@TEST-START-FILE send.zeek
|
# @TEST-START-FILE send.zeek
|
||||||
|
|
||||||
redef exit_only_after_terminate = T;
|
redef exit_only_after_terminate = T;
|
||||||
|
|
||||||
|
@ -41,9 +41,9 @@ event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string)
|
||||||
terminate();
|
terminate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
@TEST-START-FILE recv.zeek
|
# @TEST-START-FILE recv.zeek
|
||||||
|
|
||||||
redef exit_only_after_terminate = T;
|
redef exit_only_after_terminate = T;
|
||||||
|
|
||||||
|
@ -104,4 +104,4 @@ event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string)
|
||||||
terminate();
|
terminate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
# @TEST-EXEC: btest-bg-wait 45
|
# @TEST-EXEC: btest-bg-wait 45
|
||||||
# @TEST-EXEC: btest-diff recv/recv.out
|
# @TEST-EXEC: btest-diff recv/recv.out
|
||||||
|
|
||||||
@TEST-START-FILE send.zeek
|
# @TEST-START-FILE send.zeek
|
||||||
|
|
||||||
const test_var = "init" &redef;
|
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");
|
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;
|
const test_var = "init" &redef;
|
||||||
|
|
||||||
|
@ -65,4 +65,4 @@ event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string)
|
||||||
terminate();
|
terminate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
# @TEST-EXEC: btest-diff send/send.out
|
# @TEST-EXEC: btest-diff send/send.out
|
||||||
# @TEST-EXEC: btest-diff send/test.log
|
# @TEST-EXEC: btest-diff send/test.log
|
||||||
|
|
||||||
@TEST-START-FILE common.zeek
|
# @TEST-START-FILE common.zeek
|
||||||
|
|
||||||
redef exit_only_after_terminate = T;
|
redef exit_only_after_terminate = T;
|
||||||
|
|
||||||
|
@ -37,9 +37,9 @@ event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string)
|
||||||
terminate();
|
terminate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
@TEST-START-FILE recv.zeek
|
# @TEST-START-FILE recv.zeek
|
||||||
|
|
||||||
|
|
||||||
@load ./common
|
@load ./common
|
||||||
|
@ -55,9 +55,9 @@ event Broker::peer_removed(endpoint: Broker::EndpointInfo, msg: string)
|
||||||
terminate();
|
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/send.out
|
||||||
# @TEST-EXEC: btest-diff send/test.log
|
# @TEST-EXEC: btest-diff send/test.log
|
||||||
|
|
||||||
@TEST-START-FILE common.zeek
|
# @TEST-START-FILE common.zeek
|
||||||
|
|
||||||
redef exit_only_after_terminate = T;
|
redef exit_only_after_terminate = T;
|
||||||
|
|
||||||
|
@ -42,9 +42,9 @@ event quit()
|
||||||
terminate();
|
terminate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
@TEST-START-FILE recv.zeek
|
# @TEST-START-FILE recv.zeek
|
||||||
|
|
||||||
|
|
||||||
@load ./common
|
@load ./common
|
||||||
|
@ -60,9 +60,9 @@ event Broker::peer_removed(endpoint: Broker::EndpointInfo, msg: string)
|
||||||
terminate();
|
terminate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
@TEST-START-FILE send.zeek
|
# @TEST-START-FILE send.zeek
|
||||||
|
|
||||||
@load ./common
|
@load ./common
|
||||||
|
|
||||||
|
@ -104,4 +104,4 @@ event Broker::log_flush()
|
||||||
Broker::publish("zeek/quit", quit);
|
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/send.out
|
||||||
# @TEST-EXEC: btest-diff send/test.log
|
# @TEST-EXEC: btest-diff send/test.log
|
||||||
|
|
||||||
@TEST-START-FILE common.zeek
|
# @TEST-START-FILE common.zeek
|
||||||
|
|
||||||
redef exit_only_after_terminate = T;
|
redef exit_only_after_terminate = T;
|
||||||
|
|
||||||
|
@ -37,9 +37,9 @@ event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string)
|
||||||
terminate();
|
terminate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
@TEST-START-FILE recv.zeek
|
# @TEST-START-FILE recv.zeek
|
||||||
|
|
||||||
|
|
||||||
@load ./common
|
@load ./common
|
||||||
|
@ -55,9 +55,9 @@ event Broker::peer_removed(endpoint: Broker::EndpointInfo, msg: string)
|
||||||
terminate();
|
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: 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-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;
|
redef exit_only_after_terminate = T;
|
||||||
|
|
||||||
|
@ -57,9 +57,9 @@ event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string)
|
||||||
terminate();
|
terminate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
@TEST-START-FILE recv.zeek
|
# @TEST-START-FILE recv.zeek
|
||||||
|
|
||||||
@load ./common
|
@load ./common
|
||||||
|
|
||||||
|
@ -74,9 +74,9 @@ event quit_receiver()
|
||||||
terminate();
|
terminate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
@TEST-START-FILE send.zeek
|
# @TEST-START-FILE send.zeek
|
||||||
|
|
||||||
@load ./common
|
@load ./common
|
||||||
|
|
||||||
|
@ -133,4 +133,4 @@ event Broker::log_flush()
|
||||||
Broker::publish("zeek/", quit_receiver);
|
Broker::publish("zeek/", quit_receiver);
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
# @TEST-EXEC: btest-bg-wait 45
|
# @TEST-EXEC: btest-bg-wait 45
|
||||||
# @TEST-EXEC: btest-diff send/send.out
|
# @TEST-EXEC: btest-diff send/send.out
|
||||||
|
|
||||||
@TEST-START-FILE ca.pem
|
# @TEST-START-FILE ca.pem
|
||||||
-----BEGIN CERTIFICATE-----
|
-----BEGIN CERTIFICATE-----
|
||||||
MIIDmzCCAoOgAwIBAgIJAPLZ3e3WR0LLMA0GCSqGSIb3DQEBCwUAMGQxCzAJBgNV
|
MIIDmzCCAoOgAwIBAgIJAPLZ3e3WR0LLMA0GCSqGSIb3DQEBCwUAMGQxCzAJBgNV
|
||||||
BAYTAlVTMQswCQYDVQQIDAJDQTERMA8GA1UEBwwIQmVya2VsZXkxIzAhBgNVBAoM
|
BAYTAlVTMQswCQYDVQQIDAJDQTERMA8GA1UEBwwIQmVya2VsZXkxIzAhBgNVBAoM
|
||||||
|
@ -39,10 +39,10 @@ WmElijr1Tzuzd59rWPqC/tVIsh42vQ+P6g8Y1PDmo8eTUFveZ+wcr/eEPW6IOMrg
|
||||||
OW7tATcrgzNuXZ1umiuGgAPuIVqPfr9ssZHBqi9UOK9L/8MQrnOxecNUpPohcTFR
|
OW7tATcrgzNuXZ1umiuGgAPuIVqPfr9ssZHBqi9UOK9L/8MQrnOxecNUpPohcTFR
|
||||||
vq+Zqu15QV9T4BVWKHv0
|
vq+Zqu15QV9T4BVWKHv0
|
||||||
-----END CERTIFICATE-----
|
-----END CERTIFICATE-----
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
|
|
||||||
@TEST-START-FILE cert.1.pem
|
# @TEST-START-FILE cert.1.pem
|
||||||
-----BEGIN CERTIFICATE-----
|
-----BEGIN CERTIFICATE-----
|
||||||
MIIDOjCCAiICCQDz7oMOR7Wm7jANBgkqhkiG9w0BAQsFADBkMQswCQYDVQQGEwJV
|
MIIDOjCCAiICCQDz7oMOR7Wm7jANBgkqhkiG9w0BAQsFADBkMQswCQYDVQQGEwJV
|
||||||
UzELMAkGA1UECAwCQ0ExETAPBgNVBAcMCEJlcmtlbGV5MSMwIQYDVQQKDBpBQ01F
|
UzELMAkGA1UECAwCQ0ExETAPBgNVBAcMCEJlcmtlbGV5MSMwIQYDVQQKDBpBQ01F
|
||||||
|
@ -63,9 +63,9 @@ NosoTmGCV0HecWN4l38ojnXd44aSktQIND9iCLus3S6++nFnX5DHGZiv6/SnSO/6
|
||||||
+Op7nV0A6zKVcMOYQ0SGZPD8UQs5wDJgrR9LY29Ox5QBwu/5NqyvNSrMQaTop5vb
|
+Op7nV0A6zKVcMOYQ0SGZPD8UQs5wDJgrR9LY29Ox5QBwu/5NqyvNSrMQaTop5vb
|
||||||
wkMInaq5lLxEYQDSLBc=
|
wkMInaq5lLxEYQDSLBc=
|
||||||
-----END CERTIFICATE-----
|
-----END CERTIFICATE-----
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
@TEST-START-FILE key.1.pem
|
# @TEST-START-FILE key.1.pem
|
||||||
-----BEGIN RSA PRIVATE KEY-----
|
-----BEGIN RSA PRIVATE KEY-----
|
||||||
MIIEogIBAAKCAQEAx6G3HAEEKm2QDXTncfOdlv51MxnMKbqzovM24fcgsTMJxTKI
|
MIIEogIBAAKCAQEAx6G3HAEEKm2QDXTncfOdlv51MxnMKbqzovM24fcgsTMJxTKI
|
||||||
FvQLKihJ3bMqVegIf3CM+OTwIAnRIPtaXNgxu/hNPkJVeAoTcAg7pPhUlgeqajEw
|
FvQLKihJ3bMqVegIf3CM+OTwIAnRIPtaXNgxu/hNPkJVeAoTcAg7pPhUlgeqajEw
|
||||||
|
@ -93,9 +93,9 @@ Dwd/AoGAILn8pVC9dIFac2BDOFU5y9ZvMmZAvwRxh9vEWewNvkzg27vdYc+rCHNm
|
||||||
I7H0S/RqfqVeo0ApE5PQ8Sll6RvxN/mbSQo9YeCDGQ1r1rNe4Vs12GAYXAbE4ipf
|
I7H0S/RqfqVeo0ApE5PQ8Sll6RvxN/mbSQo9YeCDGQ1r1rNe4Vs12GAYXAbE4ipf
|
||||||
BTdqMbieumB/zL97iK5baHUFEJ4VRtLQhh/SOXgew/BF8ccpilI=
|
BTdqMbieumB/zL97iK5baHUFEJ4VRtLQhh/SOXgew/BF8ccpilI=
|
||||||
-----END RSA PRIVATE KEY-----
|
-----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
|
# This script just confirms the process running recv.zeek has listen()'d
|
||||||
|
|
||||||
event zeek_init()
|
event zeek_init()
|
||||||
|
@ -108,9 +108,9 @@ event Broker::peer_added(endpoint: Broker::EndpointInfo, msg: string)
|
||||||
terminate();
|
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
|
# This is expected to generate the error condition and be unable to connect
|
||||||
# do to SSL authentication failure.
|
# do to SSL authentication failure.
|
||||||
|
@ -143,9 +143,9 @@ event Broker::error(code: Broker::ErrorCode, msg: string)
|
||||||
terminate();
|
terminate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
@TEST-START-FILE recv.zeek
|
# @TEST-START-FILE recv.zeek
|
||||||
|
|
||||||
# No cert here.
|
# 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);
|
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 master.out
|
||||||
# @TEST-EXEC: btest-diff clonetwo.out
|
# @TEST-EXEC: btest-diff clonetwo.out
|
||||||
|
|
||||||
@TEST-START-FILE common.zeek
|
# @TEST-START-FILE common.zeek
|
||||||
redef exit_only_after_terminate = T;
|
redef exit_only_after_terminate = T;
|
||||||
|
|
||||||
global tablestore: opaque of Broker::Store;
|
global tablestore: opaque of Broker::Store;
|
||||||
|
@ -36,9 +36,9 @@ event dump_tables()
|
||||||
|
|
||||||
event do_terminate()
|
event do_terminate()
|
||||||
{ terminate(); }
|
{ terminate(); }
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
@TEST-START-FILE master.zeek
|
# @TEST-START-FILE master.zeek
|
||||||
|
|
||||||
event zeek_init()
|
event zeek_init()
|
||||||
{
|
{
|
||||||
|
@ -84,9 +84,9 @@ event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string)
|
||||||
if ( peers == 0 )
|
if ( peers == 0 )
|
||||||
terminate();
|
terminate();
|
||||||
}
|
}
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
@TEST-START-FILE cloneone.zeek
|
# @TEST-START-FILE cloneone.zeek
|
||||||
event zeek_init()
|
event zeek_init()
|
||||||
{
|
{
|
||||||
Broker::subscribe("cloneone");
|
Broker::subscribe("cloneone");
|
||||||
|
@ -120,9 +120,9 @@ event Broker::peer_added(endpoint: Broker::EndpointInfo, msg: string)
|
||||||
setstore = Broker::create_clone("set");
|
setstore = Broker::create_clone("set");
|
||||||
recordstore = Broker::create_clone("rec");
|
recordstore = Broker::create_clone("rec");
|
||||||
}
|
}
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
@TEST-START-FILE clonetwo.zeek
|
# @TEST-START-FILE clonetwo.zeek
|
||||||
event zeek_init()
|
event zeek_init()
|
||||||
{
|
{
|
||||||
Broker::subscribe("clonetwo");
|
Broker::subscribe("clonetwo");
|
||||||
|
@ -147,4 +147,4 @@ event Broker::peer_added(endpoint: Broker::EndpointInfo, msg: string)
|
||||||
setstore = Broker::create_clone("set");
|
setstore = Broker::create_clone("set");
|
||||||
recordstore = Broker::create_clone("rec");
|
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-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 exit_only_after_terminate = T;
|
||||||
redef table_expire_interval = 0.5sec;
|
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 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 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;
|
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()
|
event zeek_init()
|
||||||
{
|
{
|
||||||
Broker::listen("127.0.0.1", to_port(getenv("BROKER_PORT")));
|
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";
|
print "Terminating";
|
||||||
terminate();
|
terminate();
|
||||||
}
|
}
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
@TEST-START-FILE clone.zeek
|
# @TEST-START-FILE clone.zeek
|
||||||
|
|
||||||
event zeek_init()
|
event zeek_init()
|
||||||
{
|
{
|
||||||
|
@ -139,4 +139,4 @@ event Broker::peer_added(endpoint: Broker::EndpointInfo, msg: string)
|
||||||
recordstore = Broker::create_clone("rec");
|
recordstore = Broker::create_clone("rec");
|
||||||
schedule 0.1sec { check_all_set() };
|
schedule 0.1sec { check_all_set() };
|
||||||
}
|
}
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
# @TEST-EXEC: diff output1 output2
|
# @TEST-EXEC: diff output1 output2
|
||||||
# @TEST-EXEC: diff output2 output3
|
# @TEST-EXEC: diff output2 output3
|
||||||
|
|
||||||
@TEST-START-FILE common.zeek
|
# @TEST-START-FILE common.zeek
|
||||||
global tablestore: opaque of Broker::Store;
|
global tablestore: opaque of Broker::Store;
|
||||||
global setstore: opaque of Broker::Store;
|
global setstore: opaque of Broker::Store;
|
||||||
global recordstore: 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 t: table[string] of count &broker_store="table";
|
||||||
global s: set[string] &broker_store="set";
|
global s: set[string] &broker_store="set";
|
||||||
global r: table[string] of testrec &broker_allow_complex_type &broker_store="rec";
|
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...
|
# the first test writes out the sqlite files...
|
||||||
|
|
||||||
@TEST-START-FILE one.zeek
|
# @TEST-START-FILE one.zeek
|
||||||
redef exit_only_after_terminate = T;
|
redef exit_only_after_terminate = T;
|
||||||
|
|
||||||
event zeek_init()
|
event zeek_init()
|
||||||
|
@ -58,8 +58,8 @@ event zeek_init()
|
||||||
terminate();
|
terminate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
@TEST-START-FILE two.zeek
|
# @TEST-START-FILE two.zeek
|
||||||
redef exit_only_after_terminate = T;
|
redef exit_only_after_terminate = T;
|
||||||
|
|
||||||
# read in again - and serve to clones
|
# read in again - and serve to clones
|
||||||
|
@ -80,9 +80,9 @@ event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string)
|
||||||
terminate();
|
terminate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
@TEST-START-FILE three.zeek
|
# @TEST-START-FILE three.zeek
|
||||||
redef exit_only_after_terminate = T;
|
redef exit_only_after_terminate = T;
|
||||||
|
|
||||||
# get copy from master
|
# 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...
|
# 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 tablestore: opaque of Broker::Store;
|
||||||
global setstore: opaque of Broker::Store;
|
global setstore: opaque of Broker::Store;
|
||||||
global recordstore: 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 t: table[string] of count &broker_store="table";
|
||||||
global s: set[string] &broker_store="set";
|
global s: set[string] &broker_store="set";
|
||||||
global r: table[string] of testrec &broker_allow_complex_type &broker_store="rec";
|
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()
|
event zeek_init()
|
||||||
{
|
{
|
||||||
|
@ -45,8 +45,8 @@ event zeek_init()
|
||||||
print sort_table(r);
|
print sort_table(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
@TEST-START-FILE two.zeek
|
# @TEST-START-FILE two.zeek
|
||||||
|
|
||||||
# the second one reads them in again
|
# the second one reads them in again
|
||||||
|
|
||||||
|
@ -59,4 +59,4 @@ event zeek_init()
|
||||||
print sort_set(s);
|
print sort_set(s);
|
||||||
print sort_table(r);
|
print sort_table(r);
|
||||||
}
|
}
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
#
|
#
|
||||||
# @TEST-EXEC: btest-diff clone.out
|
# @TEST-EXEC: btest-diff clone.out
|
||||||
|
|
||||||
@TEST-START-FILE common.zeek
|
# @TEST-START-FILE common.zeek
|
||||||
redef exit_only_after_terminate = T;
|
redef exit_only_after_terminate = T;
|
||||||
|
|
||||||
global tablestore: opaque of Broker::Store;
|
global tablestore: opaque of Broker::Store;
|
||||||
|
@ -22,9 +22,9 @@ type testrec: record {
|
||||||
global t: table[string] of count &broker_store="table";
|
global t: table[string] of count &broker_store="table";
|
||||||
global s: set[string, string] &broker_store="set";
|
global s: set[string, string] &broker_store="set";
|
||||||
global r: table[string] of testrec &broker_allow_complex_type &broker_store="rec";
|
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()
|
event zeek_init()
|
||||||
{
|
{
|
||||||
tablestore = Broker::create_master("table");
|
tablestore = Broker::create_master("table");
|
||||||
|
@ -64,9 +64,9 @@ event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string)
|
||||||
terminate();
|
terminate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
@TEST-START-FILE clone.zeek
|
# @TEST-START-FILE clone.zeek
|
||||||
event zeek_init()
|
event zeek_init()
|
||||||
{
|
{
|
||||||
Broker::peer("127.0.0.1", to_port(getenv("BROKER_PORT")));
|
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");
|
recordstore = Broker::create_clone("rec");
|
||||||
schedule 0.1sec { check_all_set() };
|
schedule 0.1sec { check_all_set() };
|
||||||
}
|
}
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
|
@ -11,12 +11,12 @@
|
||||||
|
|
||||||
@load policy/frameworks/cluster/experimental
|
@load policy/frameworks/cluster/experimental
|
||||||
|
|
||||||
@TEST-START-FILE cluster-layout.zeek
|
# @TEST-START-FILE cluster-layout.zeek
|
||||||
redef Cluster::nodes = {
|
redef Cluster::nodes = {
|
||||||
["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT1"))],
|
["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-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,
|
function change_handler(t: table[string, count] of count, tpe: TableChange,
|
||||||
k0: string, k1: count, v: count)
|
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-1/err.log
|
||||||
# @TEST-EXEC: TEST_DIFF_CANONIFIER="$SCRIPTS/diff-sort" btest-diff worker-2/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 = {
|
redef Cluster::nodes = {
|
||||||
["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT1"))],
|
["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-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"],
|
["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
|
@load base/frameworks/cluster
|
||||||
redef exit_only_after_terminate = T;
|
redef exit_only_after_terminate = T;
|
||||||
|
|
||||||
|
@ -52,9 +52,9 @@ event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string)
|
||||||
terminate();
|
terminate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
@TEST-START-FILE clone.zeek
|
# @TEST-START-FILE clone.zeek
|
||||||
@load base/frameworks/cluster
|
@load base/frameworks/cluster
|
||||||
@load base/frameworks/reporter
|
@load base/frameworks/reporter
|
||||||
redef exit_only_after_terminate = T;
|
redef exit_only_after_terminate = T;
|
||||||
|
@ -78,4 +78,4 @@ event reporter_error(t: time, msg: string, location: string)
|
||||||
if ( errors == 2 )
|
if ( errors == 2 )
|
||||||
terminate();
|
terminate();
|
||||||
}
|
}
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
|
@ -12,15 +12,15 @@
|
||||||
# @TEST-EXEC: diff master.out clone.out
|
# @TEST-EXEC: diff master.out clone.out
|
||||||
# @TEST-EXEC: diff master.out clone2.out
|
# @TEST-EXEC: diff master.out clone2.out
|
||||||
|
|
||||||
@TEST-START-FILE cluster-layout.zeek
|
# @TEST-START-FILE cluster-layout.zeek
|
||||||
redef Cluster::nodes = {
|
redef Cluster::nodes = {
|
||||||
["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT1"))],
|
["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-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"],
|
["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/cluster
|
||||||
|
|
||||||
redef exit_only_after_terminate = T;
|
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;
|
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
|
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();
|
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_node_up: bool = F;
|
||||||
global has_announce_masters: bool = F;
|
global has_announce_masters: bool = F;
|
||||||
|
@ -115,9 +115,9 @@ event Broker::announce_masters(masters: set[string])
|
||||||
if ( has_node_up )
|
if ( has_node_up )
|
||||||
event dump_tables();
|
event dump_tables();
|
||||||
}
|
}
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
@TEST-START-FILE clone2.zeek
|
# @TEST-START-FILE clone2.zeek
|
||||||
event dump_tables()
|
event dump_tables()
|
||||||
{
|
{
|
||||||
print sort_table(t);
|
print sort_table(t);
|
||||||
|
@ -145,5 +145,5 @@ event Cluster::node_up(name: string, id: string)
|
||||||
Reporter::info(fmt("Node Up: %s", name));
|
Reporter::info(fmt("Node Up: %s", name));
|
||||||
schedule 0.1sec { check_all_set() };
|
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 clone.out
|
||||||
# @TEST-EXEC: diff master.out clone2.out
|
# @TEST-EXEC: diff master.out clone2.out
|
||||||
|
|
||||||
@TEST-START-FILE cluster-layout.zeek
|
# @TEST-START-FILE cluster-layout.zeek
|
||||||
redef Cluster::nodes = {
|
redef Cluster::nodes = {
|
||||||
["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT1"))],
|
["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-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"],
|
["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/cluster
|
||||||
@load base/frameworks/broker
|
@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 s: set[string] &backend=Broker::MEMORY;
|
||||||
global r: table[string] of testrec &broker_allow_complex_type &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()
|
event zeek_init()
|
||||||
{
|
{
|
||||||
t["a"] = 5;
|
t["a"] = 5;
|
||||||
|
@ -69,9 +69,9 @@ event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string)
|
||||||
terminate();
|
terminate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
@TEST-START-FILE clone.zeek
|
# @TEST-START-FILE clone.zeek
|
||||||
|
|
||||||
event dump_tables()
|
event dump_tables()
|
||||||
{
|
{
|
||||||
|
@ -94,4 +94,4 @@ event Cluster::node_up(name: string, id: string)
|
||||||
{
|
{
|
||||||
schedule 0.1sec { check_all_set() };
|
schedule 0.1sec { check_all_set() };
|
||||||
}
|
}
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
# the first test writes out the sqlite files...
|
# the first test writes out the sqlite files...
|
||||||
|
|
||||||
@TEST-START-FILE one.zeek
|
# @TEST-START-FILE one.zeek
|
||||||
|
|
||||||
module TestModule;
|
module TestModule;
|
||||||
|
|
||||||
|
@ -21,8 +21,8 @@ event zeek_init()
|
||||||
print t;
|
print t;
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
@TEST-START-FILE two.zeek
|
# @TEST-START-FILE two.zeek
|
||||||
|
|
||||||
# the second one reads them in again. Or not because the types are incompatible.
|
# the second one reads them in again. Or not because the types are incompatible.
|
||||||
|
|
||||||
|
@ -35,4 +35,4 @@ event zeek_init()
|
||||||
{
|
{
|
||||||
print t;
|
print t;
|
||||||
}
|
}
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
|
@ -13,23 +13,23 @@
|
||||||
# @TEST-EXEC: diff master.out clone.out
|
# @TEST-EXEC: diff master.out clone.out
|
||||||
# @TEST-EXEC: diff master.out clone2.out
|
# @TEST-EXEC: diff master.out clone2.out
|
||||||
|
|
||||||
@TEST-START-FILE cluster-layout.zeek
|
# @TEST-START-FILE cluster-layout.zeek
|
||||||
redef Cluster::nodes = {
|
redef Cluster::nodes = {
|
||||||
["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT1"))],
|
["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-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"],
|
["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 {
|
type testrec: record {
|
||||||
a: count;
|
a: count;
|
||||||
b: string;
|
b: string;
|
||||||
c: set[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 t: table[string] of count &backend=Broker::SQLITE;
|
||||||
global s: set[string] &backend=Broker::SQLITE;
|
global s: set[string] &backend=Broker::SQLITE;
|
||||||
global r: table[string] of testrec &broker_allow_complex_type &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;
|
print rt;
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
@TEST-START-FILE master.zeek
|
# @TEST-START-FILE master.zeek
|
||||||
@load base/frameworks/cluster
|
@load base/frameworks/cluster
|
||||||
|
|
||||||
redef exit_only_after_terminate = T;
|
redef exit_only_after_terminate = T;
|
||||||
|
@ -98,9 +98,9 @@ event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string)
|
||||||
terminate();
|
terminate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
@TEST-START-FILE clone.zeek
|
# @TEST-START-FILE clone.zeek
|
||||||
@load base/frameworks/cluster
|
@load base/frameworks/cluster
|
||||||
|
|
||||||
redef exit_only_after_terminate = T;
|
redef exit_only_after_terminate = T;
|
||||||
|
@ -140,4 +140,4 @@ event Cluster::node_up(name: string, id: string)
|
||||||
{
|
{
|
||||||
schedule 0.1sec { check_all_set() };
|
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 clone/clone.out
|
||||||
# @TEST-EXEC: btest-diff master/master.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;
|
redef exit_only_after_terminate = T;
|
||||||
global query_timeout = 1sec;
|
global query_timeout = 1sec;
|
||||||
|
@ -72,10 +72,10 @@ event Broker::peer_added(endpoint: Broker::EndpointInfo, msg: string)
|
||||||
schedule 4secs { insert_more() };
|
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;
|
redef exit_only_after_terminate = T;
|
||||||
|
|
||||||
|
@ -145,4 +145,4 @@ event Broker::peer_added(endpoint: Broker::EndpointInfo, msg: string)
|
||||||
schedule 2secs { lookup(1) };
|
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 recv/broker.filtered.log
|
||||||
# @TEST-EXEC: btest-diff send/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;
|
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;
|
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
|
import asyncio, datetime, websockets, os, time, json, sys
|
||||||
|
|
||||||
ws_port = os.environ['BROKER_PORT'].split('/')[0]
|
ws_port = os.environ['BROKER_PORT'].split('/')[0]
|
||||||
|
@ -149,4 +149,4 @@ async def do_run():
|
||||||
loop = asyncio.get_event_loop()
|
loop = asyncio.get_event_loop()
|
||||||
loop.run_until_complete(do_run())
|
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
|
import asyncio, websockets, os, time, json, sys
|
||||||
|
|
||||||
ws_port = os.environ['BROKER_PORT'].split('/')[0]
|
ws_port = os.environ['BROKER_PORT'].split('/')[0]
|
||||||
|
@ -125,4 +125,4 @@ async def do_run():
|
||||||
loop = asyncio.get_event_loop()
|
loop = asyncio.get_event_loop()
|
||||||
loop.run_until_complete(do_run())
|
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 recv/recv.out
|
||||||
# @TEST-EXEC: btest-diff send/send.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 Cluster::backend = Cluster::CLUSTER_BACKEND_BROKER;
|
||||||
redef exit_only_after_terminate = T;
|
redef exit_only_after_terminate = T;
|
||||||
|
@ -56,10 +56,10 @@ event pong(msg: string, n: count)
|
||||||
send_event();
|
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 Cluster::backend = Cluster::CLUSTER_BACKEND_BROKER;
|
||||||
redef exit_only_after_terminate = T;
|
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);
|
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 ./manager/.stdout
|
||||||
# @TEST-EXEC: btest-diff ./worker-1/.stdout
|
# @TEST-EXEC: btest-diff ./worker-1/.stdout
|
||||||
|
|
||||||
@TEST-START-FILE cluster-layout.zeek
|
# @TEST-START-FILE cluster-layout.zeek
|
||||||
redef Cluster::nodes = {
|
redef Cluster::nodes = {
|
||||||
["manager"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=to_port(getenv("BROKER_PORT1"))],
|
["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"],
|
["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;
|
redef Log::default_rotation_interval = 0sec;
|
||||||
|
|
||||||
global finish: event() &is_used;
|
global finish: event() &is_used;
|
||||||
global ping: event(c: count, what: string, val: any) &is_used;
|
global ping: event(c: count, what: string, val: any) &is_used;
|
||||||
global pong: 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
|
@load ./common.zeek
|
||||||
|
|
||||||
global i = 0;
|
global i = 0;
|
||||||
|
@ -81,10 +81,10 @@ event Cluster::node_down(name: string, id: string)
|
||||||
{
|
{
|
||||||
terminate();
|
terminate();
|
||||||
}
|
}
|
||||||
# @TEST-END-FILE
|
# # @TEST-END-FILE
|
||||||
|
|
||||||
|
|
||||||
# @TEST-START-FILE worker.zeek
|
# # @TEST-START-FILE worker.zeek
|
||||||
@load ./common.zeek
|
@load ./common.zeek
|
||||||
|
|
||||||
event ping(c: count, what: string, val: any)
|
event ping(c: count, what: string, val: any)
|
||||||
|
@ -104,4 +104,4 @@ event finish()
|
||||||
print "got finish!";
|
print "got finish!";
|
||||||
terminate();
|
terminate();
|
||||||
}
|
}
|
||||||
# @TEST-END-FILE
|
# # @TEST-END-FILE
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
# @TEST-EXEC: sort -n rr2.log > rr2.log.sorted
|
# @TEST-EXEC: sort -n rr2.log > rr2.log.sorted
|
||||||
# @TEST-EXEC: btest-diff 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
|
@load ./zeromq-test-bootstrap.zeek
|
||||||
|
|
||||||
redef Log::default_rotation_interval = 0sec;
|
redef Log::default_rotation_interval = 0sec;
|
||||||
|
@ -62,9 +62,9 @@ event finish()
|
||||||
{
|
{
|
||||||
terminate();
|
terminate();
|
||||||
}
|
}
|
||||||
# @TEST-END-FILE
|
# # @TEST-END-FILE
|
||||||
|
|
||||||
# @TEST-START-FILE manager.zeek
|
# # @TEST-START-FILE manager.zeek
|
||||||
@load ./common.zeek
|
@load ./common.zeek
|
||||||
|
|
||||||
event check_ready()
|
event check_ready()
|
||||||
|
@ -103,10 +103,10 @@ event Cluster::node_down(name: string, id: string)
|
||||||
if ( |nodes_down| == 4 ) # both loggers down
|
if ( |nodes_down| == 4 ) # both loggers down
|
||||||
terminate();
|
terminate();
|
||||||
}
|
}
|
||||||
# @TEST-END-FILE
|
# # @TEST-END-FILE
|
||||||
|
|
||||||
|
|
||||||
# @TEST-START-FILE worker.zeek
|
# # @TEST-START-FILE worker.zeek
|
||||||
@load ./common.zeek
|
@load ./common.zeek
|
||||||
|
|
||||||
global do_write2 = F;
|
global do_write2 = F;
|
||||||
|
@ -147,9 +147,9 @@ event zeek_init()
|
||||||
event write_log1(0);
|
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
|
#!/usr/bin/env bash
|
||||||
#
|
#
|
||||||
# This script regularly checks for the loggers rr1.log file until
|
# This script regularly checks for the loggers rr1.log file until
|
||||||
|
@ -174,4 +174,4 @@ done
|
||||||
echo "DONE"
|
echo "DONE"
|
||||||
echo "DONE" > DONE
|
echo "DONE" > DONE
|
||||||
exit 0
|
exit 0
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
# @TEST-EXEC: btest-diff ./client/out
|
# @TEST-EXEC: btest-diff ./client/out
|
||||||
# @TEST-EXEC: btest-diff ./client/.stderr
|
# @TEST-EXEC: btest-diff ./client/.stderr
|
||||||
|
|
||||||
# @TEST-START-FILE manager.zeek
|
# # @TEST-START-FILE manager.zeek
|
||||||
@load ./zeromq-test-bootstrap
|
@load ./zeromq-test-bootstrap
|
||||||
redef exit_only_after_terminate = T;
|
redef exit_only_after_terminate = T;
|
||||||
|
|
||||||
|
@ -55,10 +55,10 @@ event Cluster::websocket_client_lost(info: Cluster::EndpointInfo)
|
||||||
print "Cluster::websocket_client_lost";
|
print "Cluster::websocket_client_lost";
|
||||||
terminate();
|
terminate();
|
||||||
}
|
}
|
||||||
# @TEST-END-FILE
|
# # @TEST-END-FILE
|
||||||
|
|
||||||
|
|
||||||
@TEST-START-FILE client.py
|
# @TEST-START-FILE client.py
|
||||||
import json, os, time
|
import json, os, time
|
||||||
from websockets.sync.client import connect
|
from websockets.sync.client import connect
|
||||||
|
|
||||||
|
@ -123,4 +123,4 @@ def main():
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
# @TEST-EXEC: btest-diff ./client/out
|
# @TEST-EXEC: btest-diff ./client/out
|
||||||
# @TEST-EXEC: btest-diff ./client/.stderr
|
# @TEST-EXEC: btest-diff ./client/.stderr
|
||||||
|
|
||||||
# @TEST-START-FILE manager.zeek
|
# # @TEST-START-FILE manager.zeek
|
||||||
@load ./zeromq-test-bootstrap
|
@load ./zeromq-test-bootstrap
|
||||||
redef exit_only_after_terminate = T;
|
redef exit_only_after_terminate = T;
|
||||||
|
|
||||||
|
@ -56,10 +56,10 @@ event Cluster::websocket_client_lost(info: Cluster::EndpointInfo)
|
||||||
if ( lost == 4 )
|
if ( lost == 4 )
|
||||||
terminate();
|
terminate();
|
||||||
}
|
}
|
||||||
# @TEST-END-FILE
|
# # @TEST-END-FILE
|
||||||
|
|
||||||
|
|
||||||
@TEST-START-FILE client.py
|
# @TEST-START-FILE client.py
|
||||||
import json, os, time
|
import json, os, time
|
||||||
from websockets.sync.client import connect
|
from websockets.sync.client import connect
|
||||||
|
|
||||||
|
@ -99,4 +99,4 @@ def main():
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
# @TEST-EXEC: btest-diff ./client/out
|
# @TEST-EXEC: btest-diff ./client/out
|
||||||
# @TEST-EXEC: btest-diff ./client/.stderr
|
# @TEST-EXEC: btest-diff ./client/.stderr
|
||||||
|
|
||||||
# @TEST-START-FILE manager.zeek
|
# # @TEST-START-FILE manager.zeek
|
||||||
@load ./zeromq-test-bootstrap
|
@load ./zeromq-test-bootstrap
|
||||||
redef exit_only_after_terminate = T;
|
redef exit_only_after_terminate = T;
|
||||||
|
|
||||||
|
@ -58,10 +58,10 @@ event Cluster::websocket_client_lost(info: Cluster::EndpointInfo)
|
||||||
print "Cluster::websocket_client_lost";
|
print "Cluster::websocket_client_lost";
|
||||||
terminate();
|
terminate();
|
||||||
}
|
}
|
||||||
# @TEST-END-FILE
|
# # @TEST-END-FILE
|
||||||
|
|
||||||
|
|
||||||
@TEST-START-FILE client.py
|
# @TEST-START-FILE client.py
|
||||||
import json, os, time
|
import json, os, time
|
||||||
import websockets.exceptions
|
import websockets.exceptions
|
||||||
from websockets.sync.client import connect
|
from websockets.sync.client import connect
|
||||||
|
@ -98,4 +98,4 @@ def main():
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
# @TEST-EXEC: btest-diff ./client/out
|
# @TEST-EXEC: btest-diff ./client/out
|
||||||
# @TEST-EXEC: btest-diff ./client/.stderr
|
# @TEST-EXEC: btest-diff ./client/.stderr
|
||||||
|
|
||||||
# @TEST-START-FILE manager.zeek
|
# # @TEST-START-FILE manager.zeek
|
||||||
@load ./zeromq-test-bootstrap
|
@load ./zeromq-test-bootstrap
|
||||||
redef exit_only_after_terminate = T;
|
redef exit_only_after_terminate = T;
|
||||||
|
|
||||||
|
@ -70,10 +70,10 @@ event Cluster::websocket_client_lost(info: Cluster::EndpointInfo)
|
||||||
if ( lost == 3 )
|
if ( lost == 3 )
|
||||||
terminate();
|
terminate();
|
||||||
}
|
}
|
||||||
# @TEST-END-FILE
|
# # @TEST-END-FILE
|
||||||
|
|
||||||
|
|
||||||
@TEST-START-FILE client.py
|
# @TEST-START-FILE client.py
|
||||||
import json, os, time
|
import json, os, time
|
||||||
from websockets.sync.client import connect
|
from websockets.sync.client import connect
|
||||||
|
|
||||||
|
@ -108,4 +108,4 @@ def main():
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
# @TEST-EXEC: btest-diff ./client/out
|
# @TEST-EXEC: btest-diff ./client/out
|
||||||
# @TEST-EXEC: btest-diff ./client/.stderr
|
# @TEST-EXEC: btest-diff ./client/.stderr
|
||||||
|
|
||||||
# @TEST-START-FILE manager.zeek
|
# # @TEST-START-FILE manager.zeek
|
||||||
@load ./zeromq-test-bootstrap
|
@load ./zeromq-test-bootstrap
|
||||||
redef exit_only_after_terminate = T;
|
redef exit_only_after_terminate = T;
|
||||||
|
|
||||||
|
@ -58,10 +58,10 @@ event Cluster::websocket_client_lost(info: Cluster::EndpointInfo)
|
||||||
print "Cluster::websocket_client_lost";
|
print "Cluster::websocket_client_lost";
|
||||||
terminate();
|
terminate();
|
||||||
}
|
}
|
||||||
# @TEST-END-FILE
|
# # @TEST-END-FILE
|
||||||
|
|
||||||
|
|
||||||
@TEST-START-FILE client.py
|
# @TEST-START-FILE client.py
|
||||||
import json, os, time
|
import json, os, time
|
||||||
from websockets.sync.client import connect
|
from websockets.sync.client import connect
|
||||||
|
|
||||||
|
@ -120,4 +120,4 @@ def main():
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
# @TEST-EXEC: btest-diff ./client/out
|
# @TEST-EXEC: btest-diff ./client/out
|
||||||
# @TEST-EXEC: btest-diff ./client/.stderr
|
# @TEST-EXEC: btest-diff ./client/.stderr
|
||||||
|
|
||||||
# @TEST-START-FILE manager.zeek
|
# # @TEST-START-FILE manager.zeek
|
||||||
@load ./zeromq-test-bootstrap
|
@load ./zeromq-test-bootstrap
|
||||||
redef exit_only_after_terminate = T;
|
redef exit_only_after_terminate = T;
|
||||||
|
|
||||||
|
@ -58,10 +58,10 @@ event Cluster::websocket_client_lost(info: Cluster::EndpointInfo)
|
||||||
print "Cluster::websocket_client_lost";
|
print "Cluster::websocket_client_lost";
|
||||||
terminate();
|
terminate();
|
||||||
}
|
}
|
||||||
# @TEST-END-FILE
|
# # @TEST-END-FILE
|
||||||
|
|
||||||
|
|
||||||
@TEST-START-FILE client.py
|
# @TEST-START-FILE client.py
|
||||||
import json, os, time
|
import json, os, time
|
||||||
from websockets.sync.client import connect
|
from websockets.sync.client import connect
|
||||||
|
|
||||||
|
@ -117,4 +117,4 @@ def main():
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
# @TEST-EXEC: btest-diff ./client/out
|
# @TEST-EXEC: btest-diff ./client/out
|
||||||
# @TEST-EXEC: btest-diff ./client/.stderr
|
# @TEST-EXEC: btest-diff ./client/.stderr
|
||||||
|
|
||||||
# @TEST-START-FILE manager.zeek
|
# # @TEST-START-FILE manager.zeek
|
||||||
@load ./zeromq-test-bootstrap
|
@load ./zeromq-test-bootstrap
|
||||||
redef exit_only_after_terminate = T;
|
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::listen_websocket([$listen_host="127.0.0.1", $listen_port=to_port(getenv("WEBSOCKET_PORT"))]);
|
||||||
Cluster::subscribe("/test/manager");
|
Cluster::subscribe("/test/manager");
|
||||||
}
|
}
|
||||||
# @TEST-END-FILE
|
# # @TEST-END-FILE
|
||||||
|
|
||||||
|
|
||||||
@TEST-START-FILE client.py
|
# @TEST-START-FILE client.py
|
||||||
import json, os, time
|
import json, os, time
|
||||||
from websockets.sync.client import connect
|
from websockets.sync.client import connect
|
||||||
|
|
||||||
|
@ -146,4 +146,4 @@ def main():
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
# @TEST-EXEC: btest-diff ./client/out
|
# @TEST-EXEC: btest-diff ./client/out
|
||||||
# @TEST-EXEC: btest-diff ./client/.stderr
|
# @TEST-EXEC: btest-diff ./client/.stderr
|
||||||
|
|
||||||
# @TEST-START-FILE manager.zeek
|
# # @TEST-START-FILE manager.zeek
|
||||||
@load ./zeromq-test-bootstrap
|
@load ./zeromq-test-bootstrap
|
||||||
redef exit_only_after_terminate = T;
|
redef exit_only_after_terminate = T;
|
||||||
|
|
||||||
|
@ -72,10 +72,10 @@ event Cluster::websocket_client_lost(info: Cluster::EndpointInfo)
|
||||||
print "Cluster::websocket_client_lost";
|
print "Cluster::websocket_client_lost";
|
||||||
terminate();
|
terminate();
|
||||||
}
|
}
|
||||||
# @TEST-END-FILE
|
# # @TEST-END-FILE
|
||||||
|
|
||||||
|
|
||||||
@TEST-START-FILE client.py
|
# @TEST-START-FILE client.py
|
||||||
import asyncio, json, os, socket, time
|
import asyncio, json, os, socket, time
|
||||||
from websockets.asyncio.client import connect
|
from websockets.asyncio.client import connect
|
||||||
|
|
||||||
|
@ -135,17 +135,17 @@ def main():
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
# The cert and key were generated with OpenSSL using the following command,
|
# The cert and key were generated with OpenSSL using the following command,
|
||||||
# taken from https://letsencrypt.org/docs/certificates-for-localhost/
|
# taken from https://letsencrypt.org/docs/certificates-for-localhost/
|
||||||
#
|
#
|
||||||
# The test will generate the script, but the certificate is valid
|
# The test will generate the script, but the certificate is valid
|
||||||
# for 10 years.
|
# for 10 years.
|
||||||
@TEST-START-FILE gen-localhost-certs.sh
|
# @TEST-START-FILE gen-localhost-certs.sh
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
openssl req -x509 -out localhost.crt -keyout localhost.key \
|
openssl req -x509 -out localhost.crt -keyout localhost.key \
|
||||||
-newkey rsa:2048 -nodes -sha256 -days 3650 \
|
-newkey rsa:2048 -nodes -sha256 -days 3650 \
|
||||||
-subj '/CN=localhost' -extensions EXT -config <( \
|
-subj '/CN=localhost' -extensions EXT -config <( \
|
||||||
printf "[dn]\nCN=localhost\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:localhost\nbasicConstraints=CA:TRUE")
|
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/out
|
||||||
# @TEST-EXEC: btest-diff ./client/.stderr
|
# @TEST-EXEC: btest-diff ./client/.stderr
|
||||||
|
|
||||||
# @TEST-START-FILE manager.zeek
|
# # @TEST-START-FILE manager.zeek
|
||||||
@load ./zeromq-test-bootstrap
|
@load ./zeromq-test-bootstrap
|
||||||
redef exit_only_after_terminate = T;
|
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::listen_websocket([$listen_host="127.0.0.1", $listen_port=to_port(getenv("WEBSOCKET_PORT"))]);
|
||||||
Cluster::subscribe("/test/manager");
|
Cluster::subscribe("/test/manager");
|
||||||
}
|
}
|
||||||
# @TEST-END-FILE
|
# # @TEST-END-FILE
|
||||||
|
|
||||||
|
|
||||||
@TEST-START-FILE client.py
|
# @TEST-START-FILE client.py
|
||||||
import json, os, time
|
import json, os, time
|
||||||
from websockets.sync.client import connect
|
from websockets.sync.client import connect
|
||||||
|
|
||||||
|
@ -176,4 +176,4 @@ def main():
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
|
@ -25,15 +25,15 @@
|
||||||
# @TEST-EXEC: btest-diff ./client/out
|
# @TEST-EXEC: btest-diff ./client/out
|
||||||
# @TEST-EXEC: btest-diff ./client/.stderr
|
# @TEST-EXEC: btest-diff ./client/.stderr
|
||||||
|
|
||||||
@TEST-START-FILE common.zeek
|
# @TEST-START-FILE common.zeek
|
||||||
@load ./zeromq-test-bootstrap
|
@load ./zeromq-test-bootstrap
|
||||||
|
|
||||||
global ping: event(msg: string, c: count) &is_used;
|
global ping: event(msg: string, c: count) &is_used;
|
||||||
global pong: 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
|
@load ./common.zeek
|
||||||
|
|
||||||
redef Log::enable_local_logging = T;
|
redef Log::enable_local_logging = T;
|
||||||
|
@ -84,9 +84,9 @@ event Cluster::websocket_client_lost(info: Cluster::EndpointInfo)
|
||||||
if ( lost == 3 )
|
if ( lost == 3 )
|
||||||
terminate();
|
terminate();
|
||||||
}
|
}
|
||||||
# @TEST-END-FILE
|
# # @TEST-END-FILE
|
||||||
|
|
||||||
# @TEST-START-FILE worker.zeek
|
# # @TEST-START-FILE worker.zeek
|
||||||
@load ./common.zeek
|
@load ./common.zeek
|
||||||
|
|
||||||
event zeek_init()
|
event zeek_init()
|
||||||
|
@ -109,10 +109,10 @@ event ping(msg: string, n: count)
|
||||||
{
|
{
|
||||||
print fmt("got ping: %s, %s", msg, n);
|
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
|
import json, os, time
|
||||||
from websockets.sync.client import connect
|
from websockets.sync.client import connect
|
||||||
|
|
||||||
|
@ -175,4 +175,4 @@ def main():
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
|
@ -59,7 +59,7 @@ event zeek_init() {
|
||||||
tbl[k] = k;
|
tbl[k] = k;
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-START-FILE 1.seeds
|
# @TEST-START-FILE 1.seeds
|
||||||
3569182667
|
3569182667
|
||||||
3864322632
|
3864322632
|
||||||
2737717875
|
2737717875
|
||||||
|
@ -81,9 +81,9 @@ event zeek_init() {
|
||||||
3834222442
|
3834222442
|
||||||
2355333979
|
2355333979
|
||||||
113403102
|
113403102
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
@TEST-START-FILE 2.seeds
|
# @TEST-START-FILE 2.seeds
|
||||||
4013930712
|
4013930712
|
||||||
1835775324
|
1835775324
|
||||||
3393047106
|
3393047106
|
||||||
|
@ -105,4 +105,4 @@ event zeek_init() {
|
||||||
348858887
|
348858887
|
||||||
14638654
|
14638654
|
||||||
4267481449
|
4267481449
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
|
@ -18,7 +18,7 @@ event new_connection(c: connection) {
|
||||||
recent_conns[c$id] = c$uid;
|
recent_conns[c$id] = c$uid;
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-START-FILE 1.seeds
|
# @TEST-START-FILE 1.seeds
|
||||||
3569182667
|
3569182667
|
||||||
3864322632
|
3864322632
|
||||||
2737717875
|
2737717875
|
||||||
|
@ -40,9 +40,9 @@ event new_connection(c: connection) {
|
||||||
3834222442
|
3834222442
|
||||||
2355333979
|
2355333979
|
||||||
113403102
|
113403102
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
@TEST-START-FILE 2.seeds
|
# @TEST-START-FILE 2.seeds
|
||||||
4013930712
|
4013930712
|
||||||
1835775324
|
1835775324
|
||||||
3393047106
|
3393047106
|
||||||
|
@ -64,4 +64,4 @@ event new_connection(c: connection) {
|
||||||
348858887
|
348858887
|
||||||
14638654
|
14638654
|
||||||
4267481449
|
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: zeek -b -C -r $TRACES/icmp/icmp-destunreach-udp.pcap discarder-icmp.zeek >>output
|
||||||
# @TEST-EXEC: btest-diff output
|
# @TEST-EXEC: btest-diff output
|
||||||
|
|
||||||
@TEST-START-FILE discarder-ip.zeek
|
# @TEST-START-FILE discarder-ip.zeek
|
||||||
|
|
||||||
event zeek_init()
|
event zeek_init()
|
||||||
{
|
{
|
||||||
|
@ -24,9 +24,9 @@ event new_packet(c: connection, p: pkt_hdr)
|
||||||
print c$id;
|
print c$id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
@TEST-START-FILE discarder-tcp.zeek
|
# @TEST-START-FILE discarder-tcp.zeek
|
||||||
|
|
||||||
event zeek_init()
|
event zeek_init()
|
||||||
{
|
{
|
||||||
|
@ -46,9 +46,9 @@ event new_packet(c: connection, p: pkt_hdr)
|
||||||
print c$id;
|
print c$id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
@TEST-START-FILE discarder-udp.zeek
|
# @TEST-START-FILE discarder-udp.zeek
|
||||||
|
|
||||||
event zeek_init()
|
event zeek_init()
|
||||||
{
|
{
|
||||||
|
@ -68,9 +68,9 @@ event new_packet(c: connection, p: pkt_hdr)
|
||||||
print c$id;
|
print c$id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
@TEST-START-FILE discarder-icmp.zeek
|
# @TEST-START-FILE discarder-icmp.zeek
|
||||||
|
|
||||||
event zeek_init()
|
event zeek_init()
|
||||||
{
|
{
|
||||||
|
@ -89,4 +89,4 @@ event new_packet(c: connection, p: pkt_hdr)
|
||||||
print c$id;
|
print c$id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
|
@ -7,21 +7,21 @@ event zeek_init()
|
||||||
print "enable non existing event group", r;
|
print "enable non existing event group", r;
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
event zeek_init()
|
event zeek_init()
|
||||||
{
|
{
|
||||||
local r = disable_event_group("my-group");
|
local r = disable_event_group("my-group");
|
||||||
print "disable non existing event group", r;
|
print "disable non existing event group", r;
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
event zeek_init()
|
event zeek_init()
|
||||||
{
|
{
|
||||||
local r = enable_module_events("MyModule");
|
local r = enable_module_events("MyModule");
|
||||||
print "enabling non existing module event group", r;
|
print "enabling non existing module event group", r;
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
event zeek_init()
|
event zeek_init()
|
||||||
{
|
{
|
||||||
local r = disable_module_events("MyModule");
|
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
|
# This file triggers a binpac exception for PE that is reported through
|
||||||
# analyzer_violation_info
|
# analyzer_violation_info
|
||||||
@TEST-START-FILE ./myfile.exe
|
# @TEST-START-FILE ./myfile.exe
|
||||||
MZ0000000000000000000000000000000000000000000000000000000000000
|
MZ0000000000000000000000000000000000000000000000000000000000000
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
|
@ -28,31 +28,31 @@
|
||||||
# @TEST-EXEC-FAIL: zeek -b load_foo
|
# @TEST-EXEC-FAIL: zeek -b load_foo
|
||||||
# @TEST-EXEC: rm foo.xyz
|
# @TEST-EXEC: rm foo.xyz
|
||||||
|
|
||||||
@TEST-START-FILE load_foo
|
# @TEST-START-FILE load_foo
|
||||||
@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
|
@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";
|
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";
|
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
|
@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";
|
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";
|
print "No file extension script loaded";
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
|
@ -8,11 +8,11 @@
|
||||||
# @TEST-EXEC: rm foo/__load__.zeek
|
# @TEST-EXEC: rm foo/__load__.zeek
|
||||||
# @TEST-EXEC-FAIL: zeek -b foo
|
# @TEST-EXEC-FAIL: zeek -b foo
|
||||||
|
|
||||||
@TEST-START-FILE foo/__load__.zeek
|
# @TEST-START-FILE foo/__load__.zeek
|
||||||
@load ./test
|
@load ./test
|
||||||
print "__load__.zeek loaded";
|
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";
|
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: zeek -b base/utils/site base/protocols/http addprefixes >output
|
||||||
# @TEST-EXEC: btest-diff output
|
# @TEST-EXEC: btest-diff output
|
||||||
|
|
||||||
@TEST-START-FILE addprefixes.zeek
|
# @TEST-START-FILE addprefixes.zeek
|
||||||
@prefixes += lcl
|
@prefixes += lcl
|
||||||
@prefixes += lcl2
|
@prefixes += lcl2
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
# Since base/utils/site.zeek is a script, only a script with the original file
|
# Since base/utils/site.zeek is a script, only a script with the original file
|
||||||
# extension can be loaded here.
|
# 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";
|
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";
|
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.
|
# 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";
|
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: zeek -b foo/foo >output
|
||||||
# @TEST-EXEC: btest-diff output
|
# @TEST-EXEC: btest-diff output
|
||||||
|
|
||||||
@TEST-START-FILE foo/foo.zeek
|
# @TEST-START-FILE foo/foo.zeek
|
||||||
@load ./bar
|
@load ./bar
|
||||||
@load ../baz
|
@load ../baz
|
||||||
print "foo loaded";
|
print "foo loaded";
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
@TEST-START-FILE foo/bar.zeek
|
# @TEST-START-FILE foo/bar.zeek
|
||||||
print "bar loaded";
|
print "bar loaded";
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
@TEST-START-FILE baz.zeek
|
# @TEST-START-FILE baz.zeek
|
||||||
print "baz loaded";
|
print "baz loaded";
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
|
@ -4,15 +4,15 @@
|
||||||
# @TEST-EXEC: btest-diff output
|
# @TEST-EXEC: btest-diff output
|
||||||
# @TEST-EXEC: grep dontloadme loaded_scripts.log && exit 1 || exit 0
|
# @TEST-EXEC: grep dontloadme loaded_scripts.log && exit 1 || exit 0
|
||||||
|
|
||||||
@TEST-START-FILE unload.zeek
|
# @TEST-START-FILE unload.zeek
|
||||||
@unload dontloadme
|
@unload dontloadme
|
||||||
@unload pkg-dontloadme
|
@unload pkg-dontloadme
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
@TEST-START-FILE dontloadme.zeek
|
# @TEST-START-FILE dontloadme.zeek
|
||||||
print "Loaded: 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";
|
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 worker/.stdout
|
||||||
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff manager/.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;
|
redef allow_network_time_forward = F;
|
||||||
|
|
||||||
|
@ -65,10 +65,10 @@ event zeek_done()
|
||||||
{
|
{
|
||||||
print network_time(), "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
|
# The manager waits for a peer to appear, then starts sending timer
|
||||||
# ticks until the peer is gone again.
|
# ticks until the peer is gone again.
|
||||||
global timer_tick: event(ts: time);
|
global timer_tick: event(ts: time);
|
||||||
|
@ -100,4 +100,4 @@ event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string)
|
||||||
print "manager: peer lost, terminating";
|
print "manager: peer lost, terminating";
|
||||||
terminate();
|
terminate();
|
||||||
}
|
}
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
|
@ -3,11 +3,11 @@
|
||||||
|
|
||||||
option testbool;
|
option testbool;
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
|
|
||||||
option testbool : bool;
|
option testbool : bool;
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
|
|
||||||
option testopt = 5;
|
option testopt = 5;
|
||||||
testopt = 6;
|
testopt = 6;
|
||||||
|
|
|
@ -8,17 +8,17 @@
|
||||||
option A = 5;
|
option A = 5;
|
||||||
Option::set("B", 6);
|
Option::set("B", 6);
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
|
|
||||||
option A = 5;
|
option A = 5;
|
||||||
Option::set("A", "hi");
|
Option::set("A", "hi");
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
|
|
||||||
const A = 5;
|
const A = 5;
|
||||||
Option::set("A", 6);
|
Option::set("A", 6);
|
||||||
|
|
||||||
@TEST-START-NEXT:
|
# @TEST-START-NEXT:
|
||||||
|
|
||||||
option A = 5;
|
option A = 5;
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ function option_changed(ID: string, new_value: bool): bool {
|
||||||
|
|
||||||
Option::set_change_handler("A", option_changed);
|
Option::set_change_handler("A", option_changed);
|
||||||
|
|
||||||
@TEST-START-NEXT:
|
# @TEST-START-NEXT:
|
||||||
|
|
||||||
option A = 5;
|
option A = 5;
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ function option_changed(ID: string): bool {
|
||||||
|
|
||||||
Option::set_change_handler("A", option_changed);
|
Option::set_change_handler("A", option_changed);
|
||||||
|
|
||||||
@TEST-START-NEXT:
|
# @TEST-START-NEXT:
|
||||||
|
|
||||||
option A : count = 5;
|
option A : count = 5;
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ function option_changed(ID: string, new_value: count): bool {
|
||||||
|
|
||||||
Option::set_change_handler("A", option_changed);
|
Option::set_change_handler("A", option_changed);
|
||||||
|
|
||||||
@TEST-START-NEXT:
|
# @TEST-START-NEXT:
|
||||||
|
|
||||||
option A : count = 5;
|
option A : count = 5;
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ hook option_changed(ID: string, new_value: count) {
|
||||||
|
|
||||||
Option::set_change_handler("A", option_changed);
|
Option::set_change_handler("A", option_changed);
|
||||||
|
|
||||||
@TEST-START-NEXT:
|
# @TEST-START-NEXT:
|
||||||
|
|
||||||
option A : count = 5;
|
option A : count = 5;
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ event option_changed(ID: string, new_value: count) {
|
||||||
|
|
||||||
Option::set_change_handler("A", option_changed);
|
Option::set_change_handler("A", option_changed);
|
||||||
|
|
||||||
@TEST-START-NEXT:
|
# @TEST-START-NEXT:
|
||||||
|
|
||||||
function option_changed(ID: string, new_value: count) : count {
|
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);
|
Option::set_change_handler("A", option_changed);
|
||||||
|
|
||||||
|
|
||||||
@TEST-START-NEXT:
|
# @TEST-START-NEXT:
|
||||||
|
|
||||||
const A : count = 5;
|
const A : count = 5;
|
||||||
|
|
||||||
|
@ -80,13 +80,13 @@ function option_changed(ID: string, new_value: count) : count {
|
||||||
|
|
||||||
Option::set_change_handler("A", option_changed);
|
Option::set_change_handler("A", option_changed);
|
||||||
|
|
||||||
@TEST-START-NEXT:
|
# @TEST-START-NEXT:
|
||||||
|
|
||||||
option A : count = 5;
|
option A : count = 5;
|
||||||
|
|
||||||
Option::set_change_handler("A", A);
|
Option::set_change_handler("A", A);
|
||||||
|
|
||||||
@TEST-START-NEXT:
|
# @TEST-START-NEXT:
|
||||||
|
|
||||||
option A : count = 5;
|
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);
|
Option::set_change_handler("A", option_changed);
|
||||||
|
|
||||||
@TEST-START-NEXT:
|
# @TEST-START-NEXT:
|
||||||
|
|
||||||
option A : count = 5;
|
option A : count = 5;
|
||||||
|
|
||||||
|
|
|
@ -6,10 +6,10 @@
|
||||||
# @TEST-EXEC-FAIL: zeek -b -a test.zeek >invalid-sig-file 2>&1
|
# @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-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
|
@load-sigs test.sig
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
@TEST-START-FILE test.sig
|
# @TEST-START-FILE test.sig
|
||||||
invalid
|
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-FAIL: cat not-a.pcap | zeek -b -r - >output2 2>&1
|
||||||
# @TEST-EXEC: btest-diff output2
|
# @TEST-EXEC: btest-diff output2
|
||||||
|
|
||||||
@TEST-START-FILE ./not-a.pcap
|
# @TEST-START-FILE ./not-a.pcap
|
||||||
%PDF-1.5
|
%PDF-1.5
|
||||||
This isn't an actual pdf file, and neither a PCAP.
|
This isn't an actual pdf file, and neither a PCAP.
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
|
@ -5,47 +5,47 @@
|
||||||
# Bad syntax
|
# Bad syntax
|
||||||
redef record M::Info$ts -= &log;
|
redef record M::Info$ts -= &log;
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
# Really bad syntax
|
# Really bad syntax
|
||||||
redef record M::Info$ts -= { &log;
|
redef record M::Info$ts -= { &log;
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
# Not the right syntax
|
# Not the right syntax
|
||||||
redef record M::Info$ts -= [ &log ];
|
redef record M::Info$ts -= [ &log ];
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
# Can not make something optional
|
# Can not make something optional
|
||||||
redef record M::Info$ts += { &optional };
|
redef record M::Info$ts += { &optional };
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
# Can not add &default
|
# Can not add &default
|
||||||
redef record M::Info$addl += { &log &default="default"};
|
redef record M::Info$addl += { &log &default="default"};
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
# Can not remove optional
|
# Can not remove optional
|
||||||
redef record M::Info$msg -= { &log &optional };
|
redef record M::Info$msg -= { &log &optional };
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
# Not a record
|
# Not a record
|
||||||
redef record M::ErrCode$msg += { &log };
|
redef record M::ErrCode$msg += { &log };
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
redef record M::Unknown$ts += { &log };
|
redef record M::Unknown$ts += { &log };
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
redef record M::Unknown$ts -= { &log };
|
redef record M::Unknown$ts -= { &log };
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
redef record M::Info$no_such_field += { &log };
|
redef record M::Info$no_such_field += { &log };
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
redef record M::Info$no_such_field -= { &log };
|
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
|
# This isn't reported very nicely: It's a syntax error rather than an unknown attribute
|
||||||
redef record M::Info$ts += { &unknown };
|
redef record M::Info$ts += { &unknown };
|
||||||
|
|
||||||
# @TEST-START-FILE setup.zeek
|
# # @TEST-START-FILE setup.zeek
|
||||||
module M;
|
module M;
|
||||||
export {
|
export {
|
||||||
type ErrCode: enum {
|
type ErrCode: enum {
|
||||||
|
|
|
@ -16,6 +16,6 @@
|
||||||
#
|
#
|
||||||
# @TEST-EXEC: btest-diff output
|
# @TEST-EXEC: btest-diff output
|
||||||
|
|
||||||
@TEST-START-FILE test.zeek
|
# @TEST-START-FILE test.zeek
|
||||||
event idontexist() { }
|
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 worker/.stdout
|
||||||
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff manager/.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()
|
event zeek_init()
|
||||||
{
|
{
|
||||||
|
@ -58,10 +58,10 @@ event zeek_done()
|
||||||
{
|
{
|
||||||
print network_time(), "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()
|
# The manager waits for a peer and directly publishes do_continue_processing()
|
||||||
# to it. It terminates when the peer is lost.
|
# to it. It terminates when the peer is lost.
|
||||||
global do_continue_processing: event();
|
global do_continue_processing: event();
|
||||||
|
@ -82,4 +82,4 @@ event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string)
|
||||||
print "manager: peer lost, terminating";
|
print "manager: peer lost, terminating";
|
||||||
terminate();
|
terminate();
|
||||||
}
|
}
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
|
@ -5,11 +5,11 @@
|
||||||
@load base/frameworks/intel
|
@load base/frameworks/intel
|
||||||
|
|
||||||
|
|
||||||
@TEST-START-FILE intel.dat
|
# @TEST-START-FILE intel.dat
|
||||||
#fields indicator indicator_type meta.source meta.desc meta.url
|
#fields indicator indicator_type meta.source meta.desc meta.url
|
||||||
putty.exe Intel::FILE_NAME source1 SSH utility https://www.putty.org
|
putty.exe Intel::FILE_NAME source1 SSH utility https://www.putty.org
|
||||||
zeek.exe Intel::FILE_NAME source1 A network monitor https://zeek.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" };
|
redef Intel::read_files += { "intel.dat" };
|
||||||
|
|
||||||
|
|
|
@ -12,12 +12,12 @@
|
||||||
# @TEST-EXEC: grep profiling-test cov.txt > step3.out
|
# @TEST-EXEC: grep profiling-test cov.txt > step3.out
|
||||||
# @TEST-EXEC: btest-diff 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)
|
event new_connection(c: connection)
|
||||||
{ print "new conn"; }
|
{ 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)
|
event new_connection(c: connection)
|
||||||
{ print "new conn"; }
|
{ 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;
|
module MyModule;
|
||||||
|
|
||||||
export {
|
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;
|
module RedefIt;
|
||||||
|
|
||||||
export {
|
export {
|
||||||
|
@ -53,14 +53,14 @@ export {
|
||||||
addl: string &log &default="dfl";
|
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
|
@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;
|
module RedefMore;
|
||||||
|
|
||||||
export {
|
export {
|
||||||
|
@ -68,4 +68,4 @@ export {
|
||||||
more: string &log &default="more";
|
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: 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-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
|
identifier TestEnum* autogen-reST-enums.rst
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
## There's tons of ways an enum can look...
|
## There's tons of ways an enum can look...
|
||||||
type TestEnum1: enum {
|
type TestEnum1: enum {
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
# @TEST-EXEC: unset ZEEK_DISABLE_ZEEKYGEN; zeek -b -X zeekygen.config %INPUT
|
# @TEST-EXEC: unset ZEEK_DISABLE_ZEEKYGEN; zeek -b -X zeekygen.config %INPUT
|
||||||
# @TEST-EXEC: btest-diff example.rst
|
# @TEST-EXEC: btest-diff example.rst
|
||||||
|
|
||||||
@TEST-START-FILE zeekygen.config
|
# @TEST-START-FILE zeekygen.config
|
||||||
script zeekygen/example.zeek example.rst
|
script zeekygen/example.zeek example.rst
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
@load zeekygen/example
|
@load zeekygen/example
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
# @TEST-EXEC: unset ZEEK_DISABLE_ZEEKYGEN; zeek -b -X zeekygen.config %INPUT
|
# @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-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
|
identifier test_func_params* autogen-reST-func-params.rst
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
## This is a global function declaration.
|
## 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: 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-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
|
identifier ZeekygenExample::* test.rst
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
@load zeekygen
|
@load zeekygen
|
||||||
|
|
|
@ -9,6 +9,6 @@
|
||||||
# @TEST-EXEC: unset ZEEK_DISABLE_ZEEKYGEN; zeek -b -X zeekygen.config %INPUT
|
# @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-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
|
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: unset ZEEK_DISABLE_ZEEKYGEN; zeek -b -X zeekygen.config %INPUT Broker::default_port=$BROKER_PORT
|
||||||
# @TEST-EXEC: btest-diff test.rst
|
# @TEST-EXEC: btest-diff test.rst
|
||||||
|
|
||||||
@TEST-START-FILE zeekygen.config
|
# @TEST-START-FILE zeekygen.config
|
||||||
package zeekygen test.rst
|
package zeekygen test.rst
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
@load zeekygen
|
@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: unset ZEEK_DISABLE_ZEEKYGEN; zeek -b -X zeekygen.config %INPUT Broker::default_port=$BROKER_PORT
|
||||||
# @TEST-EXEC: btest-diff test.rst
|
# @TEST-EXEC: btest-diff test.rst
|
||||||
|
|
||||||
@TEST-START-FILE zeekygen.config
|
# @TEST-START-FILE zeekygen.config
|
||||||
package_index zeekygen test.rst
|
package_index zeekygen test.rst
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
@load zeekygen
|
@load zeekygen
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
# @TEST-EXEC: unset ZEEK_DISABLE_ZEEKYGEN; zeek -b -X zeekygen.config %INPUT
|
# @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-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
|
identifier TestRecord* autogen-reST-records.rst
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
# undocumented record
|
# undocumented record
|
||||||
type TestRecord1: 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: unset ZEEK_DISABLE_ZEEKYGEN; zeek -b -X zeekygen.config %INPUT Broker::default_port=$BROKER_PORT
|
||||||
# @TEST-EXEC: btest-diff test.rst
|
# @TEST-EXEC: btest-diff test.rst
|
||||||
|
|
||||||
@TEST-START-FILE zeekygen.config
|
# @TEST-START-FILE zeekygen.config
|
||||||
script_index zeekygen/* test.rst
|
script_index zeekygen/* test.rst
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
@load zeekygen
|
@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: unset ZEEK_DISABLE_ZEEKYGEN; zeek -b -X zeekygen.config %INPUT Broker::default_port=$BROKER_PORT
|
||||||
# @TEST-EXEC: btest-diff test.rst
|
# @TEST-EXEC: btest-diff test.rst
|
||||||
|
|
||||||
@TEST-START-FILE zeekygen.config
|
# @TEST-START-FILE zeekygen.config
|
||||||
script_summary zeekygen/example.zeek test.rst
|
script_summary zeekygen/example.zeek test.rst
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
@load zeekygen
|
@load zeekygen
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
# @TEST-EXEC: unset ZEEK_DISABLE_ZEEKYGEN; zeek -b -X zeekygen.config %INPUT
|
# @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-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
|
identifier ZeekygenTest::* autogen-reST-type-aliases.rst
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
module ZeekygenTest;
|
module ZeekygenTest;
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
# @TEST-EXEC: unset ZEEK_DISABLE_ZEEKYGEN; zeek -b -X zeekygen.config %INPUT
|
# @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-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
|
identifier test_vector* autogen-reST-vectors.rst
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
type TestRecord: record {
|
type TestRecord: record {
|
||||||
field1: bool;
|
field1: bool;
|
||||||
|
|
|
@ -44,7 +44,7 @@ event zeek_init()
|
||||||
event foo("A", "B");
|
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(a: string, b: string, c: string &default="C");
|
||||||
global foo: event(c: string, b: string, a: string &default="A");
|
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");
|
event myev("one", "two", "three");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-START-FILE hide.zeek
|
# @TEST-START-FILE hide.zeek
|
||||||
event myev(a: string, c: string) &priority = 7
|
event myev(a: string, c: string) &priority = 7
|
||||||
{
|
{
|
||||||
local ddd = vector(1,2,3);
|
local ddd = vector(1,2,3);
|
||||||
print "myev (new)", a, c, ddd;
|
print "myev (new)", a, c, ddd;
|
||||||
print b;
|
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.
|
# Do not allow to call variadic through a script-level variable.
|
||||||
global f: function(x: any);
|
global f: function(x: any);
|
||||||
|
|
||||||
|
|
|
@ -8,19 +8,19 @@ event zeek_init()
|
||||||
assert 1;
|
assert 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
event zeek_init()
|
event zeek_init()
|
||||||
{
|
{
|
||||||
assert T, 1234;
|
assert T, 1234;
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
event zeek_init()
|
event zeek_init()
|
||||||
{
|
{
|
||||||
assert;
|
assert;
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
event zeek_init()
|
event zeek_init()
|
||||||
{
|
{
|
||||||
assert T, "extra", "something";
|
assert T, "extra", "something";
|
||||||
|
|
|
@ -16,7 +16,7 @@ event zeek_init()
|
||||||
print "not reached";
|
print "not reached";
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
# Test the backtrace location, also calling break to suppress reporter log.
|
# Test the backtrace location, also calling break to suppress reporter log.
|
||||||
hook assertion_failure(cond: string, msg: string, bt: Backtrace)
|
hook assertion_failure(cond: string, msg: string, bt: Backtrace)
|
||||||
{
|
{
|
||||||
|
@ -50,7 +50,7 @@ event zeek_init()
|
||||||
print "not reached";
|
print "not reached";
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
# Calling terminate() from the assertion hook.
|
# Calling terminate() from the assertion hook.
|
||||||
redef exit_only_after_terminate = T;
|
redef exit_only_after_terminate = T;
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ event zeek_done()
|
||||||
assert zeek_is_terminating(), "zeek_done() should have zeek terminating";
|
assert zeek_is_terminating(), "zeek_done() should have zeek terminating";
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
# Calling exit() from the assertion hook.
|
# Calling exit() from the assertion hook.
|
||||||
redef exit_only_after_terminate = T;
|
redef exit_only_after_terminate = T;
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ event zeek_done()
|
||||||
assert F, "zeek_done() not executed with exit()";
|
assert F, "zeek_done() not executed with exit()";
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
global assertion_failures = 0;
|
global assertion_failures = 0;
|
||||||
global assertions_total = 0;
|
global assertions_total = 0;
|
||||||
|
|
||||||
|
@ -146,7 +146,7 @@ event zeek_done()
|
||||||
print fmt("%d of %d assertions failed", assertion_failures, assertions_total);
|
print fmt("%d of %d assertions failed", assertion_failures, assertions_total);
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
# Evaluating the msg expression can cause errors, see if we deal
|
# Evaluating the msg expression can cause errors, see if we deal
|
||||||
# with that gracefully.
|
# with that gracefully.
|
||||||
hook assertion_failure(cond: string, msg: string, bt: Backtrace)
|
hook assertion_failure(cond: string, msg: string, bt: Backtrace)
|
||||||
|
@ -174,7 +174,7 @@ event zeek_done()
|
||||||
assert 2 + 2 == 5, cat(get_current_packet_header()$ip);
|
assert 2 + 2 == 5, cat(get_current_packet_header()$ip);
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
# Breaking in assertion_result() also suppresses the reporter errors.
|
# Breaking in assertion_result() also suppresses the reporter errors.
|
||||||
hook assertion_result(result: bool, cond: string, msg: string, bt: Backtrace)
|
hook assertion_result(result: bool, cond: string, msg: string, bt: Backtrace)
|
||||||
{
|
{
|
||||||
|
@ -196,7 +196,7 @@ event zeek_done()
|
||||||
print "not reached";
|
print "not reached";
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
# Ensure cond is only evaluated once.
|
# Ensure cond is only evaluated once.
|
||||||
hook assertion_result(result: bool, cond: string, msg: string, bt: Backtrace)
|
hook assertion_result(result: bool, cond: string, msg: string, bt: Backtrace)
|
||||||
{
|
{
|
||||||
|
|
|
@ -9,21 +9,21 @@ event zeek_init()
|
||||||
print "not reached";
|
print "not reached";
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
event zeek_init()
|
event zeek_init()
|
||||||
{
|
{
|
||||||
assert fmt("%s", 1) == "2", fmt("\"%s\" != \"2\"", 1);
|
assert fmt("%s", 1) == "2", fmt("\"%s\" != \"2\"", 1);
|
||||||
print "not reached";
|
print "not reached";
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
event zeek_init()
|
event zeek_init()
|
||||||
{
|
{
|
||||||
assert to_count("42") == 42.5, "always failing";
|
assert to_count("42") == 42.5, "always failing";
|
||||||
print "not reached";
|
print "not reached";
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
event zeek_init()
|
event zeek_init()
|
||||||
{
|
{
|
||||||
local x = 2;
|
local x = 2;
|
||||||
|
@ -31,7 +31,7 @@ event zeek_init()
|
||||||
print "not reached";
|
print "not reached";
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
event zeek_init()
|
event zeek_init()
|
||||||
{
|
{
|
||||||
local tbl: table[string] of string = [
|
local tbl: table[string] of string = [
|
||||||
|
@ -43,7 +43,7 @@ event zeek_init()
|
||||||
assert "ghi" in tbl, cat(tbl);
|
assert "ghi" in tbl, cat(tbl);
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
type MyRecord: record {
|
type MyRecord: record {
|
||||||
a: count;
|
a: count;
|
||||||
b: count &optional;
|
b: count &optional;
|
||||||
|
@ -56,7 +56,7 @@ event zeek_init()
|
||||||
assert r?$b, fmt("r$b is not set in %s", r);
|
assert r?$b, fmt("r$b is not set in %s", r);
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
type MyRecord: record {
|
type MyRecord: record {
|
||||||
a: count;
|
a: count;
|
||||||
b: count &optional;
|
b: count &optional;
|
||||||
|
@ -71,7 +71,7 @@ event zeek_init()
|
||||||
assert r?$b, fmt("r$b is not set trying anyway: %s", r$b);
|
assert r?$b, fmt("r$b is not set trying anyway: %s", r$b);
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
assert 1 == 1, "always true";
|
assert 1 == 1, "always true";
|
||||||
assert 1 == 2, "always false";
|
assert 1 == 2, "always false";
|
||||||
print "not reached";
|
print "not reached";
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
# @TEST-EXEC: zeek -b foo
|
# @TEST-EXEC: zeek -b foo
|
||||||
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff .stderr
|
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff .stderr
|
||||||
|
|
||||||
@TEST-START-FILE foo.zeek
|
# @TEST-START-FILE foo.zeek
|
||||||
@deprecated
|
@deprecated
|
||||||
@load bar
|
@load bar
|
||||||
@load baz
|
@load baz
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
@TEST-START-FILE bar.zeek
|
# @TEST-START-FILE bar.zeek
|
||||||
@deprecated "Use '@load qux' instead"
|
@deprecated "Use '@load qux' instead"
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
@TEST-START-FILE baz.zeek
|
# @TEST-START-FILE baz.zeek
|
||||||
@deprecated
|
@deprecated
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
|
@ -5,6 +5,6 @@
|
||||||
|
|
||||||
print @DIR;
|
print @DIR;
|
||||||
|
|
||||||
@TEST-START-FILE pathtest.zeek
|
# @TEST-START-FILE pathtest.zeek
|
||||||
print @DIR;
|
print @DIR;
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
|
@ -27,7 +27,7 @@ event zeek_init()
|
||||||
print type_name(make_epoch_result), type_name(f), type_name(result), result;
|
print type_name(make_epoch_result), type_name(f), type_name(result), result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
# Place braces differently
|
# Place braces differently
|
||||||
|
|
||||||
@load base/misc/version
|
@load base/misc/version
|
||||||
|
@ -52,7 +52,7 @@ event zeek_init()
|
||||||
print type_name(make_epoch_result), type_name(f), type_name(result), result;
|
print type_name(make_epoch_result), type_name(f), type_name(result), result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
# This example doesn't make a whole lot of sense, but adding more @ifdef'ery
|
# This example doesn't make a whole lot of sense, but adding more @ifdef'ery
|
||||||
# around lambdas.
|
# around lambdas.
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@ event zeek_init()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
# Same as above, but toggle T
|
# Same as above, but toggle T
|
||||||
@load base/utils/numbers
|
@load base/utils/numbers
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ event zeek_init()
|
||||||
print "That's the right branch";
|
print "That's the right branch";
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
event zeek_init()
|
event zeek_init()
|
||||||
{
|
{
|
||||||
if ( F )
|
if ( F )
|
||||||
|
@ -25,7 +25,7 @@ event zeek_init()
|
||||||
@endif
|
@endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
event zeek_init()
|
event zeek_init()
|
||||||
{
|
{
|
||||||
local vec = vector(1, 2, 3);
|
local vec = vector(1, 2, 3);
|
||||||
|
@ -35,7 +35,7 @@ event zeek_init()
|
||||||
@endif
|
@endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
event zeek_init()
|
event zeek_init()
|
||||||
{
|
{
|
||||||
local i = 10;
|
local i = 10;
|
||||||
|
@ -45,7 +45,7 @@ event zeek_init()
|
||||||
@endif
|
@endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
global cond = T;
|
global cond = T;
|
||||||
event zeek_init()
|
event zeek_init()
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# @TEST-EXEC: btest-diff out
|
# @TEST-EXEC: btest-diff out
|
||||||
# @TEST-EXEC: btest-diff .stderr
|
# @TEST-EXEC: btest-diff .stderr
|
||||||
|
|
||||||
@TEST-START-FILE main.zeek
|
# @TEST-START-FILE main.zeek
|
||||||
|
|
||||||
function test_case(msg: string, expect: bool)
|
function test_case(msg: string, expect: bool)
|
||||||
{
|
{
|
||||||
|
@ -69,9 +69,9 @@ event zeek_init()
|
||||||
test_case( "@ifdef child variable", xyz == 1 );
|
test_case( "@ifdef child variable", xyz == 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
@TEST-START-FILE bar.zeek
|
# @TEST-START-FILE bar.zeek
|
||||||
|
|
||||||
module Bar;
|
module Bar;
|
||||||
|
|
||||||
|
@ -79,4 +79,4 @@ export {
|
||||||
option exists = T;
|
option exists = T;
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# @TEST-EXEC: btest-diff out
|
# @TEST-EXEC: btest-diff out
|
||||||
# @TEST-EXEC: btest-diff .stderr
|
# @TEST-EXEC: btest-diff .stderr
|
||||||
|
|
||||||
@TEST-START-FILE main.zeek
|
# @TEST-START-FILE main.zeek
|
||||||
|
|
||||||
function test_case(msg: string, expect: bool)
|
function test_case(msg: string, expect: bool)
|
||||||
{
|
{
|
||||||
|
@ -70,9 +70,9 @@ event zeek_init()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
||||||
@TEST-START-FILE bar.zeek
|
# @TEST-START-FILE bar.zeek
|
||||||
|
|
||||||
module Bar;
|
module Bar;
|
||||||
|
|
||||||
|
@ -80,4 +80,4 @@ export {
|
||||||
option exists = T;
|
option exists = T;
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-END-FILE
|
# @TEST-END-FILE
|
||||||
|
|
|
@ -9,14 +9,14 @@ event zeek_init()
|
||||||
print _;
|
print _;
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
event zeek_init()
|
event zeek_init()
|
||||||
{
|
{
|
||||||
local _ = vector( "1", "2", "3" );
|
local _ = vector( "1", "2", "3" );
|
||||||
print _;
|
print _;
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
# Ensure it does not work in a module, either.
|
# Ensure it does not work in a module, either.
|
||||||
module MyModule;
|
module MyModule;
|
||||||
event zeek_init()
|
event zeek_init()
|
||||||
|
@ -25,7 +25,7 @@ event zeek_init()
|
||||||
print _;
|
print _;
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
# Ensure _ can not referenced when it's a const in an export section.
|
# Ensure _ can not referenced when it's a const in an export section.
|
||||||
# Adding the const _ isn't an error though.
|
# Adding the const _ isn't an error though.
|
||||||
module MyModule;
|
module MyModule;
|
||||||
|
@ -39,7 +39,7 @@ event zeek_init()
|
||||||
print MyModule::_;
|
print MyModule::_;
|
||||||
}
|
}
|
||||||
|
|
||||||
@TEST-START-NEXT
|
# @TEST-START-NEXT
|
||||||
# Ensure it does not work in a function.
|
# Ensure it does not work in a function.
|
||||||
module MyModule;
|
module MyModule;
|
||||||
function helper()
|
function helper()
|
||||||
|
|
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