Files
puppet-nova/spec/classes/nova_compute_libvirt_virtstoraged_spec.rb
Rajesh Tailor 448c9d3517 Enable support for Libvirt modular daemons
This change enables support for modular libvirt
daemon configurations.

NOTE: As of now, this change doesn't handle any modular daemons
socket configuration.

Change-Id: I90c3dd7bd63f9f54e43eee7bc2f58d165ca80e57
2021-09-28 23:34:14 +09:00

63 lines
2.1 KiB
Ruby

# Unit tests for nova::compute::libvirt::virtstoraged class
#
require 'spec_helper'
describe 'nova::compute::libvirt::virtstoraged' do
let :pre_condition do
<<-eos
include nova
include nova::compute
include nova::compute::libvirt
eos
end
shared_examples_for 'nova-compute-libvirt-virtstoraged' do
context 'with default parameters' do
let :params do
{}
end
it { is_expected.to contain_class('nova::deps')}
it { is_expected.to contain_class('nova::compute::libvirt::virtstoraged')}
it { is_expected.to contain_virtstoraged_config('log_level').with_value('<SERVICE DEFAULT>')}
it { is_expected.to contain_virtstoraged_config('log_outputs').with_value('<SERVICE DEFAULT>').with_quote(true)}
it { is_expected.to contain_virtstoraged_config('log_filters').with_value('<SERVICE DEFAULT>').with_quote(true)}
it { is_expected.to contain_virtstoraged_config('ovs_timeout').with_value('<SERVICE DEFAULT>')}
end
context 'with specified parameters' do
let :params do
{ :log_level => 3,
:log_outputs => '3:syslog',
:log_filters => '1:logging 4:object 4:json 4:event 1:util',
:ovs_timeout => 10,
}
end
it { is_expected.to contain_class('nova::deps')}
it { is_expected.to contain_class('nova::compute::libvirt::virtstoraged')}
it { is_expected.to contain_virtstoraged_config('log_level').with_value(params[:log_level])}
it { is_expected.to contain_virtstoraged_config('log_outputs').with_value(params[:log_outputs]).with_quote(true)}
it { is_expected.to contain_virtstoraged_config('log_filters').with_value(params[:log_filters]).with_quote(true)}
it { is_expected.to contain_virtstoraged_config('ovs_timeout').with_value(params[:ovs_timeout])}
end
end
on_supported_os({
:supported_os => OSDefaults.get_supported_os
}).each do |os,facts|
context "on #{os}" do
let (:facts) do
facts.merge!(OSDefaults.get_facts())
end
it_configures 'nova-compute-libvirt-virtstoraged'
end
end
end