From 5c894b9753edcde371f0a8cc18ea3433cb28fb3c Mon Sep 17 00:00:00 2001 From: Paul Tobias Date: Thu, 25 Jun 2026 21:50:53 +0700 Subject: [PATCH 1/2] test: fix failing kitchen suites by pinning salt to the image version On the *-3006* / *-3007* suites, kitchen fails on every platform while applying the salt states: 'salt' changed from '3006.17-0' to '3008.1-0' [ERROR ] ModuleNotFoundError: spec not found for the module 'site' >>>>>> Converge failed on The images ship salt 3006.17/3007.9, but salt.pkgrepo adds the salt-repo-latest repo (saltproject-rpm/, currently 3008.1) and the unpinned pkg.installed upgrades salt in place; swapping the running onedir under salt-call breaks the post-install module refresh, so the run dies. The per-version pins in test/salt/pillar/ only cover 3002/3003/3004 and set salt:release, which is no longer read by any state. Pin salt:version to the image's running version instead, so the formula keeps the installed salt. Co-authored-by: Claude --- test/salt/pillar/salt.sls | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/salt/pillar/salt.sls b/test/salt/pillar/salt.sls index 9338f52..f0fe517 100644 --- a/test/salt/pillar/salt.sls +++ b/test/salt/pillar/salt.sls @@ -3,6 +3,11 @@ --- salt: py_ver: 'py3' + # Pin to the salt version baked into the kitchen image so salt.minion/salt.master + # don't upgrade it to the repo's "latest" in place mid-converge — swapping the + # running onedir breaks the post-install module refresh, which raises: + # ModuleNotFoundError: spec not found for the module 'site' + version: "{{ salt['grains.get']('saltversion') }}" # Override used for FreeBSD minion service retry_options: attempts: 5 From f418e6d8d8b5301b01f9d49ec63bd6e6ba8a25cc Mon Sep 17 00:00:00 2001 From: Paul Tobias Date: Thu, 25 Jun 2026 23:40:07 +0700 Subject: [PATCH 2/2] test: ignore the pinned salt version in the _mapdata reference check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pinning salt:version (previous commit) writes the running version into salt_settings.version, but the _mapdata reference files are static and one per OS — shared across the -3006/-3007/-master suites — so they can't carry a per-image version. Drop salt_settings.version from both sides of the compare: it now tracks the kitchen image's salt rather than a fixed default, so it's not a value the static reference should assert. Co-authored-by: Claude --- test/integration/default/controls/_mapdata.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/integration/default/controls/_mapdata.rb b/test/integration/default/controls/_mapdata.rb index b2b0541..c6a3a27 100644 --- a/test/integration/default/controls/_mapdata.rb +++ b/test/integration/default/controls/_mapdata.rb @@ -24,6 +24,8 @@ control 'salt._mapdata' do # Load the mapdata from profile, into a YAML structure # https://docs.chef.io/inspec/profiles/#profile-files mapdata_file_yaml = YAML.load(inspec.profile.file(mapdata_file_path)) + # salt_settings.version is pinned to the kitchen image's salt, so drop it + mapdata_file_yaml.dig('values', 'salt_settings')&.delete('version') # Dump the YAML back into a string for comparison mapdata_file_dump = YAML.dump(mapdata_file_yaml) @@ -36,6 +38,8 @@ control 'salt._mapdata' do # Load the output into a YAML structure using InSpec's `yaml` resource # https://github.com/inspec/inspec/blob/49b7d10/lib/inspec/resources/yaml.rb#L29 output_file_yaml = yaml(output_file_path).params + # drop the image-pinned salt_settings.version here too + output_file_yaml.dig('values', 'salt_settings')&.delete('version') # Dump the YAML back into a string for comparison output_file_dump = YAML.dump(output_file_yaml)