Commit graph

3113 commits

Author SHA1 Message Date
Jon Siwek
717a2a54f6 Merge branch 'master' into topic/jsiwek/irc-orig 2011-07-20 15:11:43 -05:00
Jon Siwek
beb44aee62 Shorten what's displayed in the IRC's log mime_type column for DCC transfers 2011-07-20 15:08:19 -05:00
Jon Siwek
73c138152c Add IRC unit tests. 2011-07-20 14:49:20 -05:00
Jon Siwek
ad7654745f Fix istate.events tests.
The receiver now registers for signature_match event so that
the http.log comes out the same as the sender's side.
2011-07-19 17:40:12 -07:00
Robin Sommer
b2a3723a1d Fixing tests that need a diff canonifier. 2011-07-19 17:39:46 -07:00
Jon Siwek
77ceb105df Fix utils/conn-ids test due to renamed conn-ids.bro 2011-07-19 11:17:52 -05:00
Jon Siwek
1a88548310 Merge branch 'master' into topic/jsiwek/unit-tests 2011-07-19 11:16:59 -05:00
Seth Hall
2eb12fef61 More conn-id file renaming fixes. 2011-07-19 12:12:16 -04:00
Jon Siwek
ba3316c0ff Merge branch 'master' into topic/jsiwek/unit-tests 2011-07-19 11:02:57 -05:00
Seth Hall
7ad0af666d Renamed utils/conn_ids.bro to utils/conn-ids.bro for consistency. 2011-07-19 12:00:27 -04:00
Jon Siwek
1b1905fcea Moving the test for site.bro to live w/ other utils/ tests. 2011-07-19 10:38:52 -05:00
Jon Siwek
613b7a1405 Fix test due to moving of site.bro 2011-07-19 10:34:51 -05:00
Jon Siwek
caf798def0 Merge branch 'master' into topic/jsiwek/unit-tests 2011-07-19 10:29:56 -05:00
Jon Siwek
27ba228fa1 More policy/utils unit tests and documentation. 2011-07-19 10:28:26 -05:00
Seth Hall
cee3991822 Script updates.
- Fixing more vestiges from moving site.bro and removing functions.bro

- Updates comments on analysis-groups.bro

- Added the trim-trace-file script from broctl.
2011-07-19 10:41:54 -04:00
Jon Siwek
c5e98a8116 Updating documentation for some utils/ policy scripts 2011-07-18 20:14:06 -05:00
Jon Siwek
9b27a98e93 Add unit tests for utils/paths.bro with some changes
- rename extract_directory() to extract_path() (later seemed clearer)
  and made it work with more than just path string in FTP response msgs
- rename build_full_path() and absolute_path()
- compress_path() should now work with relative paths also
2011-07-18 20:05:16 -05:00
Jon Siwek
4437ee59f7 Adding unit tests for utils.
Also fixing id_matches_direction() function to check both connection
endpoints when determining direction respectful of local network.
2011-07-15 16:42:09 -05:00
Jon Siwek
9d468493f2 Renaming a test better. 2011-07-14 22:06:16 -05:00
Jon Siwek
d97003892b Reimplementation of the @prefixes statement.
Any added prefixes are now used *after* all input files have been
parsed to look for a prefixed, flattened version of the input file
somewhere in BROPATH and, if found, load it.

For example, if "lcl" is in @prefixes, and site.bro is loaded, then
a file named "lcl.site.bro" that's in BROPATH would end up being
automatically loaded as well.  Packages work similarly, e.g. loading
"protocols/http" means a file named "lcl.protocols.http.bro" in BROPATH
gets loaded automatically.
2011-07-14 21:32:02 -05:00
Jon Siwek
e5e3bf28ec Make @load statements recognize relative paths.
For example a script can do "@load ./foo" to load a script named
foo.bro that lives in the same directory or "@load ../bar" to load
a script named bar.bro in the parent directory, even if those
directories are not contained in BROPATH.
2011-07-14 11:35:23 -05:00
Seth Hall
2045f1e366 Updating a baseline to make a test succeed. 2011-07-14 08:49:33 -04:00
Jon Siwek
f71010a013 Adding test for utils/addrs.bro.
Also fixed the TODO about making check for valid IPv6 string formats
more robust.
2011-07-13 20:25:57 -05:00
Jon Siwek
0dfd5b867e Add unit test for site.bro.
Small fix in site.bro's find_all_emails() to get rid of errors
about accessing non-existent table indices.
2011-07-13 18:35:43 -05:00
Seth Hall
d9f0612546 Lots of cleanup, tests, and the new Control framework.
- Control framework is for runtime control of Bro instances.
  It was extracted from BroControl and made more generic.

