Commit graph

2408 commits

Author SHA1 Message Date
Daniel Thayer
f57611c2f0 Fix travis-job script to not fail when all tests succeed
Fixed by calling the "showdiag" function only when external tests fail.
2018-06-26 08:30:49 -05:00
Daniel Thayer
ed42e20714 Use docker containers to run Bro tests on Travis CI
The advantage of using docker containers is to build and test Bro in
an environment that more closely resembles the environment where Bro
will actually be used.  The docker containers currently used enable
testing Bro with all the major versions of gcc (versions 4 through 8),
as well as both python 2 and 3.

The "travis-job" script now takes a second parameter which specifies
a Linux distro to use (specifying "travis" will build and test bro
without using docker).
2018-06-22 10:36:49 -05:00
Daniel Thayer
3767d2bee2 Travis CI fewer failures and improved output messages
Improved readability of the output by adding more error checking
and better error and informational messages, and by moving the
unit test diag.log output to just before any external tests are run.

For pull request builds, skip the private tests instead of failing.

Prevent timeouts after 10 minutes of no output by not using the
btest "-b" option.

Decrease build time by not building unneeded components.
2018-06-22 01:01:40 -05:00
Jon Siwek
e5275b0c92 Merge branch 'topic/vern/bit-ops' of https://github.com/bro/bro
* 'topic/vern/bit-ops' of https://github.com/bro/bro:
  documentation clarification for "p1 | p2"
  documentation for bitwise operators
  document the '|' operator for patterns
  test suite for bitwise operators brief NEWS blurb allow for "counter" operands (does anyone still use these?) for one (but not both) of the bitwise operands
  bitwise operations for "count" types implemented
  Starting branch for supporting bit operations on count's.
2018-06-21 16:05:07 -05:00
Daniel Thayer
7b3bad635b Disable broxygen when running unit tests
Disable broxygen when running unit tests (except for the tests that use
broxygen).  On my dual-core MacBook Pro, this change results in the
unit tests taking about 13% less time to finish running.
2018-06-19 16:30:40 -05:00
Jon Siwek
c11039cb73 Make old comm. system usages an error unless old_comm_usage_is_ok is set 2018-06-15 17:15:46 -05:00
Robin Sommer
554e8cc73d Merge remote-tracking branch 'origin/topic/jsiwek/broker-listen-env'
BIT-1935 #merged

* origin/topic/jsiwek/broker-listen-env:
  Allow BRO_DEFAULT_LISTEN_ADDRESS to control broker listen address
2018-06-08 16:38:31 +00:00
Jon Siwek
a43c7d0691 Merge remote-tracking branch 'origin/topic/jsiwek/ncp-fixes'
* origin/topic/jsiwek/ncp-fixes:
  Add NCP::max_frame_size tuning option
  Migrate NCP analyzer to use latest analyzer API
2018-06-05 11:32:38 -05:00
Johanna Amann
a891517762 Fix read at invalid address in X509 extension parser.
When encountering an extension unknown to OpenSSL, we would read from
the wrong memory location. Also added a testcase to prevent this specific
case from happening again.
2018-06-04 12:05:56 -07:00
Johanna Amann
791b24d232 Merge remote-tracking branch 'origin/topic/jsiwek/broker-misc'
* origin/topic/jsiwek/broker-misc:
  Add Broker::publish_and_relay BIF
  Document variable argument list BIFs using ellipsis
  Support unserializing broker data into type 'any'
  Fix a bug in broker data type-casting check
  Remove dead code in broker data/val conversion function
2018-06-04 10:00:49 -07:00
Jon Siwek
1b4e0116f4 Allow BRO_DEFAULT_LISTEN_ADDRESS to control broker listen address
This environment variable is now set to listen only on IPv4 loopback
when running unit tests (instead of using the default INADDR_ANY).

