Skip to content

Commit

Permalink
(maint) Update test to work with new puppet facts show behavior
Browse files Browse the repository at this point in the history
The `puppet facts` command used to default to the `find` action which returned a
Puppet::Node::Facts object, so the test had to dig into its 'values'. In Puppet
7, the default action was changed to `show` which returns just the fact values[1].

Also increase the risk level due to Windows 11

[1] puppetlabs/puppet@cac4677
  • Loading branch information
joshcooper committed Jun 23, 2022
1 parent 83669fb commit 5668065
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions acceptance/tests/env_windows_installdir_fact.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
# present and accurate.
test_name 'PA-466: Ensure env_windows_installdir fact is present and correct' do

tag 'audit:low', # important runtime environment/packaging integration, rarely changed?
'audit:delete', # Move to puppet-agent suite
tag 'audit:high', # PE and modules rely on this fact in order to execute ruby, curl, etc
'audit:acceptance'

confine :to, :platform => 'windows'
Expand All @@ -22,7 +21,7 @@

on agent, puppet('facts', '--render-as json') do |result|
facts = JSON.parse(result.stdout)
actual_value = facts["values"]["env_windows_installdir"]
actual_value = facts["env_windows_installdir"]
assert_equal(install_dir, actual_value, "env_windows_installdir fact did not match expected output")
end
end
Expand Down

0 comments on commit 5668065

Please sign in to comment.