diff --git a/acceptance/lib/puppet/acceptance/temp_file_utils.rb b/acceptance/lib/puppet/acceptance/temp_file_utils.rb index 6678552b36..4aeaaa4564 100644 --- a/acceptance/lib/puppet/acceptance/temp_file_utils.rb +++ b/acceptance/lib/puppet/acceptance/temp_file_utils.rb @@ -8,7 +8,7 @@ module TempFileUtils def root_user(host) case host['platform'] when /windows/ - 'Administrator' + host['user'] else 'root' end @@ -160,7 +160,7 @@ def initialize_temp_dirs() # we need one list of all of the hosts, to assist in managing temp dirs. It's possible # that the master is also an agent, so this will consolidate them into a unique set - @all_hosts = Set[master, *agents] + @all_hosts = Set.new([master, *agents].compact) # now we can create a hash of temp dirs--one per host, and unique to this test--without worrying about # doing it twice on any individual host diff --git a/acceptance/lib/puppet/acceptance/windows_utils.rb b/acceptance/lib/puppet/acceptance/windows_utils.rb index bb37105d57..a4417a35ac 100644 --- a/acceptance/lib/puppet/acceptance/windows_utils.rb +++ b/acceptance/lib/puppet/acceptance/windows_utils.rb @@ -33,7 +33,7 @@ def deny_administrator_access_to(host, filepath) mkdir -Force $env:TMP\\fake-dir-for-acl $acl = Get-ACL $env:TMP\\fake-dir-for-acl rm -Force $env:TMP\\fake-dir-for-acl - $ar = New-Object system.security.accesscontrol.filesystemaccessrule("Administrator","FullControl","Deny") + $ar = New-Object system.security.accesscontrol.filesystemaccessrule("#{host['user']}","FullControl","Deny") $acl.SetAccessRule($ar) Set-ACL #{filepath} $acl PS1 diff --git a/acceptance/tests/agent/agent_disable_lockfile.rb b/acceptance/tests/agent/agent_disable_lockfile.rb index f6c4ec4f45..9bdd572321 100644 --- a/acceptance/tests/agent/agent_disable_lockfile.rb +++ b/acceptance/tests/agent/agent_disable_lockfile.rb @@ -3,7 +3,6 @@ # The validation of the `vardir` at the OS level # should be accomplished in another test. 'audit:high', - 'audit:refactor', # This test should not require a master. Remove the use of `with_puppet_running_on`. 'shard:group1' # For splitting out groups of tests for slow test runners # @@ -39,7 +38,11 @@ ["I'm busy; go away.'", true] ] -with_puppet_running_on(master, {}) do +def with_server_if_present(&block) + master ? with_puppet_running_on(master, {}, &block) : block.call +end + +with_server_if_present do tuples.each do |expected_message, explicitly_specify_message| step "disable the agent; specify message? '#{explicitly_specify_message}', message: '#{expected_message}'" do agents.each do |agent| @@ -87,12 +90,15 @@ end end + # A full agent run needs a server, so it only runs where there is one. + next unless master + step "verify that we can run the agent (message: '#{expected_message}')" do agents.each do |agent| on(agent, puppet('agent', "--test")) end end end # tuples block -end # with_puppet_running_on block +end # with_server_if_present block @all_tests_passed = true diff --git a/acceptance/tests/agent/agent_fails_with_unknown_resource.rb b/acceptance/tests/agent/agent_fails_with_unknown_resource.rb index 86ddfba452..10f18dbd16 100644 --- a/acceptance/tests/agent/agent_fails_with_unknown_resource.rb +++ b/acceptance/tests/agent/agent_fails_with_unknown_resource.rb @@ -1,6 +1,7 @@ test_name "agent run should fail if it finds an unknown resource type" do tag 'audit:high', 'audit:integration', + 'server', 'shard:group2' # For splitting out groups of tests for slow test runners require 'puppet/acceptance/common_utils' diff --git a/acceptance/tests/agent/fallback_to_cached_catalog.rb b/acceptance/tests/agent/fallback_to_cached_catalog.rb index 87959ebb27..cb89c5cbb9 100644 --- a/acceptance/tests/agent/fallback_to_cached_catalog.rb +++ b/acceptance/tests/agent/fallback_to_cached_catalog.rb @@ -3,6 +3,7 @@ tag 'audit:high', 'audit:integration', # This test is not OS sensitive. 'audit:refactor', # A catalog fixture can be used for this test. Remove the usage of `with_puppet_running_on`. + 'server', 'shard:group4' # For splitting out groups of tests for slow test runners step "run agents once to cache the catalog" do diff --git a/acceptance/tests/agent/last_run_summary_report.rb b/acceptance/tests/agent/last_run_summary_report.rb index 631dfbb0b3..7bc149f150 100644 --- a/acceptance/tests/agent/last_run_summary_report.rb +++ b/acceptance/tests/agent/last_run_summary_report.rb @@ -1,5 +1,6 @@ test_name "The 'last_run_summary.yaml' report has the right location and permissions" do tag 'audit:high', + 'server', 'shard:group1' # For splitting out groups of tests for slow test runners require 'puppet/acceptance/temp_file_utils' diff --git a/acceptance/tests/direct_puppet/catalog_uuid_correlates_catalogs_with_reports.rb b/acceptance/tests/direct_puppet/catalog_uuid_correlates_catalogs_with_reports.rb index 98fd48583a..074d2003f7 100644 --- a/acceptance/tests/direct_puppet/catalog_uuid_correlates_catalogs_with_reports.rb +++ b/acceptance/tests/direct_puppet/catalog_uuid_correlates_catalogs_with_reports.rb @@ -4,6 +4,7 @@ 'audit:acceptance', 'audit:refactor', # remove dependence on server by adding a # catalog and report fixture to validate against. + 'server', 'shard:group1' # For splitting out groups of tests for slow test runners master_reportdir = create_tmpdir_for_user(master, 'reportdir') @@ -48,7 +49,7 @@ def get_catalog_uuid_from_report(master_reportdir, agent_node_name) end step "Run with --use_cached_catalog and ensure catalog_uuid in the new report matches the cached catalog" do - on(agent, puppet("agent", "--onetime", "--no-daemonize", "--use_cached_catalog", "--vardir #{agent_vardir}"), :acceptance_exit_codes => [0,2]) + on(agent, puppet("agent", "--onetime", "--no-daemonize", "--use_cached_catalog", "--vardir #{agent_vardir}"), :acceptable_exit_codes => [0,2]) report_catalog_uuid = get_catalog_uuid_from_report(master_reportdir, agent.node_name) assert_equal(cache_catalog_uuid, report_catalog_uuid, "catalog_uuid found in cached catalog, #{cache_catalog_uuid} did not match report #{report_catalog_uuid}") end diff --git a/acceptance/tests/direct_puppet/supports_utf8.rb b/acceptance/tests/direct_puppet/supports_utf8.rb index c228a8fab8..3394640cd8 100644 --- a/acceptance/tests/direct_puppet/supports_utf8.rb +++ b/acceptance/tests/direct_puppet/supports_utf8.rb @@ -9,6 +9,7 @@ tag 'audit:high', 'audit:acceptance', 'audit:refactor', # Review for agent side UTF validation. + 'server', 'shard:group3' # For splitting out groups of tests for slow test runners app_type = File.basename(__FILE__, '.*') @@ -60,22 +61,22 @@ config_version = '' config_version_matcher = /configuration version '(\d+)'/ on(agent, puppet("agent -t --environment '#{tmp_environment}'"), - :acceptable_exit_codes => 2).stdout do |result| - config_version = result.match(config_version_matcher)[1] + :acceptable_exit_codes => 2) do |result| + config_version = result.stdout.match(config_version_matcher)[1] end - on(agent, "cat '#{tmp_file[agent_to_fqdn(agent)]}'").stdout do |result| - assert_equal(file_contents, result, 'file contents did not match accepted') + on(agent, "cat '#{tmp_file[agent_to_fqdn(agent)]}'") do |result| + assert_equal(file_contents, result.stdout.chomp, 'file contents did not match accepted') end on(agent, "rm -f '#{tmp_file[agent_to_fqdn(agent)]}'") on(agent, puppet("agent -t --environment '#{tmp_environment}' --use_cached_catalog"), - :acceptable_exit_codes => 2).stdout do |result| - assert_match(config_version_matcher, result, 'agent did not use cached catalog') - second_config_version = result.match(config_version_matcher)[1] - asset_equal(config_version, second_config_version, 'config version should have been the same') + :acceptable_exit_codes => 2) do |result| + assert_match(config_version_matcher, result.stdout, 'agent did not use cached catalog') + second_config_version = result.stdout.match(config_version_matcher)[1] + assert_equal(config_version, second_config_version, 'config version should have been the same') end - on(agent, "cat '#{tmp_file[agent_to_fqdn(agent)]}'").stdout do |result| - assert_equal(file_contents, result, 'file contents did not match accepted') + on(agent, "cat '#{tmp_file[agent_to_fqdn(agent)]}'") do |result| + assert_equal(file_contents, result.stdout.chomp, 'file contents did not match accepted') end 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 222ea1e080..c7b994dcc0 100644 --- a/acceptance/tests/environment/should_find_existing_production_environment.rb +++ b/acceptance/tests/environment/should_find_existing_production_environment.rb @@ -1,5 +1,6 @@ test_name "should find existing production environment" tag 'audit:medium', + 'server', 'shard:group3' # For splitting out groups of tests for slow test runners require 'puppet/acceptance/i18ndemo_utils' diff --git a/acceptance/tests/face/parser_validate.rb b/acceptance/tests/face/parser_validate.rb index cd1eb6c1d3..efd5eb0802 100644 --- a/acceptance/tests/face/parser_validate.rb +++ b/acceptance/tests/face/parser_validate.rb @@ -24,7 +24,8 @@ skip_test('this test fails on windows French due to Cygwin/UTF Issues - PUP-8319,IMAGES-492') if agent['platform'] =~ /windows/ && agent['locale'] == 'fr' step 'manifest with parser function call' do - if agent.platform !~ /windows/ + # mk_tmp_environment_with_teardown uses the server's environmentpath + if agent.platform !~ /windows/ && master tmp_environment = mk_tmp_environment_with_teardown(agent, app_type) create_sitepp(agent, tmp_environment, <<-SITE) @@ -55,7 +56,7 @@ on(agent, puppet("parser validate #{tmp_manifest}"), :accept_all_exit_codes => true) do |result| assert_equal(result.exit_code, 1, 'parser validate did not exit with 1 upon parse failure') expected = /Error: Could not parse for environment production: This Name has no effect\. A value was produced and then forgotten \(one or more preceding expressions may have the wrong form\) \(file: .*_broken\.pp, line: 1, column: 1\)/ - assert_match(expected, result.output, "parser validate did not output correctly: '#{result.output}'. expected: '#{expected.to_s}'") unless agent['locale'] == 'ja' + assert_match(expected, result.stderr, "parser validate did not output correctly: '#{result.stderr}'. expected: '#{expected.to_s}'") unless agent['locale'] == 'ja' end end diff --git a/acceptance/tests/i18n/enable_option_disable_i18n.rb b/acceptance/tests/i18n/enable_option_disable_i18n.rb index aa99185e0f..fc2a852ad7 100644 --- a/acceptance/tests/i18n/enable_option_disable_i18n.rb +++ b/acceptance/tests/i18n/enable_option_disable_i18n.rb @@ -3,6 +3,7 @@ tag 'audit:medium', 'audit:acceptance', + 'server', 'shard:group3' # For splitting out groups of tests for slow test runners require 'puppet/acceptance/environment_utils.rb' diff --git a/acceptance/tests/i18n/modules/puppet_agent.rb b/acceptance/tests/i18n/modules/puppet_agent.rb index 555514e1fe..9e4cdbc873 100644 --- a/acceptance/tests/i18n/modules/puppet_agent.rb +++ b/acceptance/tests/i18n/modules/puppet_agent.rb @@ -3,6 +3,7 @@ tag 'audit:medium', 'audit:acceptance', + 'server', 'shard:group4' # For splitting out groups of tests for slow test runners skip_test('i18n test module uses deprecated function; update module to resume testing.') diff --git a/acceptance/tests/i18n/modules/puppet_agent_cached_catalog.rb b/acceptance/tests/i18n/modules/puppet_agent_cached_catalog.rb index bf9d10f39f..2a37263252 100644 --- a/acceptance/tests/i18n/modules/puppet_agent_cached_catalog.rb +++ b/acceptance/tests/i18n/modules/puppet_agent_cached_catalog.rb @@ -3,6 +3,7 @@ tag 'audit:medium', 'audit:acceptance', + 'server', 'shard:group1' # For splitting out groups of tests for slow test runners skip_test('i18n test module uses deprecated function; update module to resume testing.') diff --git a/acceptance/tests/i18n/modules/puppet_agent_with_multiple_environments.rb b/acceptance/tests/i18n/modules/puppet_agent_with_multiple_environments.rb index a073bed11f..faa6d4d40a 100644 --- a/acceptance/tests/i18n/modules/puppet_agent_with_multiple_environments.rb +++ b/acceptance/tests/i18n/modules/puppet_agent_with_multiple_environments.rb @@ -3,6 +3,7 @@ tag 'audit:medium', 'audit:acceptance', + 'server', 'shard:group2' # For splitting out groups of tests for slow test runners require 'puppet/acceptance/environment_utils.rb' diff --git a/acceptance/tests/i18n/translation_fallback.rb b/acceptance/tests/i18n/translation_fallback.rb index 671363bc31..f5fd2a1cb0 100644 --- a/acceptance/tests/i18n/translation_fallback.rb +++ b/acceptance/tests/i18n/translation_fallback.rb @@ -3,6 +3,7 @@ tag 'audit:medium', 'audit:acceptance', + 'server', 'shard:group1' # For splitting out groups of tests for slow test runners agents.each do |agent| diff --git a/acceptance/tests/loader/autoload_from_resource_type_decl.rb b/acceptance/tests/loader/autoload_from_resource_type_decl.rb index fe10e17f2f..2633580dc8 100644 --- a/acceptance/tests/loader/autoload_from_resource_type_decl.rb +++ b/acceptance/tests/loader/autoload_from_resource_type_decl.rb @@ -1,5 +1,6 @@ test_name 'C100303: Resource type statement triggered auto-loading works both with and without generated types' do tag 'risk:high', + 'server', 'shard:group3' # For splitting out groups of tests for slow test runners require 'puppet/acceptance/environment_utils.rb' diff --git a/acceptance/tests/loader/resource_triggers_autoload.rb b/acceptance/tests/loader/resource_triggers_autoload.rb index 85e57d5100..3e0088407b 100644 --- a/acceptance/tests/loader/resource_triggers_autoload.rb +++ b/acceptance/tests/loader/resource_triggers_autoload.rb @@ -1,5 +1,6 @@ test_name 'C100296: can auto-load defined types using a Resource statement' do tag 'risk:high', + 'server', 'shard:group1' # For splitting out groups of tests for slow test runners require 'puppet/acceptance/environment_utils.rb' diff --git a/acceptance/tests/lookup/hiera3_custom_backend.rb b/acceptance/tests/lookup/hiera3_custom_backend.rb index 879edf48af..66c45bb940 100644 --- a/acceptance/tests/lookup/hiera3_custom_backend.rb +++ b/acceptance/tests/lookup/hiera3_custom_backend.rb @@ -8,6 +8,7 @@ 'audit:acceptance', 'audit:refactor', # Master is not needed for this test. Refactor # to use puppet apply with a local module tree. + 'server', 'shard:group4' # For splitting out groups of tests for slow test runners skip_test 'puppetserver gem install needs jruby-openssl for https sources, which does not load in FIPS mode' if master.fips_mode? diff --git a/acceptance/tests/lookup/hiera_eyaml_backend.rb b/acceptance/tests/lookup/hiera_eyaml_backend.rb index f01c37e975..a106815cf4 100644 --- a/acceptance/tests/lookup/hiera_eyaml_backend.rb +++ b/acceptance/tests/lookup/hiera_eyaml_backend.rb @@ -6,6 +6,7 @@ tag 'audit:high', 'audit:acceptance', + 'server', 'shard:group1' # For splitting out groups of tests for slow test runners skip_test 'hiera-eyaml needs jruby-openssl, which does not load in puppetserver in FIPS mode' if master.fips_mode? diff --git a/acceptance/tests/lookup/merge_strategies.rb b/acceptance/tests/lookup/merge_strategies.rb index 1479cf5cfc..8b75ad934c 100644 --- a/acceptance/tests/lookup/merge_strategies.rb +++ b/acceptance/tests/lookup/merge_strategies.rb @@ -6,6 +6,7 @@ 'audit:acceptance', 'audit:refactor', # Master is not needed for this test. Refactor # to use puppet apply with a local module tree. + 'server', 'shard:group4' # For splitting out groups of tests for slow test runners app_type = File.basename(__FILE__, '.*') diff --git a/acceptance/tests/lookup/v3_config_and_data.rb b/acceptance/tests/lookup/v3_config_and_data.rb index 248d50b84e..38672bcce1 100644 --- a/acceptance/tests/lookup/v3_config_and_data.rb +++ b/acceptance/tests/lookup/v3_config_and_data.rb @@ -6,6 +6,7 @@ 'audit:acceptance', 'audit:refactor', # Master is not needed for this test. Refactor # to use puppet apply with a local module tree. + 'server', 'shard:group1' # For splitting out groups of tests for slow test runners app_type = File.basename(__FILE__, '.*') @@ -71,7 +72,7 @@ SITE on(master, "chmod -R 775 #{fq_tmp_environmentpath}") - on(master, "chmod -R 775 #{confdir}") + on(master, "chmod 755 #{confdir}/hiera.yaml") end end diff --git a/acceptance/tests/lookup/v4_hieradata_with_v5_configs.rb b/acceptance/tests/lookup/v4_hieradata_with_v5_configs.rb index 2bc9ac61fd..942f3cbed3 100644 --- a/acceptance/tests/lookup/v4_hieradata_with_v5_configs.rb +++ b/acceptance/tests/lookup/v4_hieradata_with_v5_configs.rb @@ -6,6 +6,7 @@ 'audit:acceptance', 'audit:refactor', # Master is not needed for this test. Refactor # to use puppet apply with a local module tree. + 'server', 'shard:group2' # For splitting out groups of tests for slow test runners app_type = File.basename(__FILE__, '.*') @@ -44,16 +45,6 @@ path: "common.yaml" HIERA on(master, "chmod 755 #{confdir}/hiera.yaml") - create_remote_file(master, "#{confdir}/#{tmp_environment}.yaml", <<-YAML) ---- -environment_key: environment_key-global_env_file -global_key: global_key-global_env_file - YAML - create_remote_file(master, "#{confdir}/common.yaml", <<-YAML) ---- -environment_key: environment_key-global_common_file -global_key: global_key-global_common_file - YAML end step "create environment hiera.yaml and data" do diff --git a/acceptance/tests/modulepath.rb b/acceptance/tests/modulepath.rb index cbc9339f72..c19cd1c421 100644 --- a/acceptance/tests/modulepath.rb +++ b/acceptance/tests/modulepath.rb @@ -1,5 +1,6 @@ test_name 'Supports vendored modules' do tag 'risk:high', + 'server', 'shard:group3' # For splitting out groups of tests for slow test runners # beacon custom type emits a message so we can tell where the diff --git a/acceptance/tests/parser_functions/calling_all_functions.rb b/acceptance/tests/parser_functions/calling_all_functions.rb index 0655883553..af39f349c9 100644 --- a/acceptance/tests/parser_functions/calling_all_functions.rb +++ b/acceptance/tests/parser_functions/calling_all_functions.rb @@ -192,7 +192,7 @@ def manifest_call_each_function_from_array(functions) functions_4x.each do |function| expected = "#{function[:name].capitalize}: #{scope} #{function[:expected]}" unless agent['locale'] == 'ja' - assert_match(expected, result.output, + assert_match(expected, result.stdout + result.stderr, "#{function[:name]} output didn't match expected value") end end @@ -228,7 +228,7 @@ def manifest_call_each_function_from_array(functions) end unless agent['locale'] == 'ja' - assert_match(expected, result.output, "#{function[:name]} output didn't match expected value") + assert_match(expected, result.stdout + result.stderr, "#{function[:name]} output didn't match expected value") end end end diff --git a/acceptance/tests/parser_functions/hiera/lookup_data.rb b/acceptance/tests/parser_functions/hiera/lookup_data.rb index 332f1dbe5d..0171f738c7 100644 --- a/acceptance/tests/parser_functions/hiera/lookup_data.rb +++ b/acceptance/tests/parser_functions/hiera/lookup_data.rb @@ -3,6 +3,7 @@ tag 'audit:high', 'audit:acceptance', 'audit:refactor', # Master is not required for this test. Replace with agents.each + 'server', 'shard:group2' # For splitting out groups of tests for slow test runners testdir = master.tmpdir('hiera') diff --git a/acceptance/tests/parser_functions/hiera_array/lookup_data.rb b/acceptance/tests/parser_functions/hiera_array/lookup_data.rb index 8733be82f0..d9e1fddcc5 100644 --- a/acceptance/tests/parser_functions/hiera_array/lookup_data.rb +++ b/acceptance/tests/parser_functions/hiera_array/lookup_data.rb @@ -3,6 +3,7 @@ tag 'audit:high', 'audit:acceptance', 'audit:refactor', # Master is not required for this test. Replace with agents.each + 'server', 'shard:group3' # For splitting out groups of tests for slow test runners testdir = master.tmpdir('hiera') diff --git a/acceptance/tests/parser_functions/hiera_hash/lookup_data.rb b/acceptance/tests/parser_functions/hiera_hash/lookup_data.rb index c36598cc41..9d3b6f7369 100644 --- a/acceptance/tests/parser_functions/hiera_hash/lookup_data.rb +++ b/acceptance/tests/parser_functions/hiera_hash/lookup_data.rb @@ -3,6 +3,7 @@ tag 'audit:high', 'audit:acceptance', 'audit:refactor', # Master is not required for this test. Replace with agents.each + 'server', 'shard:group4' # For splitting out groups of tests for slow test runners testdir = master.tmpdir('hiera') diff --git a/acceptance/tests/parser_functions/hiera_in_templates.rb b/acceptance/tests/parser_functions/hiera_in_templates.rb index f5e4f21b7f..f914d76530 100644 --- a/acceptance/tests/parser_functions/hiera_in_templates.rb +++ b/acceptance/tests/parser_functions/hiera_in_templates.rb @@ -2,11 +2,10 @@ tag 'audit:high', 'audit:integration', - 'audit:refactor', # Master is not required for this test. Replace with agents.each 'shard:group1' # For splitting out groups of tests for slow test runners @module_name = "hieratest" -@coderoot = master.tmpdir("#{@module_name}") +@coderoot = master.tmpdir("#{@module_name}") if master @msg_default = 'message from default.yaml' @msg_production = 'message from production.yaml' @@ -29,6 +28,7 @@ @ha_m_call = "hiera_array\\('message'\\)" @ha_i_call = "hiera_array\\('includes'\\)" @hh_h_call = "hiera_hash\\('hash_value'\\)" +@hi_i_call = "hiera_include\\('includes'\\)" @mod_default_msg = 'This file created by mod_default.' @mod_osfamily_msg = 'This file created by mod_osfamily.' @@ -43,7 +43,7 @@ } -def create_environment(osfamilies, tmp_dirs) +def create_environment(osfamilies, tmp_dirs, certnames) envroot = "#{@coderoot}/environments" production = "#{envroot}/production" modroot = "#{production}/modules" @@ -69,12 +69,25 @@ def create_environment(osfamilies, tmp_dirs) NEW_YAML osfamily_yamls += new_yaml end + + certname_yamls = "" + certnames.each do |certname| + certname_yamls += < " +--- +message: '#{@msg_fqdn}' +includes: '#{@module_name}::mod_fqdn' +" +} +CERTNAME_YAML + end + file_owner = master ? "owner => #{master.puppet['user']}, group => #{master.puppet['group']}," : '' environ = < file, - owner => #{master.puppet['user']}, - group => #{master.puppet['group']}, + #{file_owner} mode => "0644", } @@ -149,13 +162,7 @@ class {'#{@module_name}': " } -file {"#{hieradir}/#{$fqdn}.yaml": - content => " ---- -message: '#{@msg_fqdn}' -includes: '#{@module_name}::mod_fqdn' -" -} +#{certname_yamls} file {"#{moduledir}/examples/init.pp": content => " @@ -279,6 +286,10 @@ def find_osfamilies family_hash.keys end +def find_certnames + agents.map { |agent| agent.puppet['certname'] } +end + def find_tmp_dirs tmp_dirs = "" host_to_result_dir = {} @@ -298,20 +309,31 @@ def find_tmp_dirs step 'Setup' -with_puppet_running_on master, @master_opts, @coderoot do +def apply_and_verify_hiera_templates res = find_tmp_dirs tmp_dirs = res['tmp_dirs'] host_to_result_dir = res['host_to_result_dir'] - env_manifest = create_environment(find_osfamilies, tmp_dirs) - apply_manifest_on(master, env_manifest, :catch_failures => true) + if master + env_manifest = create_environment(find_osfamilies, tmp_dirs, find_certnames) + apply_manifest_on(master, env_manifest, :catch_failures => true) + end agents.each do |agent| resultdir = host_to_result_dir[on(agent, facter("networking.hostname")).stdout.chomp] step "Applying catalog to agent: #{agent}. result files in #{resultdir}" - on( - agent, - puppet('agent', "-t"), - :acceptable_exit_codes => [2] - ) + if master + on( + agent, + puppet('agent', "-t"), + :acceptable_exit_codes => [2] + ) + else + @coderoot = agent.tmpdir("#{@module_name}") + apply_manifest_on(agent, create_environment(find_osfamilies, tmp_dirs, find_certnames), :catch_failures => true) + on(agent, puppet('apply', "#{@coderoot}/environments/production/manifests/site.pp", + "--environmentpath=#{@coderoot}/environments", "--hiera_config=#{@coderoot}/hiera.yaml", + '--detailed-exitcodes'), + :acceptable_exit_codes => [2]) + end step "####### Verifying hiera calls from erb template #######" r1 = on(agent, "cat #{resultdir}/hieratest_results_erb") @@ -319,9 +341,9 @@ def find_tmp_dirs step "Verifying hiera() call #1." assert_match( - /#{@h_m_call}: #{@msg_production}/, + /#{@h_m_call}: #{@msg_fqdn}/, result, - "#{@h_m_call} failed. Expected: '#{@msg_production}'" + "#{@h_m_call} failed. Expected: '#{@msg_fqdn}'" ) step "Verifying hiera() call #2." @@ -340,23 +362,23 @@ def find_tmp_dirs step "Verifying hiera() call #4." assert_match( - /#{@h_i_call}: #{@module_name}::mod_production/, + /#{@h_i_call}: #{@module_name}::mod_fqdn/, result, - "#{@h_i_call} failed. Expected:'#{@module_name}::mod_production'" + "#{@h_i_call} failed. Expected:'#{@module_name}::mod_fqdn'" ) step "Verifying hiera_array() call. #1" assert_match( -/#{@ha_m_call}: \[\"#{@msg_production}\", \"#{@msg1os}\", \"#{@msg2os}\", \"#{@msg_default}\"\]/, +/#{@ha_m_call}: \[\"#{@msg_fqdn}\", \"#{@msg_production}\", \"#{@msg1os}\", \"#{@msg2os}\", \"#{@msg_default}\"\]/, result, - "#{@ha_m_call} failed. Expected: '[\"#{@msg_production}\", \"#{@msg1os}\", \"#{@msg2os}\", \"#{@msg_default}\"]'" + "#{@ha_m_call} failed. Expected: '[\"#{@msg_fqdn}\", \"#{@msg_production}\", \"#{@msg1os}\", \"#{@msg2os}\", \"#{@msg_default}\"]'" ) step "Verifying hiera_array() call. #2" assert_match( -/#{@ha_i_call}: \[\"#{@module_name}::mod_production\", \"#{@module_name}::mod_osfamily\", \"#{@module_name}::mod_default\"\]/, +/#{@ha_i_call}: \[\"#{@module_name}::mod_fqdn\", \"#{@module_name}::mod_production\", \"#{@module_name}::mod_osfamily\", \"#{@module_name}::mod_default\"\]/, result, - "#{@ha_i_call} failed. Expected: '[\"#{@module_name}::mod_production\", \"#{@module_name}::mod_osfamily\", \"#{@module_name}::mod_default\"]'" + "#{@ha_i_call} failed. Expected: '[\"#{@module_name}::mod_fqdn\", \"#{@module_name}::mod_production\", \"#{@module_name}::mod_osfamily\", \"#{@module_name}::mod_default\"]'" ) step "Verifying hiera_hash() call. #1" @@ -407,15 +429,24 @@ def find_tmp_dirs "#{@hi_i_call} failed. Expected: '#{@mod_production_msg}'" ) + r6 = on(agent, "cat #{resultdir}/mod_fqdn") + result = r6.stdout + step "Verifying hiera_include() call. #4" + assert_match( + "#{@mod_fqdn_msg}", + result, + "#{@hi_i_call} failed. Expected: '#{@mod_fqdn_msg}'" + ) + step "####### Verifying hiera calls from epp template #######" r5 = on(agent, "cat #{resultdir}/hieratest_results_epp") result = r5.stdout step "Verifying hiery() call #1." assert_match( - /#{@h_m_call}: #{@msg_production}/, + /#{@h_m_call}: #{@msg_fqdn}/, result, - "#{@hi_m_call} failed. Expected '#{@msg_production}'" + "#{@h_m_call} failed. Expected '#{@msg_fqdn}'" ) step "Verifying hiera() call #2." @@ -433,23 +464,23 @@ def find_tmp_dirs step "Verifying hiera() call #4." assert_match( - /#{@h_i_call}: #{@module_name}::mod_production/, + /#{@h_i_call}: #{@module_name}::mod_fqdn/, result, - "#{@h_i_call} failed. Expected: '#{@module_name}::mod_production'" + "#{@h_i_call} failed. Expected: '#{@module_name}::mod_fqdn'" ) step "Verifying hiera_array() call. #1" assert_match( -/#{@ha_m_call}: \[#{@msg_production}, #{@msg1os}, #{@msg2os}, #{@msg_default}\]/, +/#{@ha_m_call}: \[#{@msg_fqdn}, #{@msg_production}, #{@msg1os}, #{@msg2os}, #{@msg_default}\]/, result, - "#{@ha_m_call} failed. Expected: '[#{@msg_production}, #{@msg1os}, #{@msg2os}, #{@msg_default}]'" + "#{@ha_m_call} failed. Expected: '[#{@msg_fqdn}, #{@msg_production}, #{@msg1os}, #{@msg2os}, #{@msg_default}]'" ) step "Verifying hiera_array() call. #2" assert_match( -/#{@ha_i_call}: \[#{@module_name}::mod_production, #{@module_name}::mod_osfamily, #{@module_name}::mod_default\]/, +/#{@ha_i_call}: \[#{@module_name}::mod_fqdn, #{@module_name}::mod_production, #{@module_name}::mod_osfamily, #{@module_name}::mod_default\]/, result, - "#{@ha_i_call} failed. Expected: '[#{@module_name}::mod_production, #{@module_name}::mod_osfamily, #{@module_name}::mod_default'" + "#{@ha_i_call} failed. Expected: '[#{@module_name}::mod_fqdn, #{@module_name}::mod_production, #{@module_name}::mod_osfamily, #{@module_name}::mod_default'" ) step "Verifying hiera_hash() call. #1" @@ -474,3 +505,11 @@ def find_tmp_dirs ) end end + +if master + with_puppet_running_on master, @master_opts, @coderoot do + apply_and_verify_hiera_templates + end +else + apply_and_verify_hiera_templates +end diff --git a/acceptance/tests/parser_functions/no_exception_in_reduce_with_bignum.rb b/acceptance/tests/parser_functions/no_exception_in_reduce_with_bignum.rb index 2d0aac59ac..bf0c9d6ec6 100644 --- a/acceptance/tests/parser_functions/no_exception_in_reduce_with_bignum.rb +++ b/acceptance/tests/parser_functions/no_exception_in_reduce_with_bignum.rb @@ -4,6 +4,7 @@ tag 'audit:high', 'audit:unit', + 'server', 'shard:group2' # For splitting out groups of tests for slow test runners # Remove all traces of the last used environment diff --git a/acceptance/tests/parser_functions/puppet_lookup_cmd.rb b/acceptance/tests/parser_functions/puppet_lookup_cmd.rb index 5ab7dcba57..9f18c785bf 100644 --- a/acceptance/tests/parser_functions/puppet_lookup_cmd.rb +++ b/acceptance/tests/parser_functions/puppet_lookup_cmd.rb @@ -4,6 +4,7 @@ 'audit:acceptance', 'audit:refactor', # Master is not required for this test. Replace with agents.each # Wrap steps in blocks in accordance with Beaker style guide + 'server', 'shard:group3' # For splitting out groups of tests for slow test runners # doc: @@ -2578,6 +2579,12 @@ def data() result, "lookup in ENC specified environment failed" ) + # lookup falls back to the same result without trusted facts, so check it got them + refute_match( + /CA is not available/, + r.stderr, + "lookup could not get the node certificate from the CA" + ) step "without --compile does not use environment specified in ENC" r = on(master, puppet('lookup', "--node #{@node1}", "--confdir #{@confdir}", "--facts #{@coderoot}/facts.yaml", 'environment_key')) diff --git a/acceptance/tests/pluginsync/4420_pluginfacts_should_be_resolvable_on_agent.rb b/acceptance/tests/pluginsync/4420_pluginfacts_should_be_resolvable_on_agent.rb index 2329e79765..6145c8adfd 100644 --- a/acceptance/tests/pluginsync/4420_pluginfacts_should_be_resolvable_on_agent.rb +++ b/acceptance/tests/pluginsync/4420_pluginfacts_should_be_resolvable_on_agent.rb @@ -1,6 +1,7 @@ test_name "Pluginsync'ed external facts should be resolvable on the agent" do tag 'audit:high', 'audit:integration', + 'server', 'shard:group1' # For splitting out groups of tests for slow test runners # diff --git a/acceptance/tests/pluginsync/4847_pluginfacts_should_be_resolvable_from_applications.rb b/acceptance/tests/pluginsync/4847_pluginfacts_should_be_resolvable_from_applications.rb index 87dab0959a..cd371888e8 100644 --- a/acceptance/tests/pluginsync/4847_pluginfacts_should_be_resolvable_from_applications.rb +++ b/acceptance/tests/pluginsync/4847_pluginfacts_should_be_resolvable_from_applications.rb @@ -2,6 +2,7 @@ tag 'audit:high', 'audit:integration', + 'server', 'shard:group2' # For splitting out groups of tests for slow test runners # 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 c82d38097e..37e984762c 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 @@ -2,6 +2,7 @@ tag 'audit:high', 'audit:integration', + 'server', 'shard:group3' # For splitting out groups of tests for slow test runners # diff --git a/acceptance/tests/pluginsync/feature/pluginsync_should_sync_features.rb b/acceptance/tests/pluginsync/feature/pluginsync_should_sync_features.rb index d369f0bb9c..6b7491d688 100644 --- a/acceptance/tests/pluginsync/feature/pluginsync_should_sync_features.rb +++ b/acceptance/tests/pluginsync/feature/pluginsync_should_sync_features.rb @@ -2,6 +2,7 @@ tag 'audit:high', 'audit:integration', + 'server', 'shard:group1' # For splitting out groups of tests for slow test runners # diff --git a/acceptance/tests/r10k.rb b/acceptance/tests/r10k.rb index 8aa92fe84b..030e55645c 100644 --- a/acceptance/tests/r10k.rb +++ b/acceptance/tests/r10k.rb @@ -3,7 +3,7 @@ # It does not test r10k functionality itself. test_name 'Can install and execute r10k with no gem conflicts' -tag 'shard:group4' +tag 'server', 'shard:group4' # On pre-8.23.0, we already had fast_gettext installed to the # /opt/puppetlabs/puppet/lib/ruby/vendor_gems/gems directory, so diff --git a/acceptance/tests/reports/corrective_change_new_resource.rb b/acceptance/tests/reports/corrective_change_new_resource.rb index 41159e3dfe..5c12206251 100644 --- a/acceptance/tests/reports/corrective_change_new_resource.rb +++ b/acceptance/tests/reports/corrective_change_new_resource.rb @@ -11,11 +11,13 @@ 'audit:integration', 'audit:refactor', # Uses a server currently but is testing agent report 'broken:images', + 'server', 'shard:group3' # For splitting out groups of tests for slow test runners test_file_name = File.basename(__FILE__, '.*') tmp_environment = mk_tmp_environment_with_teardown(master, test_file_name) tmp_file = {} + file_contents = 'this is a test' agents.each do |agent| tmp_file[agent_to_fqdn(agent)] = agent.tmpfile(tmp_environment) @@ -37,7 +39,6 @@ end step 'create file resource - site.pp to verify corrective change flag' do - file_contents = 'this is a test' manifest = <<-MANIFEST file { '#{environmentpath}/#{tmp_environment}/manifests/site.pp': ensure => file, @@ -64,8 +65,8 @@ #Verify the file resource is created step 'Verify the file resource is created' do - on(agent, "cat '#{tmp_file[agent_to_fqdn(agent)]}'").stdout do |file_result| - assert_equal(file_contents, file_result, 'file contents did not match accepted') + on(agent, "cat '#{tmp_file[agent_to_fqdn(agent)]}'") do |file_result| + assert_equal(file_contents, file_result.stdout.chomp, 'file contents did not match accepted') end end end @@ -77,9 +78,9 @@ agents.each do |agent| on(agent, puppet('config print statedir')) do |command_result| report_path = command_result.stdout.chomp + '/last_run_report.yaml' - on(agent, "cat '#{report_path}'").stdout do |report_contents| + on(agent, "cat '#{report_path}'") do |report_result| - yaml_data = YAML::parse(report_contents) + yaml_data = YAML::parse(report_result.stdout) # Remove any Ruby class tags from the yaml yaml_data.root.each do |o| if o.respond_to?(:tag=) and o.tag != nil and o.tag.start_with?("!ruby") diff --git a/acceptance/tests/reports/corrective_change_outside_puppet.rb b/acceptance/tests/reports/corrective_change_outside_puppet.rb index e7220c56fb..8b945856f8 100644 --- a/acceptance/tests/reports/corrective_change_outside_puppet.rb +++ b/acceptance/tests/reports/corrective_change_outside_puppet.rb @@ -11,11 +11,13 @@ 'audit:integration', 'audit:refactor', # Uses a server currently, but is testing agent report 'broken:images', + 'server', 'shard:group4' # For splitting out groups of tests for slow test runners test_file_name = File.basename(__FILE__, '.*') tmp_environment = mk_tmp_environment_with_teardown(master, test_file_name) tmp_file = {} + file_contents = 'this is a test' agents.each do |agent| @@ -37,7 +39,6 @@ end step 'create file resource - site.pp to verify corrective change flag' do - file_contents = 'this is a test' manifest = <<-MANIFEST file { '#{environmentpath}/#{tmp_environment}/manifests/site.pp': ensure => file, @@ -64,8 +65,8 @@ #Verify the file resource is created step 'Verify the file resource is created' do - on(agent, "cat '#{tmp_file[agent_to_fqdn(agent)]}'").stdout do |file_result| - assert_equal(file_contents, file_result, 'file contents did not match accepted') + on(agent, "cat '#{tmp_file[agent_to_fqdn(agent)]}'") do |file_result| + assert_equal(file_contents, file_result.stdout.chomp, 'file contents did not match accepted') end end @@ -81,8 +82,8 @@ #Verify the file resource is created step 'Verify the file resource is created' do - on(agent, "cat '#{tmp_file[agent_to_fqdn(agent)]}'").stdout do |file_result| - assert_equal(file_contents, file_result, 'file contents did not match accepted') + on(agent, "cat '#{tmp_file[agent_to_fqdn(agent)]}'") do |file_result| + assert_equal(file_contents, file_result.stdout.chomp, 'file contents did not match accepted') end end end @@ -94,9 +95,9 @@ agents.each do |agent| on(agent, puppet('config print statedir')) do |command_result| report_path = command_result.stdout.chomp + '/last_run_report.yaml' - on(agent, "cat '#{report_path}'").stdout do |report_contents| + on(agent, "cat '#{report_path}'") do |report_result| - yaml_data = YAML::parse(report_contents) + yaml_data = YAML::parse(report_result.stdout) # Remove any Ruby class tags from the yaml yaml_data.root.each do |o| if o.respond_to?(:tag=) and o.tag != nil and o.tag.start_with?("!ruby") diff --git a/acceptance/tests/reports/corrective_change_via_puppet.rb b/acceptance/tests/reports/corrective_change_via_puppet.rb index 5060777a6a..10a2849ebe 100644 --- a/acceptance/tests/reports/corrective_change_via_puppet.rb +++ b/acceptance/tests/reports/corrective_change_via_puppet.rb @@ -71,8 +71,8 @@ def create_manifest_for_file_resource(file_resource, file_contents, environment_ end step 'Verify the file resource is created' do - on(agent, "cat '#{tmp_file[agent_to_fqdn(agent)]}'").stdout do |file_contents| - assert_equal(original_test_data, file_contents, 'file contents did not match expected contents') + on(agent, "cat '#{tmp_file[agent_to_fqdn(agent)]}'") do |file_result| + assert_equal(original_test_data, file_result.stdout.chomp, 'file contents did not match expected contents') end end end @@ -87,8 +87,8 @@ def create_manifest_for_file_resource(file_resource, file_contents, environment_ end step 'Verify the file resource is created' do - on(agent, "cat '#{tmp_file[agent_to_fqdn(agent)]}'").stdout do |file_contents| - assert_equal(modified_test_data, file_contents, 'file contents did not match expected contents') + on(agent, "cat '#{tmp_file[agent_to_fqdn(agent)]}'") do |file_result| + assert_equal(modified_test_data, file_result.stdout.chomp, 'file contents did not match expected contents') end end end @@ -100,9 +100,9 @@ def create_manifest_for_file_resource(file_resource, file_contents, environment_ agents.each do |agent| on(agent, puppet('config print statedir')) do |command_result| report_path = command_result.stdout.chomp + '/last_run_report.yaml' - on(agent, "cat '#{report_path}'").stdout do |report_contents| + on(agent, "cat '#{report_path}'") do |report_result| - yaml_data = YAML::parse(report_contents) + yaml_data = YAML::parse(report_result.stdout) # Remove any Ruby class tags from the yaml yaml_data.root.each do |o| if o.respond_to?(:tag=) and o.tag != nil and o.tag.start_with?("!ruby") diff --git a/acceptance/tests/reports/submission.rb b/acceptance/tests/reports/submission.rb index e699966f7b..8ad93ffae6 100644 --- a/acceptance/tests/reports/submission.rb +++ b/acceptance/tests/reports/submission.rb @@ -2,6 +2,7 @@ tag 'audit:high', 'audit:integration', + 'server', 'shard:group2' # For splitting out groups of tests for slow test runners if master.is_pe? diff --git a/acceptance/tests/resource/file/should_create_directory.rb b/acceptance/tests/resource/file/should_create_directory.rb index 65a6da73cd..f2c5f7ff17 100644 --- a/acceptance/tests/resource/file/should_create_directory.rb +++ b/acceptance/tests/resource/file/should_create_directory.rb @@ -36,7 +36,7 @@ options = {:acceptable_exit_codes => [1]} on(agent, puppet_apply("--noop #{dir_manifest}"), options) do |result| unless agent['locale'] == 'ja' - assert_match('Cannot alias File', result.output, + assert_match('Cannot alias File', result.stderr, 'duplicate directory resources did not fail properly') end end diff --git a/acceptance/tests/resource/group/should_manage_members.rb b/acceptance/tests/resource/group/should_manage_members.rb index d68bd7aa00..505e0b6797 100644 --- a/acceptance/tests/resource/group/should_manage_members.rb +++ b/acceptance/tests/resource/group/should_manage_members.rb @@ -163,7 +163,7 @@ def members_of(host, group) stdout = result.stdout.chomp group_members.each do |user| - assert_match(/#{domain}\\#{user}/, stdout, "Puppet fails to print the group member #{user} as #{domain}\\#{user}") + assert_match(/#{domain}\\#{user}/i, stdout, "Puppet fails to print the group member #{user} as #{domain}\\#{user}") end end end @@ -173,7 +173,7 @@ def members_of(host, group) stdout = result.stdout.chomp group_members.each do |user| - assert_match(/#{domain}\\#{user}/, stdout, "`puppet resource` fails to print the group member #{user} as #{domain}\\#{user}") + assert_match(/#{domain}\\#{user}/i, stdout, "`puppet resource` fails to print the group member #{user} as #{domain}\\#{user}") end end end diff --git a/acceptance/tests/resource/user/should_purge.rb b/acceptance/tests/resource/user/should_purge.rb index e8afade8ab..d8100392b9 100644 --- a/acceptance/tests/resource/user/should_purge.rb +++ b/acceptance/tests/resource/user/should_purge.rb @@ -45,7 +45,8 @@ step "verify system user is not purged" do if agent['platform'] =~ /windows/ - win_admin_user = agent['locale'] == 'fr' ? "Administrateur" : "Administrator" + # The built-in Administrator has RID 500, whatever its name + win_admin_user = execute_powershell_script_on(agent, "(Get-LocalUser | Where-Object { $_.SID -like '*-500' }).Name").stdout.strip assert(agent.user_list.include?(win_admin_user), "System user (Administrator) was purged") else assert(agent.user_list.include?("root"), "System user (root) was purged") diff --git a/acceptance/tests/ticket_2455_on_solaris_init_provider_should_start_service_in_own_smf_contract.rb b/acceptance/tests/ticket_2455_on_solaris_init_provider_should_start_service_in_own_smf_contract.rb index 648cdc74cf..8a6cfc6928 100644 --- a/acceptance/tests/ticket_2455_on_solaris_init_provider_should_start_service_in_own_smf_contract.rb +++ b/acceptance/tests/ticket_2455_on_solaris_init_provider_should_start_service_in_own_smf_contract.rb @@ -5,6 +5,7 @@ # Use mk_tmp_environment_with_teardown # Combine with Service resource tests 'audit:acceptance',# Service provider functionality + 'server', 'shard:group4' # For splitting out groups of tests for slow test runners skip_test unless agents.any? {|agent| agent['platform'] =~ /solaris/ } diff --git a/acceptance/tests/utf8/utf8-in-puppet-describe.rb b/acceptance/tests/utf8/utf8-in-puppet-describe.rb index 83c36f2f18..3dcd5865b1 100644 --- a/acceptance/tests/utf8/utf8-in-puppet-describe.rb +++ b/acceptance/tests/utf8/utf8-in-puppet-describe.rb @@ -5,6 +5,7 @@ 'audit:refactor', # if keeping, use mk_tmp_environment_with_teardown # remove with_puppet_running_on unless pluginsync is absolutely necessary # (if it is, add 'server' tag + 'server', 'shard:group2' # For splitting out groups of tests for slow test runners # utf8chars = "€‰ㄘ万竹ÜÖ" diff --git a/acceptance/tests/windows/PUP-9719_windows_system_first_pa_run.rb b/acceptance/tests/windows/PUP-9719_windows_system_first_pa_run.rb index 64e5c8610c..b609d62a70 100644 --- a/acceptance/tests/windows/PUP-9719_windows_system_first_pa_run.rb +++ b/acceptance/tests/windows/PUP-9719_windows_system_first_pa_run.rb @@ -4,6 +4,7 @@ tag 'risk:high', 'audit:high', 'audit:integration', + 'server', 'shard:group1' # For splitting out groups of tests for slow test runners confine :to, platform: 'windows' diff --git a/acceptance/tests/windows/QA-506_windows_exit_codes_test.rb b/acceptance/tests/windows/QA-506_windows_exit_codes_test.rb index b07eb82dba..dd4ece2f2a 100644 --- a/acceptance/tests/windows/QA-506_windows_exit_codes_test.rb +++ b/acceptance/tests/windows/QA-506_windows_exit_codes_test.rb @@ -71,30 +71,30 @@ step "Verify '0' is a Valid Exit Code" #Apply the manifest and verify Puppet returns success. - on(agent, puppet('apply', '--debug'), :stdin => pass_exitcode_manifest) + on(agent, puppet('apply', '--debug', '--detailed-exitcodes'), :stdin => pass_exitcode_manifest, :acceptable_exit_codes => [2]) step "Verify Unsigned 8bit Upper Boundary" #Apply the manifest and verify Puppet returns success. - on(agent, puppet('apply', '--debug'), :stdin => upper_8bit_boundary_manifest) + on(agent, puppet('apply', '--debug', '--detailed-exitcodes'), :stdin => upper_8bit_boundary_manifest, :acceptable_exit_codes => [2]) step "Verify Unsigned 8bit Cross Boundary" #Apply the manifest and verify Puppet returns success. - on(agent, puppet('apply', '--debug'), :stdin => cross_8bit_boundary_manifest) + on(agent, puppet('apply', '--debug', '--detailed-exitcodes'), :stdin => cross_8bit_boundary_manifest, :acceptable_exit_codes => [2]) step "Verify Unsigned 32bit Upper Boundary" #Apply the manifest and verify Puppet returns success. - on(agent, puppet('apply', '--debug'), :stdin => upper_32bit_boundary_manifest) + on(agent, puppet('apply', '--debug', '--detailed-exitcodes'), :stdin => upper_32bit_boundary_manifest, :acceptable_exit_codes => [2]) step "Verify Unsigned 32bit Cross Boundary" #Apply the manifest and verify Puppet returns success. - on(agent, puppet('apply', '--debug'), :stdin => cross_32bit_boundary_manifest) + on(agent, puppet('apply', '--debug', '--detailed-exitcodes'), :stdin => cross_32bit_boundary_manifest, :acceptable_exit_codes => [2]) step "Verify Negative Exit Code Rollover Boundary" #Apply the manifest and verify Puppet returns success. - on(agent, puppet('apply', '--debug'), :stdin => negative_boundary_manifest) + on(agent, puppet('apply', '--debug', '--detailed-exitcodes'), :stdin => negative_boundary_manifest, :acceptable_exit_codes => [2]) end diff --git a/acceptance/tests/windows/winexitcode/manifests/init.pp b/acceptance/tests/windows/winexitcode/manifests/init.pp index 45601421cc..ce06c076f4 100755 --- a/acceptance/tests/windows/winexitcode/manifests/init.pp +++ b/acceptance/tests/windows/winexitcode/manifests/init.pp @@ -2,14 +2,12 @@ file { "c:\\tmp": ensure => directory, mode => '0660', - owner => 'Administrator', group => 'Administrators', } -> file { "c:\\tmp\\test.bat": ensure => file, mode => '0660', - owner => 'Administrator', group => 'Administrators', content => 'exit /b %1', }