From b6eb2777e82f95bd2af09ddfcee8f23870a7ab1d Mon Sep 17 00:00:00 2001 From: nmburgan <13688219+nmburgan@users.noreply.github.com> Date: Fri, 13 Nov 2026 19:10:56 +0000 Subject: [PATCH 01/12] Let tests that need no server run without one initialize_temp_dirs failed when there was no server for every test that uses the temp file helpers, including tests that only touch agents. parser_validate's default manifest step uses mk_tmp_environment_with_teardown, which reads the server's environmentpath, so it now runs only where there is a server. Signed-off-by: nmburgan <13688219+nmburgan@users.noreply.github.com> Assisted-by: Claude Opus 5.5 --- acceptance/lib/puppet/acceptance/temp_file_utils.rb | 2 +- acceptance/tests/face/parser_validate.rb | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/acceptance/lib/puppet/acceptance/temp_file_utils.rb b/acceptance/lib/puppet/acceptance/temp_file_utils.rb index 6678552b36..53324f3336 100644 --- a/acceptance/lib/puppet/acceptance/temp_file_utils.rb +++ b/acceptance/lib/puppet/acceptance/temp_file_utils.rb @@ -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/tests/face/parser_validate.rb b/acceptance/tests/face/parser_validate.rb index cd1eb6c1d3..50fda41813 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) From 417ee2e964e93f321d27cc0f20a500cc19969570 Mon Sep 17 00:00:00 2001 From: nmburgan <13688219+nmburgan@users.noreply.github.com> Date: Fri, 13 Nov 2026 19:11:02 +0000 Subject: [PATCH 02/12] Tag the acceptance tests that need a server The Windows and MacOS cells run the openvox suite without a server and skip the tests tagged server. These 35 untagged tests use the server host or run puppet agent against a server, so they need the tag as well. Signed-off-by: nmburgan <13688219+nmburgan@users.noreply.github.com> Assisted-by: Claude Opus 5.5 --- acceptance/tests/agent/agent_fails_with_unknown_resource.rb | 1 + acceptance/tests/agent/fallback_to_cached_catalog.rb | 1 + acceptance/tests/agent/last_run_summary_report.rb | 1 + .../catalog_uuid_correlates_catalogs_with_reports.rb | 1 + acceptance/tests/direct_puppet/supports_utf8.rb | 1 + .../environment/should_find_existing_production_environment.rb | 1 + acceptance/tests/i18n/enable_option_disable_i18n.rb | 1 + acceptance/tests/i18n/modules/puppet_agent.rb | 1 + acceptance/tests/i18n/modules/puppet_agent_cached_catalog.rb | 1 + .../i18n/modules/puppet_agent_with_multiple_environments.rb | 1 + acceptance/tests/i18n/translation_fallback.rb | 1 + acceptance/tests/loader/autoload_from_resource_type_decl.rb | 1 + acceptance/tests/loader/resource_triggers_autoload.rb | 1 + acceptance/tests/lookup/hiera3_custom_backend.rb | 1 + acceptance/tests/lookup/hiera_eyaml_backend.rb | 1 + acceptance/tests/lookup/merge_strategies.rb | 1 + acceptance/tests/lookup/v3_config_and_data.rb | 1 + acceptance/tests/lookup/v4_hieradata_with_v5_configs.rb | 1 + acceptance/tests/modulepath.rb | 1 + acceptance/tests/parser_functions/hiera/lookup_data.rb | 1 + acceptance/tests/parser_functions/hiera_array/lookup_data.rb | 1 + acceptance/tests/parser_functions/hiera_hash/lookup_data.rb | 1 + .../parser_functions/no_exception_in_reduce_with_bignum.rb | 1 + acceptance/tests/parser_functions/puppet_lookup_cmd.rb | 1 + .../4420_pluginfacts_should_be_resolvable_on_agent.rb | 1 + .../4847_pluginfacts_should_be_resolvable_from_applications.rb | 1 + .../pluginsync/7316_apps_should_be_available_via_pluginsync.rb | 1 + .../tests/pluginsync/feature/pluginsync_should_sync_features.rb | 1 + acceptance/tests/r10k.rb | 2 +- acceptance/tests/reports/corrective_change_new_resource.rb | 1 + acceptance/tests/reports/corrective_change_outside_puppet.rb | 1 + acceptance/tests/reports/submission.rb | 1 + ...is_init_provider_should_start_service_in_own_smf_contract.rb | 1 + acceptance/tests/utf8/utf8-in-puppet-describe.rb | 1 + .../tests/windows/PUP-9719_windows_system_first_pa_run.rb | 1 + 35 files changed, 35 insertions(+), 1 deletion(-) 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..da6ad8c463 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') diff --git a/acceptance/tests/direct_puppet/supports_utf8.rb b/acceptance/tests/direct_puppet/supports_utf8.rb index c228a8fab8..a2d1f8f16a 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__, '.*') 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/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..12bda3cd78 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__, '.*') diff --git a/acceptance/tests/lookup/v4_hieradata_with_v5_configs.rb b/acceptance/tests/lookup/v4_hieradata_with_v5_configs.rb index 2bc9ac61fd..c09e3ddd95 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__, '.*') 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/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/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..8f8980507b 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: 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..c7d58d5784 100644 --- a/acceptance/tests/reports/corrective_change_new_resource.rb +++ b/acceptance/tests/reports/corrective_change_new_resource.rb @@ -11,6 +11,7 @@ '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__, '.*') diff --git a/acceptance/tests/reports/corrective_change_outside_puppet.rb b/acceptance/tests/reports/corrective_change_outside_puppet.rb index e7220c56fb..bf718cfc59 100644 --- a/acceptance/tests/reports/corrective_change_outside_puppet.rb +++ b/acceptance/tests/reports/corrective_change_outside_puppet.rb @@ -11,6 +11,7 @@ '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__, '.*') 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/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' From e7b85cd771c0729c325df6dfaa403535b32e2f48 Mon Sep 17 00:00:00 2001 From: nmburgan <13688219+nmburgan@users.noreply.github.com> Date: Fri, 13 Nov 2026 19:11:13 +0000 Subject: [PATCH 03/12] Run agent_disable_lockfile without a server Disabling and enabling the agent need no server, since a disabled agent stops before it contacts one. Without a server the test now runs those steps alone and skips the final agent run. With a server nothing changes. Signed-off-by: nmburgan <13688219+nmburgan@users.noreply.github.com> Assisted-by: Claude Opus 5.5 --- acceptance/tests/agent/agent_disable_lockfile.rb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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 From 4e85f8fb413d78abba98c9973b4b811c6bf76175 Mon Sep 17 00:00:00 2001 From: nmburgan <13688219+nmburgan@users.noreply.github.com> Date: Fri, 13 Nov 2026 19:11:13 +0000 Subject: [PATCH 04/12] Run hiera_in_templates without a server Without a server, each agent builds the code tree and applies it with puppet apply, then the same checks run on the results. With a server nothing changes. Signed-off-by: nmburgan <13688219+nmburgan@users.noreply.github.com> Assisted-by: Claude Opus 5.5 --- .../parser_functions/hiera_in_templates.rb | 42 +++++++++++++------ 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/acceptance/tests/parser_functions/hiera_in_templates.rb b/acceptance/tests/parser_functions/hiera_in_templates.rb index f5e4f21b7f..70f7d5cdde 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' @@ -69,12 +68,12 @@ def create_environment(osfamilies, tmp_dirs) NEW_YAML osfamily_yamls += new_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", } @@ -298,20 +297,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) + 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), :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") @@ -474,3 +484,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 From d0adfc38d324139bcd0c3b28725353ca36f82e3a Mon Sep 17 00:00:00 2001 From: nmburgan <13688219+nmburgan@users.noreply.github.com> Date: Fri, 13 Nov 2026 19:38:07 +0000 Subject: [PATCH 05/12] Run the corrective_change and supports_utf8 assertions Their file and report checks were blocks passed to Result#stdout, which ignores blocks, so they never ran. The file checks now allow the newline the heredoc writes, and the expected content moves out of the step block that two of the tests set it in, where the checks could not see it. supports_utf8's asset_equal typo is fixed too. Signed-off-by: nmburgan <13688219+nmburgan@users.noreply.github.com> Assisted-by: Claude Opus 5.5 --- .../tests/direct_puppet/supports_utf8.rb | 20 +++++++++---------- .../reports/corrective_change_new_resource.rb | 10 +++++----- .../corrective_change_outside_puppet.rb | 14 ++++++------- .../reports/corrective_change_via_puppet.rb | 12 +++++------ 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/acceptance/tests/direct_puppet/supports_utf8.rb b/acceptance/tests/direct_puppet/supports_utf8.rb index a2d1f8f16a..3394640cd8 100644 --- a/acceptance/tests/direct_puppet/supports_utf8.rb +++ b/acceptance/tests/direct_puppet/supports_utf8.rb @@ -61,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/reports/corrective_change_new_resource.rb b/acceptance/tests/reports/corrective_change_new_resource.rb index c7d58d5784..5c12206251 100644 --- a/acceptance/tests/reports/corrective_change_new_resource.rb +++ b/acceptance/tests/reports/corrective_change_new_resource.rb @@ -17,6 +17,7 @@ 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) @@ -38,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, @@ -65,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 @@ -78,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 bf718cfc59..8b945856f8 100644 --- a/acceptance/tests/reports/corrective_change_outside_puppet.rb +++ b/acceptance/tests/reports/corrective_change_outside_puppet.rb @@ -17,6 +17,7 @@ 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| @@ -38,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, @@ -65,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 @@ -82,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 @@ -95,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") From 70630b89870d908195d88a34dec96b976bbd1ef9 Mon Sep 17 00:00:00 2001 From: nmburgan <13688219+nmburgan@users.noreply.github.com> Date: Fri, 13 Nov 2026 18:53:25 +0000 Subject: [PATCH 06/12] Give hiera_in_templates its clientcert level The clientcert data file was named after $fqdn, a Ruby global that is never set, so the first hierarchy level was always empty and the assertions expected that. Each agent now gets a data file named after its certname, the assertions expect that level first, and two failure messages no longer print nil names. Signed-off-by: nmburgan <13688219+nmburgan@users.noreply.github.com> Assisted-by: Claude Opus 5.5 --- .../parser_functions/hiera_in_templates.rb | 73 ++++++++++++------- 1 file changed, 47 insertions(+), 26 deletions(-) diff --git a/acceptance/tests/parser_functions/hiera_in_templates.rb b/acceptance/tests/parser_functions/hiera_in_templates.rb index 70f7d5cdde..f914d76530 100644 --- a/acceptance/tests/parser_functions/hiera_in_templates.rb +++ b/acceptance/tests/parser_functions/hiera_in_templates.rb @@ -28,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.' @@ -42,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" @@ -68,6 +69,19 @@ 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 = < " ---- -message: '#{@msg_fqdn}' -includes: '#{@module_name}::mod_fqdn' -" -} +#{certname_yamls} file {"#{moduledir}/examples/init.pp": content => " @@ -278,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 = {} @@ -302,7 +314,7 @@ def apply_and_verify_hiera_templates tmp_dirs = res['tmp_dirs'] host_to_result_dir = res['host_to_result_dir'] if master - env_manifest = create_environment(find_osfamilies, tmp_dirs) + env_manifest = create_environment(find_osfamilies, tmp_dirs, find_certnames) apply_manifest_on(master, env_manifest, :catch_failures => true) end agents.each do |agent| @@ -316,7 +328,7 @@ def apply_and_verify_hiera_templates ) else @coderoot = agent.tmpdir("#{@module_name}") - apply_manifest_on(agent, create_environment(find_osfamilies, tmp_dirs), :catch_failures => true) + 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'), @@ -329,9 +341,9 @@ def apply_and_verify_hiera_templates 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." @@ -350,23 +362,23 @@ def apply_and_verify_hiera_templates 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" @@ -417,15 +429,24 @@ def apply_and_verify_hiera_templates "#{@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." @@ -443,23 +464,23 @@ def apply_and_verify_hiera_templates 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" From aa2c363d46224a2bf2325d60f54e7dad1d38e329 Mon Sep 17 00:00:00 2001 From: nmburgan <13688219+nmburgan@users.noreply.github.com> Date: Fri, 13 Nov 2026 18:53:25 +0000 Subject: [PATCH 07/12] Fix the v3 and v4 lookup test setup v3_config_and_data opened the server's whole confdir, SSL private keys included, with chmod -R 775 and never put it back. It now opens only the hiera.yaml it writes, as v4_hieradata_with_v5_configs does. v4_hieradata_with_v5_configs wrote global data next to its global hiera.yaml, where hiera never reads it and where the teardown left it behind, so those writes are gone. Signed-off-by: nmburgan <13688219+nmburgan@users.noreply.github.com> Assisted-by: Claude Opus 5.5 --- acceptance/tests/lookup/v3_config_and_data.rb | 2 +- .../tests/lookup/v4_hieradata_with_v5_configs.rb | 10 ---------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/acceptance/tests/lookup/v3_config_and_data.rb b/acceptance/tests/lookup/v3_config_and_data.rb index 12bda3cd78..38672bcce1 100644 --- a/acceptance/tests/lookup/v3_config_and_data.rb +++ b/acceptance/tests/lookup/v3_config_and_data.rb @@ -72,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 c09e3ddd95..942f3cbed3 100644 --- a/acceptance/tests/lookup/v4_hieradata_with_v5_configs.rb +++ b/acceptance/tests/lookup/v4_hieradata_with_v5_configs.rb @@ -45,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 From a94ab8811ce6356f4885ff61a53cd34267fa9d7e Mon Sep 17 00:00:00 2001 From: nmburgan <13688219+nmburgan@users.noreply.github.com> Date: Fri, 13 Nov 2026 18:53:26 +0000 Subject: [PATCH 08/12] Fix two acceptance assertion slips catalog_uuid passed :acceptance_exit_codes, which Beaker ignores. puppet_lookup_cmd's trusted facts check passed even when lookup fell back without the CA, since the output is the same, so it now also checks that the fallback warning is absent. Signed-off-by: nmburgan <13688219+nmburgan@users.noreply.github.com> Assisted-by: Claude Opus 5.5 --- .../catalog_uuid_correlates_catalogs_with_reports.rb | 2 +- acceptance/tests/parser_functions/puppet_lookup_cmd.rb | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) 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 da6ad8c463..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 @@ -49,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/parser_functions/puppet_lookup_cmd.rb b/acceptance/tests/parser_functions/puppet_lookup_cmd.rb index 8f8980507b..9f18c785bf 100644 --- a/acceptance/tests/parser_functions/puppet_lookup_cmd.rb +++ b/acceptance/tests/parser_functions/puppet_lookup_cmd.rb @@ -2579,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')) From 33ad2c47973f05791205ca1ed11988fd50cbd507 Mon Sep 17 00:00:00 2001 From: nmburgan <13688219+nmburgan@users.noreply.github.com> Date: Fri, 13 Nov 2026 22:26:27 +0000 Subject: [PATCH 09/12] Stop assuming a Windows account named Administrator GitHub's Windows runners name the built-in administrator (RID 500) runneradmin, and Beaker connects as it. Use the account Beaker connects as where the tests act as that user, which stays Administrator under Beaker's Windows defaults, and find the built-in account by its RID where should_purge checks that the purge kept it. QA-506's winexitcode module no longer sets an owner, whose failure skipped every exec the test runs. Signed-off-by: nmburgan <13688219+nmburgan@users.noreply.github.com> Assisted-by: Claude Opus 5.5 --- acceptance/lib/puppet/acceptance/temp_file_utils.rb | 2 +- acceptance/lib/puppet/acceptance/windows_utils.rb | 2 +- acceptance/tests/resource/user/should_purge.rb | 3 ++- acceptance/tests/windows/winexitcode/manifests/init.pp | 2 -- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/acceptance/lib/puppet/acceptance/temp_file_utils.rb b/acceptance/lib/puppet/acceptance/temp_file_utils.rb index 53324f3336..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 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/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/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', } From 0bc20b55cb4c3bee6c9fbff5ef2370267d532a20 Mon Sep 17 00:00:00 2001 From: nmburgan <13688219+nmburgan@users.noreply.github.com> Date: Fri, 13 Nov 2026 22:29:42 +0000 Subject: [PATCH 10/12] Match the Windows group member domain in any case OpenVox printed the runner's domain in lower case, while the test upper cased the hostname. Windows account names are case-insensitive. Signed-off-by: nmburgan <13688219+nmburgan@users.noreply.github.com> Assisted-by: Claude Opus 5.5 --- acceptance/tests/resource/group/should_manage_members.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 From 6d89a420f721960a63d7b2f28bf8f785d31b66e4 Mon Sep 17 00:00:00 2001 From: nmburgan <13688219+nmburgan@users.noreply.github.com> Date: Fri, 13 Nov 2026 22:38:12 +0000 Subject: [PATCH 11/12] Match on stdout and stderr instead of output Beaker's local connection, which the macOS cells use, never fills a result's output. The errors these tests expect go to stderr, and calling_all_functions logs at several levels, so it matches on both streams. Signed-off-by: nmburgan <13688219+nmburgan@users.noreply.github.com> Assisted-by: Claude Opus 5.5 --- acceptance/tests/face/parser_validate.rb | 2 +- acceptance/tests/parser_functions/calling_all_functions.rb | 4 ++-- acceptance/tests/resource/file/should_create_directory.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/acceptance/tests/face/parser_validate.rb b/acceptance/tests/face/parser_validate.rb index 50fda41813..efd5eb0802 100644 --- a/acceptance/tests/face/parser_validate.rb +++ b/acceptance/tests/face/parser_validate.rb @@ -56,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/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/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 From 50b22b8e7e18b33d7c8b92aac48cceccfb56ce16 Mon Sep 17 00:00:00 2001 From: nmburgan <13688219+nmburgan@users.noreply.github.com> Date: Fri, 13 Nov 2026 23:38:55 +0000 Subject: [PATCH 12/12] Fail the Windows exit code test when an exec fails QA-506 applied its manifests without --detailed-exitcodes, so an exec that returned an unexpected exit code failed its resource while puppet apply still exited 0, and the test passed. Now each apply has to exit 2, which means its exec ran and returned the expected code. Signed-off-by: nmburgan <13688219+nmburgan@users.noreply.github.com> Assisted-by: Claude Opus 5.5 --- .../tests/windows/QA-506_windows_exit_codes_test.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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