(maint) Fix install module acceptance test on precise

Without this patch the `with_modulepath.rb` acceptance test is failing
on Ubuntu 12.04.  The cause of this problem is that `puppet apply` is
being used to purge the `/etc/puppet/modules2` directory, which doesn't
appear to be working as expected.  This itself is concerning, but the
concern is unrelated to the expected behavior expressed in the test.

This patch addresses the problem by simply using `rm -rf` to purge the
acceptance test instead of using `puppet apply`.
(#7224) Fix hostname does not match on Ubuntu 12.04

Without this patch Puppet does not improve upon the `hostname does not
match the server certificate` error message coming from OpenSSL.  The
root cause of this problem is a bad regular expression that matches on
`error.message =~ /hostname (was )?not match/` when the error message on
precise is actually `"hostname does not match the server certificate"`

This patch addresses the problem by allowing any word to optionally
exist between `hostname` and `not` in the error message.
(maint) Improve failure message
(maint) Fix enc_provides_node_when_storeconfigs_enabled on precise

Without this patch the enc_provides_node_when_storeconfigs_enabled is
failing on Ubuntu 12.04 LTS with MRI 1.9.3-p0.  The root cause of the
failure is that the ENC script used does not output valid YAML data,
it's lacking the `--- ` header.

This patch addresses the problem by using `Hash#to_yaml` to produce
valid YAML output for the ENC API.
Merge branch 'stable_precise_acceptance' into stable

* stable_precise_acceptance:
  (maint) Fix enc_provides_node_when_storeconfigs_enabled on precise
  (maint) Improve failure message
  (#7224) Fix hostname does not match on Ubuntu 12.04
  (maint) Fix install module acceptance test on precise

closes #1624
Revert "Merge branch 'nicklewis-fix-puppet-resource-service-test' into stable"

This reverts commit f81c157f23ee637781c7bb1e384c7cb6395bcb27, reversing
changes made to 38d085c697a530192b02c2badcc4e9a73813e62d.

This change set is being reverted a second time because the acceptance
test is failing on Solaris 10 which has very different service names.

I'm reverting it because the failure represents work in progress that is
interrupting other work, even though it is a small regexp.  Based on
discussion, we might simply need to open the regexp up to:

    [10:21 AM] Nick Lewis: @jmccune /.*ssh.*/ perhaps, but that's getting a
    little silly.
(#20447) Wait for server to shutdown before exiting daemon

Previously, if the filetimeout was set to 0 and the puppet master was
run, the master would exit immediately. This was caused by the scheduler
having nothing to do and the new logic for it causes it to stop running
at that point (because once there is nothing to do, there is also no
chance that something will cause it to having something to do). There
was a slightly wrong assumption that was being made for that logic: the
scheduler is in control of all activity in the daemonized process. This
is not the case.

The daemon has 3 parts to it:
  * configuration reparse
  * agent runs
  * server control

The server does not take part in the scheduler inside the daemon. It is
assumed to be a separate thread/process, which the daemon will kick off
when it starts, and stop when the daemon is told to stop. When the
"start" method of the daemon exits, the daemon itself exits and the
server will be required to shut down.

There are 2 ways that could be used to solve this problem: have the
scheduler sit in a busy loop (or sleep forever) when it has nothing to
do, or wait for the server to finish before the daemon considers itself
done. This commit uses the latter option.

The new code will wait for the server to finish before the Daemon#start
method returns. This makes the dependency explicit rather than hidden in
an infinite loop in the scheduler.
(maint) Remove empty and pending acceptance test
(maint) Remove pending parser validate test

This test is failing on my Fedora 18 system under test and it has a
"real" copy outside of the pending/ directory.
(maint) Fix uninitialized constant ActiveRecord

Without this patch the Puppet master is reporting error 400 in the
acceptance test suite running against Fedora 18, with the error message
`Could not autoload puppet/indirector/catalog/active_record:
uninitialized constant ActiveRecord`.  This is causing the
`enc_provides_node_when_storeconfigs_enabled.rb` acceptance test to
fail.

The root cause of the problem is attempting to access the ActiveRecord
constant before loading the library.  This patch addresses the problem
by making sure the `activerecord` library is loaded prior to accessing
the constant.

References: https://projects.puppetlabs.com/issues/16670
(maint) Use activerecord 3.0.20 for acceptance testing
(maint) Add Fedora Core suitability check for password redaction

Without this patch the Fedora Core 18 system, prefixed by `fc-` is
assumed to be able to manage password.  This is a problem because the
system does not have the shadow gem installed by default.

This patch adds `fc-` to the list of platforms checked for suitability
before running the acceptance test.
(maint) Remove acceptance test for puppet --parseonly deprecation

Without this patch the acceptance test for the puppet master --parseonly
and puppet agent --parseonly is failing.  This is a problem because in
Puppet 3 the deprecation has been removed and instead Puppet reports an
error that the command line is incorrect, 1 argument was provided
instead of the expected 0 number of arguments.

This patch addresses the problem by changing the acceptance test to no
longer validate the presence of the deprecation warning and instead
validate the expected behavior of `puppet parser validate`.
Merge branch 'fix_acceptance_fedora18' into stable

* fix_acceptance_fedora18:
  (maint) Remove acceptance test for puppet --parseonly deprecation
  (maint) Add Fedora Core suitability check for password redaction
  (maint) Use activerecord 3.0.20 for acceptance testing
  (maint) Fix uninitialized constant ActiveRecord
  (maint) Remove pending parser validate test
  (maint) Remove empty and pending acceptance test

closes #1629
(#20520) Update rgen to 0.6.2, remove Array monkey patches

Monkey patches to Array were used to make Array#to_hash fail, which otherwise
broke Hash[[[]].  The later version of rgen removes the need for these, which
prevents bad interactions with other libraries and applications.
Revert "(maint) Remove acceptance test for puppet --parseonly deprecation"

This reverts commit ad762cbe176ad8a53e3f1578b0fd7818c48bd7e9.

This commit is being reverted because the underlying issue is caused by
a simply MRI block arity issue.  Josh has fixed this in master, so the
fix will be back-ported to stable for the Puppet 3.2 release.
Maint: Lambda arity must match number of arguments

Running `puppet apply --parseonly` fails on ruby 1.9, because the arity
of the option method was 0, yet was being invoked with an argument, the
manifest to parse. Under ruby 1.8, this mismatch was allowed, but not
1.9.

See acceptance/tests/ticket_6928_puppet_master_parse_fails.rb
(maint) `--parseonly` lambda arity must match number of arguments

Running `puppet apply --parseonly` and `puppet master --parseonly` fails on
ruby 1.9, because the arity of the option method was 0, yet was being invoked
with an argument, the manifest to parse. Under ruby 1.8, this mismatch was
allowed, but not 1.9.

This patch builds upon Josh's patch in e9c25f6, the previous patch only
addressed `puppet apply` while the acceptance test uses both `puppet apply` and
`puppet master`.  In order to address the test failure this patch adds the
block arguments for both apply and master.

See acceptance/tests/ticket_6928_puppet_master_parse_fails.rb
Merge branch 'fix_cli_arity' into stable

* fix_cli_arity:
  (maint) `--parseonly` lambda arity must match number of arguments
  Maint: Lambda arity must match number of arguments
  Revert "(maint) Remove acceptance test for puppet --parseonly deprecation"

closes #1632
Merge pull request #1631 from domcleal/tickets/stable/20520-rgen-062

(#20520) Update rgen to 0.6.2, remove Array monkey patches