diff --git a/acceptance/tests/agent/last_run_summary_report.rb b/acceptance/tests/agent/last_run_summary_report.rb index 0fd51758ab7..178b8771196 100644 --- a/acceptance/tests/agent/last_run_summary_report.rb +++ b/acceptance/tests/agent/last_run_summary_report.rb @@ -74,7 +74,7 @@ step "Check that '#{statedir}' exists and has no 'last_run_summary.yaml' file" do on(agent, "ls #{statedir}",:acceptable_exit_codes => [0]) do |result| - assert_no_match(/last_run_summary.yaml/, result.stdout) + refute_match(/last_run_summary.yaml/, result.stdout) end end diff --git a/acceptance/tests/environment/should_find_existing_production_environment.rb b/acceptance/tests/environment/should_find_existing_production_environment.rb index b1cb9a927ce..7a108e930be 100644 --- a/acceptance/tests/environment/should_find_existing_production_environment.rb +++ b/acceptance/tests/environment/should_find_existing_production_environment.rb @@ -95,7 +95,7 @@ step 'Expect no production environment folder changes' do on(agent, "ls #{custom_environment_path}") do |result| - assert_no_match(/production/, result.stdout) + refute_match(/production/, result.stdout) end on(agent, "ls #{default_environment_path}") do |result| @@ -110,7 +110,7 @@ step 'Expect production environment folder to be recreated in the custom path' do on(agent, puppet("agent -t"), :acceptable_exit_codes => [0, 2]) do |result| step 'Expect the module to be gone on the server node' do - assert_no_match(/Error:.*i18ndemo/, result.stderr) + refute_match(/Error:.*i18ndemo/, result.stderr) end if agent == master step 'Expect the production environment, along with the module, to be synced back on the agent node' do @@ -123,7 +123,7 @@ end on(agent, "ls #{default_environment_path}") do |result| - assert_no_match(/production/, result.stdout) + refute_match(/production/, result.stdout) end end @@ -134,7 +134,7 @@ step 'Expect production environment folder to be found in both paths but use the default one' do on(agent, puppet("agent -t"), :acceptable_exit_codes => [0, 2]) do |result| step 'Expect the module to be gone' do - assert_no_match(/Error:.*i18ndemo/, result.stderr) + refute_match(/Error:.*i18ndemo/, result.stderr) end if agent == master end diff --git a/acceptance/tests/environment/use_environment_from_environmentpath.rb b/acceptance/tests/environment/use_environment_from_environmentpath.rb index 7518f6d0930..14a90347474 100644 --- a/acceptance/tests/environment/use_environment_from_environmentpath.rb +++ b/acceptance/tests/environment/use_environment_from_environmentpath.rb @@ -180,7 +180,7 @@ def run_with_environment(agent, environment, options = {}) end run_with_environment(agent, "production", :expected_exit_code => 2) do |tmpdir, catalog_result| - assert_no_match(/module-atmp/, catalog_result.stdout, "module-atmp was included despite the default environment being loaded") + refute_match(/module-atmp/, catalog_result.stdout, "module-atmp was included despite the default environment being loaded") assert_match(/environment fact from module-globalmod/, catalog_result.stdout) diff --git a/acceptance/tests/language/pcore_resource_types_should_have_precedence_over_ruby.rb b/acceptance/tests/language/pcore_resource_types_should_have_precedence_over_ruby.rb index 539811279e6..d0eb3f54618 100644 --- a/acceptance/tests/language/pcore_resource_types_should_have_precedence_over_ruby.rb +++ b/acceptance/tests/language/pcore_resource_types_should_have_precedence_over_ruby.rb @@ -101,7 +101,7 @@ def refresh step 'compile catalog and make sure that ruby code is NOT executed' do on master, puppet('catalog', 'find', master.hostname) do |result| - assert_no_match(/running ruby code/, result.stderr) + refute_match(/running ruby code/, result.stderr) catalog_results[master.hostname]['pcore_cat'] = JSON.parse(result.stdout.sub(/^[^{]+/,'')) end end diff --git a/acceptance/tests/pluginsync/3935_pluginsync_should_follow_symlinks.rb b/acceptance/tests/pluginsync/3935_pluginsync_should_follow_symlinks.rb index 0e0b84a1404..bd95803916a 100644 --- a/acceptance/tests/pluginsync/3935_pluginsync_should_follow_symlinks.rb +++ b/acceptance/tests/pluginsync/3935_pluginsync_should_follow_symlinks.rb @@ -42,7 +42,7 @@ with_puppet_running_on master, master_opts, basedir do agents.each do |agent| on(agent, puppet('agent', "-t")) - assert_no_match(/Could not retrieve information from environment production source\(s\) puppet:\/\/\/pluginfacts/, stderr) - assert_no_match(/Could not retrieve information from environment production source\(s\) puppet:\/\/\/plugins/, stderr) + refute_match(/Could not retrieve information from environment production source\(s\) puppet:\/\/\/pluginfacts/, stderr) + refute_match(/Could not retrieve information from environment production source\(s\) puppet:\/\/\/plugins/, stderr) end end diff --git a/acceptance/tests/pluginsync/7316_apps_should_be_available_via_pluginsync.rb b/acceptance/tests/pluginsync/7316_apps_should_be_available_via_pluginsync.rb index 393c7c1e998..13f6836d39f 100644 --- a/acceptance/tests/pluginsync/7316_apps_should_be_available_via_pluginsync.rb +++ b/acceptance/tests/pluginsync/7316_apps_should_be_available_via_pluginsync.rb @@ -79,7 +79,7 @@ def main() step "run the agent" do on(agent, puppet("agent --libdir='#{agent_lib_dir}' --test --environment '#{tmp_environment}'")) do |result| - assert_no_match( + refute_match( /The \`source_permissions\` parameter is deprecated/, result.stderr, "pluginsync should not get a deprecation warning for source_permissions") diff --git a/acceptance/tests/provider/package/gem.rb b/acceptance/tests/provider/package/gem.rb index 1b1ca56b692..03865821631 100644 --- a/acceptance/tests/provider/package/gem.rb +++ b/acceptance/tests/provider/package/gem.rb @@ -58,7 +58,7 @@ package_manifest = resource_manifest('package', package, { ensure: 'absent', provider: 'gem' } ) apply_manifest_on(agent, package_manifest, :catch_failures => true) do list = on(agent, "#{system_gem_command} list").stdout - assert_no_match(/#{package} \(/, list) + refute_match(/#{package} \(/, list) end on(agent, "#{system_gem_command} uninstall #{package}") end @@ -106,7 +106,7 @@ package_manifest = resource_manifest('package', package, { ensure: 'absent', provider: 'gem', command: puppet_gem_command } ) apply_manifest_on(agent, package_manifest, :catch_failures => true) do list = on(agent, "#{puppet_gem_command} list").stdout - assert_no_match(/#{package} \(/, list) + refute_match(/#{package} \(/, list) end on(agent, "#{puppet_gem_command} uninstall #{package}") end diff --git a/acceptance/tests/provider/package/pip.rb b/acceptance/tests/provider/package/pip.rb index fbbfa02e297..d1113198b02 100644 --- a/acceptance/tests/provider/package/pip.rb +++ b/acceptance/tests/provider/package/pip.rb @@ -74,7 +74,7 @@ package_manifest = resource_manifest('package', package, { ensure: 'absent', provider: 'pip' } ) apply_manifest_on(agent, package_manifest, :catch_failures => true) do list = on(agent, "#{pip_command} list --disable-pip-version-check").stdout - assert_no_match(/#{package} \(/, list) + refute_match(/#{package} \(/, list) end end end diff --git a/acceptance/tests/provider/package/puppetserver_gem.rb b/acceptance/tests/provider/package/puppetserver_gem.rb index 50868adf773..d1aaa1f8874 100644 --- a/acceptance/tests/provider/package/puppetserver_gem.rb +++ b/acceptance/tests/provider/package/puppetserver_gem.rb @@ -31,7 +31,7 @@ package_manifest = resource_manifest('package', package, { ensure: 'absent', provider: 'puppetserver_gem' } ) apply_manifest_on(master, package_manifest, catch_failures: true) do list = on(master, "puppetserver gem list").stdout - assert_no_match(/#{package} \(/, list) + refute_match(/#{package} \(/, list) end end end diff --git a/acceptance/tests/resource/file/bin_diff_output_content_attribute.rb b/acceptance/tests/resource/file/bin_diff_output_content_attribute.rb index bdd82e1d7d4..fea60a65775 100644 --- a/acceptance/tests/resource/file/bin_diff_output_content_attribute.rb +++ b/acceptance/tests/resource/file/bin_diff_output_content_attribute.rb @@ -54,7 +54,7 @@ on(agent, puppet('apply','--show_diff'), :stdin => manifest) do assert_match(/content: content changed '{sha256}#{initial_sha_checksum}' to '{sha256}#{updated_sha_checksum}'/, stdout, "#{agent}: checksum of binary file not matched after update") - assert_no_match(/content: Received a Log attribute with invalid encoding:/, stdout, "#{agent}: Received a Log attribute with invalid encoding") + refute_match(/content: Received a Log attribute with invalid encoding:/, stdout, "#{agent}: Received a Log attribute with invalid encoding") if initial_bin_data.valid_encoding? && updated_bin_data.valid_encoding? assert_match(/^- ?#{initial_bin_data}$/, stdout, "#{agent}: initial utf-8 data not found in binary diff") assert_match(/^\+ ?#{updated_bin_data}$/, stdout, "#{agent}: updated utf-8 data not found in binary diff") diff --git a/acceptance/tests/resource/file/content_attribute.rb b/acceptance/tests/resource/file/content_attribute.rb index ca1d6712a47..be67eab9132 100644 --- a/acceptance/tests/resource/file/content_attribute.rb +++ b/acceptance/tests/resource/file/content_attribute.rb @@ -26,7 +26,7 @@ }.join("\n") apply_manifest_on agent, manifest do checksums.each do |checksum_type| - assert_no_match(/content changed/, stdout, "#{agent}: shouldn't have overwrote #{target+checksum_type}") + refute_match(/content changed/, stdout, "#{agent}: shouldn't have overwrote #{target+checksum_type}") end end diff --git a/acceptance/tests/resource/file/handle_fifo_files.rb b/acceptance/tests/resource/file/handle_fifo_files.rb index 3a30ac6a72f..3f0f7b680bd 100644 --- a/acceptance/tests/resource/file/handle_fifo_files.rb +++ b/acceptance/tests/resource/file/handle_fifo_files.rb @@ -45,7 +45,7 @@ def ensure_content_to_file_manifest(file_path, ensure_value) step "puppet ensures given fifo is a regular file" do apply_manifest_on(agent, ensure_content_to_file_manifest(fifo_path, 'file'), :acceptable_exit_codes => [0]) do assert_match(/Notice: .+\/myfifo\]\/ensure: defined content as '{/, stdout) - assert_no_match(/Warning: .+ Ensure set to :present but file type is fifo so no content will be synced/, stderr) + refute_match(/Warning: .+ Ensure set to :present but file type is fifo so no content will be synced/, stderr) end end diff --git a/acceptance/tests/resource/file/handle_fifo_files_when_recursing.rb b/acceptance/tests/resource/file/handle_fifo_files_when_recursing.rb index 44f031a955c..cec2191f39e 100644 --- a/acceptance/tests/resource/file/handle_fifo_files_when_recursing.rb +++ b/acceptance/tests/resource/file/handle_fifo_files_when_recursing.rb @@ -43,7 +43,7 @@ def ensure_owner_recursively_manifest(path, owner_value) step "puppet ensures '#{random_user}' as owner of path" do apply_manifest_on(agent, ensure_owner_recursively_manifest(tmp_path, random_user), :acceptable_exit_codes => [0]) do assert_match(/#{tmp_path}\]\/owner: owner changed '#{initial_owner}' to '#{random_user}'/, stdout) - assert_no_match(/Error: .+ Failed to generate additional resources using ‘eval_generate’: Cannot manage files of type fifo/, stderr) + refute_match(/Error: .+ Failed to generate additional resources using ‘eval_generate’: Cannot manage files of type fifo/, stderr) end end diff --git a/acceptance/tests/resource/file/should_default_mode.rb b/acceptance/tests/resource/file/should_default_mode.rb index bf8047e8fbf..728286f8bee 100644 --- a/acceptance/tests/resource/file/should_default_mode.rb +++ b/acceptance/tests/resource/file/should_default_mode.rb @@ -25,7 +25,7 @@ def regexp_mode(mode) file = "#{parent}/file.txt" on(agent, "echo foobar > #{file}") on(agent, "#{file}", :acceptable_exit_codes => (1..255)) do - assert_no_match(/foobar/, stdout) + refute_match(/foobar/, stdout) end step "set execute bit on file if explicitly specified" diff --git a/acceptance/tests/resource/file/source_attribute.rb b/acceptance/tests/resource/file/source_attribute.rb index 3532c6feed4..c8ed79c96b3 100644 --- a/acceptance/tests/resource/file/source_attribute.rb +++ b/acceptance/tests/resource/file/source_attribute.rb @@ -179,7 +179,7 @@ class source_test_module { step "second run should not update file" on(agent, puppet('agent', "--test"), :acceptable_exit_codes => [0,2]) do - assert_no_match(/content changed.*(md5|sha256)/, stdout, "Shouldn't have overwritten any files") + refute_match(/content changed.*(md5|sha256)/, stdout, "Shouldn't have overwritten any files") # When using ctime/mtime, the agent compares the values from its # local file with the values on the master to determine if the @@ -255,7 +255,7 @@ class source_test_module { step "second run should not update any files" apply_manifest_on agent, local_apply_manifest do - assert_no_match(/content changed/, stdout, "Shouldn't have overwrote any files") + refute_match(/content changed/, stdout, "Shouldn't have overwrote any files") end # changes in source file producing updates is tested elsewhere @@ -266,11 +266,11 @@ class source_test_module { if fips_host_present apply_manifest_on agent, "file { '#{localsource_testdir}/targetsha256lite': source => '#{source}', ensure => present, checksum => sha256lite }" do - assert_no_match(/(content changed|defined content)/, stdout, "Shouldn't have overwrote any files") + refute_match(/(content changed|defined content)/, stdout, "Shouldn't have overwrote any files") end else apply_manifest_on agent, "file { '#{localsource_testdir}/targetmd5lite': source => '#{source}', ensure => present, checksum => md5lite } file { '#{localsource_testdir}/targetsha256lite': source => '#{source}', ensure => present, checksum => sha256lite }" do - assert_no_match(/(content changed|defined content)/, stdout, "Shouldn't have overwrote any files") + refute_match(/(content changed|defined content)/, stdout, "Shouldn't have overwrote any files") end end @@ -294,7 +294,7 @@ class source_test_module { step "second run should not update any files using apply with puppet:/// URI source" on agent, puppet( %{apply --modulepath=#{localsource_testdir} #{localsource_test_manifest}} ) do - assert_no_match(/content changed/, stdout, "Shouldn't have overwrote any files") + refute_match(/content changed/, stdout, "Shouldn't have overwrote any files") end end diff --git a/acceptance/tests/resource/file/symbolic_modes.rb b/acceptance/tests/resource/file/symbolic_modes.rb index c6aff6a9cbd..8c558a76a8b 100644 --- a/acceptance/tests/resource/file/symbolic_modes.rb +++ b/acceptance/tests/resource/file/symbolic_modes.rb @@ -59,9 +59,9 @@ def manifest def puppet_reapply @testcase.apply_manifest_on(@agent, manifest) do |apply_result| - assert_no_match(/mode changed/, apply_result.stdout, "reapplied the symbolic mode change") + refute_match(/mode changed/, apply_result.stdout, "reapplied the symbolic mode change") (@file_list + @directory_list).each do |file| - assert_no_match(/#{Regexp.escape(file.path)}/, apply_result.stdout, "Expected to not see '#{file.path}' in 'puppet apply' output") + refute_match(/#{Regexp.escape(file.path)}/, apply_result.stdout, "Expected to not see '#{file.path}' in 'puppet apply' output") end end end @@ -119,7 +119,7 @@ def puppet_apply assert_match(/File\[#{Regexp.escape(file.path)}.* mode changed '#{'%04o' % file.start_mode}'.* to '#{'%04o' % file.mode}'/, apply_result, "couldn't set mode to #{file.symbolic_mode}") else - assert_no_match(/#{Regexp.escape(file.path)}.*mode changed/, apply_result, "reapplied the symbolic mode change for file #{file.path}") + refute_match(/#{Regexp.escape(file.path)}.*mode changed/, apply_result, "reapplied the symbolic mode change for file #{file.path}") end assert_mode(@agent, file.path, file.mode) end diff --git a/acceptance/tests/resource/package/common_package_name_in_different_providers.rb b/acceptance/tests/resource/package/common_package_name_in_different_providers.rb index d63cd5a302c..a95f78ef94f 100644 --- a/acceptance/tests/resource/package/common_package_name_in_different_providers.rb +++ b/acceptance/tests/resource/package/common_package_name_in_different_providers.rb @@ -65,7 +65,7 @@ def verify_present(hosts, pkg) end def verify_absent(hosts, pkg) - verify_state(hosts, pkg, '(?:purged|absent)', :assert_no_match) + verify_state(hosts, pkg, '(?:purged|absent)', :refute_match) end # Setup repo and package diff --git a/acceptance/tests/resource/package/does_not_exist.rb b/acceptance/tests/resource/package/does_not_exist.rb index 20723f68121..a2cb46bf240 100644 --- a/acceptance/tests/resource/package/does_not_exist.rb +++ b/acceptance/tests/resource/package/does_not_exist.rb @@ -22,7 +22,7 @@ agents.each do |agent| step "test puppet apply" do on(agent, puppet('apply', '-e', %Q|"package {'not-installed-on-this-host': ensure => purged }"|)) do - assert_no_match(/warning/i, stdout) + refute_match(/warning/i, stdout) end end end diff --git a/acceptance/tests/resource/package/ips/basic_tests.rb b/acceptance/tests/resource/package/ips/basic_tests.rb index fcfbab09571..e1126d35386 100644 --- a/acceptance/tests/resource/package/ips/basic_tests.rb +++ b/acceptance/tests/resource/package/ips/basic_tests.rb @@ -31,7 +31,7 @@ step "IPS: basic ensure we are clean" apply_manifest_on(agent, 'package {mypkg : ensure=>absent}') on(agent, "pkg list -v mypkg", :acceptable_exit_codes => [1]) do - assert_no_match( /mypkg@0.0.1/, result.stdout, "err: #{agent}") + refute_match( /mypkg@0.0.1/, result.stdout, "err: #{agent}") end step "IPS: basic - it should create" @@ -47,7 +47,7 @@ step "IPS: do not upgrade until latest is mentioned" send_pkg agent,:pkg => 'mypkg@0.0.2' apply_manifest_on(agent, 'package {mypkg : ensure=>present}') do - assert_no_match( /ensure: created/, result.stdout, "err: #{agent}") + refute_match( /ensure: created/, result.stdout, "err: #{agent}") end step "IPS: verify it was not upgraded" @@ -74,6 +74,6 @@ step "IPS: ensure removed." apply_manifest_on(agent, 'package {mypkg : ensure=>absent}') on(agent, "pkg list -v mypkg", :acceptable_exit_codes => [1]) do - assert_no_match( /mypkg@0.0.1/, result.stdout, "err: #{agent}") + refute_match( /mypkg@0.0.1/, result.stdout, "err: #{agent}") end end diff --git a/acceptance/tests/resource/package/ips/should_be_holdable.rb b/acceptance/tests/resource/package/ips/should_be_holdable.rb index 02600f03292..b23d2fd06b6 100644 --- a/acceptance/tests/resource/package/ips/should_be_holdable.rb +++ b/acceptance/tests/resource/package/ips/should_be_holdable.rb @@ -62,7 +62,7 @@ setup_fakeroot2 agent send_pkg2 agent, :pkg => 'mypkg2@0.0.3', :pkgdep => 'mypkg@0.0.3' apply_manifest_on(agent, 'package {mypkg2 : ensure=>"0.0.2"}') do - assert_no_match( /changed/, result.stdout, "err: #{agent}") + refute_match( /changed/, result.stdout, "err: #{agent}") end on agent, "pkg list -v mypkg" do assert_match( /mypkg@0.0.2/, result.stdout, "err: #{agent}") diff --git a/acceptance/tests/resource/package/ips/should_be_idempotent.rb b/acceptance/tests/resource/package/ips/should_be_idempotent.rb index 4de5abb78a8..7f7c72cd9c5 100644 --- a/acceptance/tests/resource/package/ips/should_be_idempotent.rb +++ b/acceptance/tests/resource/package/ips/should_be_idempotent.rb @@ -32,8 +32,8 @@ step "IPS: should be idempotent (present)" apply_manifest_on(agent, 'package {mypkg : ensure=>present}') do - assert_no_match( /created/, result.stdout, "err: #{agent}") - assert_no_match( /changed/, result.stdout, "err: #{agent}") + refute_match( /created/, result.stdout, "err: #{agent}") + refute_match( /changed/, result.stdout, "err: #{agent}") end send_pkg agent, :pkg => 'mypkg@0.0.2' @@ -42,7 +42,7 @@ step "IPS: ask for latest version again: should be idempotent (latest)" apply_manifest_on(agent, 'package {mypkg : ensure=>latest}') do - assert_no_match( /created/, result.stdout, "err: #{agent}") + refute_match( /created/, result.stdout, "err: #{agent}") end step "IPS: ask for specific version" @@ -53,14 +53,14 @@ step "IPS: ask for specific version again: should be idempotent (version)" apply_manifest_on(agent, 'package {mypkg : ensure=>"0.0.3"}') do - assert_no_match( /created/, result.stdout, "err: #{agent}") - assert_no_match( /changed/, result.stdout, "err: #{agent}") + refute_match( /created/, result.stdout, "err: #{agent}") + refute_match( /changed/, result.stdout, "err: #{agent}") end step "IPS: ensure removed." apply_manifest_on(agent, 'package {mypkg : ensure=>absent}') on(agent, "pkg list -v mypkg", :acceptable_exit_codes => [1]) do - assert_no_match( /mypkg/, result.stdout, "err: #{agent}") + refute_match( /mypkg/, result.stdout, "err: #{agent}") end end diff --git a/acceptance/tests/resource/package/ips/should_be_versionable.rb b/acceptance/tests/resource/package/ips/should_be_versionable.rb index 6ce1eb7a8d2..ce74efd11ed 100644 --- a/acceptance/tests/resource/package/ips/should_be_versionable.rb +++ b/acceptance/tests/resource/package/ips/should_be_versionable.rb @@ -38,7 +38,7 @@ assert_match( /ensure changed/, result.stdout, "err: #{agent}") end on agent, "pkg list mypkg" do - assert_no_match( /0.0.1/, result.stdout, "err: #{agent}") + refute_match( /0.0.1/, result.stdout, "err: #{agent}") assert_match( /0.0.2/, result.stdout, "err: #{agent}") end step "IPS: it should downpgrade if asked for previous version" @@ -46,7 +46,7 @@ assert_match( /ensure changed/, result.stdout, "err: #{agent}") end on agent, "pkg list mypkg" do - assert_no_match( /0.0.2/, result.stdout, "err: #{agent}") + refute_match( /0.0.2/, result.stdout, "err: #{agent}") assert_match( /0.0.1/, result.stdout, "err: #{agent}") end end diff --git a/acceptance/tests/resource/package/ips/should_remove.rb b/acceptance/tests/resource/package/ips/should_remove.rb index ac9ec69213c..bbedcdba625 100644 --- a/acceptance/tests/resource/package/ips/should_remove.rb +++ b/acceptance/tests/resource/package/ips/should_remove.rb @@ -33,7 +33,7 @@ apply_manifest_on(agent, 'package {mypkg : ensure=>absent}') on(agent, "pkg list -v mypkg", :acceptable_exit_codes => [1]) do - assert_no_match( /mypkg@0.0.1/, result.stdout, "err: #{agent}") + refute_match( /mypkg@0.0.1/, result.stdout, "err: #{agent}") end end diff --git a/acceptance/tests/resource/package/yum.rb b/acceptance/tests/resource/package/yum.rb index ee17047fb25..d5c60a2d568 100644 --- a/acceptance/tests/resource/package/yum.rb +++ b/acceptance/tests/resource/package/yum.rb @@ -40,7 +40,7 @@ def verify_present(hosts, pkg) end def verify_absent(hosts, pkg) - verify_state(hosts, pkg, '(?:purged|absent)', :assert_no_match) + verify_state(hosts, pkg, '(?:purged|absent)', :refute_match) end step "Managing a package which does not include an epoch in its version" do @@ -144,7 +144,7 @@ def verify_absent(hosts, pkg) end apply_manifest_on(agent, "package {'epoch': ensure => '1:1.1-1.noarch'}") do |result| - assert_no_match(/epoch/, result.stdout) + refute_match(/epoch/, result.stdout) end end @@ -162,11 +162,11 @@ def verify_absent(hosts, pkg) end apply_manifest_on(agent, 'package {"epoch": ensure => "1:1.1-1"}') do |result| - assert_no_match(/epoch/, result.stdout) + refute_match(/epoch/, result.stdout) end apply_manifest_on(agent, "package {'epoch': ensure => '1:1.1-1.noarch'}") do |result| - assert_no_match(/epoch/, result.stdout) + refute_match(/epoch/, result.stdout) end end end @@ -185,11 +185,11 @@ def verify_absent(hosts, pkg) end apply_manifest_on(agent, 'package {"epoch": ensure => "1.1-1"}') do |result| - assert_no_match(/epoch/, result.stdout) + refute_match(/epoch/, result.stdout) end apply_manifest_on(agent, "package {'epoch': ensure => '1:1.1-1.noarch'}") do |result| - assert_no_match(/epoch/, result.stdout) + refute_match(/epoch/, result.stdout) end end end diff --git a/acceptance/tests/resource/service/launchd_provider.rb b/acceptance/tests/resource/service/launchd_provider.rb index 266a4129210..d84cd5e285d 100644 --- a/acceptance/tests/resource/service/launchd_provider.rb +++ b/acceptance/tests/resource/service/launchd_provider.rb @@ -24,7 +24,7 @@ def launchctl_assert_status(host, service, expect_running) if expect_running assert_match(/#{service}/, stdout, 'Service was not found in launchctl list') else - assert_no_match(/#{service}/, stdout, 'Service was not expected in launchctl list') + refute_match(/#{service}/, stdout, 'Service was not expected in launchctl list') end end end diff --git a/acceptance/tests/resource/service/windows.rb b/acceptance/tests/resource/service/windows.rb index e7dba8571b9..ace8501d73a 100644 --- a/acceptance/tests/resource/service/windows.rb +++ b/acceptance/tests/resource/service/windows.rb @@ -120,9 +120,9 @@ def service_manifest(name, params) assert_service_properties_on(agent, mock_service_nofail[:name], StartName: fresh_user) on(agent, puppet("resource service #{mock_service_nofail[:name]} logonaccount=S-1-5-19")) do |result| assert_match(/Service\[#{mock_service_nofail[:name]}\]\/logonaccount: logonaccount changed '.\\#{fresh_user}' to '#{Regexp.escape(local_service_locale_name)}'/, result.stdout) - assert_no_match(/Transitioning the #{mock_service_nofail[:name]} service from SERVICE_RUNNING to SERVICE_STOPPED/, result.stdout, + refute_match(/Transitioning the #{mock_service_nofail[:name]} service from SERVICE_RUNNING to SERVICE_STOPPED/, result.stdout, "Expected no service restarts since ensure isn't being managed as 'running'.") - assert_no_match(/Successfully started the #{mock_service_nofail[:name]} service/, result.stdout) + refute_match(/Successfully started the #{mock_service_nofail[:name]} service/, result.stdout) end assert_service_properties_on(agent, mock_service_nofail[:name], StartName: local_service_locale_name) end @@ -152,10 +152,10 @@ def service_manifest(name, params) step 'Verify that there are no restarts if logonaccount does not change, even though ensure is managed as running' do assert_service_properties_on(agent, mock_service_nofail[:name], StartName: 'LocalSystem') on(agent, puppet("resource service #{mock_service_nofail[:name]} logonaccount=LocalSystem ensure=running --debug")) do |result| - assert_no_match(/Service\[#{mock_service_nofail[:name]}\]\/logonaccount: logonaccount changed/, result.stdout) - assert_no_match(/Service\[#{mock_service_nofail[:name]}\]\/ensure: ensure changed/, result.stdout) - assert_no_match(/Transitioning the #{mock_service_nofail[:name]} service from SERVICE_RUNNING to SERVICE_STOPPED/, result.stdout) - assert_no_match(/Successfully started the #{mock_service_nofail[:name]} service/, result.stdout) + refute_match(/Service\[#{mock_service_nofail[:name]}\]\/logonaccount: logonaccount changed/, result.stdout) + refute_match(/Service\[#{mock_service_nofail[:name]}\]\/ensure: ensure changed/, result.stdout) + refute_match(/Transitioning the #{mock_service_nofail[:name]} service from SERVICE_RUNNING to SERVICE_STOPPED/, result.stdout) + refute_match(/Successfully started the #{mock_service_nofail[:name]} service/, result.stdout) end assert_service_properties_on(agent, mock_service_nofail[:name], StartName: 'LocalSystem') end diff --git a/acceptance/tests/resource/tidy/resources_should_be_non_isomorphic.rb b/acceptance/tests/resource/tidy/resources_should_be_non_isomorphic.rb index 8ab997db888..2ded142cbd7 100644 --- a/acceptance/tests/resource/tidy/resources_should_be_non_isomorphic.rb +++ b/acceptance/tests/resource/tidy/resources_should_be_non_isomorphic.rb @@ -31,7 +31,7 @@ step "Create multiple tidy resources with same path" do apply_manifest_on(agent, manifest) do |result| - assert_no_match(/Error:/, result.stderr, "Unexpected error was detected") + refute_match(/Error:/, result.stderr, "Unexpected error was detected") end end diff --git a/acceptance/tests/resource/user/should_create_with_expiry_absent.rb b/acceptance/tests/resource/user/should_create_with_expiry_absent.rb index 99f02c45705..81db8610cd2 100644 --- a/acceptance/tests/resource/user/should_create_with_expiry_absent.rb +++ b/acceptance/tests/resource/user/should_create_with_expiry_absent.rb @@ -26,7 +26,7 @@ step "verify the user exists and expiry is not set (meaning never expire)" on(host, puppet_resource('user', user)) do |result| assert_match(/ensure.*=> 'present'/, result.stdout) - assert_no_match(/expiry.*=>/, result.stdout) + refute_match(/expiry.*=>/, result.stdout) end end end diff --git a/acceptance/tests/resource/user/should_manage_purge_ssh_keys.rb b/acceptance/tests/resource/user/should_manage_purge_ssh_keys.rb index 6b08330034d..e5b38391296 100644 --- a/acceptance/tests/resource/user/should_manage_purge_ssh_keys.rb +++ b/acceptance/tests/resource/user/should_manage_purge_ssh_keys.rb @@ -61,7 +61,7 @@ end on(agent, "cat #{authorized_keys_path}") do |result| - assert_no_match(/ssh-rsa my-key #{name}@example.com/, result.stdout) + refute_match(/ssh-rsa my-key #{name}@example.com/, result.stdout) end end @@ -91,7 +91,7 @@ end on(agent, "cat #{authorized_keys_path}") do |result| - assert_no_match(/ssh-rsa my-key #{name}@example.com/, result.stdout) + refute_match(/ssh-rsa my-key #{name}@example.com/, result.stdout) end end @@ -120,7 +120,7 @@ end on(agent, "cat #{authorized_keys_path}") do |result| - assert_no_match(/ssh-rsa my-key #{name}@example.com/, result.stdout) + refute_match(/ssh-rsa my-key #{name}@example.com/, result.stdout) end end end diff --git a/acceptance/tests/resource/user/should_manage_roles_on_windows.rb b/acceptance/tests/resource/user/should_manage_roles_on_windows.rb index c55bf6841a8..e0c5b8a222a 100644 --- a/acceptance/tests/resource/user/should_manage_roles_on_windows.rb +++ b/acceptance/tests/resource/user/should_manage_roles_on_windows.rb @@ -39,7 +39,7 @@ def user_manifest(name, params) step "Verify that a new user has no roles" do on(agent, puppet("resource user #{newUser}")) do |result| - assert_no_match(/roles\s+=>/, result.stdout) + refute_match(/roles\s+=>/, result.stdout) end end @@ -81,13 +81,13 @@ def user_manifest(name, params) step "Verify that :roles noops when #{newUser} already has given role while managing :role_membership as minimum" do apply_manifest_on(agent, user_manifest(newUser, roles: ['SeBackupPrivilege'], role_membership: :minimum), catch_changes: true) do |result| - assert_no_match(/User\[#{newUser}\]\/roles: roles changed/, result.stdout) + refute_match(/User\[#{newUser}\]\/roles: roles changed/, result.stdout) end end step "Verify that while not managing :role_membership, the behaviour remains the same, with noop from :roles when #{newUser} already has the given role" do apply_manifest_on(agent, user_manifest(newUser, roles: ['SeBackupPrivilege']), catch_changes: true) do |result| - assert_no_match(/User\[#{newUser}\]\/roles: roles changed/, result.stdout) + refute_match(/User\[#{newUser}\]\/roles: roles changed/, result.stdout) end end diff --git a/acceptance/tests/security/cve-2013-1640_facter_string.rb b/acceptance/tests/security/cve-2013-1640_facter_string.rb index 8d895422411..e6c7966b453 100644 --- a/acceptance/tests/security/cve-2013-1640_facter_string.rb +++ b/acceptance/tests/security/cve-2013-1640_facter_string.rb @@ -13,6 +13,6 @@ %q[ 'notice(inline_template("<%= \"I am Safe\" %>"))' ] do |test| assert_match(/I am Safe/, test.stdout) - assert_no_match(/hax0rd/, test.stdout) + refute_match(/hax0rd/, test.stdout) end end diff --git a/acceptance/tests/ticket_2280_refresh_fail_should_fail_run.rb b/acceptance/tests/ticket_2280_refresh_fail_should_fail_run.rb index acce41bcf44..4bc223594a3 100644 --- a/acceptance/tests/ticket_2280_refresh_fail_should_fail_run.rb +++ b/acceptance/tests/ticket_2280_refresh_fail_should_fail_run.rb @@ -27,7 +27,7 @@ agents.each do |agent| step 'Apply manifest with fail on refresh. Ensure that this results in a failed dependency' do apply_manifest_on(agent, manifest, :expect_failures => true) do |res| - assert_no_match(/require_echo.*returns: executed successfully/, res.stdout) + refute_match(/require_echo.*returns: executed successfully/, res.stdout) assert_match(/require_echo.*Skipping because of failed dependencies/, res.stderr) unless agent['locale'] == 'ja' end end diff --git a/acceptance/tests/ticket_6541_invalid_filebucket_files.rb b/acceptance/tests/ticket_6541_invalid_filebucket_files.rb index d42dde0a89b..7c432b29db2 100644 --- a/acceptance/tests/ticket_6541_invalid_filebucket_files.rb +++ b/acceptance/tests/ticket_6541_invalid_filebucket_files.rb @@ -23,13 +23,13 @@ manifest = "file { '#{target}': content => '{sha256}notahash' }" apply_manifest_on(agent, manifest) do - assert_no_match(/content changed/, stdout, "#{agent}: shouldn't have overwrote the file") + refute_match(/content changed/, stdout, "#{agent}: shouldn't have overwrote the file") end test_name "verify valid but unbucketed hashes should not change the file" manifest = "file { '#{target}': content => '{md5}13ad7345d56b566a4408ffdcd877bc78' }" apply_manifest_on(agent, manifest) do - assert_no_match(/content changed/, stdout, "#{agent}: shouldn't have overwrote the file") + refute_match(/content changed/, stdout, "#{agent}: shouldn't have overwrote the file") end test_name "verify that an empty file can be retrieved from the filebucket"