Tests for deprecation warnings for dynamic scoping

The tests for dynamic scoping were non existent and thus dynamic scoping
was implemented incorrectly. This allows us to check for correct
warnings.
Implement newlookupvar() to replace dynamic scope

lookupvar() is shifted to oldlookupvar() and newlookupvar() is added. An
intermediary lookupvar() function will query both and if the answer
varies then it will throw a deprecation warning for dynamic scoping. The
intermediary and old lookup functions may be removed at a later date,
thus completing the transition.

A test case has been introduced to detect dynamic scoping and the
deprecation warning. Slight modifications to the spec test scoping
objects were made to bring them more in line with the real world.

All scope tests pass. When oldlookupvar is replaced, the deprecated
dynamic scoping test case will fail and all other scope test cases will
pass.
Remove dynamic option for lookupvar

The :dynamic option for lookupvar() was added in an attempt to track
dynamic vs non-dynamic scoping in a single pass. This is no longer used.
Add tests for mixed inheritence/inclusion

The preexisting tests didn't fully test the various forms of inheritence
and inclusion. This commit adds tests for finding variable values
through:
class local scope
class inheritence scope
class inclusion scope (with deprecation warning)
class inheritence+inclusion scope (finding through inheritence)
node scope
top scope
Make new scoping look through inherited scopes

Previous to this commit, Puppet would look through a given scope
hierarchy and give deprecation warnings when a value was found in either
an inherited class scope or included class scope, when it should only
give the warning in the case of the included class scope.

This commit makes the new-scope behavior also examine inherited scopes,
though continuing to ignore included scopes.
Use more descriptive terms for the differing scopes
Increased test coverage of scoping rules

Added several more cases of how variables are looked up in scopes. Fixed
a small bug of not issuing a warning from boolean values when we should.
(#13640) Only agents should use next_agent_run

The new event_loop code in daemon was adjusting the run time based on
next_agent_run even when not running an agent. This caused the interval to
always be 0 and peg CPU usage at 100%. We should only make this adjustment if
there is an agent running. This also somewhat refactors the logic around
next_event to avoid duplication.
(#13204) Don't ignore missing PATH.augnew files

The original fix for #13204 may have masked other potential bugs if the
PATH.augnew file was missing.  It simply tested for the file existance and not
only when duplicate save events occurred.

This change de-duplicates the list of save events instead, so if a bug appeared
where PATH.augnew was genuinely missing, the error wouldn't be squashed.
options[:ca_location] is a string not a symbol. Safer to pull Puppet::SSL::Host.ca_location since it is already set correctly.
Merge remote-tracking branch 'domcleal/tickets/2.7.x/13204-aug-boot-enoent-uniq' into 2.7.x

* domcleal/tickets/2.7.x/13204-aug-boot-enoent-uniq:
  (#13204) Don't ignore missing PATH.augnew files
(Maint) Don't assume eventlog gem is installed on Windows

Previously, the test would fail when run on a Windows box that didn't
have the eventlog gem installed. Since the Windows agent should be able
to run without the gem installed, and fall back to writing to a log
file, this commit changes the test to only run when the gem is
installed. There is already a test that verifies that we fall back if
the eventlog feature is not available.
Merge pull request #666 from joshcooper/win-service-eventlog

Win service eventlog
(Maint) Fix order-dependent test failure

Previously, the test assumed that the agent already had a signed
certificate and would fail trying to connect to the master to retrieve a
catalog. But this didn't work if the agent didn't have a cert.

This commit changes the test to use a conf directory, whose parents
don't exist. As a result, puppet will immediately fail to start, but
report the error, including the path we specified. This way it's not
dependent on the SSL state, and it doesn't affect the SSL-ness of other
tests.
Merge pull request #658 from pcarlisle/ticket/2.7.x/13640-daemon-infinite-loop

Ticket/2.7.x/13640 daemon infinite loop
Created test that shows enc warning problem

Only when there is an enc in combination with a node statement are
top-scope, scope, and the enc provided vars incorrectly marked as
dynamic scoped and warned about.
Default autoflushing of log files to true

Log files should automatically write everything to disk eagerly or else
we could lose data. If a user wants to not autoflush for performance
reasons they can turn that off.
Make sure the log file writable

The master creates the log file as root and then can't write to it
anymore after it drops privs.
Merge remote-tracking branch 'joshcooper/maint/2.7.x/eventlog-order-dependent-test' into 2.7.x

* joshcooper/maint/2.7.x/eventlog-order-dependent-test:
  (Maint) Fix order-dependent test failure
Fixed old log test to match new autoflush behavior