(maint) Add an integration spec for agent logging.

Checks which loggers are initialized, and what the log level is for all
combinations of --onetime, --daemonize, --no-daemonize, --verbose,
--debug, and --logdest called on the agent.

A simple patch for #15187 had unintended side effects to logging
behavior which were hard to track down.  This test is intended to give
us visibility on how we expect agent logging to behave and whether or
not this has changed.

There is also a minor change to Puppet::Application#setup_logs that
separates assigning a console log for verbose/debug from setting the
log_level, because this was where one of the bugs was hidden.
(maint) expand flag constants for clarity

Abbreviations for the many flags under test were difficult to read.
This expands them to the full flag names.
Change hiera_include to properly call include with an array of arguments

Before this change hiera includes which looked up an empty array
resulted in this error:

    ArgumentError: include(): Wrong number of arguments given (0 for minimum 1)

Now hiera includes properly allow for a lookup that results in an empty
array

This regression was caused by the arity checks committed in
9ed6fcea48591cda58db1379b58cd39dfbdca684
(#21091) pass --fail to curl

This causes curl to treat things like 404's as errors, causing a
fallback to open-uri and, eventually, a sensible error message.
(20967) Clear yamldir in configuration acceptance test.

Because yamldir subdirectories are not managed outside of
indirectory/yaml, service user changes can leave puppet unable to read
from them (#21145)

This change clears the yamldir in the puppet_manages_own_configuration_in_robust_manner
acceptance test to ensure that yamldir and all subdirs are rebuilt with
the new service user.
Merge pull request #1693 from djmitche/bug21091

(#21091) pass --fail to curl
(20967) Do not run on solaris and reclear yamldir in teardown.

Cannot roundtrip users on Solaris because of #21148, so can't run the
puppet_manages_own_configuration_in_robust_manner on Solaris.

Also need to clear yamldir again in teardown since we are resetting
user/group id to original uid/gid and yaml's unmanaged subdirs will be
owned by a previous uid/gid.
Merge pull request #1697 from zaphod42/issue/master/20967-mysterious-errors-caused-by-patch

Revert "Merge pull request #1682 from zaphod42/issue/master/incorrect-management-of-rundir"
Revert "Merge pull request #1697 from zaphod42/issue/master/20967-mysterious-errors-caused-by-patch"

This reverts commit 1b27ae45c6866f9931ed6042a1c4db0a4c6aabd8, reversing
changes made to cb4881f8737ce1138057b2ec69e01a68ea7e2b65.

    Joshua Partlow: Wait, @finch, I think you just reverted something
    @AndrewParker and I are working on

Whoops.
Merge pull request #1665 from lollipopman/hiera_include_arity

commit 9ed6fcea48591cda58db1379b58cd39dfbdca684 which added arity checks
Merge pull request #1698 from jpartlow/issue/master/yaml-dir-blocking-puppet-rundir-fix

(20967) Clear yamldir in configuration acceptance test.
Merge pull request #1678 from jpartlow/maint/agent-logger-specs

(maint) Add an integration spec for agent logging.
Close streams in agent before waiting for cert

This was causing stdout to remain open while waiting for the cert, even
when daemonizing, which causes the init script to not return when
redirecting output.

This is a partial revert of c2c082381895954c25357b1ca87ad86ab3532c5c
"(#13584) in daemon mode, master can swallow errors during startup"
(Maint) Remove unused and unreachable logging configuration

The --centrallogging tried to setup some sort of central aggregation of
logs (see issue #51). However at some point in the past the
--centrallogging flag was disconnected from the internal handling of
this (the code assumed it was called :centrallogs). However, even fixing
that disconnect would not have made this work because the logging system
does not appear to support this kind of setup. The :host logging
destination depends on a class called
Puppet::Network::Client::LogClient, which does not exist.

This simply removes all of that code, including the handling of the
command line options. This results in any user who had been passing
those flags now recieving an error, however, since these were never
documented anywhere that I can find, this is an acceptable risk.
(#21055) Push setup of agent closer to where it is used

This pushes the initialization of different parts of the agent under
various circumstances closer to where the pieces are used. By reducing
the "live-time" of the code the risk of bugs related to partial
initialization is reduced.

Because of the internal refactorings and the tight coupling of the tests
to these internal control flows, many of the tests have been reworked to
take a much more outside-in approach and now mostly (but not completely)
test through a more "public" interface.
(#21055) Ensure that only logging is used after daemonization

When the point at which streams are closed was changed from
Puppet::Daemon#start to Puppet::Daemon#daemonize the error message for
onetime would be lost. This is made slightly more obvious (although
admittedly not much) by pulling daemonization as close as possible to
where it is finally started. The lost message is then solved by
switching from $stderr.puts to Puppet.err for issuing the message.
(Maint) Remove duplication from more agent tests

The inclusion of `execute_agent` was not used in all of the places it
could be. This uses it more thoroughly, but still not constantly since
there are still many tests that work from small, internal methods that
would need to be reworked.