Convert to rspec-puppet-facts
Converts those that were missing it. Change-Id: Ic7821f3a4b2db1123c9ed53a61d740883b02fbe4
This commit is contained in:
parent
83396bb3ef
commit
1aaf10e886
@ -1,55 +1,47 @@
|
|||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe 'nova::cell_v2::map_cell0' do
|
describe 'nova::cell_v2::map_cell0' do
|
||||||
|
shared_examples 'nova::cell_v2::map_cell0' do
|
||||||
shared_examples_for 'nova::cell_v2::map_cell0' do
|
|
||||||
context 'with defaults' do
|
context 'with defaults' do
|
||||||
|
it { should contain_exec('nova-cell_v2-map_cell0').with(
|
||||||
it {
|
:path => ['/bin', '/usr/bin'],
|
||||||
is_expected.to contain_exec('nova-cell_v2-map_cell0').with(
|
:command => 'nova-manage cell_v2 map_cell0',
|
||||||
:path => ['/bin', '/usr/bin'],
|
:user => 'nova',
|
||||||
:command => 'nova-manage cell_v2 map_cell0',
|
:refreshonly => 'true',
|
||||||
:user => 'nova',
|
:logoutput => 'on_failure',
|
||||||
:refreshonly => 'true',
|
:subscribe => 'Anchor[nova::cell_v2::begin]',
|
||||||
:logoutput => 'on_failure',
|
:notify => 'Anchor[nova::cell_v2::end]',
|
||||||
:subscribe => 'Anchor[nova::cell_v2::begin]',
|
)}
|
||||||
:notify => 'Anchor[nova::cell_v2::end]',
|
|
||||||
)
|
|
||||||
}
|
|
||||||
end
|
end
|
||||||
|
|
||||||
context "overriding extra_params" do
|
context "overriding extra_params" do
|
||||||
let :params do
|
let :params do
|
||||||
{
|
{
|
||||||
:extra_params => '--config-file /etc/nova/nova.conf',
|
:extra_params => '--config-file /etc/nova/nova.conf',
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
it {
|
it { should contain_exec('nova-cell_v2-map_cell0').with(
|
||||||
is_expected.to contain_exec('nova-cell_v2-map_cell0').with(
|
:path => ['/bin', '/usr/bin'],
|
||||||
:path => ['/bin', '/usr/bin'],
|
:command => 'nova-manage --config-file /etc/nova/nova.conf cell_v2 map_cell0',
|
||||||
:command => 'nova-manage --config-file /etc/nova/nova.conf cell_v2 map_cell0',
|
:user => 'nova',
|
||||||
:user => 'nova',
|
:refreshonly => 'true',
|
||||||
:refreshonly => 'true',
|
:logoutput => 'on_failure',
|
||||||
:logoutput => 'on_failure',
|
:subscribe => 'Anchor[nova::cell_v2::begin]',
|
||||||
:subscribe => 'Anchor[nova::cell_v2::begin]',
|
:notify => 'Anchor[nova::cell_v2::end]',
|
||||||
:notify => 'Anchor[nova::cell_v2::end]',
|
)}
|
||||||
)
|
|
||||||
}
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
on_supported_os({
|
on_supported_os({
|
||||||
:supported_os => OSDefaults.get_supported_os
|
:supported_os => OSDefaults.get_supported_os
|
||||||
}).each do |os,facts|
|
}).each do |os,facts|
|
||||||
context "on #{os}" do
|
context "on #{os}" do
|
||||||
let (:facts) do
|
let (:facts) do
|
||||||
facts.merge(OSDefaults.get_facts())
|
facts.merge(OSDefaults.get_facts())
|
||||||
end
|
end
|
||||||
|
|
||||||
it_configures 'nova::cell_v2::map_cell0'
|
it_behaves_like 'nova::cell_v2::map_cell0'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -1,18 +1,32 @@
|
|||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe 'nova::compute::serial' do
|
describe 'nova::compute::serial' do
|
||||||
|
shared_examples 'nova::compute::serial' do
|
||||||
|
it { should contain_nova_config('serial_console/enabled').with_value('true') }
|
||||||
|
it { should contain_nova_config('serial_console/port_range').with_value('10000:20000')}
|
||||||
|
it { should contain_nova_config('serial_console/base_url').with_value('ws://127.0.0.1:6083/')}
|
||||||
|
it { should contain_nova_config('serial_console/proxyclient_address').with_value('127.0.0.1')}
|
||||||
|
|
||||||
it { is_expected.to contain_nova_config('serial_console/enabled').with_value('true') }
|
context 'when overriding params' do
|
||||||
it { is_expected.to contain_nova_config('serial_console/port_range').with_value('10000:20000')}
|
let :params do
|
||||||
it { is_expected.to contain_nova_config('serial_console/base_url').with_value('ws://127.0.0.1:6083/')}
|
{
|
||||||
it { is_expected.to contain_nova_config('serial_console/proxyclient_address').with_value('127.0.0.1')}
|
:proxyclient_address => '10.10.10.10',
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
context 'when overriding params' do
|
it { should contain_nova_config('serial_console/proxyclient_address').with_value('10.10.10.10')}
|
||||||
let :params do
|
|
||||||
{
|
|
||||||
:proxyclient_address => '10.10.10.10',
|
|
||||||
}
|
|
||||||
end
|
end
|
||||||
it { is_expected.to contain_nova_config('serial_console/proxyclient_address').with_value('10.10.10.10')}
|
|
||||||
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_behaves_like 'nova::compute::serial'
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@ -1,22 +1,36 @@
|
|||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe 'nova::compute::spice' do
|
describe 'nova::compute::spice' do
|
||||||
|
shared_examples 'nova::compute::spice' do
|
||||||
|
it { should contain_nova_config('spice/agent_enabled').with_value('true')}
|
||||||
|
it { should contain_nova_config('spice/server_proxyclient_address').with_value('127.0.0.1')}
|
||||||
|
it { should_not contain_nova_config('spice/html5proxy_base_url')}
|
||||||
|
it { should contain_nova_config('spice/server_listen').with_value(nil)}
|
||||||
|
|
||||||
it { is_expected.to contain_nova_config('spice/agent_enabled').with_value('true')}
|
context 'when overriding params' do
|
||||||
it { is_expected.to contain_nova_config('spice/server_proxyclient_address').with_value('127.0.0.1')}
|
let :params do
|
||||||
it { is_expected.to_not contain_nova_config('spice/html5proxy_base_url')}
|
{
|
||||||
it { is_expected.to contain_nova_config('spice/server_listen').with_value(nil)}
|
|
||||||
|
|
||||||
context 'when overriding params' do
|
|
||||||
let :params do
|
|
||||||
{
|
|
||||||
:proxy_host => '10.10.10.10',
|
:proxy_host => '10.10.10.10',
|
||||||
:server_listen => '10.10.11.11',
|
:server_listen => '10.10.11.11',
|
||||||
:agent_enabled => false
|
:agent_enabled => false
|
||||||
}
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
it { should contain_nova_config('spice/html5proxy_base_url').with_value('http://10.10.10.10:6082/spice_auto.html')}
|
||||||
|
it { should contain_nova_config('spice/server_listen').with_value('10.10.11.11')}
|
||||||
|
it { should contain_nova_config('spice/agent_enabled').with_value('false')}
|
||||||
end
|
end
|
||||||
it { is_expected.to contain_nova_config('spice/html5proxy_base_url').with_value('http://10.10.10.10:6082/spice_auto.html')}
|
|
||||||
it { is_expected.to contain_nova_config('spice/server_listen').with_value('10.10.11.11')}
|
|
||||||
it { is_expected.to contain_nova_config('spice/agent_enabled').with_value('false')}
|
|
||||||
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_behaves_like 'nova::compute::spice'
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@ -3,13 +3,16 @@ require 'spec_helper'
|
|||||||
describe 'nova::compute::xenserver' do
|
describe 'nova::compute::xenserver' do
|
||||||
|
|
||||||
let :params do
|
let :params do
|
||||||
{ :connection_url => 'https://127.0.0.1',
|
{
|
||||||
|
:connection_url => 'https://127.0.0.1',
|
||||||
:connection_username => 'root',
|
:connection_username => 'root',
|
||||||
:connection_password => 'passw0rd' }
|
:connection_password => 'passw0rd'
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
let :optional_params do
|
let :optional_params do
|
||||||
{ :ovs_integration_bridge => 'xapi1',
|
{
|
||||||
|
:ovs_integration_bridge => 'xapi1',
|
||||||
:agent_timeout => '30',
|
:agent_timeout => '30',
|
||||||
:agent_version_timeout => '300',
|
:agent_version_timeout => '300',
|
||||||
:agent_resetnetwork_timeout => '60',
|
:agent_resetnetwork_timeout => '60',
|
||||||
@ -49,87 +52,101 @@ describe 'nova::compute::xenserver' do
|
|||||||
:ipxe_boot_menu_url => 'http://127.0.0.1/',
|
:ipxe_boot_menu_url => 'http://127.0.0.1/',
|
||||||
:ipxe_mkisofs_cmd => 'mkisofs',
|
:ipxe_mkisofs_cmd => 'mkisofs',
|
||||||
:running_timeout => '10',
|
:running_timeout => '10',
|
||||||
:vif_driver => 'nova.virt.xenapi.vif.XenAPIBridgeDriver',
|
:vif_driver => 'nova.virt.xenapi.vif.XenAPIBridgeDriver',
|
||||||
:image_upload_handler => 'nova.virt.xenapi.image.glance.GlanceStore',
|
:image_upload_handler => 'nova.virt.xenapi.image.glance.GlanceStore',
|
||||||
:introduce_vdi_retry_wait => '20' }
|
:introduce_vdi_retry_wait => '20'
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with required parameters' do
|
shared_examples 'nova::compute::xenserver' do
|
||||||
|
context 'with required parameters' do
|
||||||
|
it 'configures xenapi in nova.conf' do
|
||||||
|
should contain_nova_config('DEFAULT/compute_driver').with_value('xenapi.XenAPIDriver')
|
||||||
|
should contain_nova_config('xenserver/connection_url').with_value(params[:connection_url])
|
||||||
|
should contain_nova_config('xenserver/connection_username').with_value(params[:connection_username])
|
||||||
|
should contain_nova_config('xenserver/connection_password').with_value(params[:connection_password])
|
||||||
|
end
|
||||||
|
|
||||||
it 'configures xenapi in nova.conf' do
|
it 'installs xenapi with pip' do
|
||||||
is_expected.to contain_nova_config('DEFAULT/compute_driver').with_value('xenapi.XenAPIDriver')
|
should contain_package('xenapi').with(
|
||||||
is_expected.to contain_nova_config('xenserver/connection_url').with_value(params[:connection_url])
|
:ensure => 'present',
|
||||||
is_expected.to contain_nova_config('xenserver/connection_username').with_value(params[:connection_username])
|
:provider => 'pip'
|
||||||
is_expected.to contain_nova_config('xenserver/connection_password').with_value(params[:connection_password])
|
)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'installs xenapi with pip' do
|
context 'with overridden parameters' do
|
||||||
is_expected.to contain_package('xenapi').with(
|
before do
|
||||||
:ensure => 'present',
|
params.merge!({:compute_driver => 'xenapi.FoobarDriver'})
|
||||||
:provider => 'pip'
|
end
|
||||||
)
|
|
||||||
|
it 'configures xenapi in nova.conf' do
|
||||||
|
should contain_nova_config('DEFAULT/compute_driver').with_value('xenapi.FoobarDriver')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'with optional parameters' do
|
||||||
|
before :each do
|
||||||
|
params.merge!(optional_params)
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'configures xenapi in nova.conf' do
|
||||||
|
should contain_nova_config('xenserver/ovs_integration_bridge').with_value(params[:ovs_integration_bridge])
|
||||||
|
should contain_nova_config('xenserver/agent_timeout').with_value(params[:agent_timeout])
|
||||||
|
should contain_nova_config('xenserver/agent_version_timeout').with_value(params[:agent_version_timeout])
|
||||||
|
should contain_nova_config('xenserver/agent_resetnetwork_timeout').with_value(params[:agent_resetnetwork_timeout])
|
||||||
|
should contain_nova_config('xenserver/agent_path').with_value(params[:agent_path])
|
||||||
|
should contain_nova_config('xenserver/disable_agent').with_value(params[:disable_agent])
|
||||||
|
should contain_nova_config('xenserver/use_agent_default').with_value(params[:use_agent_default])
|
||||||
|
should contain_nova_config('xenserver/login_timeout').with_value(params[:login_timeout])
|
||||||
|
should contain_nova_config('xenserver/connection_concurrent').with_value(params[:connection_concurrent])
|
||||||
|
should contain_nova_config('xenserver/vhd_coalesce_poll_interval').with_value(params[:vhd_coalesce_poll_interval])
|
||||||
|
should contain_nova_config('xenserver/check_host').with_value(params[:check_host])
|
||||||
|
should contain_nova_config('xenserver/vhd_coalesce_max_attempts').with_value(params[:vhd_coalesce_max_attempts])
|
||||||
|
should contain_nova_config('xenserver/sr_base_path').with_value(params[:sr_base_path])
|
||||||
|
should contain_nova_config('xenserver/target_host').with_value(params[:target_host])
|
||||||
|
should contain_nova_config('xenserver/target_port').with_value(params[:target_port])
|
||||||
|
should contain_nova_config('xenserver/iqn_prefix').with_value(params[:iqn_prefix])
|
||||||
|
should contain_nova_config('xenserver/remap_vbd_dev').with_value(params[:remap_vbd_dev])
|
||||||
|
should contain_nova_config('xenserver/remap_vbd_dev_prefix').with_value(params[:remap_vbd_dev_prefix])
|
||||||
|
should contain_nova_config('xenserver/torrent_base_url').with_value(params[:torrent_base_url])
|
||||||
|
should contain_nova_config('xenserver/torrent_seed_chance').with_value(params[:torrent_seed_chance])
|
||||||
|
should contain_nova_config('xenserver/torrent_seed_duration').with_value(params[:torrent_seed_duration])
|
||||||
|
should contain_nova_config('xenserver/torrent_max_last_accessed').with_value(params[:torrent_max_last_accessed])
|
||||||
|
should contain_nova_config('xenserver/torrent_listen_port_start').with_value(params[:torrent_listen_port_start])
|
||||||
|
should contain_nova_config('xenserver/torrent_listen_port_end').with_value(params[:torrent_listen_port_end])
|
||||||
|
should contain_nova_config('xenserver/torrent_download_stall_cutoff').with_value(params[:torrent_download_stall_cutoff])
|
||||||
|
should contain_nova_config('xenserver/torrent_max_seeder_processes_per_host').with_value(params[:torrent_max_seeder_processes_per_host])
|
||||||
|
should contain_nova_config('xenserver/use_join_force').with_value(params[:use_join_force])
|
||||||
|
should contain_nova_config('xenserver/cache_images').with_value(params[:cache_images])
|
||||||
|
should contain_nova_config('xenserver/image_compression_level').with_value(params[:image_compression_level])
|
||||||
|
should contain_nova_config('xenserver/default_os_type').with_value(params[:default_os_type])
|
||||||
|
should contain_nova_config('xenserver/block_device_creation_timeout').with_value(params[:block_device_creation_timeout])
|
||||||
|
should contain_nova_config('xenserver/max_kernel_ramdisk_size').with_value(params[:max_kernel_ramdisk_size])
|
||||||
|
should contain_nova_config('xenserver/sr_matching_filter').with_value(params[:sr_matching_filter])
|
||||||
|
should contain_nova_config('xenserver/sparse_copy').with_value(params[:sparse_copy])
|
||||||
|
should contain_nova_config('xenserver/num_vbd_unplug_retries').with_value(params[:num_vbd_unplug_retries])
|
||||||
|
should contain_nova_config('xenserver/torrent_images').with_value(params[:torrent_images])
|
||||||
|
should contain_nova_config('xenserver/ipxe_network_name').with_value(params[:ipxe_network_name])
|
||||||
|
should contain_nova_config('xenserver/ipxe_boot_menu_url').with_value(params[:ipxe_boot_menu_url])
|
||||||
|
should contain_nova_config('xenserver/ipxe_mkisofs_cmd').with_value(params[:ipxe_mkisofs_cmd])
|
||||||
|
should contain_nova_config('xenserver/running_timeout').with_value(params[:running_timeout])
|
||||||
|
should contain_nova_config('xenserver/vif_driver').with_value(params[:vif_driver])
|
||||||
|
should contain_nova_config('xenserver/image_upload_handler').with_value(params[:image_upload_handler])
|
||||||
|
should contain_nova_config('xenserver/introduce_vdi_retry_wait').with_value(params[:introduce_vdi_retry_wait])
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with overridden parameters' do
|
on_supported_os({
|
||||||
before do
|
:supported_os => OSDefaults.get_supported_os
|
||||||
params.merge!({:compute_driver => 'xenapi.FoobarDriver'})
|
}).each do |os,facts|
|
||||||
end
|
context "on #{os}" do
|
||||||
|
let (:facts) do
|
||||||
|
facts.merge!(OSDefaults.get_facts())
|
||||||
|
end
|
||||||
|
|
||||||
it 'configures xenapi in nova.conf' do
|
it_behaves_like 'nova::compute::xenserver'
|
||||||
is_expected.to contain_nova_config('DEFAULT/compute_driver').with_value('xenapi.FoobarDriver')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'with optional parameters' do
|
|
||||||
before :each do
|
|
||||||
params.merge!(optional_params)
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'configures xenapi in nova.conf' do
|
|
||||||
is_expected.to contain_nova_config('xenserver/ovs_integration_bridge').with_value(params[:ovs_integration_bridge])
|
|
||||||
is_expected.to contain_nova_config('xenserver/agent_timeout').with_value(params[:agent_timeout])
|
|
||||||
is_expected.to contain_nova_config('xenserver/agent_version_timeout').with_value(params[:agent_version_timeout])
|
|
||||||
is_expected.to contain_nova_config('xenserver/agent_resetnetwork_timeout').with_value(params[:agent_resetnetwork_timeout])
|
|
||||||
is_expected.to contain_nova_config('xenserver/agent_path').with_value(params[:agent_path])
|
|
||||||
is_expected.to contain_nova_config('xenserver/disable_agent').with_value(params[:disable_agent])
|
|
||||||
is_expected.to contain_nova_config('xenserver/use_agent_default').with_value(params[:use_agent_default])
|
|
||||||
is_expected.to contain_nova_config('xenserver/login_timeout').with_value(params[:login_timeout])
|
|
||||||
is_expected.to contain_nova_config('xenserver/connection_concurrent').with_value(params[:connection_concurrent])
|
|
||||||
is_expected.to contain_nova_config('xenserver/vhd_coalesce_poll_interval').with_value(params[:vhd_coalesce_poll_interval])
|
|
||||||
is_expected.to contain_nova_config('xenserver/check_host').with_value(params[:check_host])
|
|
||||||
is_expected.to contain_nova_config('xenserver/vhd_coalesce_max_attempts').with_value(params[:vhd_coalesce_max_attempts])
|
|
||||||
is_expected.to contain_nova_config('xenserver/sr_base_path').with_value(params[:sr_base_path])
|
|
||||||
is_expected.to contain_nova_config('xenserver/target_host').with_value(params[:target_host])
|
|
||||||
is_expected.to contain_nova_config('xenserver/target_port').with_value(params[:target_port])
|
|
||||||
is_expected.to contain_nova_config('xenserver/iqn_prefix').with_value(params[:iqn_prefix])
|
|
||||||
is_expected.to contain_nova_config('xenserver/remap_vbd_dev').with_value(params[:remap_vbd_dev])
|
|
||||||
is_expected.to contain_nova_config('xenserver/remap_vbd_dev_prefix').with_value(params[:remap_vbd_dev_prefix])
|
|
||||||
is_expected.to contain_nova_config('xenserver/torrent_base_url').with_value(params[:torrent_base_url])
|
|
||||||
is_expected.to contain_nova_config('xenserver/torrent_seed_chance').with_value(params[:torrent_seed_chance])
|
|
||||||
is_expected.to contain_nova_config('xenserver/torrent_seed_duration').with_value(params[:torrent_seed_duration])
|
|
||||||
is_expected.to contain_nova_config('xenserver/torrent_max_last_accessed').with_value(params[:torrent_max_last_accessed])
|
|
||||||
is_expected.to contain_nova_config('xenserver/torrent_listen_port_start').with_value(params[:torrent_listen_port_start])
|
|
||||||
is_expected.to contain_nova_config('xenserver/torrent_listen_port_end').with_value(params[:torrent_listen_port_end])
|
|
||||||
is_expected.to contain_nova_config('xenserver/torrent_download_stall_cutoff').with_value(params[:torrent_download_stall_cutoff])
|
|
||||||
is_expected.to contain_nova_config('xenserver/torrent_max_seeder_processes_per_host').with_value(params[:torrent_max_seeder_processes_per_host])
|
|
||||||
is_expected.to contain_nova_config('xenserver/use_join_force').with_value(params[:use_join_force])
|
|
||||||
is_expected.to contain_nova_config('xenserver/cache_images').with_value(params[:cache_images])
|
|
||||||
is_expected.to contain_nova_config('xenserver/image_compression_level').with_value(params[:image_compression_level])
|
|
||||||
is_expected.to contain_nova_config('xenserver/default_os_type').with_value(params[:default_os_type])
|
|
||||||
is_expected.to contain_nova_config('xenserver/block_device_creation_timeout').with_value(params[:block_device_creation_timeout])
|
|
||||||
is_expected.to contain_nova_config('xenserver/max_kernel_ramdisk_size').with_value(params[:max_kernel_ramdisk_size])
|
|
||||||
is_expected.to contain_nova_config('xenserver/sr_matching_filter').with_value(params[:sr_matching_filter])
|
|
||||||
is_expected.to contain_nova_config('xenserver/sparse_copy').with_value(params[:sparse_copy])
|
|
||||||
is_expected.to contain_nova_config('xenserver/num_vbd_unplug_retries').with_value(params[:num_vbd_unplug_retries])
|
|
||||||
is_expected.to contain_nova_config('xenserver/torrent_images').with_value(params[:torrent_images])
|
|
||||||
is_expected.to contain_nova_config('xenserver/ipxe_network_name').with_value(params[:ipxe_network_name])
|
|
||||||
is_expected.to contain_nova_config('xenserver/ipxe_boot_menu_url').with_value(params[:ipxe_boot_menu_url])
|
|
||||||
is_expected.to contain_nova_config('xenserver/ipxe_mkisofs_cmd').with_value(params[:ipxe_mkisofs_cmd])
|
|
||||||
is_expected.to contain_nova_config('xenserver/running_timeout').with_value(params[:running_timeout])
|
|
||||||
is_expected.to contain_nova_config('xenserver/vif_driver').with_value(params[:vif_driver])
|
|
||||||
is_expected.to contain_nova_config('xenserver/image_upload_handler').with_value(params[:image_upload_handler])
|
|
||||||
is_expected.to contain_nova_config('xenserver/introduce_vdi_retry_wait').with_value(params[:introduce_vdi_retry_wait])
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -3,164 +3,184 @@ require 'spec_helper'
|
|||||||
describe 'nova::keystone::auth' do
|
describe 'nova::keystone::auth' do
|
||||||
|
|
||||||
let :params do
|
let :params do
|
||||||
{:password => 'nova_password'}
|
{
|
||||||
|
:password => 'nova_password'
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
let :default_params do
|
let :default_params do
|
||||||
{ :auth_name => 'nova',
|
{
|
||||||
:service_name => 'nova',
|
:auth_name => 'nova',
|
||||||
:region => 'RegionOne',
|
:service_name => 'nova',
|
||||||
:tenant => 'services',
|
:region => 'RegionOne',
|
||||||
:email => 'nova@localhost',
|
:tenant => 'services',
|
||||||
:public_url => 'http://127.0.0.1:8774/v2.1',
|
:email => 'nova@localhost',
|
||||||
:internal_url => 'http://127.0.0.1:8774/v2.1',
|
|
||||||
:admin_url => 'http://127.0.0.1:8774/v2.1' }
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'with default parameters' do
|
|
||||||
|
|
||||||
it { is_expected.to contain_keystone_user('nova').with(
|
|
||||||
:ensure => 'present',
|
|
||||||
:password => 'nova_password'
|
|
||||||
) }
|
|
||||||
|
|
||||||
it { is_expected.to contain_keystone_user_role('nova@services').with(
|
|
||||||
:ensure => 'present',
|
|
||||||
:roles => ['admin']
|
|
||||||
)}
|
|
||||||
|
|
||||||
it { is_expected.to contain_keystone_service('nova::compute').with(
|
|
||||||
:ensure => 'present',
|
|
||||||
:description => 'Openstack Compute Service'
|
|
||||||
)}
|
|
||||||
|
|
||||||
it { is_expected.to contain_keystone_endpoint('RegionOne/nova::compute').with(
|
|
||||||
:ensure => 'present',
|
|
||||||
:public_url => 'http://127.0.0.1:8774/v2.1',
|
:public_url => 'http://127.0.0.1:8774/v2.1',
|
||||||
:admin_url => 'http://127.0.0.1:8774/v2.1',
|
:internal_url => 'http://127.0.0.1:8774/v2.1',
|
||||||
:internal_url => 'http://127.0.0.1:8774/v2.1'
|
:admin_url => 'http://127.0.0.1:8774/v2.1'
|
||||||
)}
|
}
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when setting auth name' do
|
shared_examples 'nova::keystone::auth' do
|
||||||
before do
|
context 'with default parameters' do
|
||||||
params.merge!( :auth_name => 'foo' )
|
it { should contain_keystone_user('nova').with(
|
||||||
|
:ensure => 'present',
|
||||||
|
:password => 'nova_password'
|
||||||
|
)}
|
||||||
|
|
||||||
|
it { should contain_keystone_user_role('nova@services').with(
|
||||||
|
:ensure => 'present',
|
||||||
|
:roles => ['admin']
|
||||||
|
)}
|
||||||
|
|
||||||
|
it { should contain_keystone_service('nova::compute').with(
|
||||||
|
:ensure => 'present',
|
||||||
|
:description => 'Openstack Compute Service'
|
||||||
|
)}
|
||||||
|
|
||||||
|
it { should contain_keystone_endpoint('RegionOne/nova::compute').with(
|
||||||
|
:ensure => 'present',
|
||||||
|
:public_url => 'http://127.0.0.1:8774/v2.1',
|
||||||
|
:admin_url => 'http://127.0.0.1:8774/v2.1',
|
||||||
|
:internal_url => 'http://127.0.0.1:8774/v2.1'
|
||||||
|
)}
|
||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.to contain_keystone_user('foo').with(
|
context 'when setting auth name' do
|
||||||
:ensure => 'present',
|
before do
|
||||||
:password => 'nova_password'
|
params.merge!( :auth_name => 'foo' )
|
||||||
) }
|
end
|
||||||
|
|
||||||
it { is_expected.to contain_keystone_user_role('foo@services').with(
|
it { should contain_keystone_user('foo').with(
|
||||||
:ensure => 'present',
|
:ensure => 'present',
|
||||||
:roles => ['admin']
|
:password => 'nova_password'
|
||||||
)}
|
)}
|
||||||
|
|
||||||
it { is_expected.to contain_keystone_service('nova::compute').with(
|
it { should contain_keystone_user_role('foo@services').with(
|
||||||
:ensure => 'present',
|
:ensure => 'present',
|
||||||
:description => 'Openstack Compute Service'
|
:roles => ['admin']
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
it { should contain_keystone_service('nova::compute').with(
|
||||||
|
:ensure => 'present',
|
||||||
|
:description => 'Openstack Compute Service'
|
||||||
|
)}
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'when overriding endpoint parameters' do
|
||||||
|
before do
|
||||||
|
params.merge!(
|
||||||
|
:region => 'RegionTwo',
|
||||||
|
:public_url => 'https://10.0.0.1:9774/v2.2',
|
||||||
|
:internal_url => 'https://10.0.0.3:9774/v2.2',
|
||||||
|
:admin_url => 'https://10.0.0.2:9774/v2.2',
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
it { should contain_keystone_endpoint('RegionTwo/nova::compute').with(
|
||||||
|
:ensure => 'present',
|
||||||
|
:public_url => params[:public_url],
|
||||||
|
:internal_url => params[:internal_url],
|
||||||
|
:admin_url => params[:admin_url]
|
||||||
|
)}
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'when disabling endpoint configuration' do
|
||||||
|
before do
|
||||||
|
params.merge!( :configure_endpoint => false )
|
||||||
|
end
|
||||||
|
|
||||||
|
it { should_not contain_keystone_endpoint('RegionOne/nova::compute') }
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'when disabling user configuration' do
|
||||||
|
before do
|
||||||
|
params.merge!( :configure_user => false )
|
||||||
|
end
|
||||||
|
|
||||||
|
it { should_not contain_keystone_user('nova') }
|
||||||
|
it { should contain_keystone_user_role('nova@services') }
|
||||||
|
it { should contain_keystone_service('nova::compute').with(
|
||||||
|
:ensure => 'present',
|
||||||
|
:description => 'Openstack Compute Service'
|
||||||
|
)}
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'when disabling user and user role configuration' do
|
||||||
|
let :params do
|
||||||
|
{
|
||||||
|
:configure_user => false,
|
||||||
|
:configure_user_role => false,
|
||||||
|
:password => 'nova_password'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
it { should_not contain_keystone_user('nova') }
|
||||||
|
it { should_not contain_keystone_user_role('nova@services') }
|
||||||
|
|
||||||
|
it { should contain_keystone_service('nova::compute').with(
|
||||||
|
:ensure => 'present',
|
||||||
|
:description => 'Openstack Compute Service'
|
||||||
|
)}
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'when overriding service names' do
|
||||||
|
let :params do
|
||||||
|
{
|
||||||
|
:service_name => 'nova_service',
|
||||||
|
:password => 'nova_password'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
it { should contain_keystone_user('nova') }
|
||||||
|
it { should contain_keystone_user_role('nova@services') }
|
||||||
|
it { should contain_keystone_service('nova_service::compute') }
|
||||||
|
it { should contain_keystone_endpoint('RegionOne/nova_service::compute') }
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'when configuring nova-api and the keystone endpoint' do
|
||||||
|
let :pre_condition do
|
||||||
|
"class { '::nova::keystone::authtoken':
|
||||||
|
password => 'secrete',
|
||||||
|
}
|
||||||
|
class { 'nova::api': }
|
||||||
|
include nova"
|
||||||
|
end
|
||||||
|
|
||||||
|
let :params do
|
||||||
|
{
|
||||||
|
:password => 'test',
|
||||||
|
:service_name => 'nova',
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
it { should contain_keystone_endpoint('RegionOne/nova::compute').with_notify(platform_params[:nova_api_notify]) }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when overriding endpoint parameters' do
|
on_supported_os({
|
||||||
before do
|
:supported_os => OSDefaults.get_supported_os
|
||||||
params.merge!(
|
}).each do |os,facts|
|
||||||
:region => 'RegionTwo',
|
context "on #{os}" do
|
||||||
:public_url => 'https://10.0.0.1:9774/v2.2',
|
let (:facts) do
|
||||||
:internal_url => 'https://10.0.0.3:9774/v2.2',
|
facts.merge!(OSDefaults.get_facts())
|
||||||
:admin_url => 'https://10.0.0.2:9774/v2.2',
|
end
|
||||||
)
|
|
||||||
|
let (:platform_params) do
|
||||||
|
case facts[:osfamily]
|
||||||
|
when 'Debian'
|
||||||
|
{
|
||||||
|
:nova_api_notify => ['Service[nova-api]'],
|
||||||
|
}
|
||||||
|
when 'RedHat'
|
||||||
|
{
|
||||||
|
:nova_api_notify => [],
|
||||||
|
}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
it_behaves_like 'nova::keystone::auth'
|
||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.to contain_keystone_endpoint('RegionTwo/nova::compute').with(
|
|
||||||
:ensure => 'present',
|
|
||||||
:public_url => params[:public_url],
|
|
||||||
:internal_url => params[:internal_url],
|
|
||||||
:admin_url => params[:admin_url]
|
|
||||||
)}
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'when disabling endpoint configuration' do
|
|
||||||
before do
|
|
||||||
params.merge!( :configure_endpoint => false )
|
|
||||||
end
|
|
||||||
|
|
||||||
it { is_expected.to_not contain_keystone_endpoint('RegionOne/nova::compute') }
|
|
||||||
end
|
|
||||||
|
|
||||||
describe 'when disabling user configuration' do
|
|
||||||
before do
|
|
||||||
params.merge!( :configure_user => false )
|
|
||||||
end
|
|
||||||
|
|
||||||
it { is_expected.to_not contain_keystone_user('nova') }
|
|
||||||
it { is_expected.to contain_keystone_user_role('nova@services') }
|
|
||||||
it { is_expected.to contain_keystone_service('nova::compute').with(
|
|
||||||
:ensure => 'present',
|
|
||||||
:description => 'Openstack Compute Service'
|
|
||||||
)}
|
|
||||||
end
|
|
||||||
|
|
||||||
describe 'when disabling user and user role configuration' do
|
|
||||||
let :params do
|
|
||||||
{
|
|
||||||
:configure_user => false,
|
|
||||||
:configure_user_role => false,
|
|
||||||
:password => 'nova_password'
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
it { is_expected.to_not contain_keystone_user('nova') }
|
|
||||||
it { is_expected.to_not contain_keystone_user_role('nova@services') }
|
|
||||||
it { is_expected.to contain_keystone_service('nova::compute').with(
|
|
||||||
:ensure => 'present',
|
|
||||||
:description => 'Openstack Compute Service'
|
|
||||||
)}
|
|
||||||
end
|
|
||||||
|
|
||||||
describe 'when configuring nova-api and the keystone endpoint' do
|
|
||||||
let :pre_condition do
|
|
||||||
"class { '::nova::keystone::authtoken':
|
|
||||||
password => 'secrete',
|
|
||||||
}
|
|
||||||
class { 'nova::api':}
|
|
||||||
include nova"
|
|
||||||
end
|
|
||||||
|
|
||||||
let :facts do
|
|
||||||
@default_facts.merge({
|
|
||||||
:osfamily => "Debian",
|
|
||||||
:os => { :name => 'Debian', :family => 'Debian', :release => { :major => '8', :minor => '0' } },
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
let :params do
|
|
||||||
{
|
|
||||||
:password => 'test'
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
it { is_expected.to contain_keystone_endpoint('RegionOne/nova::compute').with_notify(['Service[nova-api]']) }
|
|
||||||
end
|
|
||||||
|
|
||||||
describe 'when overriding service names' do
|
|
||||||
|
|
||||||
let :params do
|
|
||||||
{
|
|
||||||
:service_name => 'nova_service',
|
|
||||||
:password => 'nova_password'
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
it { is_expected.to contain_keystone_user('nova') }
|
|
||||||
it { is_expected.to contain_keystone_user_role('nova@services') }
|
|
||||||
it { is_expected.to contain_keystone_service('nova_service::compute') }
|
|
||||||
it { is_expected.to contain_keystone_endpoint('RegionOne/nova_service::compute') }
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -6,33 +6,18 @@ describe 'nova::spicehtml5proxy' do
|
|||||||
'include nova'
|
'include nova'
|
||||||
end
|
end
|
||||||
|
|
||||||
shared_examples 'nova-spicehtml5proxy debian package' do
|
shared_examples 'nova::spicehtml5proxy' do
|
||||||
let :params do
|
|
||||||
{ :enabled => true }
|
|
||||||
end
|
|
||||||
|
|
||||||
it { is_expected.to contain_file_line('/etc/default/nova-consoleproxy:NOVA_CONSOLE_PROXY_TYPE').with(
|
|
||||||
:path => '/etc/default/nova-consoleproxy',
|
|
||||||
:match => '^NOVA_CONSOLE_PROXY_TYPE=(.*)$',
|
|
||||||
:line => 'NOVA_CONSOLE_PROXY_TYPE=spicehtml5',
|
|
||||||
:tag => 'nova-consoleproxy',
|
|
||||||
:require => 'Anchor[nova::config::begin]',
|
|
||||||
:notify => 'Anchor[nova::config::end]',
|
|
||||||
)}
|
|
||||||
end
|
|
||||||
|
|
||||||
shared_examples 'nova-spicehtml5proxy' do
|
|
||||||
it 'configures nova.conf' do
|
it 'configures nova.conf' do
|
||||||
is_expected.to contain_nova_config('spice/html5proxy_host').with(:value => '0.0.0.0')
|
should contain_nova_config('spice/html5proxy_host').with(:value => '0.0.0.0')
|
||||||
is_expected.to contain_nova_config('spice/html5proxy_port').with(:value => '6082')
|
should contain_nova_config('spice/html5proxy_port').with(:value => '6082')
|
||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.to contain_package('nova-spicehtml5proxy').with(
|
it { should contain_package('nova-spicehtml5proxy').with(
|
||||||
:ensure => 'present',
|
:ensure => 'present',
|
||||||
:name => platform_params[:spicehtml5proxy_package_name]
|
:name => platform_params[:spicehtml5proxy_package_name]
|
||||||
) }
|
) }
|
||||||
|
|
||||||
it { is_expected.to contain_service('nova-spicehtml5proxy').with(
|
it { should contain_service('nova-spicehtml5proxy').with(
|
||||||
:ensure => 'running',
|
:ensure => 'running',
|
||||||
:name => platform_params[:spicehtml5proxy_service_name],
|
:name => platform_params[:spicehtml5proxy_service_name],
|
||||||
:hasstatus => true
|
:hasstatus => true
|
||||||
@ -45,7 +30,7 @@ describe 'nova::spicehtml5proxy' do
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.to contain_service('nova-spicehtml5proxy').without_ensure }
|
it { should contain_service('nova-spicehtml5proxy').without_ensure }
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with package version' do
|
context 'with package version' do
|
||||||
@ -53,84 +38,71 @@ describe 'nova::spicehtml5proxy' do
|
|||||||
{ :ensure_package => '2012.1-2' }
|
{ :ensure_package => '2012.1-2' }
|
||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.to contain_package('nova-spicehtml5proxy').with(
|
it { should contain_package('nova-spicehtml5proxy').with(
|
||||||
:ensure => params[:ensure_package],
|
:ensure => params[:ensure_package],
|
||||||
:name => platform_params[:spicehtml5proxy_package_name],
|
:name => platform_params[:spicehtml5proxy_package_name],
|
||||||
)}
|
)}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'on Ubuntu system' do
|
shared_examples 'nova::spicehtml5proxy on Debian' do
|
||||||
let :facts do
|
let :params do
|
||||||
@default_facts.merge({
|
{
|
||||||
:osfamily => 'Debian',
|
:enabled => true
|
||||||
:operatingsystem => 'Ubuntu',
|
}
|
||||||
:os_package_type => 'ubuntu',
|
|
||||||
:os => { :family => 'Debian', :release => { :major => '16'}}
|
|
||||||
})
|
|
||||||
end
|
end
|
||||||
|
|
||||||
let :platform_params do
|
it { should contain_file_line('/etc/default/nova-consoleproxy:NOVA_CONSOLE_PROXY_TYPE').with(
|
||||||
{ :spicehtml5proxy_package_name => 'nova-spiceproxy',
|
:path => '/etc/default/nova-consoleproxy',
|
||||||
:spicehtml5proxy_service_name => 'nova-spiceproxy' }
|
:match => '^NOVA_CONSOLE_PROXY_TYPE=(.*)$',
|
||||||
end
|
:line => 'NOVA_CONSOLE_PROXY_TYPE=spicehtml5',
|
||||||
|
:tag => 'nova-consoleproxy',
|
||||||
it_configures 'nova-spicehtml5proxy'
|
:require => 'Anchor[nova::config::begin]',
|
||||||
|
:notify => 'Anchor[nova::config::end]',
|
||||||
|
)}
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'on Debian system' do
|
on_supported_os({
|
||||||
let :facts do
|
:supported_os => OSDefaults.get_supported_os
|
||||||
@default_facts.merge({
|
}).each do |os,facts|
|
||||||
:osfamily => 'Debian',
|
context "on #{os}" do
|
||||||
:operatingsystem => 'Debian',
|
let (:facts) do
|
||||||
:operatingsystemmajrelease => '9',
|
if facts[:operatingsystem] == 'Debian'
|
||||||
:os_package_type => 'debian',
|
extra = { :os_package_type => 'debian' }
|
||||||
:os => { :family => 'Debian', :release => { :major => '9'}}
|
else
|
||||||
})
|
extra = {}
|
||||||
end
|
end
|
||||||
|
|
||||||
let :platform_params do
|
facts.merge!(OSDefaults.get_facts(extra))
|
||||||
{ :spicehtml5proxy_package_name => 'nova-consoleproxy',
|
end
|
||||||
:spicehtml5proxy_service_name => 'nova-spicehtml5proxy' }
|
|
||||||
end
|
|
||||||
|
|
||||||
it_configures 'nova-spicehtml5proxy debian package'
|
let (:platform_params) do
|
||||||
it_configures 'nova-spicehtml5proxy'
|
case facts[:osfamily]
|
||||||
|
when 'Debian'
|
||||||
|
if facts[:os_package_type] == 'debian' then
|
||||||
|
package_name = 'nova-consoleproxy'
|
||||||
|
service_name = 'nova-spicehtml5proxy'
|
||||||
|
else
|
||||||
|
package_name = 'nova-spiceproxy'
|
||||||
|
service_name = 'nova-spiceproxy'
|
||||||
|
end
|
||||||
|
{
|
||||||
|
:spicehtml5proxy_package_name => package_name,
|
||||||
|
:spicehtml5proxy_service_name => service_name
|
||||||
|
}
|
||||||
|
when 'RedHat'
|
||||||
|
{
|
||||||
|
:spicehtml5proxy_package_name => 'openstack-nova-console',
|
||||||
|
:spicehtml5proxy_service_name => 'openstack-nova-spicehtml5proxy'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
it_behaves_like 'nova::spicehtml5proxy'
|
||||||
|
|
||||||
|
if facts[:os_package_type] == 'debian'
|
||||||
|
it_behaves_like 'nova::spicehtml5proxy on Debian'
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'on Ubuntu system with Debian packages' do
|
|
||||||
let :facts do
|
|
||||||
@default_facts.merge({
|
|
||||||
:osfamily => 'Debian',
|
|
||||||
:operatingsystem => 'Ubuntu',
|
|
||||||
:os_package_type => 'debian',
|
|
||||||
:os => { :family => 'Debian', :release => { :major => '16'}}
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
let :platform_params do
|
|
||||||
{ :spicehtml5proxy_package_name => 'nova-consoleproxy',
|
|
||||||
:spicehtml5proxy_service_name => 'nova-spicehtml5proxy' }
|
|
||||||
end
|
|
||||||
|
|
||||||
it_configures 'nova-spicehtml5proxy debian package'
|
|
||||||
it_configures 'nova-spicehtml5proxy'
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
context 'on Redhat platforms' do
|
|
||||||
let :facts do
|
|
||||||
@default_facts.merge({ :osfamily => 'RedHat',
|
|
||||||
:os => { :family => 'RedHat', :release => { :major => '7'}}
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
let :platform_params do
|
|
||||||
{ :spicehtml5proxy_package_name => 'openstack-nova-console',
|
|
||||||
:spicehtml5proxy_service_name => 'openstack-nova-spicehtml5proxy' }
|
|
||||||
end
|
|
||||||
|
|
||||||
it_configures 'nova-spicehtml5proxy'
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -1,37 +1,48 @@
|
|||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe 'nova::generic_service' do
|
describe 'nova::generic_service' do
|
||||||
describe 'package should come before service' do
|
shared_examples 'nova::generic_service' do
|
||||||
let :pre_condition do
|
describe 'package should come before service' do
|
||||||
'include nova'
|
let :pre_condition do
|
||||||
|
"include nova"
|
||||||
|
end
|
||||||
|
|
||||||
|
let :params do
|
||||||
|
{
|
||||||
|
:package_name => 'foo',
|
||||||
|
:service_name => 'food'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
let :title do
|
||||||
|
'foo'
|
||||||
|
end
|
||||||
|
|
||||||
|
it { should contain_service('nova-foo').with(
|
||||||
|
:name => 'food',
|
||||||
|
:ensure => 'running',
|
||||||
|
:enable => true
|
||||||
|
)}
|
||||||
|
|
||||||
|
it { should contain_service('nova-foo').that_subscribes_to(
|
||||||
|
'Anchor[nova::service::begin]',
|
||||||
|
)}
|
||||||
|
|
||||||
|
it { should contain_service('nova-foo').that_notifies(
|
||||||
|
'Anchor[nova::service::end]',
|
||||||
|
)}
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
let :params do
|
on_supported_os({
|
||||||
{
|
:supported_os => OSDefaults.get_supported_os
|
||||||
:package_name => 'foo',
|
}).each do |os,facts|
|
||||||
:service_name => 'food'
|
context "on #{os}" do
|
||||||
}
|
let (:facts) do
|
||||||
|
facts.merge!(OSDefaults.get_facts())
|
||||||
|
end
|
||||||
|
|
||||||
|
it_behaves_like 'nova::generic_service'
|
||||||
end
|
end
|
||||||
|
|
||||||
let :facts do
|
|
||||||
@default_facts.merge({ :osfamily => 'RedHat', :os => { :family => 'RedHat', :release => { :major => '8'}}})
|
|
||||||
end
|
|
||||||
|
|
||||||
let :title do
|
|
||||||
'foo'
|
|
||||||
end
|
|
||||||
|
|
||||||
it { is_expected.to contain_service('nova-foo').with(
|
|
||||||
'name' => 'food',
|
|
||||||
'ensure' => 'running',
|
|
||||||
'enable' => true
|
|
||||||
)}
|
|
||||||
|
|
||||||
it { is_expected.to contain_service('nova-foo').that_subscribes_to(
|
|
||||||
'Anchor[nova::service::begin]',
|
|
||||||
)}
|
|
||||||
it { is_expected.to contain_service('nova-foo').that_notifies(
|
|
||||||
'Anchor[nova::service::end]',
|
|
||||||
)}
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user