puppetlabs/puppet-acceptance — pull request #182 by joshcooper (2012-03-26 20:08:15+00:00)
Title: (Maint) Don't run puppet agent in the background during test run

Previously, the `setup/pe/01_PE-InstallPuppet.rb` and
`02_PE-InstallWindows.rb` tests would install the PE agent, and cause
the agent to run in the background every `runinterval` seconds.

Meanwhile, `setup/pe/05_Agent_test.rb` would try to run `puppet agent
--test` to verify that the agent could connect to the master, retrieve
its SSL certificate, etc.

This causes a second puppet process to start up and contend for the
puppet lock file. Most of the time the first puppet process releases
the lock file and sleeps for 30 minutes, before the 05_Agent_test runs.
But sometimes the first process still has the file locked, e.g.
because it's pluginsync'ing from the master. If so, 05_Agent_test fails
with `notice: Run of Puppet configuration client already in progress;
skipping`

Since none of the PE acceptance tests rely on having a puppet agent
running in the background, this commit stops all agents before
proceeding. The logic for how to stop the agent was copied from
`setup/pe_co/05_Agent_test.rb`.