Skip to content

Commit

Permalink
Reformat Zeek scripts with zeek-script.
Browse files Browse the repository at this point in the history
  • Loading branch information
rsmmr committed Jan 8, 2024
1 parent 5c83f5c commit 5be001b
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion tests/zeek/error.zeek
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ event got_result()

event zeek_init()
{
ZeekAgent::query([$sql_stmt="SELECT foo FROM bar", $event_=got_result]);
ZeekAgent::query([ $sql_stmt="SELECT foo FROM bar", $event_=got_result ]);
}

event ZeekAgentAPI::agent_error_v1(ctx: ZeekAgent::Context, msg: string)
Expand Down
6 changes: 3 additions & 3 deletions tests/zeek/if-missing-table.zeek
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ event do_terminate()

event zeek_init()
{
ZeekAgent::query([$sql_stmt="SELECT agent_version FROM zeek_agent",
ZeekAgent::query([ $sql_stmt="SELECT agent_version FROM zeek_agent",
$event_=got_result, $cookie="Hurz", $if_missing_tables=set(
"zeek_agent")]);
schedule 5 secs { do_terminate() };
"zeek_agent") ]);
schedule 5secs { do_terminate() };
}

event ZeekAgentAPI::agent_error_v1(ctx: ZeekAgent::Context, msg: string)
Expand Down
4 changes: 2 additions & 2 deletions tests/zeek/query.zeek
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ event got_result(ctx: ZeekAgent::Context, data: Columns)

event zeek_init()
{
ZeekAgent::query([$sql_stmt="SELECT agent_version FROM zeek_agent",
$event_=got_result, $cookie="Hurz", $schedule_=20 secs]);
ZeekAgent::query([ $sql_stmt="SELECT agent_version FROM zeek_agent",
$event_=got_result, $cookie="Hurz", $schedule_=20secs ]);
}
6 changes: 3 additions & 3 deletions tests/zeek/requires-table.zeek
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ event got_result()

event zeek_init()
{
ZeekAgent::query([$sql_stmt="SELECT foo FROM bar", $event_=got_result,
$requires_tables=set("bar")]);
schedule 5 secs { do_terminate() };
ZeekAgent::query([ $sql_stmt="SELECT foo FROM bar", $event_=got_result,
$requires_tables=set("bar") ]);
schedule 5secs { do_terminate() };
}

event ZeekAgentAPI::agent_error_v1(ctx: ZeekAgent::Context, msg: string)
Expand Down
4 changes: 2 additions & 2 deletions tests/zeek/scheduled.zeek
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ event got_result(ctx: ZeekAgent::Context, data: Columns)
{
ZeekAgent::cancel(query_id);
print "terminating soon - there should not be another 'got result' after this";
schedule 2 secs { do_terminate() };
schedule 2secs { do_terminate() };
}
}

event zeek_init()
{
query_id = ZeekAgent::query([
$sql_stmt="SELECT id, agent_version FROM zeek_agent",
$event_=got_result, $cookie="Hurz", $schedule_=3 secs]);
$event_=got_result, $cookie="Hurz", $schedule_=3secs ]);
}
2 changes: 1 addition & 1 deletion tests/zeek/table/files.zeek
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ event do_terminate()
event ZeekAgentAPI::agent_hello_v1(ctx: ZeekAgent::Context,
columns: ZeekAgentAPI::AgentHelloV1)
{
schedule 2 secs { do_terminate() };
schedule 2secs { do_terminate() };
}
2 changes: 1 addition & 1 deletion tests/zeek/table/processes.zeek
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ event do_terminate()
event ZeekAgentAPI::agent_hello_v1(ctx: ZeekAgent::Context,
columns: ZeekAgentAPI::AgentHelloV1)
{
schedule 2 secs { do_terminate() };
schedule 2secs { do_terminate() };
}
2 changes: 1 addition & 1 deletion tests/zeek/table/sockets.zeek
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ event do_terminate()
event ZeekAgentAPI::agent_hello_v1(ctx: ZeekAgent::Context,
columns: ZeekAgentAPI::AgentHelloV1)
{
schedule 2 secs { do_terminate() };
schedule 2secs { do_terminate() };
}
2 changes: 1 addition & 1 deletion tests/zeek/table/ssh.zeek
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ event do_terminate()
event ZeekAgentAPI::agent_hello_v1(ctx: ZeekAgent::Context,
columns: ZeekAgentAPI::AgentHelloV1)
{
schedule 5 secs { do_terminate() };
schedule 5secs { do_terminate() };
}
4 changes: 2 additions & 2 deletions tests/zeek/table/system_logs.zeek
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

@load test-setup

redef ZeekAgent_SystemLogs::query_interval = 1 sec;
redef ZeekAgent_SystemLogs::query_interval = 1sec;

# We only accept the 2nd write writer so that our output doesn't depend on
# runtime duration (1st write is empty).
Expand All @@ -31,5 +31,5 @@ event do_terminate()
event ZeekAgentAPI::agent_hello_v1(ctx: ZeekAgent::Context,
columns: ZeekAgentAPI::AgentHelloV1)
{
schedule 4 secs { do_terminate() };
schedule 4secs { do_terminate() };
}
2 changes: 1 addition & 1 deletion tests/zeek/table/users.zeek
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ event do_terminate()
event ZeekAgentAPI::agent_hello_v1(ctx: ZeekAgent::Context,
columns: ZeekAgentAPI::AgentHelloV1)
{
schedule 2 secs { do_terminate() };
schedule 2secs { do_terminate() };
}

0 comments on commit 5be001b

Please sign in to comment.