(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.
(PE-158) speed license check

Prior to this commit, the CertificateAuthority did not expose any
methods that allow Puppet Enterprise license checking to not require
reading the certificate files twice (once for `list` and again for
`verify`).  This commit allows the CertificateAuthority to list
certificates as objects and then, in turn, be able to issue a judgement
of whether or not these certificate objects are valid/live.
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.
Merge pull request #1690 'zaphod42/issue/master/21055-agent-holding-stdout-open'

* zaphod42/issue/master/21055-agent-holding-stdout-open:
  (Maint) Remove duplication from more agent tests
  (#21055) Ensure that only logging is used after daemonization
  (#21055) Push setup of agent closer to where it is used
  (Maint) Remove unused and unreachable logging configuration
  Close streams in agent before waiting for cert
Merge pull request #1647 from jeffweiss/pe158_license_checking_too_slow

(PE-158) speed license check
Merge branch 'master' of https://github.com/puppetlabs/puppet