naemon/naemon-core — pull request #26 by catharsis (2014-01-24 11:37:14+00:00)
Title: tests: Add Check plumbing and (naemon) check regression tests

This patch adds autotools infrastructure for writing and running Check
test cases.

In preparation for refactoring, I've also added a number of test cases
for the plugin output parsing.

These tests found two peculiarities (read: bugs).

The first, demonstrated by the following test results:

test-checks.c:104:F:Output parsing:perfdata_only:0: Assertion
'""==short_output' failed: ""=="", short_output=="some=perfdata;"
test-checks.c:117:F:Output parsing:multiline_perfdata_only:0: Assertion
'""==short_output' failed: ""=="", short_output=="some=perfdata;"

shows that if you have a plugin that does not output any "regular" short
output, you will get any perfdata, that you might have in your
short_output buffer, and you'll be left without perf data. Now, this is
a bit of an edge case, of course, but the behaviour is nevertheless
highly unexpected.

The second, demonstrated by:
test-checks.c:134:E:Output parsing:no_plugin_output_on_first_line:0:
(after this point) Received signal 11 (Segmentation fault)

is somewhat more serious. I'm sure I don't have to expand on why.

Signed-off-by: Anton Lofgren