- Tests for cluster frameworks and control framework.

- Small fix for btest.cfg

- Fixed a bug in the cluster framework that was causing things to break.
2011-07-13 17:09:20 -04:00
Seth Hall
427855a40d Fixing the name of a test so that it actually runs. 2011-07-12 16:19:47 -04:00
Seth Hall
0332a06012 Fixed most of the tests after the script reorganization. 2011-07-12 14:12:25 -04:00
Robin Sommer
8bacb6eb3d New BiF record_field_vals() that returns the fields of a record in a
table with meta-information.

Example:

type r: record {
	a: count;
	b: string &default="Foo";
	c: double &optional;
	d: string &log;
};

event bro_init()
{
    local x: r = [$a=42, $d="Bar"];
    print record_fields(x);
}

This prints:

  {
  [a] = [type_name=record, log=F, value=42, default_val=<uninitialized>]
  [b] = [type_name=record, log=F, value=<uninitialized>, default_val=Foo],
  [c] = [type_name=record, log=F, value=<uninitialized>, default_val=<uninitialized>],
  [d] = [type_name=record, log=T, value=Bar, default_val=<uninitialized>],
  }

This is one more step in Seth's quest for full inspection support. :-)
2011-07-07 19:56:48 -07:00
Robin Sommer
084c2086a4 Fixing bug causing crash when running without arguments. 2011-07-07 19:56:48 -07:00
Robin Sommer
97b5f812c7 A new event bro_script_loaded() raised for each policy script loaded.
Also removing the -l command-line option as that can now be done at
the script-level.

A couple tests fail now that use -l. Leaving that until we have
script-level replacement.
2011-07-07 19:56:26 -07:00
Robin Sommer
df1b2f922b Renaming reporter_message to report_info.
Same change internally.
2011-07-07 19:56:25 -07:00
Robin Sommer
eb0580c622 Fixing another memory leak.
This is the ConnVal leak that Gilbert also saw.
2011-07-07 19:46:40 -07:00
Robin Sommer
c738701ffd Cleaning up some testing stuff.
- The Makefiles now run btest with "-f diag.log" so that diangnostics
  output will always be written into that file.

- Makefiles now hardcode path to btest to avoid picking up the wrong version
  if in PATH.

- The canonifier scripts now live in testing/scripts, and they are
  used from both btest/ and external/.

