Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/topic/awelzel/fix-dump-events-test'
Browse files Browse the repository at this point in the history
* origin/topic/awelzel/fix-dump-events-test:
  Func: Use std::stable_sort() for sorting bodies by priority
  btest/dump-events: Do not skip everywhere and update baselines
  • Loading branch information
awelzel committed Dec 13, 2022
2 parents f1bcb5d + 7ca78ea commit 061c066
Show file tree
Hide file tree
Showing 8 changed files with 2,141 additions and 2,110 deletions.
4 changes: 4 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
5.2.0-dev.430 | 2022-12-13 11:50:47 +0100

* Func: Use std::stable_sort() for sorting bodies by priority (Arne Welzel, Corelight)

5.2.0-dev.427 | 2022-12-13 11:37:47 +0100

* logging: Add event_groups to Stream (Arne Welzel, Corelight)
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.2.0-dev.427
5.2.0-dev.430
4 changes: 2 additions & 2 deletions src/Func.cc
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ ScriptFunc::ScriptFunc(std::string _name, FuncTypePtr ft, std::vector<StmtPtr> b
bodies.push_back(b);
}

sort(bodies.begin(), bodies.end());
std::stable_sort(bodies.begin(), bodies.end());

if ( ! bodies.empty() )
{
Expand Down Expand Up @@ -566,7 +566,7 @@ void ScriptFunc::AddBody(StmtPtr new_body, const std::vector<IDPtr>& new_inits,
current_priority = b.priority = priority;

bodies.push_back(b);
sort(bodies.begin(), bodies.end());
std::stable_sort(bodies.begin(), bodies.end());
}

void ScriptFunc::ReplaceBody(const StmtPtr& old_body, StmtPtr new_body)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
0.000000 filter_change_tracking
XXXXXXXXXX.XXXXXX Broker::log_flush
XXXXXXXXXX.XXXXXX ChecksumOffloading::check
XXXXXXXXXX.XXXXXX run_sync_hook
XXXXXXXXXX.XXXXXX filter_change_tracking
XXXXXXXXXX.XXXXXX new_connection
XXXXXXXXXX.XXXXXX dns_message
XXXXXXXXXX.XXXXXX dns_request
XXXXXXXXXX.XXXXXX analyzer_confirmation
XXXXXXXXXX.XXXXXX analyzer_confirmation_info
XXXXXXXXXX.XXXXXX dns_end
XXXXXXXXXX.XXXXXX dns_message
XXXXXXXXXX.XXXXXX dns_CNAME_reply
Expand All @@ -19,7 +20,7 @@ XXXXXXXXXX.XXXXXX connection_established
XXXXXXXXXX.XXXXXX smtp_reply
XXXXXXXXXX.XXXXXX smtp_reply
XXXXXXXXXX.XXXXXX smtp_reply
XXXXXXXXXX.XXXXXX analyzer_confirmation
XXXXXXXXXX.XXXXXX analyzer_confirmation_info
XXXXXXXXXX.XXXXXX smtp_request
XXXXXXXXXX.XXXXXX Broker::log_flush
XXXXXXXXXX.XXXXXX smtp_reply
Expand Down Expand Up @@ -108,6 +109,7 @@ XXXXXXXXXX.XXXXXX smtp_request
XXXXXXXXXX.XXXXXX smtp_reply
XXXXXXXXXX.XXXXXX Broker::log_flush
XXXXXXXXXX.XXXXXX new_connection
XXXXXXXXXX.XXXXXX run_sync_hook
XXXXXXXXXX.XXXXXX ChecksumOffloading::check
XXXXXXXXXX.XXXXXX connection_state_remove
XXXXXXXXXX.XXXXXX Broker::log_flush
Expand All @@ -117,10 +119,11 @@ XXXXXXXXXX.XXXXXX connection_state_remove
XXXXXXXXXX.XXXXXX filter_change_tracking
XXXXXXXXXX.XXXXXX new_connection
XXXXXXXXXX.XXXXXX Broker::log_flush
XXXXXXXXXX.XXXXXX run_sync_hook
XXXXXXXXXX.XXXXXX new_connection
XXXXXXXXXX.XXXXXX connection_established
XXXXXXXXXX.XXXXXX smtp_reply
XXXXXXXXXX.XXXXXX analyzer_confirmation
XXXXXXXXXX.XXXXXX analyzer_confirmation_info
XXXXXXXXXX.XXXXXX smtp_request
XXXXXXXXXX.XXXXXX smtp_reply
XXXXXXXXXX.XXXXXX smtp_reply
Expand Down Expand Up @@ -162,6 +165,7 @@ XXXXXXXXXX.XXXXXX get_file_handle
XXXXXXXXXX.XXXXXX smtp_request
XXXXXXXXXX.XXXXXX smtp_reply
XXXXXXXXXX.XXXXXX Broker::log_flush
XXXXXXXXXX.XXXXXX run_sync_hook
XXXXXXXXXX.XXXXXX new_connection
XXXXXXXXXX.XXXXXX new_connection
XXXXXXXXXX.XXXXXX new_connection
Expand All @@ -173,7 +177,7 @@ XXXXXXXXXX.XXXXXX ssl_extension
XXXXXXXXXX.XXXXXX ssl_extension
XXXXXXXXXX.XXXXXX ssl_extension
XXXXXXXXXX.XXXXXX ssl_extension
XXXXXXXXXX.XXXXXX analyzer_confirmation
XXXXXXXXXX.XXXXXX analyzer_confirmation_info
XXXXXXXXXX.XXXXXX ssl_client_hello
XXXXXXXXXX.XXXXXX ssl_handshake_message
XXXXXXXXXX.XXXXXX ssl_plaintext_data
Expand Down Expand Up @@ -227,6 +231,7 @@ XXXXXXXXXX.XXXXXX ssl_plaintext_data
XXXXXXXXXX.XXXXXX ssl_established
XXXXXXXXXX.XXXXXX net_done
XXXXXXXXXX.XXXXXX Broker::log_flush
XXXXXXXXXX.XXXXXX run_sync_hook
XXXXXXXXXX.XXXXXX filter_change_tracking
XXXXXXXXXX.XXXXXX connection_state_remove
XXXXXXXXXX.XXXXXX connection_state_remove
Expand Down
547 changes: 274 additions & 273 deletions testing/btest/Baseline/scripts.policy.misc.dump-events/all-events.log

Large diffs are not rendered by default.

3,589 changes: 1,805 additions & 1,784 deletions testing/btest/Baseline/scripts.policy.misc.dump-events/really-all-events.log

Large diffs are not rendered by default.

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions testing/btest/scripts/policy/misc/dump-events.zeek
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Skip this test for OpenSSL 3.0 at the moment. We will switch it to only OpenSSL 3.0, once
# a majority of distributions use is.
# @TEST-REQUIRES: grep -q "^ZEEK_HAVE_OPENSSL_3_0.*true" $BUILD/CMakeCache.txt && test $? != 0
# @TEST-REQUIRES: ! grep -q "^ZEEK_HAVE_OPENSSL_3_0.*true" $BUILD/CMakeCache.txt

# @TEST-EXEC: zeek -r $TRACES/smtp.trace policy/misc/dump-events %INPUT >all-events.log
# @TEST-EXEC: zeek -r $TRACES/smtp.trace policy/misc/dump-events %INPUT DumpEvents::include_args=F >all-events-no-args.log
# @TEST-EXEC: zeek -r $TRACES/smtp.trace policy/misc/dump-events %INPUT DumpEvents::include=/smtp_/ >smtp-events.log
# @TEST-EXEC: zeek -r $TRACES/smtp.trace policy/misc/dump-events %INPUT DumpEvents::dump_all_events=T | grep -v "CPU: interval\|samples: set\|path: string" > really-all-events.log
# @TEST-EXEC: zeek -r $TRACES/smtp.trace policy/misc/dump-events %INPUT DumpEvents::dump_all_events=T | grep -v "CPU: interval\|samples: load_sample_info\|path: string" > really-all-events.log
#
# @TEST-EXEC: btest-diff all-events.log
# @TEST-EXEC: btest-diff all-events-no-args.log
Expand Down

0 comments on commit 061c066

Please sign in to comment.