summaryrefslogtreecommitdiffstats
path: root/acceptance
diff options
context:
space:
mode:
authorMatt Robinson <matt@puppetlabs.com>2011-07-14 15:27:54 -0700
committerMatt Robinson <matt@puppetlabs.com>2011-07-14 15:27:54 -0700
commitafc3616dc31f4a432410be4081a657726a257986 (patch)
tree72587e4fbe49bceff756e9fdb3e718612e4b2a93 /acceptance
parentacf5d3ae8c45099534d0b4d43276c1ae3d586c8a (diff)
parent790e947e5581fc51e7002c81c3848fb7048bb6ac (diff)
downloadpuppet-afc3616dc31f4a432410be4081a657726a257986.tar.gz
puppet-afc3616dc31f4a432410be4081a657726a257986.tar.xz
puppet-afc3616dc31f4a432410be4081a657726a257986.zip
Merge branch '2.6.x' into 2.7.x
* 2.6.x: (maint) Cleanup and strengthen acceptance tests (#7144) Update Settings#writesub to convert mode to Fixnum (maint) Fix platform dection for RHEL Manually Resolved Conflicts: acceptance/tests/ticket_5477_master_not_dectect_sitepp.rb spec/unit/util/settings_spec.rb
Diffstat (limited to 'acceptance')
-rw-r--r--acceptance/tests/jeff_append_to_array.rb9
-rw-r--r--acceptance/tests/puppet_apply_a_file_should_create_a_file_and_report_the_md5.rb9
-rw-r--r--acceptance/tests/puppet_apply_basics.rb8
-rw-r--r--acceptance/tests/puppet_apply_should_show_a_notice.rb8
-rwxr-xr-xacceptance/tests/resource/service/ticket_4123_should_list_all_running_redhat.rb3
-rwxr-xr-xacceptance/tests/resource/service/ticket_4124_should_list_all_disabled.rb2
-rw-r--r--acceptance/tests/ticket_3172_puppet_kick_with_hostnames_on_the_command_line.rb8
-rw-r--r--acceptance/tests/ticket_4059_ralsh_can_change_settings.rb7
-rw-r--r--acceptance/tests/ticket_4110_puppet_apply_should_not_create_a_user_that_already_exists.rb6
-rw-r--r--acceptance/tests/ticket_4233_resource_with_a_newline.rb7
-rw-r--r--acceptance/tests/ticket_4285_file_resource_fail_when_name_defined_instead_of_path.rb6
-rw-r--r--acceptance/tests/ticket_4287_undefined_method_evaluate_match_when_function_call_used_in_an_if_statement.rb7
-rw-r--r--acceptance/tests/ticket_4289_facter_should_recognize_OEL_operatingsystemrelease.rb2
-rw-r--r--acceptance/tests/ticket_4293_define_and_use_a_define_within_a_class.rb7
-rw-r--r--acceptance/tests/ticket_5477_master_not_dectect_sitepp.rb7
-rw-r--r--acceptance/tests/ticket_6541_invalid_filebucket_files.rb21
-rw-r--r--acceptance/tests/ticket_6734_6256_5530_5503.rb2
17 files changed, 71 insertions, 48 deletions
diff --git a/acceptance/tests/jeff_append_to_array.rb b/acceptance/tests/jeff_append_to_array.rb
index 415d59fe8..20f43665e 100644
--- a/acceptance/tests/jeff_append_to_array.rb
+++ b/acceptance/tests/jeff_append_to_array.rb
@@ -12,8 +12,9 @@ manifest = %q{
include parent::child
}
-apply_manifest_on(agents, manifest) do
- stdout =~ /notice: parent array element/ or fail_test("parent missing")
- stdout =~ /notice: child array element/ or fail_test("child missing")
+agents.each do |host|
+ apply_manifest_on(host, manifest) do
+ assert_match(/notice: parent array element/, stdout, "#{host}: parent missing")
+ assert_match(/notice: child array element/, stdout, "#{host}: child missing")
+ end
end
-
diff --git a/acceptance/tests/puppet_apply_a_file_should_create_a_file_and_report_the_md5.rb b/acceptance/tests/puppet_apply_a_file_should_create_a_file_and_report_the_md5.rb
index abb06fbaf..44338520a 100644
--- a/acceptance/tests/puppet_apply_a_file_should_create_a_file_and_report_the_md5.rb
+++ b/acceptance/tests/puppet_apply_a_file_should_create_a_file_and_report_the_md5.rb
@@ -6,10 +6,11 @@ manifest = "file{'#{file}': content => 'test'}"
step "clean up #{file} for testing"
on agents, "rm -f #{file}"
-step "run the manifest and verify MD5 was printed"
-apply_manifest_on(agents, manifest) do
- fail_test "didn't find the content MD5 on output" unless
- stdout.include? "defined content as '{md5}098f6bcd4621d373cade4e832627b4f6'"
+step "Run the manifest and verify MD5 was printed"
+agents.each do |host|
+ apply_manifest_on(host, manifest) do
+ assert_match(/defined content as '{md5}098f6bcd4621d373cade4e832627b4f6'/, stdout, "#{host}: didn't find the content MD5 on output")
+ end
end
step "clean up #{file} after testing"
diff --git a/acceptance/tests/puppet_apply_basics.rb b/acceptance/tests/puppet_apply_basics.rb
index bbbdefc15..23c57d84d 100644
--- a/acceptance/tests/puppet_apply_basics.rb
+++ b/acceptance/tests/puppet_apply_basics.rb
@@ -5,11 +5,13 @@
test_name "Trivial puppet tests"
step "check that puppet apply displays notices"
-apply_manifest_on(agents, "notice 'Hello World'") do
- stdout =~ /notice:.*Hello World/ or fail_test("missing notice!")
+agents.each do |host|
+ apply_manifest_on(host, "notice 'Hello World'") do
+ assert_match(/notice:.*Hello World/, stdout, "#{host}: missing notice!")
+ end
end
step "verify help displays something for puppet master"
on master, puppet_master("--help") do
- stdout =~ /puppet master/ or fail_test("improper help output")
+ assert_match(/puppet master/, stdout, "improper help output")
end
diff --git a/acceptance/tests/puppet_apply_should_show_a_notice.rb b/acceptance/tests/puppet_apply_should_show_a_notice.rb
index af6f41ca7..757d29bbf 100644
--- a/acceptance/tests/puppet_apply_should_show_a_notice.rb
+++ b/acceptance/tests/puppet_apply_should_show_a_notice.rb
@@ -1,5 +1,7 @@
test_name "puppet apply should show a notice"
-apply_manifest_on(agents, "notice 'Hello World'") do
- fail_test "the notice didn't show" unless
- stdout =~ /notice: .*: Hello World/
+
+agents.each do |host|
+ apply_manifest_on(host, "notice 'Hello World'") do
+ assert_match(/notice: .*: Hello World/, stdout, "#{host}: the notice didn't show")
+ end
end
diff --git a/acceptance/tests/resource/service/ticket_4123_should_list_all_running_redhat.rb b/acceptance/tests/resource/service/ticket_4123_should_list_all_running_redhat.rb
index 127e943a9..9f0fdc5c7 100755
--- a/acceptance/tests/resource/service/ticket_4123_should_list_all_running_redhat.rb
+++ b/acceptance/tests/resource/service/ticket_4123_should_list_all_running_redhat.rb
@@ -4,8 +4,7 @@ step "Validate services running agreement ralsh vs. OS service count"
# ticket_4123_should_list_all_running_redhat.sh
hosts.each do |host|
- if host['platform'].include?('centos') or host['platform'].include?('redhat')
- puts "XXX #{host['platform']}"
+ if host['platform'].include?('centos') or host['platform'].include?('rhel')
run_script_on(host,'acceptance-tests/tests/resource/service/ticket_4123_should_list_all_running_redhat.sh')
else
skip_test "Test not supported on this plaform"
diff --git a/acceptance/tests/resource/service/ticket_4124_should_list_all_disabled.rb b/acceptance/tests/resource/service/ticket_4124_should_list_all_disabled.rb
index db96ad91c..13ad5ceac 100755
--- a/acceptance/tests/resource/service/ticket_4124_should_list_all_disabled.rb
+++ b/acceptance/tests/resource/service/ticket_4124_should_list_all_disabled.rb
@@ -4,7 +4,7 @@ step "Validate disabled services agreement ralsh vs. OS service count"
# ticket_4124_should_list_all_disabled.sh
hosts.each do |host|
- unless host['platform'].include? 'centos' or host['platform'].include? 'redhat'
+ unless host['platform'].include? 'centos' or host['platform'].include? 'rhel'
skip_test "Test not supported on this plaform"
else
run_script_on(host,'acceptance-tests/tests/resource/service/ticket_4124_should_list_all_disabled.sh')
diff --git a/acceptance/tests/ticket_3172_puppet_kick_with_hostnames_on_the_command_line.rb b/acceptance/tests/ticket_3172_puppet_kick_with_hostnames_on_the_command_line.rb
index 436ce29fe..24dd7256b 100644
--- a/acceptance/tests/ticket_3172_puppet_kick_with_hostnames_on_the_command_line.rb
+++ b/acceptance/tests/ticket_3172_puppet_kick_with_hostnames_on_the_command_line.rb
@@ -2,6 +2,8 @@ test_name "#3172: puppet kick with hostnames on the command line"
step "verify that we trigger our host"
target = 'working.example.org'
-on(agents, puppet_kick(target), :acceptable_exit_codes => [3]) {
- fail_test "didn't trigger #{target}" unless stdout.include? "Triggering #{target}"
-}
+agents.each do |host|
+ on(host, puppet_kick(target), :acceptable_exit_codes => [3]) {
+ assert_match(/Triggering #{target}/, stdout, "didn't trigger #{target} on #{host}" )
+ }
+end
diff --git a/acceptance/tests/ticket_4059_ralsh_can_change_settings.rb b/acceptance/tests/ticket_4059_ralsh_can_change_settings.rb
index c97bbdbe6..83f5899f2 100644
--- a/acceptance/tests/ticket_4059_ralsh_can_change_settings.rb
+++ b/acceptance/tests/ticket_4059_ralsh_can_change_settings.rb
@@ -11,9 +11,10 @@ on(agents, puppet_resource(content)) do
stdout.index('Host[example.com]/ensure: created') or
fail_test("missing notice about host record creation")
end
-on(agents, "cat #{target}") do
- stdout =~ /^127\.0\.0\.1\s+example\.com/ or
- fail_test("missing host record in #{target}")
+agents.each do |host|
+ on(host, "cat #{target}") do
+ assert_match(/^127\.0\.0\.1\s+example\.com/, stdout, "missing host record in #{target} on #{host}")
+ end
end
step "cleanup at the end of the test"
diff --git a/acceptance/tests/ticket_4110_puppet_apply_should_not_create_a_user_that_already_exists.rb b/acceptance/tests/ticket_4110_puppet_apply_should_not_create_a_user_that_already_exists.rb
index 9704250d9..147857362 100644
--- a/acceptance/tests/ticket_4110_puppet_apply_should_not_create_a_user_that_already_exists.rb
+++ b/acceptance/tests/ticket_4110_puppet_apply_should_not_create_a_user_that_already_exists.rb
@@ -1,5 +1,7 @@
test_name "#4110: puppet apply should not create a user that already exists"
-apply_manifest_on(agents, "user { 'root': ensure => 'present' }") do
- fail_test("we tried to create root on this host") if stdout =~ /created/
+agents.each do |host|
+ apply_manifest_on(host, "user { 'root': ensure => 'present' }") do
+ assert_no_match(/created/, stdout, "we tried to create root on #{host}" )
+ end
end
diff --git a/acceptance/tests/ticket_4233_resource_with_a_newline.rb b/acceptance/tests/ticket_4233_resource_with_a_newline.rb
index 7bb7dc3c3..11924b550 100644
--- a/acceptance/tests/ticket_4233_resource_with_a_newline.rb
+++ b/acceptance/tests/ticket_4233_resource_with_a_newline.rb
@@ -8,6 +8,9 @@ test_name "#4233: resource with a newline"
# and 2.6.0 final to not return an error line.
# Look for the line in the output and fail the test
# if we find it.
-apply_manifest_on(agents, 'exec { \'/bin/echo -e "\nHello World\n"\': }') do
- stdout =~ /err:/ and fail_test("error report in output, sorry")
+
+agents.each do |host|
+ apply_manifest_on(host, 'exec { \'/bin/echo -e "\nHello World\n"\': }') do
+ assert_no_match(/err:/, stdout, "error report in output on #{host}")
+ end
end
diff --git a/acceptance/tests/ticket_4285_file_resource_fail_when_name_defined_instead_of_path.rb b/acceptance/tests/ticket_4285_file_resource_fail_when_name_defined_instead_of_path.rb
index d2297fbc4..c1cdb0b9d 100644
--- a/acceptance/tests/ticket_4285_file_resource_fail_when_name_defined_instead_of_path.rb
+++ b/acceptance/tests/ticket_4285_file_resource_fail_when_name_defined_instead_of_path.rb
@@ -12,6 +12,8 @@ manifest = %q{
}
}
-apply_manifest_on(agents, manifest) do
- fail_test "found the bug report output" if stdout =~ /Cannot alias/
+agents.each do |host|
+ apply_manifest_on(host, manifest) do
+ assert_no_match(/Cannot alias/, stdout, "#{host}: found the bug report output")
+ end
end
diff --git a/acceptance/tests/ticket_4287_undefined_method_evaluate_match_when_function_call_used_in_an_if_statement.rb b/acceptance/tests/ticket_4287_undefined_method_evaluate_match_when_function_call_used_in_an_if_statement.rb
index e9a17df36..f5a1c1685 100644
--- a/acceptance/tests/ticket_4287_undefined_method_evaluate_match_when_function_call_used_in_an_if_statement.rb
+++ b/acceptance/tests/ticket_4287_undefined_method_evaluate_match_when_function_call_used_in_an_if_statement.rb
@@ -7,7 +7,8 @@ manifest = %q{
}
}
-apply_manifest_on(agents, manifest) do
- fail_test "didn't get the expected notice" unless
- stdout.include? 'notice: No issue here...'
+agents.each do |host|
+ apply_manifest_on(host, manifest) do
+ assert_match(/notice: No issue here.../, stdout, "didn't get the expected notice on #{host}")
+ end
end
diff --git a/acceptance/tests/ticket_4289_facter_should_recognize_OEL_operatingsystemrelease.rb b/acceptance/tests/ticket_4289_facter_should_recognize_OEL_operatingsystemrelease.rb
index 653fcb274..cacb7db65 100644
--- a/acceptance/tests/ticket_4289_facter_should_recognize_OEL_operatingsystemrelease.rb
+++ b/acceptance/tests/ticket_4289_facter_should_recognize_OEL_operatingsystemrelease.rb
@@ -16,6 +16,6 @@ agents.each do |host|
if stdout =~ /oel/i then
step "test operatingsystemrelease fact on OEL host #{host}"
on host, facter("operatingsystemrelease")
- stdout =~ /^\d\.\d$/ or fail_test "operatingsystemrelease not as expected"
+ assert_match(/^\d\.\d$/, stdout, "operatingsystemrelease not as expected on #{host}")
end
end
diff --git a/acceptance/tests/ticket_4293_define_and_use_a_define_within_a_class.rb b/acceptance/tests/ticket_4293_define_and_use_a_define_within_a_class.rb
index 830da99b4..aa42fd401 100644
--- a/acceptance/tests/ticket_4293_define_and_use_a_define_within_a_class.rb
+++ b/acceptance/tests/ticket_4293_define_and_use_a_define_within_a_class.rb
@@ -16,7 +16,8 @@ class foo {
include foo
PP
-apply_manifest_on(agents, manifest) do
- stdout =~ /notice.*?Foo::Do_notify.*?a_message_for_you/ or
- fail_test("the notification didn't show up in stdout")
+agents.each do |host|
+ apply_manifest_on(host, manifest) do
+ assert_match(/notice.*?Foo::Do_notify.*?a_message_for_you/, stdout, "the notification didn't show up in stdout on #{host}")
+ end
end
diff --git a/acceptance/tests/ticket_5477_master_not_dectect_sitepp.rb b/acceptance/tests/ticket_5477_master_not_dectect_sitepp.rb
index d8723b2ec..f774eca05 100644
--- a/acceptance/tests/ticket_5477_master_not_dectect_sitepp.rb
+++ b/acceptance/tests/ticket_5477_master_not_dectect_sitepp.rb
@@ -24,7 +24,10 @@ with_master_running_on(master, "--manifest #{manifest_file} --certdnsnames=\"pup
sleep 3
step "Agent: puppet agent --test"
- on agents, puppet_agent("--test --server #{master}"), :acceptable_exit_codes => [2] do
- fail_test "Site.pp not detect at Master?" unless stdout.include? 'ticket_5477_notify'
+
+ agents.each do |host|
+ on(host, puppet_agent("--test --server #{master}"), :acceptable_exit_codes => [2]) do
+ assert_match(/ticket_5477_notify/, stdout, "#{host}: Site.pp not detected on Puppet Master")
+ end
end
end
diff --git a/acceptance/tests/ticket_6541_invalid_filebucket_files.rb b/acceptance/tests/ticket_6541_invalid_filebucket_files.rb
index 25bcff452..33b985b67 100644
--- a/acceptance/tests/ticket_6541_invalid_filebucket_files.rb
+++ b/acceptance/tests/ticket_6541_invalid_filebucket_files.rb
@@ -4,23 +4,26 @@ apply_manifest_on(agents, manifest)
test_name "verify invalid hashes should not change the file"
manifest = "file { '/tmp/6541': content => '{md5}notahash' }"
-apply_manifest_on(agents, manifest) do
- fail_test "shouldn't have overwrote the file" if
- stdout =~ /content changed/
+agents.each do |host|
+ apply_manifest_on(host, manifest) do
+ assert_no_match(/content changed/, stdout, "#{host}: shouldn't have overwrote the file")
+ end
end
test_name "verify valid but unbucketed hashes should not change the file"
manifest = "file { '/tmp/6541': content => '{md5}13ad7345d56b566a4408ffdcd877bc78' }"
-apply_manifest_on(agents, manifest) do
- fail_test "shouldn't have overwrote the file" if
- stdout =~ /content changed/
+agents.each do |host|
+ apply_manifest_on(host, manifest) do
+ assert_no_match(/content changed/, stdout, "#{host}: shouldn't have overwrote the file")
+ end
end
on(agents, puppet_filebucket("backup -l /dev/null") )
test_name "verify that an empty file can be retrieved from the filebucket"
manifest = "file { '/tmp/6541': content => '{md5}d41d8cd98f00b204e9800998ecf8427e' }"
-apply_manifest_on(agents, manifest) do
- fail_test "shouldn't have overwrote the file" unless
- stdout =~ /content changed '\{md5\}552e21cd4cd9918678e3c1a0df491bc3' to '\{md5\}d41d8cd98f00b204e9800998ecf8427e'/
+agents.each do |host|
+ apply_manifest_on(host, manifest) do
+ assert_match(/content changed '\{md5\}552e21cd4cd9918678e3c1a0df491bc3' to '\{md5\}d41d8cd98f00b204e9800998ecf8427e'/, stdout, "#{host}: shouldn't have overwrote the file")
+ end
end
diff --git a/acceptance/tests/ticket_6734_6256_5530_5503.rb b/acceptance/tests/ticket_6734_6256_5530_5503.rb
index 72bb592d8..b5d7aaaf3 100644
--- a/acceptance/tests/ticket_6734_6256_5530_5503.rb
+++ b/acceptance/tests/ticket_6734_6256_5530_5503.rb
@@ -7,6 +7,6 @@ test_name "Tickets 6734 6256 5530 5503i Puppet Master fails to start"
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}'" do
- fail_test "puppet/rrd does not exist/wrong permission" unless stdout.include? 'puppet puppet'
+ assert_match(/puppet puppet/, stdout, "puppet/rrd does not exist/wrong permissions")
end
end