- There's a new diff-remove-uids scripts that removed connection UIDs
  for diffing. The external/* tests now use that by default.

- Timestamp removal now has its own script: diff-remove-timestamps.
  diff-canonifier calls that.

- All Makefile have a "brief" target that runs btest with -b.

- The higher-level directories have Makefile to call the subdirs.
2011-07-05 18:47:08 -07:00
Robin Sommer
073358c488 Updating tests. 2011-07-01 18:57:03 -07:00
Robin Sommer
8432258db0 Merge remote branch 'origin/topic/jsiwek/pybroccoli-fixes'
* origin/topic/jsiwek/pybroccoli-fixes:
  Move event arg. record coercion check; now only done for recv'd remote events
  Update istate.pybroccoli test.
2011-07-01 18:56:27 -07:00
Robin Sommer
b520f98541 Updating test baselines. 2011-07-01 15:59:48 -07:00
Robin Sommer
bff8d39428 Fixing bug with even priorities potentially being ignored for the
handler.
2011-07-01 15:40:42 -07:00
Robin Sommer
9709b1d522 Merge remote branch 'origin/topic/robin/reporting'
* origin/topic/robin/reporting:
  Syslog BiF now goes through the reporter as well.
  Avoiding infinite loops when an error message handlers triggers errors itself.
  Renaming the Logger to Reporter.
  Overhauling the internal reporting of messages to the user.

Updating a bunch of tests/baselines as well.

Conflicts:
	aux/broccoli
	policy.old/alarm.bro
	policy/all.bro
	policy/bro.init
	policy/frameworks/notice/weird.bro
	policy/notice.bro
	src/SSL-binpac.cc
	src/bro.bif
	src/main.cc
2011-07-01 13:59:21 -07:00
Robin Sommer
fb6a8cec19 Avoiding infinite loops when an error message handlers triggers errors
itself.

If an error is triggered inside one of the reporter_* handlers, the
message about that will now fall back to stderr.
2011-07-01 10:04:27 -07:00
Robin Sommer
66e2c3b623 Renaming the Logger to Reporter.
Also changing output to not include timestamps when we haven't started
processing packets yet.
2011-07-01 09:22:33 -07:00
Robin Sommer
4577787d9c Test for the HTTP problem in #488.
The test is currently failing until fixed.
2011-06-30 22:54:25 -07:00
Robin Sommer
a34e5e0973 Test for problem in DNS scripts.
It's currently failing.
2011-06-30 22:54:25 -07:00
Robin Sommer
b57624aabf Adding new policy file test-all.bro that loads all other policies.
This is for testing only. There are also two test: one that checks
that test-all.bro loads correctly, and one that ensures that test-all
is actually loading all scripts found in policy/*.
2011-06-30 17:47:23 -07:00
Jon Siwek
5a2cd265ab Update the generated script doc organization.
Added an additional master TOC index for Bro script packages that
automatically gets filled in at ``make doc`` time.  The master TOC
links to per-package indexes which contains links to all the scripts
contained within it along with their summary.  The per-package index
is also now automatically generated/derived from the path component
of the script passed into the rest_target() macro.
2011-06-30 16:58:20 -05:00
Jon Siwek
fe5f4b8e53 Changes to make generated script docs understand new policy/ hierarchy.
Added an arg to the search_for_files() util function that can return
the subpath of BROPATH's policy/ dir in which the loaded file is found.
This subpath is then used in both the the reST file's document title
(so that script's named e.g. "base.bro" actually have some context) and
in figuring out how to interlink with other generated docs of other
scripts that are found in @load directives.

I still need to overhaul things so the loading of "packages" is
documented in a meaningful way and that the CMake targets are able
to generate indexes for packages.
2011-06-30 11:37:15 -05:00
Jon Siwek
f307a3f408 Update core.vlan-mpls baseline.
conn UIDs changed because they're now also generated for notices.
2011-06-29 12:57:45 -05:00
Jon Siwek
3c055b16a5 Update core.conn-uid test/baseline.
All the UIDs in the baselines changed because they're now also
being generated for notices.
2011-06-29 12:49:07 -05:00
Jon Siwek
0d4be5d772 Fixing tests / updating baselines.
- core.load-unload: scripts that get loaded by default changed, so to
  make the test insensitive to that in the future, I changed the test
  to just check that the stdout is empty (the @unload'd script would have
  had output there)

- policy.frameworks.logging.rotate-custom: I saw that the ordering of
  the log postprocessor output caused a failure for me even though the
  overall content was the same, so it now sorts that part before diff'ing

- core.print-bpf-filters-ipv[4|6]: packet-filter log file name changed

- policy.protocols.conn.known-services: logging file names changes and
  local_nets is now in the Site module
2011-06-29 12:34:14 -05:00
Jon Siwek
1c30ce7e23 Merge branch 'master' into topic/jsiwek/pybroccoli-fixes 2011-06-27 16:00:50 -05:00
Seth Hall
c070cb31da Merge remote branch 'origin/master' into topic/policy-scripts-new
Conflicts:
	policy/bro.init
	testing/btest/language/rare-events.bro
2011-06-25 23:49:20 -04:00