Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(maint) Ignore os.release.major related fact diffs on Window 11 #2263

Merged
merged 2 commits into from
Jun 28, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 18 additions & 12 deletions acceptance/tests/ensure_facter_3_and_facter_4_output_matches.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,42 @@
exclude_list = %w{mountpoints\..*
partitions\..*\.filesystem
partitions\..*\.size_bytes
partitions\..*\.mount
partitions\..*\.mount
partitions\..*\.uuid
ldom_.*
boardassettag
dmi\.board\.asset_tag
is_virtual
kernelmajversion
lsbmajdistrelease
zones
virtual
ldom_.*
boardassettag
dmi\.board\.asset_tag
is_virtual
kernelmajversion
lsbmajdistrelease
zones
virtual
blockdevice_.*_vendor blockdevice_.*_size
hypervisors.vmware.version
os\.distro\.description }

agents.each do |agent|
exclude_list += ['macosx_productversion.*', 'os.macosx.version'] if agent.platform =~ /^osx-1[1-9]/
# FACT-3039 was only fixed in facter 4
exclude_list += %w[
operatingsystemrelease
operatingsystemmajrelease
os.release.full
os.release.major
] if agent.platform =~ /windows-11/

step 'run puppet facts diff ' do
on agent, puppet('facts diff') do
@diff = stdout

end
end

step 'compare Facter 3 to Facter 4 outputs' do
join_str = agent.platform =~ /windows/ ? '^^^|' : '|'
join_str = agent.platform =~ /windows/ ? '^^^|' : '|'
ignored_facts = exclude_list.join(join_str)
on(agent, puppet("facts diff --exclude '#{ignored_facts}'")) do
diff = JSON.parse(stdout)

rep_diff = diff.delete_if {|key, value| value['old_value'] == nil}
fail_test("Facter 3 and Facter 4 outputs have the following differences: #{diff}") if rep_diff.keys.size.positive?
end
Expand Down