Fix Bro and unit tests when broker is not enabled

When Bro was compiled with broker disabled, then some Bro scripts
were referencing functions and types that were not defined.  Fixed
by adding @ifdefs to several scripts.  Removed one @ifdef because
it was causing several unit tests to fail.

Also fixed the @TEST-REQUIRES check in tests that rely on broker so
that such tests are skipped when broker is disabled.
This commit is contained in:
Daniel Thayer 2016-05-10 06:24:35 -05:00
parent 90223fe428
commit d91dd8d9a8
24 changed files with 39 additions and 20 deletions

View file

@ -6,6 +6,8 @@ module NetControl;
@load ../plugin
@load base/frameworks/broker
@ifdef ( Broker::__enable )
export {
type AclRule : record {
command: string;
@ -292,3 +294,4 @@ function create_acld(config: AcldConfig) : PluginState
return p;
}
@endif

View file

@ -8,6 +8,8 @@ module NetControl;
@load ../plugin
@load base/frameworks/broker
@ifdef ( Broker::__enable )
export {
## Instantiates the broker plugin.
global create_broker: function(host: addr, host_port: port, topic: string, can_expire: bool &default=F) : PluginState;
@ -161,3 +163,5 @@ function create_broker(host: addr, host_port: port, topic: string, can_expire: b
return p;
}
@endif