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 df8171df93)
(cherry picked from commit 7c996fb434)
(cherry picked from commit 9ce2f50886)
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