(#7285) Add spec for Augeas initialisation and file loading

Simple initialisaton tests with combinations of lens include paths, explicit
file/lens loading against a few example files.
(#13379) Add path of pluginsync'd lenses to Augeas load_path automatically

The path $libdir/augeas/lenses is added to the Augeas load_path initialisation
option automatically to support lenses being pluginsynced.  Lenses should be
added into the <module>/lib/augeas/lenses directory inside a module.

The load_path parameter has been expanded to support an array of paths as well
as a colon-separated list.
(#9160) Change logging facility to debug for not supported provider features
initial prototype for acceptance test libraries

* Adds a "helper.rb", which you can use by adding "--helper" to your
  call to systest.rb.  Current implementation doesn't do anything
  except for add puppet/acceptance/lib to your LOAD_PATH, which
  gives you the ability to do "require 'puppet/acceptance/*'" from
  within your tests.
* Adds acceptance/lib/puppet/acceptance/temp_file_utils.rb, which
  contains a bunch of utility methods for dealing with temp files,
  file permissions, etc. from within your acceptance tests.
* Modifies "7316_apps_should_be_available_via_pluginsync.rb" to
  use this new library instead of manually defining all of the
  utility methods.
Refactor acceptance tests to use util library

This commit adds utility methods to "temp_file_utils.rb"
and refactors all the tests that were duplicating these
utility methods to use this library code instead.
(#13009) Compare scheduled task commands using backslashes

Previously, if the command for a scheduled task was specified using
forward slashes, puppet would always think the resource was out-of-sync.
This issue is that Windows does not preserve forward slashes, so the
*current* value always contains backslashes.

This commit munges forward slashes in the command to backslashes. It also
uses `File.expand_path`, because otherwise commands like the following in
the puppet language would be considered different:

    command => 'c:\\windows\\system32\\cmd.exe'
    command => 'c:\windows\system32\cmd.exe'
 (#13008) Allow scheduled task arguments to be specified

Previously, the `arguments` property of a `scheduled_task` resource
could not be specified as it would lead to a TypeError when we passed
the `should` array value to the task scheduler method that expected a
string.

Previously, scheduled tasks arguments could be specified as either a
string or an array. But if an array was specified it could only contain
a single element.

This commit requires that the arguments be specified as a
space-delimited string, e.g.  'arg1 arg2'.  It is not a breaking change,
because the ability to specify arguments never worked.
(#14749) Clear reference to invalid task after saving

Previously, running `puppet resource scheduled_task <name> ...` to
create a scheduled task would raise an exception. This would occur
because the provider's flush method calls `task.save`, which releases
the reference to the COM interface and sets it to nil. Then later the
`resource` application attempts to retrieve the state of the resource it
just flushed. This causes the win32-taskscheduler gem to raise an
exception because the underlying interface is nil.

This is not an issue when applying a manifest, because puppet doesn't
retrieve the state of the resource after it's been flushed. However,
when writing acceptance tests for the scheduled_task type using `puppet
resource scheduled_task` this bug occurred.

The `Win32::TaskScheduler#save` method should have probably been called
`close` since you can't perform additional operations on it, once it's
been closed. However, this is the gem, not puppet code, and the method
does say:

    Note that calling TaskScheduler#save also resets the
    TaskScheduler object so that there is no currently active task.

So whatever.

This commit simply changes the provider's flush method to clear the
`Win32::TaskScheduler` object after saving it, so that subsequent calls
to the `task` getter method will create a new `Win32::TaskScheduler`
instance.

This commit also adds acceptance tests that exercise things that were
previously broken in #13749, #13008, and #13009. The tests rely on the
ability to create scheduled_tasks using the `puppet resource
scheduled_task` style invocation, which this commit fixes.

The acceptance tests are more verbose than one would like because the
options to the `schtasks.exe` are different for before Vista, and
Vista and later.
(#14378) Skip context-based optimisation for complex expressions

When optimising loaded files based on the context given, the context would be
passed into a path expression itself inside quotes.  If the user had given a
path expression for the context that contained quotes then these would need to
be escaped, which Augeas doesn't support today.

This disables the optimisation when the user supplies a complex context path,
preventing errors caused by improperly quoted paths.
Merge remote-tracking branch 'upstream/2.7.x' into 3.0rc

* upstream/2.7.x:
  (#8858) Explicitly set SSL peer verification mode.
  Test SSL setup code, not our stubbing of it.
  (maint) Add mailmap to identify contributors
  Updating CHANGELOG, conf/redhat/puppet.spec for puppet 2.7.15rc4
  (#14723) Fix http report description
  Remove EL-related test changes from this commit.
  Revert changes to symbolic_modes.rb -- this test should indeed be pending (it should eventually work on Windows).
  Update acceptance tests to use confine instead of skip_test loops

Conflicts:
	CHANGELOG
	conf/redhat/puppet.spec
(#14789) Fix inconsistent normalization and API in autoloader

Since I didn't get around to adding a require method to the autoloader, it
still makes sense to have the loaded? method exposed on instances. I also
added the changed? method, which would be useful in similar situations.
Testing these changes revealed inconsistency about how names are normalized,
which is also fixed in this commit.
Merge pull request #840 from pcarlisle/ticket/master/14789-autoloader-loaded

(#14789) Fix inconsistent normalization and API in autoloader
Update facter dep to reflect epoch 1

This commit updates the dependency on facter
to include the epoch 1. Without this commit,
now that facter 1.6.9 is epoch 1, rpm sees
facter 1:1.6.9 as > 2.0.0, preventing puppet
2.7.x from installing on systems with facter
1:1.6.9. This commit resolves this issue.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
(#14900) Add data bindings hiera-puppet support.

Data binding now supports the hiera-puppet backend. When looking up data
in Hiera we now call the `Hiera#lookup` function with the Puppet scope
object instead of the host's facts (Hash).

We also remove the need to fetch node facts for every lookup; the scope
object already contains this info. The scope object provides access to
Facter Facts via the `Scope#[]` method.

This patch includes updated tests.
Merge pull request #843 from kelseyhightower/ticket/3.0rc/14900_data_bindings_does_not_support_hiera_puppet_backend

Ticket/3.0rc/14900 data bindings does not support hiera puppet backend
(#14843, #14844) Add block to Puppet::Provider.execpipe

Previously the execpipe wrapper in Puppet::Provider only accepted and passed a
block if called from a provider instance, and not the class. This led to
providers failiing with messages of "No block given". This commit brings the
class wrapper in line with the instance wrapper, adding a block to its argument
list and to its Puppet::Util::Execution.execpipe call.
It also adds a single test for the rpm package provider, to verify sanity of
self.instances.
(#14927) Set node environment correctly in termini

The node environment was only being set correctly in the exec terminus. This
sets it in the other relevant termini. It also involved significant rewriting
of tests to not mock node objects.
(#14964) Don't fail if we can't unlink the Tempfile on Windows

Previously, if the exec resource created a process, e.g. start.exe, that
executed another process asynchronously, then the grandchild would inherit
the tempfile handle, preventing puppet from being able to unlink it. This
is not an issue on POSIX systems.

This commit changes the `wait_for_output` method to ignore Errno::EACCES
exceptions caused when closing and unlinking the stdout tempfile. The
behavior on POSIX systems is unchanged.
(#14901) Refactored test to improve readability

There was a fair amount of duplication in testing the option parser. By
removing that the tests become much more readable.
(#14901) Use the last argument when there are duplicates

Previously, Trollop would raise an error if the command line contained
duplicate arguments. This caused the application to ignore all arguments
because of the error handling around Trollop. The argument handling will
now accept duplicate arguments, but will only use the last duplicate's
value. This is the same as the behaviour of 2.7.