Merge pull request #452 from daniel-pittman/bug/2.7.x/8435-openbsd-package-provider-broken-with-remote-packages

Bug/2.7.x/8435 openbsd package provider broken with remote packages
Updating CHANGELOG and lib/puppet.rb for 2.6.14
Fix spec ordering failure on environment

The module_requirements method was sorting the requirements, but only as
it went along, not for the entire list of requirements that got put in
the data structure.  This caused intermittent test failures since
sometimes the results would come out in a different order than the
specs asserted.

This moves the sort to happen *after* the data is all in.
Merge pull request #517 from mmrobins/maint/2.7.x/fix_enviornment_sort_spec_failure

Maint/2.7.x/fix enviornment sort spec failure
Symbolic file mode test fixes when no mode change happens.

The acceptance test for symbolic file modes didn't handle a case when the
initial and target file mode were identical correctly; it expected a message
about a change, which was never delivered.

Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
(#12412) Mark symbolic file modes test as pending on Windows

Previously, the test used hard-coded tmp file locations, and then
passed the posix style paths to puppet apply, which doesn't work on
Windows agents.

This commit refactors the test to use `Host#tmpfile` and Host#tmpdir`
methods, which requires using `agents.each do |agent|` style test.

Also, there are problems executing `chmod 0000 path` via Cygwin as the
resulting file always has at least 0400 permission. For now, I'm
marking the entire test as pending on Windows and will come back to
it.
Updating CHANGELOG and lib/puppet.rb for 2.7.11
(#7316) Initial acceptance tests

This is an acceptance test for #7316 and #6753.  It creates an application
and a face on the master, runs the agent, verifies that the pluginsync
brought down the correct files, and then attempts to run the app/face.

If the app/face run successfully then we've illustrated that the pluginsync
worked and that the app/face are available on the node, and also that the
face can be run without having a stub placeholder file in the application
directory (#6753).

These currently fail, which is why they are in the "pending" directory.
(#12564) Stub CHILDSTATUS in all test cases, not just failure cases.

On my machine, $CHILDSTATUS is always "success", so I didn't notice the
failure to stub out the first couple of tests correctly.  Now, with them
stubbed, it is no longer possible that a previous test can leave global state
dangling that will break their assumptions.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
(#11740) Wait on the handle from the PROCESS_INFORMATION structure

Previously, the `Puppet::Util.execute` method was using `waitpid2` to
wait for the child process to exit and retrieve its exit status. On
Windows, this method (as implemented by the win32-process gem) opens a
handle to the process with the given pid, and then calls
`WaitForSingleObject` and `GetExitCodeProcess` on the process
handle. However, the pid-to-handle lookup will raise an exception if
the child process has exited. As a result there was a race condition
whereby puppet could sometimes fail to retrieve the exit status of
child processes.

The normal way of getting the exit code for a child process on Windows
is to use the child process handle contained in the
`PROCESS_INFORMATION` structure returned by `CreateProcess`. This
works regardless of whether the child process is currently executing
or not.

This commit reworks the `Puppet::Util.execute_windows` method to wait
on the child process handle contained in the process information
structure. This requires that we pass the `:close_handles => false`
option to the win32-process gem so that it doesn't close the handles.

This commit also re-enables tests that were previously being skipped
due to this bug.
Merge pull request #519 from daniel-pittman/bug/2.7.x/12564-insufficient-stubbing-of-childstatus

Bug/2.7.x/12564 insufficient stubbing of childstatus
Merge pull request #520 from joshcooper/ticket/2.7.x/11740-handle-is-invalid

(#11740) Wait on the handle from the PROCESS_INFORMATION structure
(#8011) Support temp repo URLs in pkgutil provider

One or more URLs to pkgutil repositories can be supplied in the "source"
attribute and are given to pkgutil via the -t option as temporary repos.  A
single URL can be given, or multiple URLs as an array.
Merge branch 'puppet-2.7.11-cve+regression' of github.com:puppetlabs/puppet-cve-test into puppet-2.7.11-cve+regression
(#12725) Fix puppet agent --listen on Windows

Previously, running `puppet agent --listen` failed on Windows, because
we were trying to set the Fcntl::FD_CLOEXEC flag on webrick's http
access log, but Windows does not support that flag.

There are ways to prevent file handles from being inherited across
calls to CreateProcess (either disabling inheritance on a given handle
or preventing all handles from being inherited). But for now, this
commit just skips setting the flag on Windows.

This commit also re-enables spec tests that were disabled on
Windows. The thinking previously is that webrick would never run on a
Windows agent, but that's not true.
Maint: Fix bad copy and paste

The code for creating the webrick access log file was copied from
ruby's `WEBrick::BasicLog.initialize` method so that we can prevent
the file descriptor from being inherited across an exec call. However,
the pasted version changed `sync = true` to just `sync`, which doesn't
do what we want.

This commit sets the sync mode on the access log file descriptor so
that writes are automatically flushed.
Fix backups_spec, which fails if run by itself

If you run backups_spec without any other tests, it will fail due to
an incomplete expectation on FileTest.exists?.  This commit fixes it.
(#12572) Revert fix for #7106 and implement a more minimal fix

The original fix for #7106 (last_run_summary.yaml only readable by root) used
a catalog to write out the last run summary. This created extra output if
show_diff is turned on. This reverts that change, and adds a chmod call to set
the mode based on settings.
(#12572) Add acceptance test to make sure no last_run_summary diff is printed
Merge pull request #5 from pcarlisle/ticket/2.7.x/12572-last-run-summary

(#12572) Don't print a diff of last_run_summary.yaml