| 1 |
require 'spec_helper' |
| 2 |
|
| 3 |
describe 'nova::workarounds' do |
| 4 |
|
| 5 |
let :params do |
| 6 |
{} |
| 7 |
end |
| 8 |
|
| 9 |
shared_examples 'nova::workarounds' do |
| 10 |
|
| 11 |
context 'with default parameters' do |
| 12 |
it { is_expected.not_to contain_nova_config('workarounds/enable_numa_live_migration') } |
| 13 |
it { is_expected.to contain_nova_config('workarounds/never_download_image_if_on_rbd').with_value('<SERVICE DEFAULT>') } |
| 14 |
it { is_expected.to contain_nova_config('workarounds/ensure_libvirt_rbd_instance_dir_cleanup').with_value('<SERVICE DEFAULT>') } |
| 15 |
it { is_expected.to contain_nova_config('workarounds/enable_qemu_monitor_announce_self').with_value('<SERVICE DEFAULT>') } |
| 16 |
it { is_expected.to contain_nova_config('workarounds/qemu_monitor_announce_self_count').with_value('<SERVICE DEFAULT>') } |
| 17 |
it { is_expected.to contain_nova_config('workarounds/qemu_monitor_announce_self_interval').with_value('<SERVICE DEFAULT>') } |
| 18 |
it { is_expected.to contain_nova_config('workarounds/wait_for_vif_plugged_event_during_hard_reboot').with_value('<SERVICE DEFAULT>') } |
| 19 |
it { is_expected.to contain_nova_config('workarounds/disable_compute_service_check_for_ffu').with_value('<SERVICE DEFAULT>') } |
| 20 |
it { is_expected.to contain_nova_config('workarounds/skip_hypervisor_version_check_on_lm').with_value('<SERVICE DEFAULT>') } |
| 21 |
it { is_expected.to contain_nova_config('workarounds/skip_cpu_compare_on_dest').with_value('<SERVICE DEFAULT>') } |
| 22 |
it { is_expected.to contain_nova_config('workarounds/skip_cpu_compare_at_startup').with_value('<SERVICE DEFAULT>') } |
| 23 |
end |
| 24 |
|
| 25 |
context 'with overridden parameters' do |
| 26 |
let :params do |
| 27 |
{ |
| 28 |
:enable_numa_live_migration => true, |
| 29 |
:never_download_image_if_on_rbd => true, |
| 30 |
:ensure_libvirt_rbd_instance_dir_cleanup => true, |
| 31 |
:enable_qemu_monitor_announce_self => true, |
| 32 |
:qemu_monitor_announce_self_count => 3, |
| 33 |
:qemu_monitor_announce_self_interval => 1, |
| 34 |
:wait_for_vif_plugged_event_during_hard_reboot => ['normal', 'direct'], |
| 35 |
:disable_compute_service_check_for_ffu => true, |
| 36 |
:skip_hypervisor_version_check_on_lm => true, |
| 37 |
:skip_cpu_compare_on_dest => true, |
| 38 |
:skip_cpu_compare_at_startup => true, |
| 39 |
} |
| 40 |
end |
| 41 |
|
| 42 |
it { is_expected.to contain_nova_config('workarounds/enable_numa_live_migration').with_value('true') } |
| 43 |
it { is_expected.to contain_nova_config('workarounds/never_download_image_if_on_rbd').with_value('true') } |
| 44 |
it { is_expected.to contain_nova_config('workarounds/ensure_libvirt_rbd_instance_dir_cleanup').with_value('true') } |
| 45 |
it { is_expected.to contain_nova_config('workarounds/enable_qemu_monitor_announce_self').with_value(true) } |
| 46 |
it { is_expected.to contain_nova_config('workarounds/qemu_monitor_announce_self_count').with_value(3) } |
| 47 |
it { is_expected.to contain_nova_config('workarounds/qemu_monitor_announce_self_interval').with_value(1) } |
| 48 |
it { is_expected.to contain_nova_config('workarounds/wait_for_vif_plugged_event_during_hard_reboot').with_value('normal,direct') } |
| 49 |
it { is_expected.to contain_nova_config('workarounds/disable_compute_service_check_for_ffu').with_value(true) } |
| 50 |
it { is_expected.to contain_nova_config('workarounds/skip_hypervisor_version_check_on_lm').with_value(true) } |
| 51 |
it { is_expected.to contain_nova_config('workarounds/skip_cpu_compare_on_dest').with_value(true) } |
| 52 |
it { is_expected.to contain_nova_config('workarounds/skip_cpu_compare_at_startup').with_value(true) } |
| 53 |
end |
| 54 |
|
| 55 |
end |
| 56 |
|
| 57 |
on_supported_os({ |
| 58 |
:supported_os => OSDefaults.get_supported_os |
| 59 |
}).each do |os,facts| |
| 60 |
context "on #{os}" do |
| 61 |
let (:facts) do |
| 62 |
facts.merge!(OSDefaults.get_facts()) |
| 63 |
end |
| 64 |
|
| 65 |
it_behaves_like 'nova::workarounds' |
| 66 |
end |
| 67 |
end |
| 68 |
end |