Assume structured fact in unit tests

The legacy fact has been deprecated and is no longer available in
Puppet 8. Use the structured one to access fact values in tests so that
we use the consistent method for fact value access.

This change also fixes ignored unit tests of nova::migration::libvirt
with modular libvirt daemons.

Conflicts:
	spec/classes/nova_migration_libvirt_spec.rb

Change-Id: I852facc2ee0ad2a948821f4232a1e8fc20ce4957
(cherry picked from commit df8171df9352f32fa768d8c8cb7197dbe50fb1e9)
(cherry picked from commit 7c996fb434e252d90be87daf4516852730ad8656)
(cherry picked from commit 9ce2f50886fa95aab83a3f0f70478d93444a0996)
This commit is contained in:
Takashi Kajinami 2024-05-30 20:14:04 +09:00
parent a827cfa78e
commit 79ba10f61b
2 changed files with 3 additions and 3 deletions

View File

@ -58,7 +58,7 @@ describe 'nova::compute::libvirt::services' do
facts.merge!(OSDefaults.get_facts())
end
it_configures 'nova compute libvirt services'
if facts['osfamily'] == 'RedHat'
if facts[:os]['family'] == 'RedHat'
it_configures 'nova compute libvirt services with modular libvirt'
end
end

View File

@ -521,8 +521,8 @@ describe 'nova::migration::libvirt' do
it_behaves_like 'nova migration with libvirt'
it_behaves_like "nova migration with libvirt in #{facts[:os]['family']}"
if facts['osfamily'] == 'RedHat'
it_behaves_like 'nova migration with modulr libvirt'
if facts[:os]['family'] == 'RedHat'
it_behaves_like 'nova migration with modular libvirt'
end
end
end