This also moves some of the @loads out from init-bare.bro into a new
init-frameworks-and-bifs.bro in order to better support calling BIFs
(like `getenv`) from variable initializations in those particular
frameworks.
2018-06-01 15:38:11 -05:00
Johanna Amann
327acf6555 KRB: do not set keytab by default.
Only enable decryption if a user purposefully sets a keytab.
2018-06-01 12:46:26 -07:00
Johanna Amann
8bb76cd3c1 KRB: do not set authentication info to nouser.
Simply do not set it at all in this case - it is an optional after
all...
2018-06-01 12:32:34 -07:00
Johanna Amann
5d5dd65cab Merge branch 'krb_changes2' of https://github.com/jwallior/bro
I did some cleanup work.
2018-06-01 12:28:45 -07:00
Jon Siwek
55f14c2eb8 Relocate temporary script coverage files
So they don't clutter the top-level of unit test .tmp/ dir.
2018-06-01 11:30:36 -05:00
Johanna Amann
b2dc7ffb26 Merge branch 'smb2-updates' of https://github.com/dtrejod/bro 2018-05-31 21:13:20 -07:00
Johanna Amann
7e801563a0 Merge branch 'topic/p-l-/add-badarp-tests' of https://github.com/p-l-/bro
* 'topic/p-l-/add-badarp-tests' of https://github.com/p-l-/bro:
  Add bad ARP tests
2018-05-31 15:06:33 -07:00
Jon Siwek
224ee790e2 Add Broker::publish_and_relay BIF
Like Broker::relay, except the relaying-node also calls event handlers.
2018-05-31 15:26:22 -05:00
Jon Siwek
d873acc9e3 Support unserializing broker data into type 'any'
The receiver side will wrap the data as a Broker::Data value, which
can then be type-checked/cast via 'is' or 'as' operators to a specific
Bro type.  For example:

Sender:

    Broker::publish("topic", my_event, "hello")

Receiver:

    event my_event(arg: any)
        {
        if ( arg is string )
            print arg as string;
        }
2018-05-31 10:39:40 -05:00
Jon Siwek
fe478877c6 Change Intel framework to round-robin insertion events across proxies 2018-05-24 14:36:22 -05:00
Jon Siwek
b2923f5528 Documentation improvements/fixes 2018-05-23 16:50:31 -05:00
Jon Siwek
58864c358c Add NCP::max_frame_size tuning option
This helps prevent excessive allocations based on message lengths
taken from NCP headers.
2018-05-22 18:27:52 -05:00
Jon Siwek
e35da5f592 Migrate NCP analyzer to use latest analyzer API
It was possibly never updated for newer Analyzer API changes, as simply
attaching the NCP analyzer to a connection would result in null pointer
derefernces and also support analyzers were not attached.
2018-05-22 16:27:07 -05:00
Jon Siwek
de029dd430 Merge remote-tracking branch 'origin/topic/jsiwek/binpac-fixes'
* origin/topic/jsiwek/binpac-fixes:
  Update test baseline for binpac changes
  Update test baseline for optimized binpac static-size array parsing
  Fixes for MySQL and SMB protocol parsers
  BIT-1829: add unit test for modbus parser issue
2018-05-22 15:06:51 -05:00
Jon Siwek
c1871b0f0b Update test baseline for binpac changes 2018-05-22 12:46:30 -05:00
Robin Sommer
fe7e1ee7f0 Merge topic/actor-system throug a squashed commit. 2018-05-18 22:39:23 +00:00
Pierre LALET
8315aa36a6 Add bad ARP tests
The capture file (btest/Traces/arp-leak.pcap) contains the
exploitation of an ARP leak flaw against NetBSD 7.0.2 using Scapy
etherleak() function.
2018-05-18 17:39:53 +02:00
Jon Siwek
99a417fc07 Update test baseline for optimized binpac static-size array parsing 2018-05-18 10:34:06 -05:00
Jon Siwek
954e7980cf Fixes for MySQL and SMB protocol parsers
* MySQL: the parser for this was generally broken (not following
  the specification well) and needed many changes.  One addition is a
  new "mysql_result_row" event that provides access to the results of
  queries.

