lib/worker: Add spawn_named_helper()

Setting argv[0] to some arbitrary name causes that arbitrary name
to show up as the process "title" (same as name, really) in most
programs, such as pidof, ps and top.

We don't use that feature yet, but when we get asked to spawn
particular workers (which will most likely happen "any day now")
it's nifty to be able to separate the workers from each other so
while also grouping them together. This patch makes that possible
without changing the current behaviour at all.

Signed-off-by: Andreas Ericsson <ae@op5.se>

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@2630 5f96b256-904b-4d8d-8c98-d829582c6739
Forward patch of fix for bug #403

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@2632 5f96b256-904b-4d8d-8c98-d829582c6739
Updated html_encode() to correctly encode characters outside the ASCII character set

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@2633 5f96b256-904b-4d8d-8c98-d829582c6739
lib/test-bitmap: Properly start and set colors for tests

It's pretty and makes output consistent, so let's do it.

Signed-off-by: Andreas Ericsson <ae@op5.se>

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@2634 5f96b256-904b-4d8d-8c98-d829582c6739
lib/t-utils: Add t_reset()

It makes sense to reset test scores here and there, so let's make
it easy to do that.

Signed-off-by: Andreas Ericsson <ae@op5.se>

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@2635 5f96b256-904b-4d8d-8c98-d829582c6739
lib/test-dkhash: Reset test results between tests

Otherwise output appears to be lying, which is kinda bad.

Signed-off-by: Andreas Ericsson <ae@op5.se>

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@2636 5f96b256-904b-4d8d-8c98-d829582c6739
lib/runcmd: Detect backticked subcommands inside double quotes

Shell substitutes it, so we must detect it.

Signed-off-by: Andreas Ericsson <ae@op5.se>

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@2637 5f96b256-904b-4d8d-8c98-d829582c6739
lib/runcmd: Detect $() type subcommands as well as backtick ones

Signed-off-by: Andreas Ericsson <ae@op5.se>

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@2638 5f96b256-904b-4d8d-8c98-d829582c6739
lib/runcmd: Detect shell variables

We can't really interpolate them properly, so it's an error if we
find any.

Signed-off-by: Andreas Ericsson <ae@op5.se>

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@2639 5f96b256-904b-4d8d-8c98-d829582c6739
lib/runcmd: Detect closing parentheses as CMD_HAS_PAREN too

Signed-off-by: Andreas Ericsson <ae@op5.se>

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@2640 5f96b256-904b-4d8d-8c98-d829582c6739
lib/test-runcmd: Make test-failures cause "build" failures

This makes these tests infinitely more useful from buildbots and
whatnot.

Signed-off-by: Andreas Ericsson <ae@op5.se>

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@2641 5f96b256-904b-4d8d-8c98-d829582c6739
lib/test-runcmd: Add anomaly detection tests

These are the tests responsible for the earlier flurry of commits.
Since they've already proven useful, we keep them around in an
easily runnable state.

While at it, rename "runcmd test" to "exec output comparison".

Signed-off-by: Andreas Ericsson <ae@op5.se>

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@2642 5f96b256-904b-4d8d-8c98-d829582c6739
lib/test-runcmd: Add argument-splitting tests

This is just an embryo (or zygote, even) of a real testsuite for
argument splitting, but since tests tend to get written when
there's a comfortable framework to put them in, I expect more
will come in case bugs are found in this area.

Signed-off-by: Andreas Ericsson <ae@op5.se>

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@2643 5f96b256-904b-4d8d-8c98-d829582c6739