mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Fixing unit tests and some minor bugs.
This commit is contained in:
parent
39af63841b
commit
d2118200ea
13 changed files with 25 additions and 21 deletions
|
@ -102,7 +102,6 @@ rest_target(${psd} policy/integration/barnyard2/main.bro)
|
|||
rest_target(${psd} policy/integration/barnyard2/types.bro)
|
||||
rest_target(${psd} policy/misc/analysis-groups.bro)
|
||||
rest_target(${psd} policy/misc/loaded-scripts.bro)
|
||||
rest_target(${psd} policy/misc/pf-ring-load-balancing.bro)
|
||||
rest_target(${psd} policy/misc/profiling.bro)
|
||||
rest_target(${psd} policy/misc/trim-trace-file.bro)
|
||||
rest_target(${psd} policy/protocols/conn/known-hosts.bro)
|
||||
|
@ -115,7 +114,7 @@ rest_target(${psd} policy/protocols/http/detect-MHR.bro)
|
|||
rest_target(${psd} policy/protocols/http/detect-intel.bro)
|
||||
rest_target(${psd} policy/protocols/http/detect-sqli.bro)
|
||||
rest_target(${psd} policy/protocols/http/detect-webapps.bro)
|
||||
rest_target(${psd} policy/protocols/http/headers.bro)
|
||||
rest_target(${psd} policy/protocols/http/header-names.bro)
|
||||
rest_target(${psd} policy/protocols/http/software.bro)
|
||||
rest_target(${psd} policy/protocols/http/var-extraction-cookies.bro)
|
||||
rest_target(${psd} policy/protocols/http/var-extraction-uri.bro)
|
||||
|
|
|
@ -207,7 +207,8 @@ function default_path_func(id: ID, path: string, rec: any) : string
|
|||
else
|
||||
{
|
||||
# In case there is a logging stream in the global namespace.
|
||||
return to_lower(id_str);
|
||||
# TODO: same bug as above with split and lack of terminating \0
|
||||
return fmt("%s", to_lower(id_str));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -241,8 +242,7 @@ function create_stream(id: ID, stream: Stream) : bool
|
|||
|
||||
function disable_stream(id: ID) : bool
|
||||
{
|
||||
if ( ! __disable_stream(id) )
|
||||
return F;
|
||||
return __disable_stream(id);
|
||||
}
|
||||
|
||||
function add_filter(id: ID, filter: Filter) : bool
|
||||
|
|
|
@ -14,7 +14,7 @@ export {
|
|||
|
||||
## The vector of HTTP header names sent by the server. No header
|
||||
## values are included here, just the header names.
|
||||
server_headers_names: vector of string &log &optional;
|
||||
server_header_names: vector of string &log &optional;
|
||||
};
|
||||
|
||||
## A boolean value to determine if client header names are to be logged.
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
|
||||
@load base/protocols/ssh
|
||||
@load base/frameworks/metrics
|
||||
@load base/frameworks/notice
|
||||
@load base/frameworks/intel
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
@load integration/barnyard2/types.bro
|
||||
@load misc/analysis-groups.bro
|
||||
@load misc/loaded-scripts.bro
|
||||
@load misc/profiling.bro
|
||||
@load misc/trim-trace-file.bro
|
||||
@load protocols/conn/known-hosts.bro
|
||||
@load protocols/conn/known-services.bro
|
||||
|
@ -37,11 +38,16 @@
|
|||
@load protocols/http/detect-MHR.bro
|
||||
@load protocols/http/detect-sqli.bro
|
||||
@load protocols/http/detect-webapps.bro
|
||||
@load protocols/http/header-names.bro
|
||||
@load protocols/http/software.bro
|
||||
@load protocols/http/var-extraction-cookies.bro
|
||||
@load protocols/http/var-extraction-uri.bro
|
||||
@load protocols/smtp/blocklists.bro
|
||||
@load protocols/smtp/detect-suspicious-orig.bro
|
||||
@load protocols/smtp/software.bro
|
||||
@load protocols/ssh/detect-bruteforcing.bro
|
||||
@load protocols/ssh/geo-data.bro
|
||||
@load protocols/ssh/interesting-hostnames.bro
|
||||
@load protocols/ssh/software.bro
|
||||
@load protocols/ssl/known-certs.bro
|
||||
@load protocols/ssl/validate-certs.bro
|
||||
|
|
|
@ -334,7 +334,7 @@ Val* BroFunc::Call(val_list* args, Frame* parent) const
|
|||
(flow != FLOW_RETURN /* we fell off the end */ ||
|
||||
! result /* explicit return with no result */) &&
|
||||
! f->HasDelayed() )
|
||||
reporter->Warning("non-void function returns without a value:", id->Name());
|
||||
reporter->Warning("non-void function returns without a value: %s", id->Name());
|
||||
|
||||
if ( result && g_trace_state.DoTrace() )
|
||||
{
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
# depth name
|
||||
#separator \x09
|
||||
#path loaded_scripts
|
||||
#fields depth name
|
||||
#types count string
|
||||
0 scripts/base/init-bare.bro
|
||||
1 build/src/base/const.bif.bro
|
||||
1 build/src/base/types.bif.bro
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
# depth name
|
||||
#separator \x09
|
||||
#path loaded_scripts
|
||||
#fields depth name
|
||||
#types count string
|
||||
0 scripts/base/init-bare.bro
|
||||
1 build/src/base/const.bif.bro
|
||||
1 build/src/base/types.bif.bro
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
# This test will fail if there are Bro scripts that have been temporarily
|
||||
# blacklisted from the documentation generation process for some reason
|
||||
# (e.g. they're a work-in-progress or otherwise fail to parse). It's meant
|
||||
# to serve as a reminder that some future action may be needed to generate
|
||||
# documentation for the blacklisted scripts.
|
||||
#
|
||||
# @TEST-EXEC: $DIST/doc/scripts/genDocSourcesList.sh
|
||||
# @TEST-EXEC: btest-diff .stderr
|
|
@ -5,7 +5,7 @@
|
|||
#@TEST-EXEC: test -e $DIST/scripts/base/init-default.bro
|
||||
#@TEST-EXEC: ( cd $DIST/scripts/base && find . -name '*.bro' ) | sort >"all scripts found"
|
||||
#@TEST-EXEC: bro misc/loaded-scripts
|
||||
#@TEST-EXEC: cat loaded_scripts.log | egrep -v '/build/|/loaded-scripts.bro' | awk 'NR>1{print $2}' | sed 's#/./#/#g' >loaded_scripts.log.tmp
|
||||
#@TEST-EXEC: cat loaded_scripts.log | egrep -v '/build/|/loaded-scripts.bro|#' | awk 'NR>1{print $2}' | sed 's#/./#/#g' >loaded_scripts.log.tmp
|
||||
#@TEST-EXEC: cat loaded_scripts.log.tmp | sed -e ':a' -e '$!N' -e 's/^\(.*\).*\n\1.*/\1/' -e 'ta' >prefix
|
||||
#@TEST-EXEC: cat loaded_scripts.log.tmp | sed "s#`cat prefix`#./#g" | sort >init-default.bro
|
||||
#@TEST-EXEC: diff -u "all scripts found" init-default.bro 1>&2
|
||||
|
|
|
@ -7,6 +7,6 @@
|
|||
|
||||
# @TEST-EXEC: bro -b misc/loaded-scripts
|
||||
# @TEST-EXEC: test -e loaded_scripts.log
|
||||
# @TEST-EXEC: cat loaded_scripts.log | awk 'NR>1{print $2}' | sed -e ':a' -e '$!N' -e 's/^\(.*\).*\n\1.*/\1/' -e 'ta' >prefix
|
||||
# @TEST-EXEC: cat loaded_scripts.log | egrep -v '#' | awk 'NR>1{print $2}' | sed -e ':a' -e '$!N' -e 's/^\(.*\).*\n\1.*/\1/' -e 'ta' >prefix
|
||||
# @TEST-EXEC: cat loaded_scripts.log | sed "s#`cat prefix`##g" >canonified_loaded_scripts.log
|
||||
# @TEST-EXEC: btest-diff canonified_loaded_scripts.log
|
||||
|
|
|
@ -7,6 +7,6 @@
|
|||
|
||||
# @TEST-EXEC: bro misc/loaded-scripts
|
||||
# @TEST-EXEC: test -e loaded_scripts.log
|
||||
# @TEST-EXEC: cat loaded_scripts.log | awk 'NR>1{print $2}' | sed -e ':a' -e '$!N' -e 's/^\(.*\).*\n\1.*/\1/' -e 'ta' >prefix
|
||||
# @TEST-EXEC: cat loaded_scripts.log | egrep -v '#' | awk 'NR>1{print $2}' | sed -e ':a' -e '$!N' -e 's/^\(.*\).*\n\1.*/\1/' -e 'ta' >prefix
|
||||
# @TEST-EXEC: cat loaded_scripts.log | sed "s#`cat prefix`##g" >canonified_loaded_scripts.log
|
||||
# @TEST-EXEC: btest-diff canonified_loaded_scripts.log
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue