(#15529) Initialize app settings before all and each test

Adds a new initialize() call to the TestHelper API, designed to be run before
all testing and further loading commences.

It initializes Puppet settings using the proper initialize_app_defaults call
rather than setting items individually, so the settings class correctly states
the app has been initialized.  This then makes the autoloader set up paths as
it queries this value to determine if the libdir and others have been set up
and it can autoload from them.

Patch modified by Josh Cooper <josh@puppetlabs.com>
 (#15529) Initialize settings before executing puppet specs

Previously, Puppet's settings were not initialized until the first
example was executed. Depending on the test being executed, this could
cause errors that $confdir was not initialized. For example, if the
first spec test to be executed contained:

    Puppet::Interface.faces.each do |name|
      it "should ... #{name}" do
        ..
      end
    end

Then the test would blow up, since the call to `faces` happens before
the spec_helper's before each block is executed.

This commit ensures Puppet's application default settings have been
initialized before any test code executes. A similar change will need to
be made in puppet_spec_helper.
Add postflight for OSX packages to add puppet user, group

Previously, users installing the Puppet package for OS X would need to create
their own user and group to run `puppet apply` successfully or to set up a
puppet master. This also was out of line wiht our other puppet packages, which
do create the puppet user and group. This commit adds a postflight script to
the OS X packaging that will create a puppet user and group if they don't
already exist.

Note: this commit depends on packaging changes to install the postflight during
OS X packaging and will be inert until that change is made.
(#18161) Honor CA SRV record for all types of CA requests

For certificate requests, certificate status requests & certificate
revocation list requests puppet used the x-puppet srv record instead of
the x-puppet-ca record.

Adds tests for the issue.
Merge branch 'dalen-srv_ca'

* dalen-srv_ca:
  (#18161) Honor CA SRV record for all types of CA requests
(#18162) Honor fileserver SRV record for file metadata requests

File content requests uses the x-puppet-fileserver SRV record, but file
metadata requests used the x-puppet SRV record.

Adds test for the functionality.
Merge branch 'dalen-file_metadata_srv'

* dalen-file_metadata_srv:
  (#18162) Honor fileserver SRV record for file metadata requests
Merge pull request #1363 from haus/feature/master/add_postflight_for_osx

Add postflight for OSX packages to add puppet user, group
(Maint) Exclude ownership test from windows

Windows does not try to manage ownership of settings files and
directories right now, so this needs to exclude it. Also, since it runs
across agents, it needs to make sure it only does what an agent can do,
which means it can only use "apply" and not "master".
(Maint) Use string for exclusion instead of symbol

The proper way to exclude from a platform is to use a string. The symbol
does not actually exclude (but also doesn't raise an error)
Merge pull request #1332 from joshcooper/ticket/master/15529-reinitialize_app_defaults

(#15529) Reinitialize app defaults before all and each test
Bug #17898 - pkgdmg provider broken since version 2.7.13 under OS X 10.5 Leopard
http://projects.puppetlabs.com/issues/17898

Dir.mktmpdir doesn't exist under Ruby 1.8.6 or older. This adds it, using code from https://github.com/puppetlabs/hiera/pull/47/files which uses code from ruby-1.8.7-p357/lib/ruby/1.8/tmpdir.rb
Merge branch 'mrrcollins-bug17898'

* mrrcollins-bug17898:
  Bug #17898 - pkgdmg provider broken since version 2.7.13 under OS X 10.5 Leopard http://projects.puppetlabs.com/issues/17898