* SMB: the spec seems to explitly call out the omission of the
  PrimaryDomain field on SMB_COM_SESSION_SETUP_ANDX responses (and I
  don't see that field in pcaps either), so this may have just been a
  typo that used to work fine in the past only due to faulty array
  parsing behavior in binpac.
2018-05-18 10:31:36 -05:00
Pierre LALET
cc4605c8ae Tests/ARP: fix capture files.
It seems the wrong ones were selected in a merge conflict (see
d5797d8).
2018-05-18 17:25:55 +02:00
Jon Siwek
9c1e20394b BIT-1829: add unit test for modbus parser issue 2018-05-18 09:24:06 -05:00
Seth Hall
09d283f7ed Merge branch 'topic/support-wlan-monitor' of https://github.com/p-l-/bro 2018-05-15 13:35:20 -04:00
Seth Hall
f2b4c16dd5 Merge branch 'p-l--topic/support-wlan-monitor' 2018-05-15 13:32:34 -04:00
Pierre LALET
a7fb278710 Add tests for ARP in 802.11 (w & w/o RadioTAP) 2018-05-15 18:15:17 +02:00
Pierre LALET
dfa392bd6c Add a test for 802.11 monitor mode 2018-05-15 17:59:26 +02:00
Jon Siwek
057c982b9d Merge branch 'BIT-1927' of https://github.com/hosom/bro
* 'BIT-1927' of https://github.com/hosom/bro:
  Fix for BIT-1927: notice/extend-email relocation

And updated coverage unit tests.

BIT-1927 #close
2018-05-10 11:28:08 -05:00
Julien Wallior
afac2ac20f Add krb unit test 2018-05-10 10:14:30 -04:00
Julien Wallior
ae7625bb2b Fix base.protocols.krb.kinit unit test. 2018-05-10 10:14:30 -04:00
Daniel Thayer
075edbdd2b Sort output of the missing-file-initially.bro test
The output needs to be sorted to ensure that the test doesn't fail.
2018-05-09 14:30:22 -05:00
Jon Siwek
1f777b57b8 BIT-1926: add unit tests for misc. HTTP patches 2018-05-08 15:39:27 -05:00
Johanna Amann
bb20026267 Add test for dump_current_packet bif. 2018-05-08 11:24:38 -07:00
Jon Siwek
5572d05921 Merge remote-tracking branch 'origin/topic/dnthayer/test-improvements'
* origin/topic/dnthayer/test-improvements:
  Fix the ip-broken-header.bro test on macOS
  Improve reliability of the logging rotate.bro test
  Improve reliability of missing-file-initially.bro test

BIT-1929 #merged
2018-05-01 18:29:59 -05:00
Jon Siwek
c859919f31 Improve canonicalization of build dir path in a coverage unit test 2018-05-01 18:10:11 -05:00
Jon Siwek
81133f3116 Merge remote-tracking branch 'origin/topic/seth/dhcp-update'
* origin/topic/seth/dhcp-update:
  Rework to the DHCP analyzer.
  First step of DHCP analyzer rearchitecture.
  Add .btest scripts for dhck_ack and dhcp_discover messages verifying that new options are correctly reported in dhcp.log records.
  Extend DHCP protocol analyzer with new options.

BIT-1924 #merged

Additional changes:

* Removed known-hosts.bro as the only thing populating its table was
  the already-removed known-hosts-and-devices.bro.  So a
  known_devices.log will no longer be generated.

* In dhcp-options.pac, the process_relay_agent_inf_option had a memleak
  and also process_auto_proxy_config_option looked like it accessed one
  byte past the end of the available bytestring, so fixed those.
2018-05-01 18:06:41 -05:00
Jon Siwek
720cf55d53 Improve how coverage unit tests handle name of build dir
This change allows the tests to still pass if the build dir is named
something other than 'build' and/or is a symlink.
2018-04-30 16:30:21 -05:00
Seth Hall
c973375f1f Add subnet intel expiration to a test. 2018-04-27 19:55:22 -04:00
Robin Sommer
8df77aee09 Merge remote-tracking branch 'origin/topic/jsiwek/bit-1909'
I've moved the resizing loop into a static method of RecordVal.

* origin/topic/jsiwek/bit-1909:
  BIT-1909: fix invalid redef'd record field accesses
2018-04-27 10:35:37 -07:00
Vern Paxson
58ffd61dcc test suite for bitwise operators
brief NEWS blurb
allow for "counter" operands (does anyone still use these?) for one (but not both) of the bitwise operands
2018-04-26 13:25:04 -07:00
Jon Siwek
19389ad350 Merge remote-tracking branch 'origin/topic/jsiwek/bit-1914'
* origin/topic/jsiwek/bit-1914:
  BIT-1914: comment out &check usages now that they emit warnings
  Convert some BinPAC &check expressions to &enforce
  Update &check'd fields in various protocol parsers

BIT-1914 #merged
2018-04-25 11:09:43 -05:00
Daniel Thayer
27a7276009 Fix the ip-broken-header.bro test on macOS
There is no xzcat command on macOS by default.
2018-04-23 17:06:01 -05:00