summaryrefslogtreecommitdiffstats
path: root/acceptance
diff options
context:
space:
mode:
authorNick Lewis <nick@puppetlabs.com>2011-06-06 18:08:13 -0700
committerNick Lewis <nick@puppetlabs.com>2011-06-06 18:16:57 -0700
commitc260cf1c8f4850fb5e81616c1e4baa2a42c063e9 (patch)
tree9a994a7deee4f1603dd2284d1638445b19f11cf6 /acceptance
parent3d09ca82e57d0c8836b77623d876cd5dc9a3a5e6 (diff)
downloadpuppet-c260cf1c8f4850fb5e81616c1e4baa2a42c063e9.tar.gz
puppet-c260cf1c8f4850fb5e81616c1e4baa2a42c063e9.tar.xz
puppet-c260cf1c8f4850fb5e81616c1e4baa2a42c063e9.zip
Fix acceptance tests not managing their masters
These tests were assuming a master was already started when they were run, which caused order-dependent failures. They will now start their own masters, and use newer helper methods to run master and agent. Paired-With: Jacob Helwig <jacob@puppetlabs.com>
Diffstat (limited to 'acceptance')
-rw-r--r--acceptance/tests/ticket_5477_master_not_dectect_sitepp.rb45
-rw-r--r--acceptance/tests/ticket_6734_6256_5530_5503.rb14
2 files changed, 22 insertions, 37 deletions
diff --git a/acceptance/tests/ticket_5477_master_not_dectect_sitepp.rb b/acceptance/tests/ticket_5477_master_not_dectect_sitepp.rb
index d05735e50..3b0e21512 100644
--- a/acceptance/tests/ticket_5477_master_not_dectect_sitepp.rb
+++ b/acceptance/tests/ticket_5477_master_not_dectect_sitepp.rb
@@ -6,38 +6,25 @@
test_name "Ticket 5477, Puppet Master does not detect newly created site.pp file"
-# Kill running Puppet Master
-step "Master: kill running Puppet Master"
-on master, "ps -U puppet | awk '/puppet/ { print \$1 }' | xargs kill"
+manifest_file = "/tmp/missing_site-5477-#{$$}.pp"
-# Run tests against Master first
-step "Master: mv site.pp file to /tmp, if existing"
-on master, "if [ -e /etc/puppet/manifests/site.pp ] ; then mv /etc/puppet/manifests/site.pp /tmp/site.pp-5477 ; fi"
+on master, "rm -f #{manifest_file}"
-# Start Puppet Master
-#step "Master: Run Puppet Master in verbose mode"
-#on master, puppet_master("--verbose")
-step "Master: Start Puppet Master"
-on master, puppet_master("--certdnsnames=\"puppet:$(hostname -s):$(hostname -f)\" --verbose")
+with_master_running_on(master, "--manifest #{manifest_file} --certdnsnames=\"puppet:$(hostname -s):$(hostname -f)\" --verbose --filetimeout 1") do
+ # Run test on Agents
+ step "Agent: agent --test"
+ on agents, puppet_agent("--test")
-# Allow puppet server to start accepting conections
-sleep 10
+ # Create a new site.pp
+ step "Master: create basic site.pp file"
+ create_remote_file master, manifest_file, "notify{ticket_5477_notify:}"
-# Run test on Agents
-step "Agent: agent --test"
-agents.each { |agent|
- on agent, puppet_agent("--test")
-}
-
-# Create a new site.pp
-step "Master: create basic site.pp file"
-on master, "echo 'notify{ticket_5477_notify:}' > /etc/puppet/manifests/site.pp"
+ on master, "chmod 644 #{manifest_file}"
-sleep 20
+ sleep 3
-step "Agent: puppet agent --test"
-agents.each { |agent|
- on agent, "puppet agent -t", :acceptable_exit_codes => [2]
- fail_test "Site.pp not detect at Master?" unless
- stdout.include? 'ticket_5477_notify'
-}
+ step "Agent: puppet agent --test"
+ on agents, puppet_agent("--test"), :acceptable_exit_codes => [2] do
+ fail_test "Site.pp not detect at Master?" unless stdout.include? 'ticket_5477_notify'
+ end
+end
diff --git a/acceptance/tests/ticket_6734_6256_5530_5503.rb b/acceptance/tests/ticket_6734_6256_5530_5503.rb
index fe8866901..8f0155efb 100644
--- a/acceptance/tests/ticket_6734_6256_5530_5503.rb
+++ b/acceptance/tests/ticket_6734_6256_5530_5503.rb
@@ -5,12 +5,10 @@
test_name "Tickets 6734 6256 5530 5503i Puppet Master fails to start"
# Kill running Puppet Master
-step "Check for running Puppet Master"
-on master, "ps -ef | grep puppet"
- fail_test "Puppet Master not running" unless
- stdout.include? 'master'
+with_master_running_on(master) do
-step "Check permissions on puppet/rrd/"
-on master, "ls -l /var/lib/puppet | grep rrd | awk '{print $3\" \"$4}'"
- fail_test "puppet/rrd does not exist/wrong permission" unless
- stdout.include? 'puppet puppet'
+ step "Check permissions on puppet/rrd/"
+ on master, "ls -l /var/lib/puppet | grep rrd | awk '{print $3\" \"$4}'" do
+ fail_test "puppet/rrd does not exist/wrong permission" unless stdout.include? 'puppet puppet'
+ end
+end