mirror of
https://github.com/zeek/zeek.git
synced 2025-10-03 07:08:19 +00:00
![]() - 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. |
||
---|---|---|
.. | ||
Baseline | ||
scripts | ||
.gitignore | ||
Makefile | ||
random.seed | ||
README | ||
subdir-btest.cfg |
Test Suite for Large Trace Files ================================ This test-suite runs more complex Bro configurations on larger trace files, and compares the results to a preestablished baseline. Due to their size, both traces and baseline are not part of the main Bro repository but kept externally. In addition to the publically provided files, one can also add a local set to the test-suite for running on private traces. Initialization -------------- Before the test-suite can be run, one needs to download the traces and the corresponding test and baseline files. They are kept in a separate git repository and a ``Makefile`` is provided to clone a copy: .. console: > make init To later update to upstream changes: .. console: > make pull Running Tests ------------- The easiest way to run all tests is simply typing ``make``. Doing so will iterate through all ``*.git`` repositories and run ``btest`` in each of them. Alternatively, one can also manually run all tests inside a single test repository: .. console: > cd bro-testing.git > btest All the standard ``btest`` options can be used to run individual tests, get diagnostic output, etc. Updating Baseline ----------------- To update a test's baseline, first run ``btest`` in update mode: .. console: > cd bro-testing.git > btest -U tests/test-you-want-to-update Then use ``git`` to commit the changes and push the changes upstream as usual. Adding a Local Repository ------------------------- One can add local non-public set of tests (potentially using private traces) by creating a git repository of a similar structure as the public one. A helper script is provided to set up such a repository: .. console: > ./scripts/create-new-repo <repo-name> <repo-url> The first argument is the local name of the repository (it will be cloned into ``<repo-name>.git``); and then second is the path to the git repository. The repository will be initialized with a few standard directories as well as a skeleton test in ``<name>.git/tests``. You can then edit files as needed (and in particular add traces to ``<name>.git/traces``). If you already have such a private test repository that you want to include into the test suite, clone it directly into ``<repo-name>.git``.