Add broctl testing infrastructure
CMake support for broctl testing

At configure time, record the Bro install path in build/aux/broctl/broctl-path
so that the test scripts know where the broctl config files are located.
Modify broctl error-checking for easier testing

Changed error checking code to allow the case where all nodes in
a cluster config are localhost.  This enables cluster config test cases
to run on a single host without having to know the IP address.
Make broctl tests easier to run

Now user can just type "make test" in top-level broctl directory
(or "make" in broctl/testing/btest), and it will automatically
build and install bro in another prefix directory (and it will
automatically restore original configure prefix if one exists),
and then run all the broctl tests.  Individual test cases can also
be run manually with btest in any order (after first doing the "make").

Changed btest.cfg so that INSTALL refers to the test prefix instead of
just the most recently-configured prefix (to prevent the possibility
of running btest manually on the wrong prefix).

Added a broctl-test-setup script to cleanup and install necessary
files for each test case.
Parallelize broctl tests

Each test case now uses its own copy of the bro/broctl install.
Modified broctl to check for env. variable BROCTL_INSTALL_PREFIX
which overrides the hard-coded install prefix.
Cleanup broctl tests upon failure and simplify tests

Added cleanup function so that test directory is removed even when
test case fails (thanks Jon).  Added setting of PATH and BROCTL_INSTALL_PREFIX
to make test cases easier to read.
Fix cleanup and allow test prefix to be changed
Build tests without running them

Made it easier to build tests without running them (in case someone
wants to run an individual test directly with btest).
Add node.cfg tests

Added debug output to broctl to show the node configuration that
was read from the node.cfg file.
Add more tests for broctl.cfg and networks.cfg
Use broctl nodes cmd instead of debug log

Changed a few tests to use the broctl nodes command instead of
the debug.log file.
Reorganize and simplify the tests

Reorganized and simplified the tests.  The broctl-test-setup script
no longer requires specifying test-specific config files.  Instead,
they are specified in a more flexible way (only the actual files
needed are specified, both the directory and filename are specified,
and they follow a simple naming scheme that makes their purpose
clear).  It's also easier to change where the tests are run (the
BROCTL_TEST env. var. overrides the directory where the test-specific
bro install directories are located).  Setting BROCTL_TEST_DEBUG
to any value prevents test cases from removing their bro install
directory tree, which can be convenient when debugging a failed
test case.
Add tests for broctl commands and plugins
Merge remote-tracking branch 'origin/master' into topic/dnthayer/broctl-testing
Small fix for a couple of test cases

Due to recent changes in the broctl diag command, a couple of test cases
needed to be updated.
Fix a typo
Prevent deletion of unarchived logs during broctl stop

After a broctl stop (or restart), the archival of the conn.log and
conn-summary.log could easily take over a minute (this is mainly due
to trace-summary and sendmail taking a very long time to finish), even for
a small conn.log, so a loop has been added that waits for such unarchived
log files to finish being archived before we remove the tmp dir that
contains those files.
Allow multiple conn-summary.log files to be processed

If a broctl stop (or restart) happens just after a normal log
rotation occurs, then it is likely that the first pair of
conn.log/conn-summary.log is still being archived while the second
pair is beginning to be processed.  For the conn.log, this poses
no problems, because Bro rotates logs with a name containing a timestamp.
But the conn-summary.log was being created (before it gets archived)
without a timestamp in the filename.  Therefore, two processes were
trying to create two different files in the same directory at the same
time with the same filename.  Fixed by renaming the conn-summary.log
to contain a timestamp.
Merge remote-tracking branch 'origin/master' into topic/dnthayer/broctl-testing
Enable some tests that were causing broctl to crash

Several bugs have been fixed in broctl, so now these tests can be run.