Merge "spec: updates for rspec-puppet 2.x and rspec 3.x"
This commit is contained in:
commit
d1a2f9606d
4
Gemfile
4
Gemfile
|
@ -2,6 +2,7 @@ source 'https://rubygems.org'
|
|||
|
||||
group :development, :test do
|
||||
gem 'puppetlabs_spec_helper', :require => false
|
||||
gem 'rspec-puppet', '~> 2.0.0', :require => false
|
||||
|
||||
gem 'metadata-json-lint'
|
||||
gem 'puppet-lint-param-docs'
|
||||
|
@ -15,10 +16,7 @@ group :development, :test do
|
|||
gem 'puppet-lint-variable_contains_upcase'
|
||||
gem 'puppet-lint-numericvariable'
|
||||
|
||||
gem 'rake', '10.1.1'
|
||||
gem 'rspec-puppet', '~> 1.0.1', :require => false
|
||||
gem 'beaker-rspec', '~> 2.2.4', :require => false
|
||||
gem 'rspec', '< 2.99'
|
||||
gem 'json'
|
||||
gem 'webmock'
|
||||
end
|
||||
|
|
|
@ -19,59 +19,59 @@ describe 'nova::api' do
|
|||
context 'with default parameters' do
|
||||
|
||||
it 'installs nova-api package and service' do
|
||||
should contain_service('nova-api').with(
|
||||
is_expected.to contain_service('nova-api').with(
|
||||
:name => platform_params[:nova_api_service],
|
||||
:ensure => 'stopped',
|
||||
:hasstatus => true,
|
||||
:enable => false
|
||||
)
|
||||
should contain_package('nova-api').with(
|
||||
is_expected.to contain_package('nova-api').with(
|
||||
:name => platform_params[:nova_api_package],
|
||||
:ensure => 'present',
|
||||
:notify => 'Service[nova-api]',
|
||||
:tag => ['openstack']
|
||||
)
|
||||
should_not contain_exec('validate_nova_api')
|
||||
is_expected.to_not contain_exec('validate_nova_api')
|
||||
end
|
||||
|
||||
it 'configures keystone_authtoken middleware' do
|
||||
should contain_nova_config(
|
||||
is_expected.to contain_nova_config(
|
||||
'keystone_authtoken/auth_host').with_value('127.0.0.1')
|
||||
should contain_nova_config(
|
||||
is_expected.to contain_nova_config(
|
||||
'keystone_authtoken/auth_port').with_value('35357')
|
||||
should contain_nova_config(
|
||||
is_expected.to contain_nova_config(
|
||||
'keystone_authtoken/auth_protocol').with_value('http')
|
||||
should contain_nova_config(
|
||||
is_expected.to contain_nova_config(
|
||||
'keystone_authtoken/auth_uri').with_value('http://127.0.0.1:5000/')
|
||||
should contain_nova_config(
|
||||
is_expected.to contain_nova_config(
|
||||
'keystone_authtoken/auth_admin_prefix').with_ensure('absent')
|
||||
should contain_nova_config(
|
||||
is_expected.to contain_nova_config(
|
||||
'keystone_authtoken/auth_version').with_ensure('absent')
|
||||
should contain_nova_config(
|
||||
is_expected.to contain_nova_config(
|
||||
'keystone_authtoken/admin_tenant_name').with_value('services')
|
||||
should contain_nova_config(
|
||||
is_expected.to contain_nova_config(
|
||||
'keystone_authtoken/admin_user').with_value('nova')
|
||||
should contain_nova_config(
|
||||
is_expected.to contain_nova_config(
|
||||
'keystone_authtoken/admin_password').with_value('passw0rd').with_secret(true)
|
||||
end
|
||||
|
||||
it 'configures various stuff' do
|
||||
should contain_nova_config('DEFAULT/ec2_listen').with('value' => '0.0.0.0')
|
||||
should contain_nova_config('DEFAULT/osapi_compute_listen').with('value' => '0.0.0.0')
|
||||
should contain_nova_config('DEFAULT/metadata_listen').with('value' => '0.0.0.0')
|
||||
should contain_nova_config('DEFAULT/osapi_volume_listen').with('value' => '0.0.0.0')
|
||||
should contain_nova_config('DEFAULT/osapi_compute_workers').with('value' => '5')
|
||||
should contain_nova_config('DEFAULT/ec2_workers').with('value' => '5')
|
||||
should contain_nova_config('DEFAULT/metadata_workers').with('value' => '5')
|
||||
is_expected.to contain_nova_config('DEFAULT/ec2_listen').with('value' => '0.0.0.0')
|
||||
is_expected.to contain_nova_config('DEFAULT/osapi_compute_listen').with('value' => '0.0.0.0')
|
||||
is_expected.to contain_nova_config('DEFAULT/metadata_listen').with('value' => '0.0.0.0')
|
||||
is_expected.to contain_nova_config('DEFAULT/osapi_volume_listen').with('value' => '0.0.0.0')
|
||||
is_expected.to contain_nova_config('DEFAULT/osapi_compute_workers').with('value' => '5')
|
||||
is_expected.to contain_nova_config('DEFAULT/ec2_workers').with('value' => '5')
|
||||
is_expected.to contain_nova_config('DEFAULT/metadata_workers').with('value' => '5')
|
||||
end
|
||||
|
||||
it 'do not configure v3 api' do
|
||||
should contain_nova_config('osapi_v3/enabled').with('value' => false)
|
||||
is_expected.to contain_nova_config('osapi_v3/enabled').with('value' => false)
|
||||
end
|
||||
|
||||
it 'unconfigures neutron_metadata proxy' do
|
||||
should contain_nova_config('neutron/service_metadata_proxy').with(:value => false)
|
||||
should contain_nova_config('neutron/metadata_proxy_shared_secret').with(:ensure => 'absent')
|
||||
is_expected.to contain_nova_config('neutron/service_metadata_proxy').with(:value => false)
|
||||
is_expected.to contain_nova_config('neutron/metadata_proxy_shared_secret').with(:ensure => 'absent')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -104,12 +104,12 @@ describe 'nova::api' do
|
|||
end
|
||||
|
||||
it 'installs nova-api package and service' do
|
||||
should contain_package('nova-api').with(
|
||||
is_expected.to contain_package('nova-api').with(
|
||||
:name => platform_params[:nova_api_package],
|
||||
:ensure => '2012.1-2',
|
||||
:tag => ['openstack']
|
||||
)
|
||||
should contain_service('nova-api').with(
|
||||
is_expected.to contain_service('nova-api').with(
|
||||
:name => platform_params[:nova_api_service],
|
||||
:ensure => 'running',
|
||||
:hasstatus => true,
|
||||
|
@ -118,47 +118,47 @@ describe 'nova::api' do
|
|||
end
|
||||
|
||||
it 'configures keystone_authtoken middleware' do
|
||||
should contain_nova_config(
|
||||
is_expected.to contain_nova_config(
|
||||
'keystone_authtoken/auth_host').with_value('10.0.0.1')
|
||||
should contain_nova_config(
|
||||
is_expected.to contain_nova_config(
|
||||
'keystone_authtoken/auth_port').with_value('1234')
|
||||
should contain_nova_config(
|
||||
is_expected.to contain_nova_config(
|
||||
'keystone_authtoken/auth_protocol').with_value('https')
|
||||
should contain_nova_config(
|
||||
is_expected.to contain_nova_config(
|
||||
'keystone_authtoken/auth_admin_prefix').with_value('/keystone/admin')
|
||||
should contain_nova_config(
|
||||
is_expected.to contain_nova_config(
|
||||
'keystone_authtoken/auth_uri').with_value('https://10.0.0.1:9999/')
|
||||
should contain_nova_config(
|
||||
is_expected.to contain_nova_config(
|
||||
'keystone_authtoken/auth_version').with_value('v3.0')
|
||||
should contain_nova_config(
|
||||
is_expected.to contain_nova_config(
|
||||
'keystone_authtoken/admin_tenant_name').with_value('service2')
|
||||
should contain_nova_config(
|
||||
is_expected.to contain_nova_config(
|
||||
'keystone_authtoken/admin_user').with_value('nova2')
|
||||
should contain_nova_config(
|
||||
is_expected.to contain_nova_config(
|
||||
'keystone_authtoken/admin_password').with_value('passw0rd2').with_secret(true)
|
||||
should contain_nova_paste_api_ini(
|
||||
is_expected.to contain_nova_paste_api_ini(
|
||||
'filter:ratelimit/limits').with_value('(GET, "*", .*, 100, MINUTE);(POST, "*", .*, 200, MINUTE)')
|
||||
end
|
||||
|
||||
it 'configures various stuff' do
|
||||
should contain_nova_config('DEFAULT/ec2_listen').with('value' => '192.168.56.210')
|
||||
should contain_nova_config('DEFAULT/osapi_compute_listen').with('value' => '192.168.56.210')
|
||||
should contain_nova_config('DEFAULT/metadata_listen').with('value' => '127.0.0.1')
|
||||
should contain_nova_config('DEFAULT/osapi_volume_listen').with('value' => '192.168.56.210')
|
||||
should contain_nova_config('DEFAULT/use_forwarded_for').with('value' => false)
|
||||
should contain_nova_config('DEFAULT/osapi_compute_workers').with('value' => '1')
|
||||
should contain_nova_config('DEFAULT/metadata_workers').with('value' => '2')
|
||||
should contain_nova_config('neutron/service_metadata_proxy').with('value' => true)
|
||||
should contain_nova_config('neutron/metadata_proxy_shared_secret').with('value' => 'secrete')
|
||||
should contain_nova_config('DEFAULT/keystone_ec2_url').with('value' => 'https://example.com:5000/v2.0/ec2tokens')
|
||||
is_expected.to contain_nova_config('DEFAULT/ec2_listen').with('value' => '192.168.56.210')
|
||||
is_expected.to contain_nova_config('DEFAULT/osapi_compute_listen').with('value' => '192.168.56.210')
|
||||
is_expected.to contain_nova_config('DEFAULT/metadata_listen').with('value' => '127.0.0.1')
|
||||
is_expected.to contain_nova_config('DEFAULT/osapi_volume_listen').with('value' => '192.168.56.210')
|
||||
is_expected.to contain_nova_config('DEFAULT/use_forwarded_for').with('value' => false)
|
||||
is_expected.to contain_nova_config('DEFAULT/osapi_compute_workers').with('value' => '1')
|
||||
is_expected.to contain_nova_config('DEFAULT/metadata_workers').with('value' => '2')
|
||||
is_expected.to contain_nova_config('neutron/service_metadata_proxy').with('value' => true)
|
||||
is_expected.to contain_nova_config('neutron/metadata_proxy_shared_secret').with('value' => 'secrete')
|
||||
is_expected.to contain_nova_config('DEFAULT/keystone_ec2_url').with('value' => 'https://example.com:5000/v2.0/ec2tokens')
|
||||
end
|
||||
|
||||
it 'configure nova api v3' do
|
||||
should contain_nova_config('osapi_v3/enabled').with('value' => true)
|
||||
is_expected.to contain_nova_config('osapi_v3/enabled').with('value' => true)
|
||||
end
|
||||
|
||||
it 'configures nova pci_alias entries' do
|
||||
should contain_nova_config('DEFAULT/pci_alias').with(
|
||||
is_expected.to contain_nova_config('DEFAULT/pci_alias').with(
|
||||
'value' => "[{\"vendor_id\":\"8086\",\"product_id\":\"0126\",\"name\":\"graphic_card\"},{\"vendor_id\":\"9096\",\"product_id\":\"1520\",\"name\":\"network_card\"}]"
|
||||
)
|
||||
end
|
||||
|
@ -176,7 +176,7 @@ describe 'nova::api' do
|
|||
before do
|
||||
params.merge!({ :auth_admin_prefix => auth_admin_prefix })
|
||||
end
|
||||
it { expect { should contain_nova_config('keystone_authtoken/auth_admin_prefix') }.to \
|
||||
it { expect { is_expected.to contain_nova_config('keystone_authtoken/auth_admin_prefix') }.to \
|
||||
raise_error(Puppet::Error, /validate_re\(\): "#{auth_admin_prefix}" does not match/) }
|
||||
end
|
||||
end
|
||||
|
@ -187,7 +187,7 @@ describe 'nova::api' do
|
|||
:validate => true,
|
||||
})
|
||||
end
|
||||
it { should contain_exec('execute nova-api validation').with(
|
||||
it { is_expected.to contain_exec('execute nova-api validation').with(
|
||||
:path => '/usr/bin:/bin:/usr/sbin:/sbin',
|
||||
:provider => 'shell',
|
||||
:tries => '10',
|
||||
|
@ -195,7 +195,7 @@ describe 'nova::api' do
|
|||
:command => 'nova --os-auth-url http://127.0.0.1:5000/ --os-tenant-name services --os-username nova --os-password passw0rd flavor-list',
|
||||
)}
|
||||
|
||||
it { should contain_anchor('create nova-api anchor').with(
|
||||
it { is_expected.to contain_anchor('create nova-api anchor').with(
|
||||
:require => 'Exec[execute nova-api validation]',
|
||||
)}
|
||||
end
|
||||
|
@ -207,7 +207,7 @@ describe 'nova::api' do
|
|||
:validation_options => { 'nova-api' => { 'command' => 'my-script' } }
|
||||
})
|
||||
end
|
||||
it { should contain_exec('execute nova-api validation').with(
|
||||
it { is_expected.to contain_exec('execute nova-api validation').with(
|
||||
:path => '/usr/bin:/bin:/usr/sbin:/sbin',
|
||||
:provider => 'shell',
|
||||
:tries => '10',
|
||||
|
@ -215,7 +215,7 @@ describe 'nova::api' do
|
|||
:command => 'my-script',
|
||||
)}
|
||||
|
||||
it { should contain_anchor('create nova-api anchor').with(
|
||||
it { is_expected.to contain_anchor('create nova-api anchor').with(
|
||||
:require => 'Exec[execute nova-api validation]',
|
||||
)}
|
||||
end
|
||||
|
@ -228,7 +228,7 @@ describe 'nova::api' do
|
|||
})
|
||||
end
|
||||
|
||||
it { should contain_service('nova-api').without_ensure }
|
||||
it { is_expected.to contain_service('nova-api').without_ensure }
|
||||
end
|
||||
|
||||
context 'with default database parameters' do
|
||||
|
@ -236,9 +236,9 @@ describe 'nova::api' do
|
|||
"include nova"
|
||||
end
|
||||
|
||||
it { should_not contain_nova_config('database/connection') }
|
||||
it { should_not contain_nova_config('database/slave_connection') }
|
||||
it { should_not contain_nova_config('database/idle_timeout').with_value('3600') }
|
||||
it { is_expected.to_not contain_nova_config('database/connection') }
|
||||
it { is_expected.to_not contain_nova_config('database/slave_connection') }
|
||||
it { is_expected.to_not contain_nova_config('database/idle_timeout').with_value('3600') }
|
||||
end
|
||||
|
||||
context 'with overridden database parameters' do
|
||||
|
@ -251,9 +251,9 @@ describe 'nova::api' do
|
|||
"
|
||||
end
|
||||
|
||||
it { should contain_nova_config('database/connection').with_value('mysql://user:pass@db/db').with_secret(true) }
|
||||
it { should contain_nova_config('database/slave_connection').with_value('mysql://user:pass@slave/db').with_secret(true) }
|
||||
it { should contain_nova_config('database/idle_timeout').with_value('30') }
|
||||
it { is_expected.to contain_nova_config('database/connection').with_value('mysql://user:pass@db/db').with_secret(true) }
|
||||
it { is_expected.to contain_nova_config('database/slave_connection').with_value('mysql://user:pass@slave/db').with_secret(true) }
|
||||
it { is_expected.to contain_nova_config('database/idle_timeout').with_value('30') }
|
||||
end
|
||||
|
||||
context 'with custom keystone identity_uri' do
|
||||
|
@ -263,12 +263,12 @@ describe 'nova::api' do
|
|||
})
|
||||
end
|
||||
it 'configures identity_uri' do
|
||||
should contain_nova_config('keystone_authtoken/identity_uri').with_value("https://foo.bar:1234/");
|
||||
# since only auth_uri is set the deprecated auth parameters should
|
||||
is_expected.to contain_nova_config('keystone_authtoken/identity_uri').with_value("https://foo.bar:1234/");
|
||||
# since only auth_uri is set the deprecated auth parameters is_expected.to
|
||||
# still get set in case they are still in use
|
||||
should contain_nova_config('keystone_authtoken/auth_host').with_value('127.0.0.1');
|
||||
should contain_nova_config('keystone_authtoken/auth_port').with_value('35357');
|
||||
should contain_nova_config('keystone_authtoken/auth_protocol').with_value('http');
|
||||
is_expected.to contain_nova_config('keystone_authtoken/auth_host').with_value('127.0.0.1');
|
||||
is_expected.to contain_nova_config('keystone_authtoken/auth_port').with_value('35357');
|
||||
is_expected.to contain_nova_config('keystone_authtoken/auth_protocol').with_value('http');
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -280,12 +280,12 @@ describe 'nova::api' do
|
|||
})
|
||||
end
|
||||
it 'configures identity_uri' do
|
||||
should contain_nova_config('keystone_authtoken/identity_uri').with_value("https://foo.bar:35357/");
|
||||
should contain_nova_config('keystone_authtoken/auth_uri').with_value("https://foo.bar:5000/v2.0/");
|
||||
should contain_nova_config('keystone_authtoken/auth_host').with_ensure('absent')
|
||||
should contain_nova_config('keystone_authtoken/auth_port').with_ensure('absent')
|
||||
should contain_nova_config('keystone_authtoken/auth_protocol').with_ensure('absent')
|
||||
should contain_nova_config('keystone_authtoken/auth_admin_prefix').with_ensure('absent')
|
||||
is_expected.to contain_nova_config('keystone_authtoken/identity_uri').with_value("https://foo.bar:35357/");
|
||||
is_expected.to contain_nova_config('keystone_authtoken/auth_uri').with_value("https://foo.bar:5000/v2.0/");
|
||||
is_expected.to contain_nova_config('keystone_authtoken/auth_host').with_ensure('absent')
|
||||
is_expected.to contain_nova_config('keystone_authtoken/auth_port').with_ensure('absent')
|
||||
is_expected.to contain_nova_config('keystone_authtoken/auth_protocol').with_ensure('absent')
|
||||
is_expected.to contain_nova_config('keystone_authtoken/auth_admin_prefix').with_ensure('absent')
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -55,10 +55,10 @@ describe 'nova::cells' do
|
|||
|
||||
shared_examples_for 'nova-cells' do
|
||||
|
||||
it { should contain_class('nova::params') }
|
||||
it { is_expected.to contain_class('nova::params') }
|
||||
|
||||
it 'installs nova-cells package' do
|
||||
should contain_package('nova-cells').with(
|
||||
is_expected.to contain_package('nova-cells').with(
|
||||
:ensure => 'present',
|
||||
:name => platform_params[:cells_package_name],
|
||||
:tag => ['openstack']
|
||||
|
@ -66,33 +66,33 @@ describe 'nova::cells' do
|
|||
end
|
||||
|
||||
it 'configures nova-cells service' do
|
||||
should contain_service('nova-cells').with(
|
||||
is_expected.to contain_service('nova-cells').with(
|
||||
:ensure => 'running',
|
||||
:name => platform_params[:cells_service_name]
|
||||
)
|
||||
end
|
||||
|
||||
it 'configures cell' do
|
||||
should contain_nova_config('cells/bandwidth_update_interval').with(:value => '600')
|
||||
should contain_nova_config('cells/call_timeout').with(:value => '60')
|
||||
should contain_nova_config('cells/capabilities').with(:value => 'hypervisor=xenserver;kvm,os=linux;windows')
|
||||
should contain_nova_config('cells/db_check_interval').with(:value => '60')
|
||||
should contain_nova_config('cells/driver').with(:value => 'nova.cells.rpc_driver.CellsRPCDriver')
|
||||
should contain_nova_config('cells/instance_updated_at_threshold').with(:value => '3600')
|
||||
should contain_nova_config('cells/instance_update_num_instances').with(:value => '1')
|
||||
should contain_nova_config('cells/manager').with(:value => 'nova.cells.manager.CellsManager')
|
||||
should contain_nova_config('cells/max_hop_count').with(:value => '10')
|
||||
should contain_nova_config('cells/mute_child_interval').with(:value => '300')
|
||||
should contain_nova_config('cells/mute_weight_multiplier').with(:value => '-10.0')
|
||||
should contain_nova_config('cells/mute_weight_value').with(:value => '1000.0')
|
||||
should contain_nova_config('cells/ram_weight_multiplier').with(:value => '10.0')
|
||||
should contain_nova_config('cells/reserve_percent').with(:value => '10.0')
|
||||
should contain_nova_config('cells/rpc_driver_queue_base').with(:value => 'cells.intercell')
|
||||
should contain_nova_config('cells/scheduler_filter_classes').with(:value => 'nova.cells.filters.all_filters')
|
||||
should contain_nova_config('cells/scheduler_retries').with(:value => '10')
|
||||
should contain_nova_config('cells/scheduler_retry_delay').with(:value => '2')
|
||||
should contain_nova_config('cells/scheduler_weight_classes').with(:value => 'nova.cells.weights.all_weighers')
|
||||
should contain_nova_config('cells/scheduler').with(:value => 'nova.cells.scheduler.CellsScheduler')
|
||||
is_expected.to contain_nova_config('cells/bandwidth_update_interval').with(:value => '600')
|
||||
is_expected.to contain_nova_config('cells/call_timeout').with(:value => '60')
|
||||
is_expected.to contain_nova_config('cells/capabilities').with(:value => 'hypervisor=xenserver;kvm,os=linux;windows')
|
||||
is_expected.to contain_nova_config('cells/db_check_interval').with(:value => '60')
|
||||
is_expected.to contain_nova_config('cells/driver').with(:value => 'nova.cells.rpc_driver.CellsRPCDriver')
|
||||
is_expected.to contain_nova_config('cells/instance_updated_at_threshold').with(:value => '3600')
|
||||
is_expected.to contain_nova_config('cells/instance_update_num_instances').with(:value => '1')
|
||||
is_expected.to contain_nova_config('cells/manager').with(:value => 'nova.cells.manager.CellsManager')
|
||||
is_expected.to contain_nova_config('cells/max_hop_count').with(:value => '10')
|
||||
is_expected.to contain_nova_config('cells/mute_child_interval').with(:value => '300')
|
||||
is_expected.to contain_nova_config('cells/mute_weight_multiplier').with(:value => '-10.0')
|
||||
is_expected.to contain_nova_config('cells/mute_weight_value').with(:value => '1000.0')
|
||||
is_expected.to contain_nova_config('cells/ram_weight_multiplier').with(:value => '10.0')
|
||||
is_expected.to contain_nova_config('cells/reserve_percent').with(:value => '10.0')
|
||||
is_expected.to contain_nova_config('cells/rpc_driver_queue_base').with(:value => 'cells.intercell')
|
||||
is_expected.to contain_nova_config('cells/scheduler_filter_classes').with(:value => 'nova.cells.filters.all_filters')
|
||||
is_expected.to contain_nova_config('cells/scheduler_retries').with(:value => '10')
|
||||
is_expected.to contain_nova_config('cells/scheduler_retry_delay').with(:value => '2')
|
||||
is_expected.to contain_nova_config('cells/scheduler_weight_classes').with(:value => 'nova.cells.weights.all_weighers')
|
||||
is_expected.to contain_nova_config('cells/scheduler').with(:value => 'nova.cells.scheduler.CellsScheduler')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -105,9 +105,9 @@ describe 'nova::cells' do
|
|||
let :expected_params do
|
||||
default_params.merge(params)
|
||||
end
|
||||
it { should contain_nova_config('cells/name').with_value(expected_params[:cell_name]) }
|
||||
it { should contain_nova_config('DEFAULT/compute_api_class').with_value('nova.compute.cells_api.ComputeCellsAPI')}
|
||||
it { should contain_nova_config('cells/cell_type').with_value('api')}
|
||||
it { is_expected.to contain_nova_config('cells/name').with_value(expected_params[:cell_name]) }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/compute_api_class').with_value('nova.compute.cells_api.ComputeCellsAPI')}
|
||||
it { is_expected.to contain_nova_config('cells/cell_type').with_value('api')}
|
||||
it_configures 'nova-cells'
|
||||
end
|
||||
|
||||
|
@ -121,7 +121,7 @@ describe 'nova::cells' do
|
|||
let :expected_params do
|
||||
default_params.merge(params)
|
||||
end
|
||||
it { should contain_service(platform_params[:cells_service_name]).without_ensure }
|
||||
it { is_expected.to contain_service(platform_params[:cells_service_name]).without_ensure }
|
||||
end
|
||||
|
||||
shared_examples_for 'a child cell' do
|
||||
|
@ -133,9 +133,9 @@ describe 'nova::cells' do
|
|||
let :expected_params do
|
||||
default_params.merge(params)
|
||||
end
|
||||
it { should contain_nova_config('cells/name').with_value(expected_params[:cell_name]) }
|
||||
it { should contain_nova_config('DEFAULT/quota_driver').with_value('nova.quota.NoopQuotaDriver')}
|
||||
it { should contain_nova_config('cells/cell_type').with_value('compute')}
|
||||
it { is_expected.to contain_nova_config('cells/name').with_value(expected_params[:cell_name]) }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/quota_driver').with_value('nova.quota.NoopQuotaDriver')}
|
||||
it { is_expected.to contain_nova_config('cells/cell_type').with_value('compute')}
|
||||
it_configures 'nova-cells'
|
||||
end
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ describe 'nova::client' do
|
|||
|
||||
context 'with default parameters' do
|
||||
it {
|
||||
should contain_package('python-novaclient').with(
|
||||
is_expected.to contain_package('python-novaclient').with(
|
||||
:ensure => 'present',
|
||||
:tag => ['openstack']
|
||||
)
|
||||
|
@ -15,6 +15,6 @@ describe 'nova::client' do
|
|||
let :params do
|
||||
{ :ensure => '2012.1-2' }
|
||||
end
|
||||
it { should contain_package('python-novaclient').with_ensure('2012.1-2') }
|
||||
it { is_expected.to contain_package('python-novaclient').with_ensure('2012.1-2') }
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2,12 +2,12 @@ require 'spec_helper'
|
|||
describe 'nova::compute::ironic' do
|
||||
|
||||
it 'configures ironic in nova.conf' do
|
||||
should contain_nova_config('ironic/admin_username').with_value('admin')
|
||||
should contain_nova_config('ironic/admin_password').with_value('ironic')
|
||||
should contain_nova_config('ironic/admin_url').with_value('http://127.0.0.1:35357/v2.0')
|
||||
should contain_nova_config('ironic/admin_tenant_name').with_value('services')
|
||||
should contain_nova_config('ironic/api_endpoint').with_value('http://127.0.0.1:6385/v1')
|
||||
should contain_nova_config('DEFAULT/compute_driver').with_value('nova.virt.ironic.IronicDriver')
|
||||
is_expected.to contain_nova_config('ironic/admin_username').with_value('admin')
|
||||
is_expected.to contain_nova_config('ironic/admin_password').with_value('ironic')
|
||||
is_expected.to contain_nova_config('ironic/admin_url').with_value('http://127.0.0.1:35357/v2.0')
|
||||
is_expected.to contain_nova_config('ironic/admin_tenant_name').with_value('services')
|
||||
is_expected.to contain_nova_config('ironic/api_endpoint').with_value('http://127.0.0.1:6385/v1')
|
||||
is_expected.to contain_nova_config('DEFAULT/compute_driver').with_value('nova.virt.ironic.IronicDriver')
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -12,20 +12,20 @@ describe 'nova::compute::libvirt' do
|
|||
|
||||
describe 'with default parameters' do
|
||||
|
||||
it { should contain_class('nova::params')}
|
||||
it { is_expected.to contain_class('nova::params')}
|
||||
|
||||
it { should contain_package('nova-compute-kvm').with(
|
||||
it { is_expected.to contain_package('nova-compute-kvm').with(
|
||||
:ensure => 'present',
|
||||
:before => 'Package[nova-compute]',
|
||||
:tag => ['openstack']
|
||||
) }
|
||||
|
||||
it { should contain_package('libvirt').with(
|
||||
it { is_expected.to contain_package('libvirt').with(
|
||||
:name => 'libvirt-bin',
|
||||
:ensure => 'present'
|
||||
) }
|
||||
|
||||
it { should contain_service('libvirt').with(
|
||||
it { is_expected.to contain_service('libvirt').with(
|
||||
:name => 'libvirt-bin',
|
||||
:enable => true,
|
||||
:ensure => 'running',
|
||||
|
@ -34,18 +34,18 @@ describe 'nova::compute::libvirt' do
|
|||
:before => 'Service[nova-compute]'
|
||||
)}
|
||||
|
||||
it { should contain_nova_config('DEFAULT/compute_driver').with_value('libvirt.LibvirtDriver')}
|
||||
it { should contain_nova_config('libvirt/virt_type').with_value('kvm')}
|
||||
it { should contain_nova_config('libvirt/cpu_mode').with_value('host-model')}
|
||||
it { should contain_nova_config('libvirt/disk_cachemodes').with_ensure('absent')}
|
||||
it { should contain_nova_config('libvirt/inject_password').with_value(false)}
|
||||
it { should contain_nova_config('libvirt/inject_key').with_value(false)}
|
||||
it { should contain_nova_config('libvirt/inject_partition').with_value(-2)}
|
||||
it { should contain_nova_config('DEFAULT/vncserver_listen').with_value('127.0.0.1')}
|
||||
it { should contain_nova_config('DEFAULT/remove_unused_base_images').with_ensure('absent')}
|
||||
it { should contain_nova_config('DEFAULT/remove_unused_original_minimum_age_seconds').with_ensure('absent')}
|
||||
it { should contain_nova_config('libvirt/remove_unused_kernels').with_ensure('absent')}
|
||||
it { should contain_nova_config('libvirt/remove_unused_resized_minimum_age_seconds').with_ensure('absent')}
|
||||
it { is_expected.to contain_nova_config('DEFAULT/compute_driver').with_value('libvirt.LibvirtDriver')}
|
||||
it { is_expected.to contain_nova_config('libvirt/virt_type').with_value('kvm')}
|
||||
it { is_expected.to contain_nova_config('libvirt/cpu_mode').with_value('host-model')}
|
||||
it { is_expected.to contain_nova_config('libvirt/disk_cachemodes').with_ensure('absent')}
|
||||
it { is_expected.to contain_nova_config('libvirt/inject_password').with_value(false)}
|
||||
it { is_expected.to contain_nova_config('libvirt/inject_key').with_value(false)}
|
||||
it { is_expected.to contain_nova_config('libvirt/inject_partition').with_value(-2)}
|
||||
it { is_expected.to contain_nova_config('DEFAULT/vncserver_listen').with_value('127.0.0.1')}
|
||||
it { is_expected.to contain_nova_config('DEFAULT/remove_unused_base_images').with_ensure('absent')}
|
||||
it { is_expected.to contain_nova_config('DEFAULT/remove_unused_original_minimum_age_seconds').with_ensure('absent')}
|
||||
it { is_expected.to contain_nova_config('libvirt/remove_unused_kernels').with_ensure('absent')}
|
||||
it { is_expected.to contain_nova_config('libvirt/remove_unused_resized_minimum_age_seconds').with_ensure('absent')}
|
||||
end
|
||||
|
||||
describe 'with params' do
|
||||
|
@ -62,15 +62,15 @@ describe 'nova::compute::libvirt' do
|
|||
}
|
||||
end
|
||||
|
||||
it { should contain_nova_config('libvirt/virt_type').with_value('qemu')}
|
||||
it { should contain_nova_config('libvirt/cpu_mode').with_value('host-passthrough')}
|
||||
it { should contain_nova_config('libvirt/disk_cachemodes').with_value('file=directsync,block=none')}
|
||||
it { should contain_nova_config('DEFAULT/vncserver_listen').with_value('0.0.0.0')}
|
||||
it { should contain_nova_config('DEFAULT/remove_unused_base_images').with_value(true)}
|
||||
it { should contain_nova_config('DEFAULT/remove_unused_original_minimum_age_seconds').with_value(3600)}
|
||||
it { should contain_nova_config('libvirt/remove_unused_kernels').with_value(true)}
|
||||
it { should contain_nova_config('libvirt/remove_unused_resized_minimum_age_seconds').with_value(3600)}
|
||||
it { should contain_service('libvirt').with(
|
||||
it { is_expected.to contain_nova_config('libvirt/virt_type').with_value('qemu')}
|
||||
it { is_expected.to contain_nova_config('libvirt/cpu_mode').with_value('host-passthrough')}
|
||||
it { is_expected.to contain_nova_config('libvirt/disk_cachemodes').with_value('file=directsync,block=none')}
|
||||
it { is_expected.to contain_nova_config('DEFAULT/vncserver_listen').with_value('0.0.0.0')}
|
||||
it { is_expected.to contain_nova_config('DEFAULT/remove_unused_base_images').with_value(true)}
|
||||
it { is_expected.to contain_nova_config('DEFAULT/remove_unused_original_minimum_age_seconds').with_value(3600)}
|
||||
it { is_expected.to contain_nova_config('libvirt/remove_unused_kernels').with_value(true)}
|
||||
it { is_expected.to contain_nova_config('libvirt/remove_unused_resized_minimum_age_seconds').with_value(3600)}
|
||||
it { is_expected.to contain_service('libvirt').with(
|
||||
:name => 'custom_service',
|
||||
:enable => true,
|
||||
:ensure => 'running',
|
||||
|
@ -87,9 +87,9 @@ describe 'nova::compute::libvirt' do
|
|||
:migration_support => true }
|
||||
end
|
||||
|
||||
it { should contain_class('nova::migration::libvirt')}
|
||||
it { should contain_nova_config('DEFAULT/vncserver_listen').with_value('0.0.0.0')}
|
||||
it { should contain_file_line('/etc/default/libvirt-bin libvirtd opts').with(:line => 'libvirtd_opts="-d -l"') }
|
||||
it { is_expected.to contain_class('nova::migration::libvirt')}
|
||||
it { is_expected.to contain_nova_config('DEFAULT/vncserver_listen').with_value('0.0.0.0')}
|
||||
it { is_expected.to contain_file_line('/etc/default/libvirt-bin libvirtd opts').with(:line => 'libvirtd_opts="-d -l"') }
|
||||
end
|
||||
|
||||
context 'with vncserver_listen set to ::0' do
|
||||
|
@ -109,7 +109,7 @@ describe 'nova::compute::libvirt' do
|
|||
:migration_support => true }
|
||||
end
|
||||
|
||||
it { expect { should contain_class('nova::compute::libvirt') }.to \
|
||||
it { expect { is_expected.to contain_class('nova::compute::libvirt') }.to \
|
||||
raise_error(Puppet::Error, /For migration support to work, you MUST set vncserver_listen to '0.0.0.0' or '::0'/) }
|
||||
end
|
||||
|
||||
|
@ -119,7 +119,7 @@ describe 'nova::compute::libvirt' do
|
|||
:vncserver_listen => '0.0.0.0',
|
||||
:migration_support => true }
|
||||
end
|
||||
it { should contain_file_line('/etc/default/libvirtd libvirtd opts').with(:line => 'libvirtd_opts="-d -l"') }
|
||||
it { is_expected.to contain_file_line('/etc/default/libvirtd libvirtd opts').with(:line => 'libvirtd_opts="-d -l"') }
|
||||
|
||||
end
|
||||
end
|
||||
|
@ -134,14 +134,14 @@ describe 'nova::compute::libvirt' do
|
|||
|
||||
describe 'with default parameters' do
|
||||
|
||||
it { should contain_class('nova::params')}
|
||||
it { is_expected.to contain_class('nova::params')}
|
||||
|
||||
it { should contain_package('libvirt').with(
|
||||
it { is_expected.to contain_package('libvirt').with(
|
||||
:name => 'libvirt',
|
||||
:ensure => 'present'
|
||||
) }
|
||||
|
||||
it { should contain_service('libvirt').with(
|
||||
it { is_expected.to contain_service('libvirt').with(
|
||||
:name => 'libvirtd',
|
||||
:enable => true,
|
||||
:ensure => 'running',
|
||||
|
@ -149,7 +149,7 @@ describe 'nova::compute::libvirt' do
|
|||
:require => 'Package[libvirt]',
|
||||
:before => 'Service[nova-compute]'
|
||||
)}
|
||||
it { should contain_service('messagebus').with(
|
||||
it { is_expected.to contain_service('messagebus').with(
|
||||
:ensure => 'running',
|
||||
:enable => true,
|
||||
:before => 'Service[libvirt]',
|
||||
|
@ -161,25 +161,25 @@ describe 'nova::compute::libvirt' do
|
|||
super().merge(:operatingsystemrelease => 7.0)
|
||||
end
|
||||
|
||||
it { should contain_service('libvirt').with(
|
||||
it { is_expected.to contain_service('libvirt').with(
|
||||
:provider => nil
|
||||
)}
|
||||
|
||||
it { should contain_service('messagebus').with(
|
||||
it { is_expected.to contain_service('messagebus').with(
|
||||
:provider => nil
|
||||
)}
|
||||
end
|
||||
|
||||
it { should contain_nova_config('DEFAULT/compute_driver').with_value('libvirt.LibvirtDriver')}
|
||||
it { should contain_nova_config('libvirt/virt_type').with_value('kvm')}
|
||||
it { should contain_nova_config('libvirt/inject_password').with_value(false)}
|
||||
it { should contain_nova_config('libvirt/inject_key').with_value(false)}
|
||||
it { should contain_nova_config('libvirt/inject_partition').with_value(-2)}
|
||||
it { should contain_nova_config('DEFAULT/vncserver_listen').with_value('127.0.0.1')}
|
||||
it { should contain_nova_config('DEFAULT/remove_unused_base_images').with_ensure('absent')}
|
||||
it { should contain_nova_config('DEFAULT/remove_unused_original_minimum_age_seconds').with_ensure('absent')}
|
||||
it { should contain_nova_config('libvirt/remove_unused_kernels').with_ensure('absent')}
|
||||
it { should contain_nova_config('libvirt/remove_unused_resized_minimum_age_seconds').with_ensure('absent')}
|
||||
it { is_expected.to contain_nova_config('DEFAULT/compute_driver').with_value('libvirt.LibvirtDriver')}
|
||||
it { is_expected.to contain_nova_config('libvirt/virt_type').with_value('kvm')}
|
||||
it { is_expected.to contain_nova_config('libvirt/inject_password').with_value(false)}
|
||||
it { is_expected.to contain_nova_config('libvirt/inject_key').with_value(false)}
|
||||
it { is_expected.to contain_nova_config('libvirt/inject_partition').with_value(-2)}
|
||||
it { is_expected.to contain_nova_config('DEFAULT/vncserver_listen').with_value('127.0.0.1')}
|
||||
it { is_expected.to contain_nova_config('DEFAULT/remove_unused_base_images').with_ensure('absent')}
|
||||
it { is_expected.to contain_nova_config('DEFAULT/remove_unused_original_minimum_age_seconds').with_ensure('absent')}
|
||||
it { is_expected.to contain_nova_config('libvirt/remove_unused_kernels').with_ensure('absent')}
|
||||
it { is_expected.to contain_nova_config('libvirt/remove_unused_resized_minimum_age_seconds').with_ensure('absent')}
|
||||
end
|
||||
|
||||
describe 'with params' do
|
||||
|
@ -193,12 +193,12 @@ describe 'nova::compute::libvirt' do
|
|||
}
|
||||
end
|
||||
|
||||
it { should contain_nova_config('libvirt/virt_type').with_value('qemu')}
|
||||
it { should contain_nova_config('DEFAULT/vncserver_listen').with_value('0.0.0.0')}
|
||||
it { should contain_nova_config('DEFAULT/remove_unused_base_images').with_value(true)}
|
||||
it { should contain_nova_config('DEFAULT/remove_unused_original_minimum_age_seconds').with_value(3600)}
|
||||
it { should contain_nova_config('libvirt/remove_unused_kernels').with_value(true)}
|
||||
it { should contain_nova_config('libvirt/remove_unused_resized_minimum_age_seconds').with_value(3600)}
|
||||
it { is_expected.to contain_nova_config('libvirt/virt_type').with_value('qemu')}
|
||||
it { is_expected.to contain_nova_config('DEFAULT/vncserver_listen').with_value('0.0.0.0')}
|
||||
it { is_expected.to contain_nova_config('DEFAULT/remove_unused_base_images').with_value(true)}
|
||||
it { is_expected.to contain_nova_config('DEFAULT/remove_unused_original_minimum_age_seconds').with_value(3600)}
|
||||
it { is_expected.to contain_nova_config('libvirt/remove_unused_kernels').with_value(true)}
|
||||
it { is_expected.to contain_nova_config('libvirt/remove_unused_resized_minimum_age_seconds').with_value(3600)}
|
||||
end
|
||||
|
||||
describe 'with migration_support enabled' do
|
||||
|
@ -209,8 +209,8 @@ describe 'nova::compute::libvirt' do
|
|||
:migration_support => true }
|
||||
end
|
||||
|
||||
it { should contain_class('nova::migration::libvirt')}
|
||||
it { should contain_nova_config('DEFAULT/vncserver_listen').with_value('0.0.0.0')}
|
||||
it { is_expected.to contain_class('nova::migration::libvirt')}
|
||||
it { is_expected.to contain_nova_config('DEFAULT/vncserver_listen').with_value('0.0.0.0')}
|
||||
end
|
||||
|
||||
context 'with vncserver_listen not set to 0.0.0.0' do
|
||||
|
@ -219,7 +219,7 @@ describe 'nova::compute::libvirt' do
|
|||
:migration_support => true }
|
||||
end
|
||||
|
||||
it { expect { should contain_class('nova::compute::libvirt') }.to \
|
||||
it { expect { is_expected.to contain_class('nova::compute::libvirt') }.to \
|
||||
raise_error(Puppet::Error, /For migration support to work, you MUST set vncserver_listen to '0.0.0.0'/) }
|
||||
end
|
||||
end
|
||||
|
@ -229,14 +229,14 @@ describe 'nova::compute::libvirt' do
|
|||
{ :operatingsystem => 'Fedora', :osfamily => 'RedHat' }
|
||||
end
|
||||
|
||||
it { should contain_class('nova::params')}
|
||||
it { is_expected.to contain_class('nova::params')}
|
||||
|
||||
it { should contain_package('libvirt').with(
|
||||
it { is_expected.to contain_package('libvirt').with(
|
||||
:name => 'libvirt',
|
||||
:ensure => 'present'
|
||||
) }
|
||||
|
||||
it { should contain_service('libvirt').with(
|
||||
it { is_expected.to contain_service('libvirt').with(
|
||||
:name => 'libvirtd',
|
||||
:enable => true,
|
||||
:ensure => 'running',
|
||||
|
@ -245,9 +245,9 @@ describe 'nova::compute::libvirt' do
|
|||
:before => 'Service[nova-compute]'
|
||||
)}
|
||||
|
||||
it { should contain_nova_config('DEFAULT/compute_driver').with_value('libvirt.LibvirtDriver')}
|
||||
it { should contain_nova_config('libvirt/virt_type').with_value('kvm')}
|
||||
it { should contain_nova_config('DEFAULT/vncserver_listen').with_value('127.0.0.1')}
|
||||
it { is_expected.to contain_nova_config('DEFAULT/compute_driver').with_value('libvirt.LibvirtDriver')}
|
||||
it { is_expected.to contain_nova_config('libvirt/virt_type').with_value('kvm')}
|
||||
it { is_expected.to contain_nova_config('DEFAULT/vncserver_listen').with_value('127.0.0.1')}
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -2,32 +2,31 @@ require 'spec_helper'
|
|||
describe 'nova::compute::neutron' do
|
||||
|
||||
context 'with default parameters' do
|
||||
it { should contain_nova_config('libvirt/vif_driver').with_value('nova.virt.libvirt.vif.LibvirtGenericVIFDriver')}
|
||||
it { should contain_nova_config('DEFAULT/force_snat_range').with(:value => '0.0.0.0/0') }
|
||||
it { is_expected.to contain_nova_config('libvirt/vif_driver').with_value('nova.virt.libvirt.vif.LibvirtGenericVIFDriver')}
|
||||
it { is_expected.to contain_nova_config('DEFAULT/force_snat_range').with(:value => '0.0.0.0/0') }
|
||||
end
|
||||
|
||||
context 'when overriding params' do
|
||||
let :params do
|
||||
{:libvirt_vif_driver => 'foo' }
|
||||
end
|
||||
it { should contain_nova_config('libvirt/vif_driver').with_value('foo')}
|
||||
it { should contain_nova_config('DEFAULT/force_snat_range').with_ensure(:absent) }
|
||||
it { is_expected.to contain_nova_config('libvirt/vif_driver').with_value('foo')}
|
||||
it { is_expected.to contain_nova_config('DEFAULT/force_snat_range').with_ensure(:absent) }
|
||||
end
|
||||
|
||||
context 'when overriding with a removed libvirt_vif_driver param' do
|
||||
let :params do
|
||||
{:libvirt_vif_driver => 'nova.virt.libvirt.vif.LibvirtOpenVswitchDriver' }
|
||||
end
|
||||
it 'should fails to configure libvirt_vif_driver with old OVS driver' do
|
||||
expect { subject }.to raise_error(Puppet::Error, /nova.virt.libvirt.vif.LibvirtOpenVswitchDriver as vif_driver is removed from Icehouse/)
|
||||
end
|
||||
|
||||
it_raises 'a Puppet::Error', /nova.virt.libvirt.vif.LibvirtOpenVswitchDriver as vif_driver is removed from Icehouse/
|
||||
end
|
||||
|
||||
context 'with force_snat_range parameter set to false' do
|
||||
let :params do
|
||||
{ :force_snat_range => false, }
|
||||
end
|
||||
it { should contain_nova_config('DEFAULT/force_snat_range').with_ensure('absent') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/force_snat_range').with_ensure('absent') }
|
||||
end
|
||||
|
||||
context 'with force_snat_range parameter set to 10.0.0.0/24' do
|
||||
|
@ -35,7 +34,7 @@ describe 'nova::compute::neutron' do
|
|||
{ :force_snat_range => '10.0.0.0/24', }
|
||||
end
|
||||
|
||||
it { should contain_nova_config('DEFAULT/force_snat_range').with_value('10.0.0.0/24') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/force_snat_range').with_value('10.0.0.0/24') }
|
||||
end
|
||||
|
||||
context 'with force_snat_range parameter set to fe80::/64' do
|
||||
|
@ -43,7 +42,7 @@ describe 'nova::compute::neutron' do
|
|||
{ :force_snat_range => 'fe80::/64', }
|
||||
end
|
||||
|
||||
it { should contain_nova_config('DEFAULT/force_snat_range').with_value('fe80::/64') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/force_snat_range').with_value('fe80::/64') }
|
||||
end
|
||||
|
||||
context 'with force_snat_range parameter set ip without mask' do
|
||||
|
@ -51,8 +50,7 @@ describe 'nova::compute::neutron' do
|
|||
{ :force_snat_range => '10.0.0.0', }
|
||||
end
|
||||
|
||||
it { expect { should contain_nova_config('DEFAULT/force_snat_range') }.to \
|
||||
raise_error(Puppet::Error, /force_snat_range should be IPv4 or IPv6/) }
|
||||
it_raises 'a Puppet::Error', /force_snat_range should be IPv4 or IPv6 CIDR notation/
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -31,13 +31,13 @@ describe 'nova::compute::rbd' do
|
|||
|
||||
shared_examples_for 'nova compute rbd' do
|
||||
|
||||
it { should contain_class('nova::params') }
|
||||
it { is_expected.to contain_class('nova::params') }
|
||||
|
||||
it 'configure nova.conf with default parameters' do
|
||||
should contain_nova_config('libvirt/images_type').with_value('rbd')
|
||||
should contain_nova_config('libvirt/images_rbd_pool').with_value('rbd')
|
||||
should contain_nova_config('libvirt/images_rbd_ceph_conf').with_value('/etc/ceph/ceph.conf')
|
||||
should contain_nova_config('libvirt/rbd_user').with_value('nova')
|
||||
is_expected.to contain_nova_config('libvirt/images_type').with_value('rbd')
|
||||
is_expected.to contain_nova_config('libvirt/images_rbd_pool').with_value('rbd')
|
||||
is_expected.to contain_nova_config('libvirt/images_rbd_ceph_conf').with_value('/etc/ceph/ceph.conf')
|
||||
is_expected.to contain_nova_config('libvirt/rbd_user').with_value('nova')
|
||||
end
|
||||
|
||||
context 'when overriding default parameters' do
|
||||
|
@ -51,10 +51,10 @@ describe 'nova::compute::rbd' do
|
|||
end
|
||||
|
||||
it 'configure nova.conf with overridden parameters' do
|
||||
should contain_nova_config('libvirt/images_type').with_value('rbd')
|
||||
should contain_nova_config('libvirt/images_rbd_pool').with_value('AnotherPool')
|
||||
should contain_nova_config('libvirt/images_rbd_ceph_conf').with_value('/tmp/ceph.conf')
|
||||
should contain_nova_config('libvirt/rbd_user').with_value('joe')
|
||||
is_expected.to contain_nova_config('libvirt/images_type').with_value('rbd')
|
||||
is_expected.to contain_nova_config('libvirt/images_rbd_pool').with_value('AnotherPool')
|
||||
is_expected.to contain_nova_config('libvirt/images_rbd_ceph_conf').with_value('/tmp/ceph.conf')
|
||||
is_expected.to contain_nova_config('libvirt/rbd_user').with_value('joe')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -67,11 +67,11 @@ describe 'nova::compute::rbd' do
|
|||
end
|
||||
|
||||
it 'configure nova.conf with RBD secret UUID' do
|
||||
should contain_nova_config('libvirt/rbd_secret_uuid').with_value('UUID')
|
||||
is_expected.to contain_nova_config('libvirt/rbd_secret_uuid').with_value('UUID')
|
||||
end
|
||||
|
||||
it 'configure ceph on compute nodes' do
|
||||
verify_contents(subject, '/etc/nova/secret.xml', [
|
||||
verify_contents(catalogue, '/etc/nova/secret.xml', [
|
||||
"<secret ephemeral=\'no\' private=\'no\'>",
|
||||
" <usage type=\'ceph\'>",
|
||||
" <name>client.rbd_test secret</name>",
|
||||
|
@ -79,12 +79,12 @@ describe 'nova::compute::rbd' do
|
|||
" <uuid>UUID</uuid>",
|
||||
"</secret>"
|
||||
])
|
||||
should contain_exec('get-or-set virsh secret').with(
|
||||
is_expected.to contain_exec('get-or-set virsh secret').with(
|
||||
:command => '/usr/bin/virsh secret-define --file /etc/nova/secret.xml | /usr/bin/awk \'{print $2}\' | sed \'/^$/d\' > /etc/nova/virsh.secret',
|
||||
:creates => '/etc/nova/virsh.secret',
|
||||
:require => 'File[/etc/nova/secret.xml]'
|
||||
)
|
||||
should contain_exec('set-secret-value virsh').with(
|
||||
is_expected.to contain_exec('set-secret-value virsh').with(
|
||||
:command => "/usr/bin/virsh secret-set-value --secret $(cat /etc/nova/virsh.secret) --base64 $(ceph auth get-key client.rbd_test)"
|
||||
)
|
||||
end
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
require 'spec_helper'
|
||||
describe '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/listen').with_value('127.0.0.1')}
|
||||
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') }
|
||||
it { is_expected.to contain_nova_config('serial_console/port_range').with_value('10000:20000')}
|
||||
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/listen').with_value('127.0.0.1')}
|
||||
it { is_expected.to contain_nova_config('serial_console/proxyclient_address').with_value('127.0.0.1')}
|
||||
|
||||
context 'when overriding params' do
|
||||
let :params do
|
||||
|
@ -14,8 +14,8 @@ describe 'nova::compute::serial' do
|
|||
:listen => '10.10.11.11',
|
||||
}
|
||||
end
|
||||
it { should contain_nova_config('serial_console/proxyclient_address').with_value('10.10.10.10')}
|
||||
it { should contain_nova_config('serial_console/listen').with_value('10.10.11.11')}
|
||||
it { is_expected.to contain_nova_config('serial_console/proxyclient_address').with_value('10.10.10.10')}
|
||||
it { is_expected.to contain_nova_config('serial_console/listen').with_value('10.10.11.11')}
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -11,38 +11,38 @@ describe 'nova::compute' do
|
|||
context 'with default parameters' do
|
||||
|
||||
it 'installs nova-compute package and service' do
|
||||
should contain_service('nova-compute').with({
|
||||
is_expected.to contain_service('nova-compute').with({
|
||||
:name => platform_params[:nova_compute_service],
|
||||
:ensure => 'stopped',
|
||||
:hasstatus => true,
|
||||
:enable => false
|
||||
})
|
||||
should contain_package('nova-compute').with({
|
||||
is_expected.to contain_package('nova-compute').with({
|
||||
:name => platform_params[:nova_compute_package],
|
||||
:tag => ['openstack']
|
||||
})
|
||||
end
|
||||
|
||||
it { should contain_nova_config('DEFAULT/network_device_mtu').with(:ensure => 'absent') }
|
||||
it { should_not contain_nova_config('DEFAULT/novncproxy_base_url') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/network_device_mtu').with(:ensure => 'absent') }
|
||||
it { is_expected.to_not contain_nova_config('DEFAULT/novncproxy_base_url') }
|
||||
|
||||
it { should_not contain_package('bridge-utils').with(
|
||||
it { is_expected.to_not contain_package('bridge-utils').with(
|
||||
:ensure => 'present',
|
||||
:before => 'Nova::Generic_service[compute]'
|
||||
) }
|
||||
|
||||
it { should contain_package('pm-utils').with(
|
||||
it { is_expected.to contain_package('pm-utils').with(
|
||||
:ensure => 'present'
|
||||
) }
|
||||
|
||||
it { should contain_nova_config('DEFAULT/force_raw_images').with(:value => true) }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/force_raw_images').with(:value => true) }
|
||||
|
||||
it 'configures availability zones' do
|
||||
should contain_nova_config('DEFAULT/default_availability_zone').with_value('nova')
|
||||
should contain_nova_config('DEFAULT/internal_service_availability_zone').with_value('internal')
|
||||
is_expected.to contain_nova_config('DEFAULT/default_availability_zone').with_value('nova')
|
||||
is_expected.to contain_nova_config('DEFAULT/internal_service_availability_zone').with_value('internal')
|
||||
end
|
||||
|
||||
it { should contain_nova_config('DEFAULT/heal_instance_info_cache_interval').with_value('60') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/heal_instance_info_cache_interval').with_value('60') }
|
||||
end
|
||||
|
||||
context 'with overridden parameters' do
|
||||
|
@ -63,13 +63,13 @@ describe 'nova::compute' do
|
|||
end
|
||||
|
||||
it 'installs nova-compute package and service' do
|
||||
should contain_service('nova-compute').with({
|
||||
is_expected.to contain_service('nova-compute').with({
|
||||
:name => platform_params[:nova_compute_service],
|
||||
:ensure => 'running',
|
||||
:hasstatus => true,
|
||||
:enable => true
|
||||
})
|
||||
should contain_package('nova-compute').with({
|
||||
is_expected.to contain_package('nova-compute').with({
|
||||
:name => platform_params[:nova_compute_package],
|
||||
:ensure => '2012.1-2',
|
||||
:tag => ['openstack']
|
||||
|
@ -77,34 +77,34 @@ describe 'nova::compute' do
|
|||
end
|
||||
|
||||
it 'configures ironic in nova.conf' do
|
||||
should contain_nova_config('DEFAULT/reserved_host_memory_mb').with_value('0')
|
||||
should contain_nova_config('DEFAULT/compute_manager').with_value('ironic.nova.compute.manager.ClusteredComputeManager')
|
||||
is_expected.to contain_nova_config('DEFAULT/reserved_host_memory_mb').with_value('0')
|
||||
is_expected.to contain_nova_config('DEFAULT/compute_manager').with_value('ironic.nova.compute.manager.ClusteredComputeManager')
|
||||
end
|
||||
|
||||
it 'configures network_device_mtu' do
|
||||
should contain_nova_config('DEFAULT/network_device_mtu').with_value('9999')
|
||||
is_expected.to contain_nova_config('DEFAULT/network_device_mtu').with_value('9999')
|
||||
end
|
||||
|
||||
it 'configures vnc in nova.conf' do
|
||||
should contain_nova_config('DEFAULT/vnc_enabled').with_value(true)
|
||||
should contain_nova_config('DEFAULT/vncserver_proxyclient_address').with_value('127.0.0.1')
|
||||
should contain_nova_config('DEFAULT/novncproxy_base_url').with_value(
|
||||
is_expected.to contain_nova_config('DEFAULT/vnc_enabled').with_value(true)
|
||||
is_expected.to contain_nova_config('DEFAULT/vncserver_proxyclient_address').with_value('127.0.0.1')
|
||||
is_expected.to contain_nova_config('DEFAULT/novncproxy_base_url').with_value(
|
||||
'http://127.0.0.1:6080/vnc_auto.html'
|
||||
)
|
||||
end
|
||||
|
||||
it 'configures availability zones' do
|
||||
should contain_nova_config('DEFAULT/default_availability_zone').with_value('az1')
|
||||
should contain_nova_config('DEFAULT/default_schedule_zone').with_value('az2')
|
||||
should contain_nova_config('DEFAULT/internal_service_availability_zone').with_value('az_int1')
|
||||
is_expected.to contain_nova_config('DEFAULT/default_availability_zone').with_value('az1')
|
||||
is_expected.to contain_nova_config('DEFAULT/default_schedule_zone').with_value('az2')
|
||||
is_expected.to contain_nova_config('DEFAULT/internal_service_availability_zone').with_value('az_int1')
|
||||
end
|
||||
|
||||
it { should contain_nova_config('DEFAULT/heal_instance_info_cache_interval').with_value('120') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/heal_instance_info_cache_interval').with_value('120') }
|
||||
|
||||
it { should contain_nova_config('DEFAULT/force_raw_images').with(:value => false) }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/force_raw_images').with(:value => false) }
|
||||
|
||||
it 'configures nova pci_passthrough_whitelist entries' do
|
||||
should contain_nova_config('DEFAULT/pci_passthrough_whitelist').with(
|
||||
is_expected.to contain_nova_config('DEFAULT/pci_passthrough_whitelist').with(
|
||||
'value' => "[{\"vendor_id\":\"8086\",\"product_id\":\"0126\"},{\"vendor_id\":\"9096\",\"product_id\":\"1520\",\"physical_network\":\"physnet1\"}]"
|
||||
)
|
||||
end
|
||||
|
@ -116,7 +116,7 @@ describe 'nova::compute' do
|
|||
end
|
||||
|
||||
it 'installs bridge-utils package for nova-network' do
|
||||
should contain_package('bridge-utils').with(
|
||||
is_expected.to contain_package('bridge-utils').with(
|
||||
:ensure => 'present',
|
||||
:before => 'Nova::Generic_service[compute]'
|
||||
)
|
||||
|
@ -129,9 +129,9 @@ describe 'nova::compute' do
|
|||
end
|
||||
|
||||
it 'disables vnc in nova.conf' do
|
||||
should contain_nova_config('DEFAULT/vnc_enabled').with_value(false)
|
||||
should contain_nova_config('DEFAULT/vncserver_proxyclient_address').with_value('127.0.0.1')
|
||||
should_not contain_nova_config('DEFAULT/novncproxy_base_url')
|
||||
is_expected.to contain_nova_config('DEFAULT/vnc_enabled').with_value(false)
|
||||
is_expected.to contain_nova_config('DEFAULT/vncserver_proxyclient_address').with_value('127.0.0.1')
|
||||
is_expected.to_not contain_nova_config('DEFAULT/novncproxy_base_url')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -140,7 +140,7 @@ describe 'nova::compute' do
|
|||
{ :force_config_drive => true }
|
||||
end
|
||||
|
||||
it { should contain_nova_config('DEFAULT/force_config_drive').with_value(true) }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/force_config_drive').with_value(true) }
|
||||
end
|
||||
|
||||
context 'while not managing service state' do
|
||||
|
@ -150,7 +150,7 @@ describe 'nova::compute' do
|
|||
}
|
||||
end
|
||||
|
||||
it { should contain_service('nova-compute').without_ensure }
|
||||
it { is_expected.to contain_service('nova-compute').without_ensure }
|
||||
end
|
||||
|
||||
context 'with instance_usage_audit parameter set to false' do
|
||||
|
@ -158,8 +158,8 @@ describe 'nova::compute' do
|
|||
{ :instance_usage_audit => false, }
|
||||
end
|
||||
|
||||
it { should contain_nova_config('DEFAULT/instance_usage_audit').with_ensure('absent') }
|
||||
it { should contain_nova_config('DEFAULT/instance_usage_audit_period').with_ensure('absent') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/instance_usage_audit').with_ensure('absent') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/instance_usage_audit_period').with_ensure('absent') }
|
||||
end
|
||||
|
||||
context 'with instance_usage_audit parameter and wrong period' do
|
||||
|
@ -168,8 +168,8 @@ describe 'nova::compute' do
|
|||
:instance_usage_audit_period => 'fake', }
|
||||
end
|
||||
|
||||
it { should contain_nova_config('DEFAULT/instance_usage_audit').with_ensure('absent') }
|
||||
it { should contain_nova_config('DEFAULT/instance_usage_audit_period').with_ensure('absent') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/instance_usage_audit').with_ensure('absent') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/instance_usage_audit_period').with_ensure('absent') }
|
||||
end
|
||||
|
||||
context 'with instance_usage_audit parameter and period' do
|
||||
|
@ -178,15 +178,15 @@ describe 'nova::compute' do
|
|||
:instance_usage_audit_period => 'year', }
|
||||
end
|
||||
|
||||
it { should contain_nova_config('DEFAULT/instance_usage_audit').with_value(true) }
|
||||
it { should contain_nova_config('DEFAULT/instance_usage_audit_period').with_value('year') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/instance_usage_audit').with_value(true) }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/instance_usage_audit_period').with_value('year') }
|
||||
end
|
||||
context 'with vnc_keymap set to fr' do
|
||||
let :params do
|
||||
{ :vnc_keymap => 'fr', }
|
||||
end
|
||||
|
||||
it { should contain_nova_config('DEFAULT/vnc_keymap').with_value('fr') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/vnc_keymap').with_value('fr') }
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
require 'spec_helper'
|
||||
describe 'nova::compute::spice' do
|
||||
|
||||
it { should contain_nova_config('spice/enabled').with_value('true')}
|
||||
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/enabled').with_value('true')}
|
||||
it { is_expected.to contain_nova_config('spice/agent_enabled').with_value('true')}
|
||||
it { is_expected.to contain_nova_config('spice/server_proxyclient_address').with_value('127.0.0.1')}
|
||||
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
|
||||
|
@ -15,9 +15,9 @@ describe 'nova::compute::spice' do
|
|||
: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')}
|
||||
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
|
||||
|
|
|
@ -18,20 +18,20 @@ describe 'nova::compute::vmware' do
|
|||
end
|
||||
|
||||
it 'configures vmwareapi in nova.conf' do
|
||||
should contain_nova_config('DEFAULT/compute_driver').with_value('vmwareapi.VMwareVCDriver')
|
||||
should contain_nova_config('VMWARE/host_ip').with_value(params[:host_ip])
|
||||
should contain_nova_config('VMWARE/host_username').with_value(params[:host_username])
|
||||
should contain_nova_config('VMWARE/host_password').with_value(params[:host_password])
|
||||
should contain_nova_config('VMWARE/cluster_name').with_value(params[:cluster_name])
|
||||
should contain_nova_config('VMWARE/api_retry_count').with_value(5)
|
||||
should contain_nova_config('VMWARE/maximum_objects').with_value(100)
|
||||
should contain_nova_config('VMWARE/task_poll_interval').with_value(5.0)
|
||||
should contain_nova_config('VMWARE/use_linked_clone').with_value(true)
|
||||
should_not contain_nova_config('VMWARE/wsdl_location')
|
||||
is_expected.to contain_nova_config('DEFAULT/compute_driver').with_value('vmwareapi.VMwareVCDriver')
|
||||
is_expected.to contain_nova_config('VMWARE/host_ip').with_value(params[:host_ip])
|
||||
is_expected.to contain_nova_config('VMWARE/host_username').with_value(params[:host_username])
|
||||
is_expected.to contain_nova_config('VMWARE/host_password').with_value(params[:host_password])
|
||||
is_expected.to contain_nova_config('VMWARE/cluster_name').with_value(params[:cluster_name])
|
||||
is_expected.to contain_nova_config('VMWARE/api_retry_count').with_value(5)
|
||||
is_expected.to contain_nova_config('VMWARE/maximum_objects').with_value(100)
|
||||
is_expected.to contain_nova_config('VMWARE/task_poll_interval').with_value(5.0)
|
||||
is_expected.to contain_nova_config('VMWARE/use_linked_clone').with_value(true)
|
||||
is_expected.to_not contain_nova_config('VMWARE/wsdl_location')
|
||||
end
|
||||
|
||||
it 'installs suds python package' do
|
||||
should contain_package('python-suds').with(
|
||||
is_expected.to contain_package('python-suds').with(
|
||||
:ensure => 'present'
|
||||
)
|
||||
end
|
||||
|
@ -42,11 +42,11 @@ describe 'nova::compute::vmware' do
|
|||
end
|
||||
|
||||
it 'configures vmwareapi in nova.conf' do
|
||||
should contain_nova_config('VMWARE/api_retry_count').with_value(params[:api_retry_count])
|
||||
should contain_nova_config('VMWARE/maximum_objects').with_value(params[:maximum_objects])
|
||||
should contain_nova_config('VMWARE/task_poll_interval').with_value(params[:task_poll_interval])
|
||||
should contain_nova_config('VMWARE/use_linked_clone').with_value(false)
|
||||
should contain_nova_config('VMWARE/wsdl_location').with_value(params[:wsdl_location])
|
||||
is_expected.to contain_nova_config('VMWARE/api_retry_count').with_value(params[:api_retry_count])
|
||||
is_expected.to contain_nova_config('VMWARE/maximum_objects').with_value(params[:maximum_objects])
|
||||
is_expected.to contain_nova_config('VMWARE/task_poll_interval').with_value(params[:task_poll_interval])
|
||||
is_expected.to contain_nova_config('VMWARE/use_linked_clone').with_value(false)
|
||||
is_expected.to contain_nova_config('VMWARE/wsdl_location').with_value(params[:wsdl_location])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -11,16 +11,16 @@ describe '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('DEFAULT/connection_type').with_value('xenapi')
|
||||
should contain_nova_config('DEFAULT/xenapi_connection_url').with_value(params[:xenapi_connection_url])
|
||||
should contain_nova_config('DEFAULT/xenapi_connection_username').with_value(params[:xenapi_connection_username])
|
||||
should contain_nova_config('DEFAULT/xenapi_connection_password').with_value(params[:xenapi_connection_password])
|
||||
should contain_nova_config('DEFAULT/xenapi_inject_image').with_value(false)
|
||||
is_expected.to contain_nova_config('DEFAULT/compute_driver').with_value('xenapi.XenAPIDriver')
|
||||
is_expected.to contain_nova_config('DEFAULT/connection_type').with_value('xenapi')
|
||||
is_expected.to contain_nova_config('DEFAULT/xenapi_connection_url').with_value(params[:xenapi_connection_url])
|
||||
is_expected.to contain_nova_config('DEFAULT/xenapi_connection_username').with_value(params[:xenapi_connection_username])
|
||||
is_expected.to contain_nova_config('DEFAULT/xenapi_connection_password').with_value(params[:xenapi_connection_password])
|
||||
is_expected.to contain_nova_config('DEFAULT/xenapi_inject_image').with_value(false)
|
||||
end
|
||||
|
||||
it 'installs xenapi with pip' do
|
||||
should contain_package('xenapi').with(
|
||||
is_expected.to contain_package('xenapi').with(
|
||||
:ensure => 'present',
|
||||
:provider => 'pip'
|
||||
)
|
||||
|
|
|
@ -13,12 +13,12 @@ describe 'nova::conductor' do
|
|||
shared_examples 'nova-conductor' do
|
||||
|
||||
|
||||
it { should contain_package('nova-conductor').with(
|
||||
it { is_expected.to contain_package('nova-conductor').with(
|
||||
:name => platform_params[:conductor_package_name],
|
||||
:ensure => 'present'
|
||||
) }
|
||||
|
||||
it { should contain_service('nova-conductor').with(
|
||||
it { is_expected.to contain_service('nova-conductor').with(
|
||||
:name => platform_params[:conductor_service_name],
|
||||
:hasstatus => 'true',
|
||||
:ensure => 'running'
|
||||
|
@ -30,7 +30,7 @@ describe 'nova::conductor' do
|
|||
:manage_service => false
|
||||
}
|
||||
end
|
||||
it { should contain_service('nova-conductor').without_ensure }
|
||||
it { is_expected.to contain_service('nova-conductor').without_ensure }
|
||||
end
|
||||
|
||||
context 'with package version' do
|
||||
|
@ -38,7 +38,7 @@ describe 'nova::conductor' do
|
|||
{ :ensure_package => '2012.1-2' }
|
||||
end
|
||||
|
||||
it { should contain_package('nova-conductor').with(
|
||||
it { is_expected.to contain_package('nova-conductor').with(
|
||||
:ensure => params[:ensure_package]
|
||||
)}
|
||||
end
|
||||
|
@ -47,7 +47,7 @@ describe 'nova::conductor' do
|
|||
before do
|
||||
params.merge!({:workers => '5' })
|
||||
end
|
||||
it { should contain_nova_config('conductor/workers').with_value('5') }
|
||||
it { is_expected.to contain_nova_config('conductor/workers').with_value('5') }
|
||||
end
|
||||
|
||||
context 'with default database parameters' do
|
||||
|
@ -55,9 +55,9 @@ describe 'nova::conductor' do
|
|||
"include nova"
|
||||
end
|
||||
|
||||
it { should_not contain_nova_config('database/connection') }
|
||||
it { should_not contain_nova_config('database/slave_connection') }
|
||||
it { should_not contain_nova_config('database/idle_timeout').with_value('3600') }
|
||||
it { is_expected.to_not contain_nova_config('database/connection') }
|
||||
it { is_expected.to_not contain_nova_config('database/slave_connection') }
|
||||
it { is_expected.to_not contain_nova_config('database/idle_timeout').with_value('3600') }
|
||||
end
|
||||
|
||||
context 'with overridden database parameters' do
|
||||
|
@ -70,9 +70,9 @@ describe 'nova::conductor' do
|
|||
"
|
||||
end
|
||||
|
||||
it { should contain_nova_config('database/connection').with_value('mysql://user:pass@db/db').with_secret(true) }
|
||||
it { should contain_nova_config('database/slave_connection').with_value('mysql://user:pass@slave/db').with_secret(true) }
|
||||
it { should contain_nova_config('database/idle_timeout').with_value('30') }
|
||||
it { is_expected.to contain_nova_config('database/connection').with_value('mysql://user:pass@db/db').with_secret(true) }
|
||||
it { is_expected.to contain_nova_config('database/slave_connection').with_value('mysql://user:pass@slave/db').with_secret(true) }
|
||||
it { is_expected.to contain_nova_config('database/idle_timeout').with_value('30') }
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -17,14 +17,14 @@ describe 'nova::config' do
|
|||
end
|
||||
|
||||
it 'configures arbitrary nova configurations' do
|
||||
should contain_nova_config('DEFAULT/foo').with_value('fooValue')
|
||||
should contain_nova_config('DEFAULT/bar').with_value('barValue')
|
||||
should contain_nova_config('DEFAULT/baz').with_ensure('absent')
|
||||
is_expected.to contain_nova_config('DEFAULT/foo').with_value('fooValue')
|
||||
is_expected.to contain_nova_config('DEFAULT/bar').with_value('barValue')
|
||||
is_expected.to contain_nova_config('DEFAULT/baz').with_ensure('absent')
|
||||
end
|
||||
|
||||
it 'configures arbitrary nova api-paste configurations' do
|
||||
should contain_nova_paste_api_ini('DEFAULT/foo2').with_value('fooValue')
|
||||
should contain_nova_paste_api_ini('DEFAULT/bar2').with_value('barValue')
|
||||
should contain_nova_paste_api_ini('DEFAULT/baz2').with_ensure('absent')
|
||||
is_expected.to contain_nova_paste_api_ini('DEFAULT/foo2').with_value('fooValue')
|
||||
is_expected.to contain_nova_paste_api_ini('DEFAULT/bar2').with_value('barValue')
|
||||
is_expected.to contain_nova_paste_api_ini('DEFAULT/baz2').with_ensure('absent')
|
||||
end
|
||||
end
|
||||
|
|
|
@ -7,7 +7,7 @@ describe 'nova::cron::archive_deleted_rows' do
|
|||
end
|
||||
|
||||
it 'configures a cron' do
|
||||
should contain_cron('nova-manage db archive_deleted_rows').with(
|
||||
is_expected.to contain_cron('nova-manage db archive_deleted_rows').with(
|
||||
:command => 'nova-manage db archive_deleted_rows --max_rows 100 >>/var/log/nova/nova-rowsflush.log 2>&1',
|
||||
:environment => 'PATH=/bin:/usr/bin:/usr/sbin SHELL=/bin/sh',
|
||||
:user => 'nova',
|
||||
|
|
|
@ -20,7 +20,7 @@ describe 'nova::db::mysql' do
|
|||
required_params
|
||||
end
|
||||
|
||||
it { should contain_openstacklib__db__mysql('nova').with(
|
||||
it { is_expected.to contain_openstacklib__db__mysql('nova').with(
|
||||
:user => 'nova',
|
||||
:password_hash => '*AA1420F182E88B9E5F874F6FBE7459291E8F4601',
|
||||
:charset => 'utf8'
|
||||
|
@ -32,7 +32,7 @@ describe 'nova::db::mysql' do
|
|||
{ :charset => 'latin1' }.merge(required_params)
|
||||
end
|
||||
|
||||
it { should contain_openstacklib__db__mysql('nova').with_charset(params[:charset]) }
|
||||
it { is_expected.to contain_openstacklib__db__mysql('nova').with_charset(params[:charset]) }
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -46,7 +46,7 @@ describe 'nova::db::mysql' do
|
|||
required_params
|
||||
end
|
||||
|
||||
it { should contain_openstacklib__db__mysql('nova').with(
|
||||
it { is_expected.to contain_openstacklib__db__mysql('nova').with(
|
||||
:user => 'nova',
|
||||
:password_hash => '*AA1420F182E88B9E5F874F6FBE7459291E8F4601',
|
||||
:charset => 'utf8'
|
||||
|
@ -58,7 +58,7 @@ describe 'nova::db::mysql' do
|
|||
{ :charset => 'latin1' }.merge(required_params)
|
||||
end
|
||||
|
||||
it { should contain_openstacklib__db__mysql('nova').with_charset(params[:charset]) }
|
||||
it { is_expected.to contain_openstacklib__db__mysql('nova').with_charset(params[:charset]) }
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ describe 'nova::db::postgresql' do
|
|||
req_params
|
||||
end
|
||||
|
||||
it { should contain_postgresql__server__db('nova').with(
|
||||
it { is_expected.to contain_postgresql__server__db('nova').with(
|
||||
:user => 'nova',
|
||||
:password => 'md557ae0608fad632bf0155cb9502a6b454'
|
||||
)}
|
||||
|
@ -47,7 +47,7 @@ describe 'nova::db::postgresql' do
|
|||
req_params
|
||||
end
|
||||
|
||||
it { should contain_postgresql__server__db('nova').with(
|
||||
it { is_expected.to contain_postgresql__server__db('nova').with(
|
||||
:user => 'nova',
|
||||
:password => 'md557ae0608fad632bf0155cb9502a6b454'
|
||||
)}
|
||||
|
|
|
@ -9,9 +9,9 @@ describe 'nova::db' do
|
|||
shared_examples 'nova-db' do
|
||||
|
||||
context 'with default parameters' do
|
||||
it { should_not contain_nova_config('database/connection') }
|
||||
it { should_not contain_nova_config('database/slave_connection') }
|
||||
it { should_not contain_nova_config('database/idle_timeout') }
|
||||
it { is_expected.to_not contain_nova_config('database/connection') }
|
||||
it { is_expected.to_not contain_nova_config('database/slave_connection') }
|
||||
it { is_expected.to_not contain_nova_config('database/idle_timeout') }
|
||||
end
|
||||
|
||||
context 'with overriden parameters' do
|
||||
|
@ -23,9 +23,9 @@ describe 'nova::db' do
|
|||
)
|
||||
end
|
||||
|
||||
it { should contain_nova_config('database/connection').with_value('mysql://user:pass@db/db').with_secret(true) }
|
||||
it { should contain_nova_config('database/slave_connection').with_value('mysql://user:pass@slave/db').with_secret(true) }
|
||||
it { should contain_nova_config('database/idle_timeout').with_value('30') }
|
||||
it { is_expected.to contain_nova_config('database/connection').with_value('mysql://user:pass@db/db').with_secret(true) }
|
||||
it { is_expected.to contain_nova_config('database/slave_connection').with_value('mysql://user:pass@slave/db').with_secret(true) }
|
||||
it { is_expected.to contain_nova_config('database/idle_timeout').with_value('30') }
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -7,14 +7,14 @@ describe 'nova' do
|
|||
context 'with default parameters' do
|
||||
|
||||
it 'installs packages' do
|
||||
should contain_package('python-greenlet').with(
|
||||
is_expected.to contain_package('python-greenlet').with(
|
||||
:ensure => 'present',
|
||||
)
|
||||
should contain_package('python-nova').with(
|
||||
is_expected.to contain_package('python-nova').with(
|
||||
:ensure => 'present',
|
||||
:require => 'Package[python-greenlet]'
|
||||
)
|
||||
should contain_package('nova-common').with(
|
||||
is_expected.to contain_package('nova-common').with(
|
||||
:name => platform_params[:nova_common_package],
|
||||
:ensure => 'present',
|
||||
:tag => ['openstack']
|
||||
|
@ -22,13 +22,13 @@ describe 'nova' do
|
|||
end
|
||||
|
||||
it 'creates various files and folders' do
|
||||
should contain_file('/var/log/nova').with(
|
||||
is_expected.to contain_file('/var/log/nova').with(
|
||||
:ensure => 'directory',
|
||||
:mode => '0750',
|
||||
:owner => 'nova',
|
||||
:require => 'Package[nova-common]'
|
||||
)
|
||||
should contain_file('/etc/nova/nova.conf').with(
|
||||
is_expected.to contain_file('/etc/nova/nova.conf').with(
|
||||
:mode => '0640',
|
||||
:owner => 'nova',
|
||||
:group => 'nova',
|
||||
|
@ -37,51 +37,51 @@ describe 'nova' do
|
|||
end
|
||||
|
||||
it 'configures rootwrap' do
|
||||
should contain_nova_config('DEFAULT/rootwrap_config').with_value('/etc/nova/rootwrap.conf')
|
||||
is_expected.to contain_nova_config('DEFAULT/rootwrap_config').with_value('/etc/nova/rootwrap.conf')
|
||||
end
|
||||
|
||||
it { should contain_exec('networking-refresh').with(
|
||||
it { is_expected.to contain_exec('networking-refresh').with(
|
||||
:command => '/sbin/ifdown -a ; /sbin/ifup -a',
|
||||
:refreshonly => true
|
||||
)}
|
||||
|
||||
it 'configures image service' do
|
||||
should contain_nova_config('DEFAULT/image_service').with_value('nova.image.glance.GlanceImageService')
|
||||
should contain_nova_config('glance/api_servers').with_value('localhost:9292')
|
||||
is_expected.to contain_nova_config('DEFAULT/image_service').with_value('nova.image.glance.GlanceImageService')
|
||||
is_expected.to contain_nova_config('glance/api_servers').with_value('localhost:9292')
|
||||
end
|
||||
|
||||
it 'configures auth_strategy' do
|
||||
should contain_nova_config('DEFAULT/auth_strategy').with_value('keystone')
|
||||
should_not contain_nova_config('DEFAULT/use_deprecated_auth').with_value(false)
|
||||
is_expected.to contain_nova_config('DEFAULT/auth_strategy').with_value('keystone')
|
||||
is_expected.to_not contain_nova_config('DEFAULT/use_deprecated_auth').with_value(false)
|
||||
end
|
||||
|
||||
it 'configures rabbit' do
|
||||
should contain_nova_config('DEFAULT/rpc_backend').with_value('rabbit')
|
||||
should contain_nova_config('DEFAULT/rabbit_host').with_value('localhost')
|
||||
should contain_nova_config('DEFAULT/rabbit_password').with_value('guest').with_secret(true)
|
||||
should contain_nova_config('DEFAULT/rabbit_port').with_value('5672')
|
||||
should contain_nova_config('DEFAULT/rabbit_userid').with_value('guest')
|
||||
should contain_nova_config('DEFAULT/rabbit_virtual_host').with_value('/')
|
||||
is_expected.to contain_nova_config('DEFAULT/rpc_backend').with_value('rabbit')
|
||||
is_expected.to contain_nova_config('DEFAULT/rabbit_host').with_value('localhost')
|
||||
is_expected.to contain_nova_config('DEFAULT/rabbit_password').with_value('guest').with_secret(true)
|
||||
is_expected.to contain_nova_config('DEFAULT/rabbit_port').with_value('5672')
|
||||
is_expected.to contain_nova_config('DEFAULT/rabbit_userid').with_value('guest')
|
||||
is_expected.to contain_nova_config('DEFAULT/rabbit_virtual_host').with_value('/')
|
||||
end
|
||||
|
||||
it 'configures various things' do
|
||||
should contain_nova_config('DEFAULT/verbose').with_value(false)
|
||||
should contain_nova_config('DEFAULT/debug').with_value(false)
|
||||
should contain_nova_config('DEFAULT/log_dir').with_value('/var/log/nova')
|
||||
should contain_nova_config('DEFAULT/state_path').with_value('/var/lib/nova')
|
||||
should contain_nova_config('DEFAULT/lock_path').with_value(platform_params[:lock_path])
|
||||
should contain_nova_config('DEFAULT/service_down_time').with_value('60')
|
||||
should contain_nova_config('DEFAULT/rootwrap_config').with_value('/etc/nova/rootwrap.conf')
|
||||
should contain_nova_config('DEFAULT/report_interval').with_value('10')
|
||||
should contain_nova_config('DEFAULT/os_region_name').with_ensure('absent')
|
||||
is_expected.to contain_nova_config('DEFAULT/verbose').with_value(false)
|
||||
is_expected.to contain_nova_config('DEFAULT/debug').with_value(false)
|
||||
is_expected.to contain_nova_config('DEFAULT/log_dir').with_value('/var/log/nova')
|
||||
is_expected.to contain_nova_config('DEFAULT/state_path').with_value('/var/lib/nova')
|
||||
is_expected.to contain_nova_config('DEFAULT/lock_path').with_value(platform_params[:lock_path])
|
||||
is_expected.to contain_nova_config('DEFAULT/service_down_time').with_value('60')
|
||||
is_expected.to contain_nova_config('DEFAULT/rootwrap_config').with_value('/etc/nova/rootwrap.conf')
|
||||
is_expected.to contain_nova_config('DEFAULT/report_interval').with_value('10')
|
||||
is_expected.to contain_nova_config('DEFAULT/os_region_name').with_ensure('absent')
|
||||
end
|
||||
|
||||
it 'installs utilities' do
|
||||
should contain_class('nova::utilities')
|
||||
is_expected.to contain_class('nova::utilities')
|
||||
end
|
||||
|
||||
it 'disables syslog' do
|
||||
should contain_nova_config('DEFAULT/use_syslog').with_value(false)
|
||||
is_expected.to contain_nova_config('DEFAULT/use_syslog').with_value(false)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -112,63 +112,63 @@ describe 'nova' do
|
|||
end
|
||||
|
||||
it 'installs packages' do
|
||||
should contain_package('nova-common').with('ensure' => '2012.1.1-15.el6')
|
||||
should contain_package('python-nova').with('ensure' => '2012.1.1-15.el6')
|
||||
is_expected.to contain_package('nova-common').with('ensure' => '2012.1.1-15.el6')
|
||||
is_expected.to contain_package('python-nova').with('ensure' => '2012.1.1-15.el6')
|
||||
end
|
||||
|
||||
it 'configures image service' do
|
||||
should contain_nova_config('DEFAULT/image_service').with_value('nova.image.local.LocalImageService')
|
||||
should_not contain_nova_config('glance/api_servers')
|
||||
is_expected.to contain_nova_config('DEFAULT/image_service').with_value('nova.image.local.LocalImageService')
|
||||
is_expected.to_not contain_nova_config('glance/api_servers')
|
||||
end
|
||||
|
||||
it 'configures auth_strategy' do
|
||||
should contain_nova_config('DEFAULT/auth_strategy').with_value('foo')
|
||||
should_not contain_nova_config('DEFAULT/use_deprecated_auth').with_value(true)
|
||||
is_expected.to contain_nova_config('DEFAULT/auth_strategy').with_value('foo')
|
||||
is_expected.to_not contain_nova_config('DEFAULT/use_deprecated_auth').with_value(true)
|
||||
end
|
||||
|
||||
it 'configures rabbit' do
|
||||
should contain_nova_config('DEFAULT/rpc_backend').with_value('rabbit')
|
||||
should contain_nova_config('DEFAULT/rabbit_host').with_value('rabbit')
|
||||
should contain_nova_config('DEFAULT/rabbit_password').with_value('password').with_secret(true)
|
||||
should contain_nova_config('DEFAULT/rabbit_port').with_value('5673')
|
||||
should contain_nova_config('DEFAULT/rabbit_userid').with_value('rabbit_user')
|
||||
should contain_nova_config('DEFAULT/rabbit_virtual_host').with_value('/')
|
||||
is_expected.to contain_nova_config('DEFAULT/rpc_backend').with_value('rabbit')
|
||||
is_expected.to contain_nova_config('DEFAULT/rabbit_host').with_value('rabbit')
|
||||
is_expected.to contain_nova_config('DEFAULT/rabbit_password').with_value('password').with_secret(true)
|
||||
is_expected.to contain_nova_config('DEFAULT/rabbit_port').with_value('5673')
|
||||
is_expected.to contain_nova_config('DEFAULT/rabbit_userid').with_value('rabbit_user')
|
||||
is_expected.to contain_nova_config('DEFAULT/rabbit_virtual_host').with_value('/')
|
||||
end
|
||||
|
||||
it 'configures memcached_servers' do
|
||||
should contain_nova_config('DEFAULT/memcached_servers').with_value('memcached01:11211,memcached02:11211')
|
||||
is_expected.to contain_nova_config('DEFAULT/memcached_servers').with_value('memcached01:11211,memcached02:11211')
|
||||
end
|
||||
|
||||
it 'configures various things' do
|
||||
should contain_nova_config('DEFAULT/verbose').with_value(true)
|
||||
should contain_nova_config('DEFAULT/debug').with_value(true)
|
||||
should contain_nova_config('DEFAULT/log_dir').with_value('/var/log/nova2')
|
||||
should contain_nova_config('DEFAULT/state_path').with_value('/var/lib/nova2')
|
||||
should contain_nova_config('DEFAULT/lock_path').with_value('/var/locky/path')
|
||||
should contain_nova_config('DEFAULT/service_down_time').with_value('120')
|
||||
should contain_nova_config('DEFAULT/notification_driver').with_value('ceilometer.compute.nova_notifier')
|
||||
should contain_nova_config('DEFAULT/notification_topics').with_value('openstack')
|
||||
should contain_nova_config('DEFAULT/notify_api_faults').with_value(true)
|
||||
should contain_nova_config('DEFAULT/report_interval').with_value('60')
|
||||
should contain_nova_config('DEFAULT/os_region_name').with_value('MyRegion')
|
||||
is_expected.to contain_nova_config('DEFAULT/verbose').with_value(true)
|
||||
is_expected.to contain_nova_config('DEFAULT/debug').with_value(true)
|
||||
is_expected.to contain_nova_config('DEFAULT/log_dir').with_value('/var/log/nova2')
|
||||
is_expected.to contain_nova_config('DEFAULT/state_path').with_value('/var/lib/nova2')
|
||||
is_expected.to contain_nova_config('DEFAULT/lock_path').with_value('/var/locky/path')
|
||||
is_expected.to contain_nova_config('DEFAULT/service_down_time').with_value('120')
|
||||
is_expected.to contain_nova_config('DEFAULT/notification_driver').with_value('ceilometer.compute.nova_notifier')
|
||||
is_expected.to contain_nova_config('DEFAULT/notification_topics').with_value('openstack')
|
||||
is_expected.to contain_nova_config('DEFAULT/notify_api_faults').with_value(true)
|
||||
is_expected.to contain_nova_config('DEFAULT/report_interval').with_value('60')
|
||||
is_expected.to contain_nova_config('DEFAULT/os_region_name').with_value('MyRegion')
|
||||
end
|
||||
|
||||
context 'with multiple notification_driver' do
|
||||
before { params.merge!( :notification_driver => ['ceilometer.compute.nova_notifier', 'nova.openstack.common.notifier.rpc_notifier']) }
|
||||
|
||||
it { should contain_nova_config('DEFAULT/notification_driver').with_value(
|
||||
it { is_expected.to contain_nova_config('DEFAULT/notification_driver').with_value(
|
||||
'ceilometer.compute.nova_notifier,nova.openstack.common.notifier.rpc_notifier'
|
||||
) }
|
||||
end
|
||||
|
||||
it 'does not install utilities' do
|
||||
should_not contain_class('nova::utilities')
|
||||
is_expected.to_not contain_class('nova::utilities')
|
||||
end
|
||||
|
||||
context 'with logging directory disabled' do
|
||||
before { params.merge!( :log_dir => false) }
|
||||
|
||||
it { should contain_nova_config('DEFAULT/log_dir').with_ensure('absent') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/log_dir').with_ensure('absent') }
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -178,7 +178,7 @@ describe 'nova' do
|
|||
end
|
||||
|
||||
it 'configures database' do
|
||||
should contain_nova_config('DEFAULT/notify_on_state_change').with_ensure('absent')
|
||||
is_expected.to contain_nova_config('DEFAULT/notify_on_state_change').with_ensure('absent')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -188,7 +188,7 @@ describe 'nova' do
|
|||
end
|
||||
|
||||
it 'configures database' do
|
||||
should contain_nova_config('DEFAULT/notify_on_state_change').with_value('vm_state')
|
||||
is_expected.to contain_nova_config('DEFAULT/notify_on_state_change').with_value('vm_state')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -198,8 +198,8 @@ describe 'nova' do
|
|||
end
|
||||
|
||||
it 'configures syslog' do
|
||||
should contain_nova_config('DEFAULT/use_syslog').with_value(true)
|
||||
should contain_nova_config('DEFAULT/syslog_log_facility').with_value('LOG_USER')
|
||||
is_expected.to contain_nova_config('DEFAULT/use_syslog').with_value(true)
|
||||
is_expected.to contain_nova_config('DEFAULT/syslog_log_facility').with_value('LOG_USER')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -210,8 +210,8 @@ describe 'nova' do
|
|||
end
|
||||
|
||||
it 'configures syslog' do
|
||||
should contain_nova_config('DEFAULT/use_syslog').with_value(true)
|
||||
should contain_nova_config('DEFAULT/syslog_log_facility').with_value('LOG_LOCAL0')
|
||||
is_expected.to contain_nova_config('DEFAULT/use_syslog').with_value(true)
|
||||
is_expected.to contain_nova_config('DEFAULT/syslog_log_facility').with_value('LOG_LOCAL0')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -221,16 +221,16 @@ describe 'nova' do
|
|||
end
|
||||
|
||||
it 'configures rabbit' do
|
||||
should_not contain_nova_config('DEFAULT/rabbit_host')
|
||||
should_not contain_nova_config('DEFAULT/rabbit_port')
|
||||
should contain_nova_config('DEFAULT/rabbit_hosts').with_value('rabbit:5673,rabbit2:5674')
|
||||
should contain_nova_config('DEFAULT/rabbit_ha_queues').with_value(true)
|
||||
should contain_nova_config('DEFAULT/rabbit_use_ssl').with_value(false)
|
||||
should contain_nova_config('DEFAULT/amqp_durable_queues').with_value(false)
|
||||
should contain_nova_config('DEFAULT/kombu_ssl_ca_certs').with_ensure('absent')
|
||||
should contain_nova_config('DEFAULT/kombu_ssl_certfile').with_ensure('absent')
|
||||
should contain_nova_config('DEFAULT/kombu_ssl_keyfile').with_ensure('absent')
|
||||
should contain_nova_config('DEFAULT/kombu_ssl_version').with_ensure('absent')
|
||||
is_expected.to_not contain_nova_config('DEFAULT/rabbit_host')
|
||||
is_expected.to_not contain_nova_config('DEFAULT/rabbit_port')
|
||||
is_expected.to contain_nova_config('DEFAULT/rabbit_hosts').with_value('rabbit:5673,rabbit2:5674')
|
||||
is_expected.to contain_nova_config('DEFAULT/rabbit_ha_queues').with_value(true)
|
||||
is_expected.to contain_nova_config('DEFAULT/rabbit_use_ssl').with_value(false)
|
||||
is_expected.to contain_nova_config('DEFAULT/amqp_durable_queues').with_value(false)
|
||||
is_expected.to contain_nova_config('DEFAULT/kombu_ssl_ca_certs').with_ensure('absent')
|
||||
is_expected.to contain_nova_config('DEFAULT/kombu_ssl_certfile').with_ensure('absent')
|
||||
is_expected.to contain_nova_config('DEFAULT/kombu_ssl_keyfile').with_ensure('absent')
|
||||
is_expected.to contain_nova_config('DEFAULT/kombu_ssl_version').with_ensure('absent')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -240,12 +240,12 @@ describe 'nova' do
|
|||
end
|
||||
|
||||
it 'configures rabbit' do
|
||||
should_not contain_nova_config('DEFAULT/rabbit_host')
|
||||
should_not contain_nova_config('DEFAULT/rabbit_port')
|
||||
should contain_nova_config('DEFAULT/rabbit_hosts').with_value('rabbit:5673')
|
||||
should contain_nova_config('DEFAULT/rabbit_ha_queues').with_value(true)
|
||||
should contain_nova_config('DEFAULT/rabbit_use_ssl').with_value(false)
|
||||
should contain_nova_config('DEFAULT/amqp_durable_queues').with_value(false)
|
||||
is_expected.to_not contain_nova_config('DEFAULT/rabbit_host')
|
||||
is_expected.to_not contain_nova_config('DEFAULT/rabbit_port')
|
||||
is_expected.to contain_nova_config('DEFAULT/rabbit_hosts').with_value('rabbit:5673')
|
||||
is_expected.to contain_nova_config('DEFAULT/rabbit_ha_queues').with_value(true)
|
||||
is_expected.to contain_nova_config('DEFAULT/rabbit_use_ssl').with_value(false)
|
||||
is_expected.to contain_nova_config('DEFAULT/amqp_durable_queues').with_value(false)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -255,7 +255,7 @@ describe 'nova' do
|
|||
end
|
||||
|
||||
it 'configures rabbit' do
|
||||
should contain_nova_config('DEFAULT/rabbit_ha_queues').with_value(true)
|
||||
is_expected.to contain_nova_config('DEFAULT/rabbit_ha_queues').with_value(true)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -266,16 +266,16 @@ describe 'nova' do
|
|||
end
|
||||
|
||||
it 'configures rabbit' do
|
||||
should_not contain_nova_config('DEFAULT/rabbit_host')
|
||||
should_not contain_nova_config('DEFAULT/rabbit_port')
|
||||
should contain_nova_config('DEFAULT/rabbit_hosts').with_value('rabbit:5673')
|
||||
should contain_nova_config('DEFAULT/rabbit_ha_queues').with_value(true)
|
||||
should contain_nova_config('DEFAULT/rabbit_use_ssl').with_value(false)
|
||||
should contain_nova_config('DEFAULT/amqp_durable_queues').with_value(true)
|
||||
should contain_nova_config('DEFAULT/kombu_ssl_ca_certs').with_ensure('absent')
|
||||
should contain_nova_config('DEFAULT/kombu_ssl_certfile').with_ensure('absent')
|
||||
should contain_nova_config('DEFAULT/kombu_ssl_keyfile').with_ensure('absent')
|
||||
should contain_nova_config('DEFAULT/kombu_ssl_version').with_ensure('absent')
|
||||
is_expected.to_not contain_nova_config('DEFAULT/rabbit_host')
|
||||
is_expected.to_not contain_nova_config('DEFAULT/rabbit_port')
|
||||
is_expected.to contain_nova_config('DEFAULT/rabbit_hosts').with_value('rabbit:5673')
|
||||
is_expected.to contain_nova_config('DEFAULT/rabbit_ha_queues').with_value(true)
|
||||
is_expected.to contain_nova_config('DEFAULT/rabbit_use_ssl').with_value(false)
|
||||
is_expected.to contain_nova_config('DEFAULT/amqp_durable_queues').with_value(true)
|
||||
is_expected.to contain_nova_config('DEFAULT/kombu_ssl_ca_certs').with_ensure('absent')
|
||||
is_expected.to contain_nova_config('DEFAULT/kombu_ssl_certfile').with_ensure('absent')
|
||||
is_expected.to contain_nova_config('DEFAULT/kombu_ssl_keyfile').with_ensure('absent')
|
||||
is_expected.to contain_nova_config('DEFAULT/kombu_ssl_version').with_ensure('absent')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -290,11 +290,11 @@ describe 'nova' do
|
|||
end
|
||||
|
||||
it 'configures rabbit' do
|
||||
should contain_nova_config('DEFAULT/rabbit_use_ssl').with_value(true)
|
||||
should contain_nova_config('DEFAULT/kombu_ssl_ca_certs').with_value('/etc/ca.cert')
|
||||
should contain_nova_config('DEFAULT/kombu_ssl_certfile').with_value('/etc/certfile')
|
||||
should contain_nova_config('DEFAULT/kombu_ssl_keyfile').with_value('/etc/key')
|
||||
should contain_nova_config('DEFAULT/kombu_ssl_version').with_value('TLSv1')
|
||||
is_expected.to contain_nova_config('DEFAULT/rabbit_use_ssl').with_value(true)
|
||||
is_expected.to contain_nova_config('DEFAULT/kombu_ssl_ca_certs').with_value('/etc/ca.cert')
|
||||
is_expected.to contain_nova_config('DEFAULT/kombu_ssl_certfile').with_value('/etc/certfile')
|
||||
is_expected.to contain_nova_config('DEFAULT/kombu_ssl_keyfile').with_value('/etc/key')
|
||||
is_expected.to contain_nova_config('DEFAULT/kombu_ssl_version').with_value('TLSv1')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -305,11 +305,11 @@ describe 'nova' do
|
|||
end
|
||||
|
||||
it 'configures rabbit' do
|
||||
should contain_nova_config('DEFAULT/rabbit_use_ssl').with_value(true)
|
||||
should contain_nova_config('DEFAULT/kombu_ssl_ca_certs').with_ensure('absent')
|
||||
should contain_nova_config('DEFAULT/kombu_ssl_certfile').with_ensure('absent')
|
||||
should contain_nova_config('DEFAULT/kombu_ssl_keyfile').with_ensure('absent')
|
||||
should contain_nova_config('DEFAULT/kombu_ssl_version').with_value('TLSv1')
|
||||
is_expected.to contain_nova_config('DEFAULT/rabbit_use_ssl').with_value(true)
|
||||
is_expected.to contain_nova_config('DEFAULT/kombu_ssl_ca_certs').with_ensure('absent')
|
||||
is_expected.to contain_nova_config('DEFAULT/kombu_ssl_certfile').with_ensure('absent')
|
||||
is_expected.to contain_nova_config('DEFAULT/kombu_ssl_keyfile').with_ensure('absent')
|
||||
is_expected.to contain_nova_config('DEFAULT/kombu_ssl_version').with_value('TLSv1')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -323,11 +323,11 @@ describe 'nova' do
|
|||
end
|
||||
|
||||
it 'configures rabbit' do
|
||||
should contain_nova_config('DEFAULT/rabbit_use_ssl').with_value('false')
|
||||
should contain_nova_config('DEFAULT/kombu_ssl_ca_certs').with_ensure('absent')
|
||||
should contain_nova_config('DEFAULT/kombu_ssl_certfile').with_ensure('absent')
|
||||
should contain_nova_config('DEFAULT/kombu_ssl_keyfile').with_ensure('absent')
|
||||
should contain_nova_config('DEFAULT/kombu_ssl_version').with_ensure('absent')
|
||||
is_expected.to contain_nova_config('DEFAULT/rabbit_use_ssl').with_value('false')
|
||||
is_expected.to contain_nova_config('DEFAULT/kombu_ssl_ca_certs').with_ensure('absent')
|
||||
is_expected.to contain_nova_config('DEFAULT/kombu_ssl_certfile').with_ensure('absent')
|
||||
is_expected.to contain_nova_config('DEFAULT/kombu_ssl_keyfile').with_ensure('absent')
|
||||
is_expected.to contain_nova_config('DEFAULT/kombu_ssl_version').with_ensure('absent')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -338,14 +338,14 @@ describe 'nova' do
|
|||
|
||||
context 'with default parameters' do
|
||||
it 'configures qpid' do
|
||||
should contain_nova_config('DEFAULT/rpc_backend').with_value('qpid')
|
||||
should contain_nova_config('DEFAULT/qpid_hostname').with_value('localhost')
|
||||
should contain_nova_config('DEFAULT/qpid_port').with_value('5672')
|
||||
should contain_nova_config('DEFAULT/qpid_username').with_value('guest')
|
||||
should contain_nova_config('DEFAULT/qpid_password').with_value('guest').with_secret(true)
|
||||
should contain_nova_config('DEFAULT/qpid_heartbeat').with_value('60')
|
||||
should contain_nova_config('DEFAULT/qpid_protocol').with_value('tcp')
|
||||
should contain_nova_config('DEFAULT/qpid_tcp_nodelay').with_value(true)
|
||||
is_expected.to contain_nova_config('DEFAULT/rpc_backend').with_value('qpid')
|
||||
is_expected.to contain_nova_config('DEFAULT/qpid_hostname').with_value('localhost')
|
||||
is_expected.to contain_nova_config('DEFAULT/qpid_port').with_value('5672')
|
||||
is_expected.to contain_nova_config('DEFAULT/qpid_username').with_value('guest')
|
||||
is_expected.to contain_nova_config('DEFAULT/qpid_password').with_value('guest').with_secret(true)
|
||||
is_expected.to contain_nova_config('DEFAULT/qpid_heartbeat').with_value('60')
|
||||
is_expected.to contain_nova_config('DEFAULT/qpid_protocol').with_value('tcp')
|
||||
is_expected.to contain_nova_config('DEFAULT/qpid_tcp_nodelay').with_value(true)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -353,7 +353,7 @@ describe 'nova' do
|
|||
before do
|
||||
params.merge!({ :qpid_password => 'guest' })
|
||||
end
|
||||
it { should contain_nova_config('DEFAULT/qpid_sasl_mechanisms').with_ensure('absent') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/qpid_sasl_mechanisms').with_ensure('absent') }
|
||||
end
|
||||
|
||||
context 'with qpid_password parameter (with qpid_sasl_mechanisms)' do
|
||||
|
@ -363,7 +363,7 @@ describe 'nova' do
|
|||
:qpid_sasl_mechanisms => 'A'
|
||||
})
|
||||
end
|
||||
it { should contain_nova_config('DEFAULT/qpid_sasl_mechanisms').with_value('A') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/qpid_sasl_mechanisms').with_value('A') }
|
||||
end
|
||||
|
||||
context 'with qpid_password parameter (with array of qpid_sasl_mechanisms)' do
|
||||
|
@ -373,7 +373,7 @@ describe 'nova' do
|
|||
:qpid_sasl_mechanisms => [ 'DIGEST-MD5', 'GSSAPI', 'PLAIN' ]
|
||||
})
|
||||
end
|
||||
it { should contain_nova_config('DEFAULT/qpid_sasl_mechanisms').with_value('DIGEST-MD5 GSSAPI PLAIN') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/qpid_sasl_mechanisms').with_value('DIGEST-MD5 GSSAPI PLAIN') }
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -382,7 +382,7 @@ describe 'nova' do
|
|||
{ :rpc_backend => 'nova.openstack.common.rpc.impl_qpid' }
|
||||
end
|
||||
|
||||
it { should contain_nova_config('DEFAULT/rpc_backend').with_value('nova.openstack.common.rpc.impl_qpid') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/rpc_backend').with_value('nova.openstack.common.rpc.impl_qpid') }
|
||||
end
|
||||
|
||||
context 'with rabbitmq rpc_backend with old parameter' do
|
||||
|
@ -390,7 +390,7 @@ describe 'nova' do
|
|||
{ :rpc_backend => 'nova.openstack.common.rpc.impl_kombu' }
|
||||
end
|
||||
|
||||
it { should contain_nova_config('DEFAULT/rpc_backend').with_value('nova.openstack.common.rpc.impl_kombu') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/rpc_backend').with_value('nova.openstack.common.rpc.impl_kombu') }
|
||||
end
|
||||
|
||||
context 'with ssh public key' do
|
||||
|
@ -402,7 +402,7 @@ describe 'nova' do
|
|||
end
|
||||
|
||||
it 'should install ssh public key' do
|
||||
should contain_ssh_authorized_key('nova-migration-public-key').with(
|
||||
is_expected.to contain_ssh_authorized_key('nova-migration-public-key').with(
|
||||
:ensure => 'present',
|
||||
:key => 'keydata',
|
||||
:type => 'ssh-rsa'
|
||||
|
@ -420,7 +420,7 @@ describe 'nova' do
|
|||
|
||||
it 'should raise an error' do
|
||||
expect {
|
||||
should contain_ssh_authorized_key('nova-migration-public-key').with(
|
||||
is_expected.to contain_ssh_authorized_key('nova-migration-public-key').with(
|
||||
:ensure => 'present',
|
||||
:key => 'keydata',
|
||||
:type => ''
|
||||
|
@ -439,7 +439,7 @@ describe 'nova' do
|
|||
|
||||
it 'should raise an error' do
|
||||
expect {
|
||||
should contain_ssh_authorized_key('nova-migration-public-key').with(
|
||||
is_expected.to contain_ssh_authorized_key('nova-migration-public-key').with(
|
||||
:ensure => 'present',
|
||||
:key => 'keydata',
|
||||
:type => ''
|
||||
|
@ -457,7 +457,7 @@ describe 'nova' do
|
|||
end
|
||||
|
||||
it 'should install ssh private key' do
|
||||
should contain_file('/var/lib/nova/.ssh/id_rsa').with(
|
||||
is_expected.to contain_file('/var/lib/nova/.ssh/id_rsa').with(
|
||||
:content => 'keydata'
|
||||
)
|
||||
end
|
||||
|
@ -473,7 +473,7 @@ describe 'nova' do
|
|||
|
||||
it 'should raise an error' do
|
||||
expect {
|
||||
should contain_file('/var/lib/nova/.ssh/id_rsa').with(
|
||||
is_expected.to contain_file('/var/lib/nova/.ssh/id_rsa').with(
|
||||
:content => 'keydata'
|
||||
)
|
||||
}.to raise_error Puppet::Error, /You must provide both a key type and key data./
|
||||
|
@ -490,7 +490,7 @@ describe 'nova' do
|
|||
|
||||
it 'should raise an error' do
|
||||
expect {
|
||||
should contain_file('/var/lib/nova/.ssh/id_rsa').with(
|
||||
is_expected.to contain_file('/var/lib/nova/.ssh/id_rsa').with(
|
||||
:content => 'keydata'
|
||||
)
|
||||
}.to raise_error Puppet::Error, /Unable to determine name of private key file./
|
||||
|
@ -507,7 +507,7 @@ describe 'nova' do
|
|||
|
||||
it 'should raise an error' do
|
||||
expect {
|
||||
should contain_file('/var/lib/nova/.ssh/id_rsa').with(
|
||||
is_expected.to contain_file('/var/lib/nova/.ssh/id_rsa').with(
|
||||
:content => 'keydata'
|
||||
)
|
||||
}.to raise_error Puppet::Error, /You must provide both a key type and key data./
|
||||
|
@ -525,10 +525,10 @@ describe 'nova' do
|
|||
}
|
||||
end
|
||||
|
||||
it { should contain_nova_config('DEFAULT/enabled_ssl_apis').with_value('ec2,osapi_compute') }
|
||||
it { should contain_nova_config('DEFAULT/ssl_ca_file').with_value('/path/to/ca') }
|
||||
it { should contain_nova_config('DEFAULT/ssl_cert_file').with_value('/path/to/cert') }
|
||||
it { should contain_nova_config('DEFAULT/ssl_key_file').with_value('/path/to/key') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/enabled_ssl_apis').with_value('ec2,osapi_compute') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/ssl_ca_file').with_value('/path/to/ca') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/ssl_cert_file').with_value('/path/to/cert') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/ssl_key_file').with_value('/path/to/key') }
|
||||
end
|
||||
|
||||
context 'with SSL socket options set with wrong parameters' do
|
||||
|
@ -555,10 +555,10 @@ describe 'nova' do
|
|||
}
|
||||
end
|
||||
|
||||
it { should contain_nova_config('DEFAULT/enabled_ssl_apis').with_ensure('absent') }
|
||||
it { should contain_nova_config('DEFAULT/ssl_ca_file').with_ensure('absent') }
|
||||
it { should contain_nova_config('DEFAULT/ssl_cert_file').with_ensure('absent') }
|
||||
it { should contain_nova_config('DEFAULT/ssl_key_file').with_ensure('absent') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/enabled_ssl_apis').with_ensure('absent') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/ssl_ca_file').with_ensure('absent') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/ssl_cert_file').with_ensure('absent') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/ssl_key_file').with_ensure('absent') }
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -576,7 +576,7 @@ describe 'nova' do
|
|||
|
||||
it_behaves_like 'nova'
|
||||
it 'creates the log folder with the right group for Debian' do
|
||||
should contain_file('/var/log/nova').with(:group => 'nova')
|
||||
is_expected.to contain_file('/var/log/nova').with(:group => 'nova')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -593,7 +593,7 @@ describe 'nova' do
|
|||
|
||||
it_behaves_like 'nova'
|
||||
it 'creates the log folder with the right group for Ubuntu' do
|
||||
should contain_file('/var/log/nova').with(:group => 'adm')
|
||||
is_expected.to contain_file('/var/log/nova').with(:group => 'adm')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -610,7 +610,7 @@ describe 'nova' do
|
|||
it_behaves_like 'nova'
|
||||
|
||||
it 'creates the log folder with the right group for RedHat' do
|
||||
should contain_file('/var/log/nova').with(:group => 'nova')
|
||||
is_expected.to contain_file('/var/log/nova').with(:group => 'nova')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -8,49 +8,49 @@ describe 'nova::keystone::auth' do
|
|||
|
||||
context 'with default parameters' do
|
||||
|
||||
it { should contain_keystone_user('nova').with(
|
||||
it { is_expected.to contain_keystone_user('nova').with(
|
||||
:ensure => 'present',
|
||||
:password => 'nova_password'
|
||||
) }
|
||||
|
||||
it { should contain_keystone_user_role('nova@services').with(
|
||||
it { is_expected.to contain_keystone_user_role('nova@services').with(
|
||||
:ensure => 'present',
|
||||
:roles => 'admin'
|
||||
)}
|
||||
|
||||
it { should contain_keystone_service('nova').with(
|
||||
it { is_expected.to contain_keystone_service('nova').with(
|
||||
:ensure => 'present',
|
||||
:type => 'compute',
|
||||
:description => 'Openstack Compute Service'
|
||||
)}
|
||||
|
||||
it { should contain_keystone_service('novav3').with(
|
||||
it { is_expected.to contain_keystone_service('novav3').with(
|
||||
:ensure => 'present',
|
||||
:type => 'computev3',
|
||||
:description => 'Openstack Compute Service v3'
|
||||
)}
|
||||
|
||||
it { should contain_keystone_service('nova_ec2').with(
|
||||
it { is_expected.to contain_keystone_service('nova_ec2').with(
|
||||
:ensure => 'present',
|
||||
:type => 'ec2',
|
||||
:description => 'EC2 Service'
|
||||
)}
|
||||
|
||||
it { should contain_keystone_endpoint('RegionOne/nova').with(
|
||||
it { is_expected.to contain_keystone_endpoint('RegionOne/nova').with(
|
||||
:ensure => 'present',
|
||||
:public_url => 'http://127.0.0.1:8774/v2/%(tenant_id)s',
|
||||
:admin_url => 'http://127.0.0.1:8774/v2/%(tenant_id)s',
|
||||
:internal_url => 'http://127.0.0.1:8774/v2/%(tenant_id)s'
|
||||
)}
|
||||
|
||||
it { should contain_keystone_endpoint('RegionOne/novav3').with(
|
||||
it { is_expected.to contain_keystone_endpoint('RegionOne/novav3').with(
|
||||
:ensure => 'present',
|
||||
:public_url => 'http://127.0.0.1:8774/v3',
|
||||
:admin_url => 'http://127.0.0.1:8774/v3',
|
||||
:internal_url => 'http://127.0.0.1:8774/v3'
|
||||
)}
|
||||
|
||||
it { should contain_keystone_endpoint('RegionOne/nova_ec2').with(
|
||||
it { is_expected.to contain_keystone_endpoint('RegionOne/nova_ec2').with(
|
||||
:ensure => 'present',
|
||||
:public_url => 'http://127.0.0.1:8773/services/Cloud',
|
||||
:admin_url => 'http://127.0.0.1:8773/services/Admin',
|
||||
|
@ -64,23 +64,23 @@ describe 'nova::keystone::auth' do
|
|||
params.merge!( :auth_name => 'foo' )
|
||||
end
|
||||
|
||||
it { should contain_keystone_user('foo').with(
|
||||
it { is_expected.to contain_keystone_user('foo').with(
|
||||
:ensure => 'present',
|
||||
:password => 'nova_password'
|
||||
) }
|
||||
|
||||
it { should contain_keystone_user_role('foo@services').with(
|
||||
it { is_expected.to contain_keystone_user_role('foo@services').with(
|
||||
:ensure => 'present',
|
||||
:roles => 'admin'
|
||||
)}
|
||||
|
||||
it { should contain_keystone_service('foo').with(
|
||||
it { is_expected.to contain_keystone_service('foo').with(
|
||||
:ensure => 'present',
|
||||
:type => 'compute',
|
||||
:description => 'Openstack Compute Service'
|
||||
)}
|
||||
|
||||
it { should contain_keystone_service('foo_ec2').with(
|
||||
it { is_expected.to contain_keystone_service('foo_ec2').with(
|
||||
:ensure => 'present',
|
||||
:type => 'ec2',
|
||||
:description => 'EC2 Service'
|
||||
|
@ -98,10 +98,10 @@ describe 'nova::keystone::auth' do
|
|||
)
|
||||
end
|
||||
|
||||
it { should contain_keystone_user('thesame').with(:ensure => 'present') }
|
||||
it { should contain_keystone_user_role('thesame@services').with(:ensure => 'present') }
|
||||
it { should contain_keystone_service('nova').with(:ensure => 'present') }
|
||||
it { should contain_keystone_service('novav3').with(:ensure => 'present') }
|
||||
it { is_expected.to contain_keystone_user('thesame').with(:ensure => 'present') }
|
||||
it { is_expected.to contain_keystone_user_role('thesame@services').with(:ensure => 'present') }
|
||||
it { is_expected.to contain_keystone_service('nova').with(:ensure => 'present') }
|
||||
it { is_expected.to contain_keystone_service('novav3').with(:ensure => 'present') }
|
||||
|
||||
end
|
||||
|
||||
|
@ -114,7 +114,7 @@ describe 'nova::keystone::auth' do
|
|||
end
|
||||
|
||||
it do
|
||||
expect { should contain_keystone_service('nova') }.to raise_error(Puppet::Error, /service_name and service_name_v3 must be different/)
|
||||
expect { is_expected.to contain_keystone_service('nova') }.to raise_error(Puppet::Error, /service_name and service_name_v3 must be different/)
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -128,7 +128,7 @@ describe 'nova::keystone::auth' do
|
|||
end
|
||||
|
||||
it do
|
||||
expect { should contain_keystone_service('nova') }.to raise_error(Puppet::Error, /service_name and service_name_v3 must be different/)
|
||||
expect { is_expected.to contain_keystone_service('nova') }.to raise_error(Puppet::Error, /service_name and service_name_v3 must be different/)
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -149,14 +149,14 @@ describe 'nova::keystone::auth' do
|
|||
)
|
||||
end
|
||||
|
||||
it { should contain_keystone_endpoint('RegionTwo/nova').with(
|
||||
it { is_expected.to contain_keystone_endpoint('RegionTwo/nova').with(
|
||||
:ensure => 'present',
|
||||
:public_url => 'https://10.0.0.1:9774/v2.2/%(tenant_id)s',
|
||||
:admin_url => 'https://10.0.0.2:9774/v2.2/%(tenant_id)s',
|
||||
:internal_url => 'https://10.0.0.3:9774/v2.2/%(tenant_id)s'
|
||||
)}
|
||||
|
||||
it { should contain_keystone_endpoint('RegionTwo/nova_ec2').with(
|
||||
it { is_expected.to contain_keystone_endpoint('RegionTwo/nova_ec2').with(
|
||||
:ensure => 'present',
|
||||
:public_url => 'https://10.0.0.1:9773/services/Cloud',
|
||||
:admin_url => 'https://10.0.0.2:9773/services/Admin',
|
||||
|
@ -170,7 +170,7 @@ describe 'nova::keystone::auth' do
|
|||
params.merge!( :configure_endpoint => false )
|
||||
end
|
||||
|
||||
it { should_not contain_keystone_endpoint('RegionOne/nova') }
|
||||
it { is_expected.to_not contain_keystone_endpoint('RegionOne/nova') }
|
||||
end
|
||||
|
||||
describe 'when disabling EC2 endpoint' do
|
||||
|
@ -178,8 +178,8 @@ describe 'nova::keystone::auth' do
|
|||
params.merge!( :configure_ec2_endpoint => false )
|
||||
end
|
||||
|
||||
it { should_not contain_keystone_service('nova_ec2') }
|
||||
it { should_not contain_keystone_endpoint('RegionOne/nova_ec2') }
|
||||
it { is_expected.to_not contain_keystone_service('nova_ec2') }
|
||||
it { is_expected.to_not contain_keystone_endpoint('RegionOne/nova_ec2') }
|
||||
end
|
||||
|
||||
describe 'when disabling user configuration' do
|
||||
|
@ -187,11 +187,11 @@ describe 'nova::keystone::auth' do
|
|||
params.merge!( :configure_user => false )
|
||||
end
|
||||
|
||||
it { should_not contain_keystone_user('nova') }
|
||||
it { is_expected.to_not contain_keystone_user('nova') }
|
||||
|
||||
it { should contain_keystone_user_role('nova@services') }
|
||||
it { is_expected.to contain_keystone_user_role('nova@services') }
|
||||
|
||||
it { should contain_keystone_service('nova').with(
|
||||
it { is_expected.to contain_keystone_service('nova').with(
|
||||
:ensure => 'present',
|
||||
:type => 'compute',
|
||||
:description => 'Openstack Compute Service'
|
||||
|
@ -207,11 +207,11 @@ describe 'nova::keystone::auth' do
|
|||
}
|
||||
end
|
||||
|
||||
it { should_not contain_keystone_user('nova') }
|
||||
it { is_expected.to_not contain_keystone_user('nova') }
|
||||
|
||||
it { should_not contain_keystone_user_role('nova@services') }
|
||||
it { is_expected.to_not contain_keystone_user_role('nova@services') }
|
||||
|
||||
it { should contain_keystone_service('nova').with(
|
||||
it { is_expected.to contain_keystone_service('nova').with(
|
||||
:ensure => 'present',
|
||||
:type => 'compute',
|
||||
:description => 'Openstack Compute Service'
|
||||
|
@ -234,7 +234,7 @@ describe 'nova::keystone::auth' do
|
|||
}
|
||||
end
|
||||
|
||||
it { should contain_keystone_endpoint('RegionOne/nova').with_notify('Service[nova-api]') }
|
||||
it { is_expected.to contain_keystone_endpoint('RegionOne/nova').with_notify('Service[nova-api]') }
|
||||
end
|
||||
|
||||
describe 'when overriding service names' do
|
||||
|
@ -247,14 +247,14 @@ describe 'nova::keystone::auth' do
|
|||
}
|
||||
end
|
||||
|
||||
it { should contain_keystone_user('nova') }
|
||||
it { should contain_keystone_user_role('nova@services') }
|
||||
it { should contain_keystone_service('nova_service') }
|
||||
it { should contain_keystone_service('nova_service_v3') }
|
||||
it { should contain_keystone_service('nova_service_ec2') }
|
||||
it { should contain_keystone_endpoint('RegionOne/nova_service') }
|
||||
it { should contain_keystone_endpoint('RegionOne/nova_service_v3') }
|
||||
it { should contain_keystone_endpoint('RegionOne/nova_service_ec2') }
|
||||
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') }
|
||||
it { is_expected.to contain_keystone_service('nova_service_v3') }
|
||||
it { is_expected.to contain_keystone_service('nova_service_ec2') }
|
||||
it { is_expected.to contain_keystone_endpoint('RegionOne/nova_service') }
|
||||
it { is_expected.to contain_keystone_endpoint('RegionOne/nova_service_v3') }
|
||||
it { is_expected.to contain_keystone_endpoint('RegionOne/nova_service_ec2') }
|
||||
|
||||
end
|
||||
|
||||
|
|
|
@ -42,36 +42,36 @@ describe 'nova::logging' do
|
|||
|
||||
shared_examples_for 'logging params set' do
|
||||
it 'enables logging params' do
|
||||
should contain_nova_config('DEFAULT/logging_context_format_string').with_value(
|
||||
is_expected.to contain_nova_config('DEFAULT/logging_context_format_string').with_value(
|
||||
'%(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [%(request_id)s %(user_identity)s] %(instance)s%(message)s')
|
||||
|
||||
should contain_nova_config('DEFAULT/logging_default_format_string').with_value(
|
||||
is_expected.to contain_nova_config('DEFAULT/logging_default_format_string').with_value(
|
||||
'%(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [-] %(instance)s%(message)s')
|
||||
|
||||
should contain_nova_config('DEFAULT/logging_debug_format_suffix').with_value(
|
||||
is_expected.to contain_nova_config('DEFAULT/logging_debug_format_suffix').with_value(
|
||||
'%(funcName)s %(pathname)s:%(lineno)d')
|
||||
|
||||
should contain_nova_config('DEFAULT/logging_exception_prefix').with_value(
|
||||
is_expected.to contain_nova_config('DEFAULT/logging_exception_prefix').with_value(
|
||||
'%(asctime)s.%(msecs)03d %(process)d TRACE %(name)s %(instance)s')
|
||||
|
||||
should contain_nova_config('DEFAULT/log_config_append').with_value(
|
||||
is_expected.to contain_nova_config('DEFAULT/log_config_append').with_value(
|
||||
'/etc/nova/logging.conf')
|
||||
should contain_nova_config('DEFAULT/publish_errors').with_value(
|
||||
is_expected.to contain_nova_config('DEFAULT/publish_errors').with_value(
|
||||
true)
|
||||
|
||||
should contain_nova_config('DEFAULT/default_log_levels').with_value(
|
||||
is_expected.to contain_nova_config('DEFAULT/default_log_levels').with_value(
|
||||
'amqp=WARN,amqplib=WARN,boto=WARN,iso8601=WARN,qpid=WARN,requests.packages.urllib3.connectionpool=WARN,sqlalchemy=WARN,suds=INFO')
|
||||
|
||||
should contain_nova_config('DEFAULT/fatal_deprecations').with_value(
|
||||
is_expected.to contain_nova_config('DEFAULT/fatal_deprecations').with_value(
|
||||
true)
|
||||
|
||||
should contain_nova_config('DEFAULT/instance_format').with_value(
|
||||
is_expected.to contain_nova_config('DEFAULT/instance_format').with_value(
|
||||
'[instance: %(uuid)s] ')
|
||||
|
||||
should contain_nova_config('DEFAULT/instance_uuid_format').with_value(
|
||||
is_expected.to contain_nova_config('DEFAULT/instance_uuid_format').with_value(
|
||||
'[instance: %(uuid)s] ')
|
||||
|
||||
should contain_nova_config('DEFAULT/log_date_format').with_value(
|
||||
is_expected.to contain_nova_config('DEFAULT/log_date_format').with_value(
|
||||
'%Y-%m-%d %H:%M:%S')
|
||||
end
|
||||
end
|
||||
|
@ -84,7 +84,7 @@ describe 'nova::logging' do
|
|||
:default_log_levels, :fatal_deprecations,
|
||||
:instance_format, :instance_uuid_format,
|
||||
:log_date_format, ].each { |param|
|
||||
it { should contain_nova_config("DEFAULT/#{param}").with_ensure('absent') }
|
||||
it { is_expected.to contain_nova_config("DEFAULT/#{param}").with_ensure('absent') }
|
||||
}
|
||||
end
|
||||
|
||||
|
|
|
@ -32,9 +32,9 @@ describe 'nova::migration::libvirt' do
|
|||
shared_examples_for 'nova migration with libvirt' do
|
||||
|
||||
it 'configure libvirtd.conf' do
|
||||
should contain_file_line('/etc/libvirt/libvirtd.conf listen_tls').with(:line => 'listen_tls = 0')
|
||||
should contain_file_line('/etc/libvirt/libvirtd.conf listen_tcp').with(:line => 'listen_tcp = 1')
|
||||
should contain_file_line('/etc/libvirt/libvirtd.conf auth_tcp').with(:line => 'auth_tcp = "none"')
|
||||
is_expected.to contain_file_line('/etc/libvirt/libvirtd.conf listen_tls').with(:line => 'listen_tls = 0')
|
||||
is_expected.to contain_file_line('/etc/libvirt/libvirtd.conf listen_tcp').with(:line => 'listen_tcp = 1')
|
||||
is_expected.to contain_file_line('/etc/libvirt/libvirtd.conf auth_tcp').with(:line => 'auth_tcp = "none"')
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -45,7 +45,7 @@ describe 'nova::migration::libvirt' do
|
|||
end
|
||||
|
||||
it_configures 'nova migration with libvirt'
|
||||
it { should contain_file_line('/etc/default/libvirt-bin libvirtd opts').with(:line => 'libvirtd_opts="-d -l"') }
|
||||
it { is_expected.to contain_file_line('/etc/default/libvirt-bin libvirtd opts').with(:line => 'libvirtd_opts="-d -l"') }
|
||||
end
|
||||
|
||||
context 'on RedHat platforms' do
|
||||
|
@ -54,7 +54,7 @@ describe 'nova::migration::libvirt' do
|
|||
end
|
||||
|
||||
it_configures 'nova migration with libvirt'
|
||||
it { should contain_file_line('/etc/sysconfig/libvirtd libvirtd args').with(:line => 'LIBVIRTD_ARGS="--listen"') }
|
||||
it { is_expected.to contain_file_line('/etc/sysconfig/libvirtd libvirtd args').with(:line => 'LIBVIRTD_ARGS="--listen"') }
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -9,11 +9,11 @@ describe 'nova::network::flat' do
|
|||
}
|
||||
end
|
||||
|
||||
it { should contain_nova_config('DEFAULT/network_manager').with_value('nova.network.manager.FlatManager') }
|
||||
it { should_not contain_nova_config('DEFAULT/public_interface') }
|
||||
it { should contain_nova_config('DEFAULT/fixed_range').with_value('10.0.0.0/32') }
|
||||
it { should contain_nova_config('DEFAULT/flat_network_bridge').with_value('br100') }
|
||||
it { should contain_nova_config('DEFAULT/flat_interface').with_value(nil) }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/network_manager').with_value('nova.network.manager.FlatManager') }
|
||||
it { is_expected.to_not contain_nova_config('DEFAULT/public_interface') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/fixed_range').with_value('10.0.0.0/32') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/flat_network_bridge').with_value('br100') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/flat_interface').with_value(nil) }
|
||||
end
|
||||
|
||||
describe 'when overriding class parameters' do
|
||||
|
@ -27,10 +27,10 @@ describe 'nova::network::flat' do
|
|||
}
|
||||
end
|
||||
|
||||
it { should contain_nova_config('DEFAULT/public_interface').with_value('eth0') }
|
||||
it { should contain_nova_config('DEFAULT/flat_network_bridge').with_value('br1001') }
|
||||
it { should contain_nova_config('DEFAULT/fixed_range').with_value('10.0.0.0/32') }
|
||||
it { should contain_nova_config('DEFAULT/flat_interface').with_value('eth1') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/public_interface').with_value('eth0') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/flat_network_bridge').with_value('br1001') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/fixed_range').with_value('10.0.0.0/32') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/flat_interface').with_value('eth1') }
|
||||
|
||||
end
|
||||
|
||||
|
|
|
@ -10,16 +10,16 @@ describe 'nova::network::flatdhcp' do
|
|||
}
|
||||
end
|
||||
|
||||
it { should contain_nova_config('DEFAULT/network_manager').with_value('nova.network.manager.FlatDHCPManager') }
|
||||
it { should_not contain_nova_config('DEFAULT/public_interface') }
|
||||
it { should contain_nova_config('DEFAULT/fixed_range').with_value('10.0.0.0/32') }
|
||||
it { should contain_nova_config('DEFAULT/flat_interface').with_value('eth1') }
|
||||
it { should contain_nova_config('DEFAULT/flat_interface').with_value('eth1') }
|
||||
it { should contain_nova_config('DEFAULT/flat_network_bridge').with_value('br100') }
|
||||
it { should contain_nova_config('DEFAULT/force_dhcp_release').with_value(true) }
|
||||
it { should contain_nova_config('DEFAULT/flat_injected').with_value(false) }
|
||||
it { should contain_nova_config('DEFAULT/dhcpbridge').with_value('/usr/bin/nova-dhcpbridge') }
|
||||
it { should contain_nova_config('DEFAULT/dhcpbridge_flagfile').with_value('/etc/nova/nova.conf') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/network_manager').with_value('nova.network.manager.FlatDHCPManager') }
|
||||
it { is_expected.to_not contain_nova_config('DEFAULT/public_interface') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/fixed_range').with_value('10.0.0.0/32') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/flat_interface').with_value('eth1') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/flat_interface').with_value('eth1') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/flat_network_bridge').with_value('br100') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/force_dhcp_release').with_value(true) }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/flat_injected').with_value(false) }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/dhcpbridge').with_value('/usr/bin/nova-dhcpbridge') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/dhcpbridge_flagfile').with_value('/etc/nova/nova.conf') }
|
||||
end
|
||||
|
||||
describe 'when overriding class parameters' do
|
||||
|
@ -37,12 +37,12 @@ describe 'nova::network::flatdhcp' do
|
|||
}
|
||||
end
|
||||
|
||||
it { should contain_nova_config('DEFAULT/public_interface').with_value('eth0') }
|
||||
it { should contain_nova_config('DEFAULT/flat_network_bridge').with_value('br1001') }
|
||||
it { should contain_nova_config('DEFAULT/force_dhcp_release').with_value(false) }
|
||||
it { should contain_nova_config('DEFAULT/flat_injected').with_value(true) }
|
||||
it { should contain_nova_config('DEFAULT/dhcpbridge').with_value('/usr/bin/dhcpbridge') }
|
||||
it { should contain_nova_config('DEFAULT/dhcpbridge_flagfile').with_value('/etc/nova/nova-dhcp.conf') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/public_interface').with_value('eth0') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/flat_network_bridge').with_value('br1001') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/force_dhcp_release').with_value(false) }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/flat_injected').with_value(true) }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/dhcpbridge').with_value('/usr/bin/dhcpbridge') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/dhcpbridge_flagfile').with_value('/etc/nova/nova-dhcp.conf') }
|
||||
|
||||
end
|
||||
|
||||
|
|
|
@ -28,27 +28,27 @@ describe 'nova::network::neutron' do
|
|||
|
||||
context 'with required parameters' do
|
||||
it 'configures neutron endpoint in nova.conf' do
|
||||
should contain_nova_config('neutron/admin_password').with_value(params[:neutron_admin_password]).with_secret(true)
|
||||
should contain_nova_config('DEFAULT/network_api_class').with_value('nova.network.neutronv2.api.API')
|
||||
should contain_nova_config('DEFAULT/dhcp_domain').with_value(default_params[:dhcp_domain])
|
||||
should contain_nova_config('neutron/auth_strategy').with_value(default_params[:neutron_auth_strategy])
|
||||
should contain_nova_config('neutron/url').with_value(default_params[:neutron_url])
|
||||
should contain_nova_config('neutron/url_timeout').with_value(default_params[:neutron_url_timeout])
|
||||
should contain_nova_config('neutron/admin_tenant_name').with_value(default_params[:neutron_admin_tenant_name])
|
||||
should contain_nova_config('neutron/default_tenant_id').with_value(default_params[:neutron_default_tenant_id])
|
||||
should contain_nova_config('neutron/region_name').with_value(default_params[:neutron_region_name])
|
||||
should contain_nova_config('neutron/admin_username').with_value(default_params[:neutron_admin_username])
|
||||
should contain_nova_config('neutron/admin_auth_url').with_value(default_params[:neutron_admin_auth_url])
|
||||
should contain_nova_config('neutron/extension_sync_interval').with_value(default_params[:neutron_extension_sync_interval])
|
||||
is_expected.to contain_nova_config('neutron/admin_password').with_value(params[:neutron_admin_password]).with_secret(true)
|
||||
is_expected.to contain_nova_config('DEFAULT/network_api_class').with_value('nova.network.neutronv2.api.API')
|
||||
is_expected.to contain_nova_config('DEFAULT/dhcp_domain').with_value(default_params[:dhcp_domain])
|
||||
is_expected.to contain_nova_config('neutron/auth_strategy').with_value(default_params[:neutron_auth_strategy])
|
||||
is_expected.to contain_nova_config('neutron/url').with_value(default_params[:neutron_url])
|
||||
is_expected.to contain_nova_config('neutron/url_timeout').with_value(default_params[:neutron_url_timeout])
|
||||
is_expected.to contain_nova_config('neutron/admin_tenant_name').with_value(default_params[:neutron_admin_tenant_name])
|
||||
is_expected.to contain_nova_config('neutron/default_tenant_id').with_value(default_params[:neutron_default_tenant_id])
|
||||
is_expected.to contain_nova_config('neutron/region_name').with_value(default_params[:neutron_region_name])
|
||||
is_expected.to contain_nova_config('neutron/admin_username').with_value(default_params[:neutron_admin_username])
|
||||
is_expected.to contain_nova_config('neutron/admin_auth_url').with_value(default_params[:neutron_admin_auth_url])
|
||||
is_expected.to contain_nova_config('neutron/extension_sync_interval').with_value(default_params[:neutron_extension_sync_interval])
|
||||
end
|
||||
it 'configures Nova to use Neutron Bridge Security Groups and Firewall' do
|
||||
should contain_nova_config('DEFAULT/firewall_driver').with_value(default_params[:firewall_driver])
|
||||
should contain_nova_config('DEFAULT/security_group_api').with_value(default_params[:security_group_api])
|
||||
should contain_nova_config('neutron/ovs_bridge').with_value(default_params[:neutron_ovs_bridge])
|
||||
is_expected.to contain_nova_config('DEFAULT/firewall_driver').with_value(default_params[:firewall_driver])
|
||||
is_expected.to contain_nova_config('DEFAULT/security_group_api').with_value(default_params[:security_group_api])
|
||||
is_expected.to contain_nova_config('neutron/ovs_bridge').with_value(default_params[:neutron_ovs_bridge])
|
||||
end
|
||||
it 'configures neutron vif plugging events in nova.conf' do
|
||||
should contain_nova_config('DEFAULT/vif_plugging_is_fatal').with_value(default_params[:vif_plugging_is_fatal])
|
||||
should contain_nova_config('DEFAULT/vif_plugging_timeout').with_value(default_params[:vif_plugging_timeout])
|
||||
is_expected.to contain_nova_config('DEFAULT/vif_plugging_is_fatal').with_value(default_params[:vif_plugging_is_fatal])
|
||||
is_expected.to contain_nova_config('DEFAULT/vif_plugging_timeout').with_value(default_params[:vif_plugging_timeout])
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -74,27 +74,27 @@ describe 'nova::network::neutron' do
|
|||
end
|
||||
|
||||
it 'configures neutron endpoint in nova.conf' do
|
||||
should contain_nova_config('neutron/auth_strategy').with_value(default_params[:neutron_auth_strategy])
|
||||
should contain_nova_config('neutron/admin_password').with_value(params[:neutron_admin_password]).with_secret(true)
|
||||
should contain_nova_config('DEFAULT/network_api_class').with_value('network.api.class')
|
||||
should contain_nova_config('DEFAULT/dhcp_domain').with_value(params[:dhcp_domain])
|
||||
should contain_nova_config('neutron/url').with_value(params[:neutron_url])
|
||||
should contain_nova_config('neutron/url_timeout').with_value(params[:neutron_url_timeout])
|
||||
should contain_nova_config('neutron/admin_tenant_name').with_value(params[:neutron_admin_tenant_name])
|
||||
should contain_nova_config('neutron/default_tenant_id').with_value(params[:neutron_default_tenant_id])
|
||||
should contain_nova_config('neutron/region_name').with_value(params[:neutron_region_name])
|
||||
should contain_nova_config('neutron/admin_username').with_value(params[:neutron_admin_username])
|
||||
should contain_nova_config('neutron/admin_auth_url').with_value(params[:neutron_admin_auth_url])
|
||||
should contain_nova_config('neutron/extension_sync_interval').with_value(params[:neutron_extension_sync_interval])
|
||||
is_expected.to contain_nova_config('neutron/auth_strategy').with_value(default_params[:neutron_auth_strategy])
|
||||
is_expected.to contain_nova_config('neutron/admin_password').with_value(params[:neutron_admin_password]).with_secret(true)
|
||||
is_expected.to contain_nova_config('DEFAULT/network_api_class').with_value('network.api.class')
|
||||
is_expected.to contain_nova_config('DEFAULT/dhcp_domain').with_value(params[:dhcp_domain])
|
||||
is_expected.to contain_nova_config('neutron/url').with_value(params[:neutron_url])
|
||||
is_expected.to contain_nova_config('neutron/url_timeout').with_value(params[:neutron_url_timeout])
|
||||
is_expected.to contain_nova_config('neutron/admin_tenant_name').with_value(params[:neutron_admin_tenant_name])
|
||||
is_expected.to contain_nova_config('neutron/default_tenant_id').with_value(params[:neutron_default_tenant_id])
|
||||
is_expected.to contain_nova_config('neutron/region_name').with_value(params[:neutron_region_name])
|
||||
is_expected.to contain_nova_config('neutron/admin_username').with_value(params[:neutron_admin_username])
|
||||
is_expected.to contain_nova_config('neutron/admin_auth_url').with_value(params[:neutron_admin_auth_url])
|
||||
is_expected.to contain_nova_config('neutron/extension_sync_interval').with_value(params[:neutron_extension_sync_interval])
|
||||
end
|
||||
it 'configures Nova to use Neutron Security Groups and Firewall' do
|
||||
should contain_nova_config('DEFAULT/firewall_driver').with_value(params[:firewall_driver])
|
||||
should contain_nova_config('DEFAULT/security_group_api').with_value(params[:security_group_api])
|
||||
should contain_nova_config('neutron/ovs_bridge').with_value(params[:neutron_ovs_bridge])
|
||||
is_expected.to contain_nova_config('DEFAULT/firewall_driver').with_value(params[:firewall_driver])
|
||||
is_expected.to contain_nova_config('DEFAULT/security_group_api').with_value(params[:security_group_api])
|
||||
is_expected.to contain_nova_config('neutron/ovs_bridge').with_value(params[:neutron_ovs_bridge])
|
||||
end
|
||||
it 'configures neutron vif plugging events in nova.conf' do
|
||||
should contain_nova_config('DEFAULT/vif_plugging_is_fatal').with_value(params[:vif_plugging_is_fatal])
|
||||
should contain_nova_config('DEFAULT/vif_plugging_timeout').with_value(params[:vif_plugging_timeout])
|
||||
is_expected.to contain_nova_config('DEFAULT/vif_plugging_is_fatal').with_value(params[:vif_plugging_is_fatal])
|
||||
is_expected.to contain_nova_config('DEFAULT/vif_plugging_timeout').with_value(params[:vif_plugging_timeout])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -23,11 +23,11 @@ describe 'nova::network' do
|
|||
{ :osfamily => 'Debian' }
|
||||
end
|
||||
|
||||
it { should contain_sysctl__value('net.ipv4.ip_forward').with_value('1') }
|
||||
it { is_expected.to contain_sysctl__value('net.ipv4.ip_forward').with_value('1') }
|
||||
|
||||
describe 'when installing service' do
|
||||
|
||||
it { should contain_package('nova-network').with(
|
||||
it { is_expected.to contain_package('nova-network').with(
|
||||
'name' => 'nova-network',
|
||||
'ensure' => 'present',
|
||||
'notify' => 'Service[nova-network]'
|
||||
|
@ -37,7 +37,7 @@ describe 'nova::network' do
|
|||
let :params do
|
||||
default_params.merge(:enabled => true)
|
||||
end
|
||||
it { should contain_service('nova-network').with(
|
||||
it { is_expected.to contain_service('nova-network').with(
|
||||
'name' => 'nova-network',
|
||||
'ensure' => 'running',
|
||||
'hasstatus' => true,
|
||||
|
@ -45,7 +45,7 @@ describe 'nova::network' do
|
|||
)}
|
||||
end
|
||||
describe 'when enabled is set to false' do
|
||||
it { should contain_service('nova-network').with(
|
||||
it { is_expected.to contain_service('nova-network').with(
|
||||
'name' => 'nova-network',
|
||||
'ensure' => 'stopped',
|
||||
'hasstatus' => true,
|
||||
|
@ -59,8 +59,8 @@ describe 'nova::network' do
|
|||
default_params.merge(:install_service => false)
|
||||
end
|
||||
|
||||
it { should_not contain_package('nova-network') }
|
||||
it { should_not contain_service('nova-network') }
|
||||
it { is_expected.to_not contain_package('nova-network') }
|
||||
it { is_expected.to_not contain_service('nova-network') }
|
||||
|
||||
end
|
||||
|
||||
|
@ -68,21 +68,21 @@ describe 'nova::network' do
|
|||
let :params do
|
||||
default_params.merge(:create_networks => false)
|
||||
end
|
||||
it { should_not contain_nova__manage__network('nova-vm-net') }
|
||||
it { should_not contain_nova__manage__floating('nova-vm-floating') }
|
||||
it { is_expected.to_not contain_nova__manage__network('nova-vm-net') }
|
||||
it { is_expected.to_not contain_nova__manage__floating('nova-vm-floating') }
|
||||
end
|
||||
|
||||
describe 'when creating networks' do
|
||||
it { should contain_nova__manage__network('nova-vm-net').with(
|
||||
it { is_expected.to contain_nova__manage__network('nova-vm-net').with(
|
||||
:network => '10.0.0.0/32',
|
||||
:num_networks => '1'
|
||||
) }
|
||||
it { should_not contain__nova__manage__floating('nova-vm-floating') }
|
||||
it { is_expected.to_not contain__nova__manage__floating('nova-vm-floating') }
|
||||
describe 'when number of networks is set' do
|
||||
let :params do
|
||||
default_params.merge(:num_networks => '2')
|
||||
end
|
||||
it { should contain_nova__manage__network('nova-vm-net').with(
|
||||
it { is_expected.to contain_nova__manage__network('nova-vm-net').with(
|
||||
:num_networks => '2'
|
||||
) }
|
||||
end
|
||||
|
@ -90,8 +90,8 @@ describe 'nova::network' do
|
|||
let :params do
|
||||
default_params.merge(:floating_range => '10.0.0.0/30')
|
||||
end
|
||||
it { should contain_nova_config('DEFAULT/floating_range').with_value('10.0.0.0/30') }
|
||||
it { should contain_nova__manage__floating('nova-vm-floating').with_network('10.0.0.0/30') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/floating_range').with_value('10.0.0.0/30') }
|
||||
it { is_expected.to contain_nova__manage__floating('nova-vm-floating').with_network('10.0.0.0/30') }
|
||||
end
|
||||
end
|
||||
describe 'when configuring networks' do
|
||||
|
@ -99,7 +99,7 @@ describe 'nova::network' do
|
|||
let :params do
|
||||
default_params.merge(:network_manager => 'nova.network.manager.FlatDHCPManager')
|
||||
end
|
||||
it { should contain_class('nova::network::flatdhcp').with(
|
||||
it { is_expected.to contain_class('nova::network::flatdhcp').with(
|
||||
:fixed_range => '10.0.0.0/32',
|
||||
:public_interface => nil,
|
||||
:flat_interface => 'eth1',
|
||||
|
@ -128,7 +128,7 @@ describe 'nova::network' do
|
|||
}
|
||||
)
|
||||
end
|
||||
it { should contain_class('nova::network::flatdhcp').with(
|
||||
it { is_expected.to contain_class('nova::network::flatdhcp').with(
|
||||
:fixed_range => '10.0.0.0/32',
|
||||
:public_interface => 'eth0',
|
||||
:flat_interface => 'eth1',
|
||||
|
@ -146,7 +146,7 @@ describe 'nova::network' do
|
|||
let :params do
|
||||
default_params.merge(:network_manager => 'nova.network.manager.FlatManager')
|
||||
end
|
||||
it { should contain_class('nova::network::flat').with(
|
||||
it { is_expected.to contain_class('nova::network::flat').with(
|
||||
:fixed_range => '10.0.0.0/32',
|
||||
:public_interface => nil,
|
||||
:flat_interface => 'eth1',
|
||||
|
@ -162,7 +162,7 @@ describe 'nova::network' do
|
|||
}
|
||||
)
|
||||
end
|
||||
it { should contain_class('nova::network::flat').with(
|
||||
it { is_expected.to contain_class('nova::network::flat').with(
|
||||
:public_interface => 'eth0',
|
||||
:flat_network_bridge => 'br400'
|
||||
) }
|
||||
|
@ -172,7 +172,7 @@ describe 'nova::network' do
|
|||
let :params do
|
||||
default_params.merge(:network_manager => 'nova.network.manager.VlanManager')
|
||||
end
|
||||
it { should contain_class('nova::network::vlan').with(
|
||||
it { is_expected.to contain_class('nova::network::vlan').with(
|
||||
:fixed_range => '10.0.0.0/32',
|
||||
:public_interface => nil,
|
||||
:vlan_interface => 'eth1',
|
||||
|
@ -195,7 +195,7 @@ describe 'nova::network' do
|
|||
let :params do
|
||||
default_params.merge(:ensure_package => '2012.1-2')
|
||||
end
|
||||
it { should contain_package('nova-network').with(
|
||||
it { is_expected.to contain_package('nova-network').with(
|
||||
'ensure' => '2012.1-2'
|
||||
)}
|
||||
end
|
||||
|
@ -204,12 +204,12 @@ describe 'nova::network' do
|
|||
let :facts do
|
||||
{ :osfamily => 'RedHat' }
|
||||
end
|
||||
it { should contain_service('nova-network').with(
|
||||
it { is_expected.to contain_service('nova-network').with(
|
||||
'name' => 'openstack-nova-network',
|
||||
'ensure' => 'stopped',
|
||||
'hasstatus' => true,
|
||||
'enable' => false
|
||||
)}
|
||||
it { should contain_package('nova-network').with_name('openstack-nova-network') }
|
||||
it { is_expected.to contain_package('nova-network').with_name('openstack-nova-network') }
|
||||
end
|
||||
end
|
||||
|
|
|
@ -10,14 +10,14 @@ describe 'nova::network::vlan' do
|
|||
}
|
||||
end
|
||||
|
||||
it { should contain_nova_config('DEFAULT/network_manager').with_value('nova.network.manager.VlanManager') }
|
||||
it { should_not contain_nova_config('DEFAULT/public_interface') }
|
||||
it { should contain_nova_config('DEFAULT/fixed_range').with_value('10.0.0.0/32') }
|
||||
it { should contain_nova_config('DEFAULT/vlan_start').with_value('300') }
|
||||
it { should contain_nova_config('DEFAULT/vlan_interface').with_value('eth1') }
|
||||
it { should contain_nova_config('DEFAULT/force_dhcp_release').with_value(true) }
|
||||
it { should contain_nova_config('DEFAULT/dhcpbridge').with_value('/usr/bin/nova-dhcpbridge') }
|
||||
it { should contain_nova_config('DEFAULT/dhcpbridge_flagfile').with_value('/etc/nova/nova.conf') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/network_manager').with_value('nova.network.manager.VlanManager') }
|
||||
it { is_expected.to_not contain_nova_config('DEFAULT/public_interface') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/fixed_range').with_value('10.0.0.0/32') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/vlan_start').with_value('300') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/vlan_interface').with_value('eth1') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/force_dhcp_release').with_value(true) }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/dhcpbridge').with_value('/usr/bin/nova-dhcpbridge') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/dhcpbridge_flagfile').with_value('/etc/nova/nova.conf') }
|
||||
|
||||
end
|
||||
|
||||
|
@ -35,13 +35,13 @@ describe 'nova::network::vlan' do
|
|||
}
|
||||
end
|
||||
|
||||
it { should contain_nova_config('DEFAULT/network_manager').with_value('nova.network.manager.VlanManager') }
|
||||
it { should contain_nova_config('DEFAULT/public_interface').with_value('eth0') }
|
||||
it { should contain_nova_config('DEFAULT/fixed_range').with_value('10.0.0.0/32') }
|
||||
it { should contain_nova_config('DEFAULT/vlan_start').with_value('100') }
|
||||
it { should contain_nova_config('DEFAULT/vlan_interface').with_value('eth1') }
|
||||
it { should contain_nova_config('DEFAULT/force_dhcp_release').with_value(false) }
|
||||
it { should contain_nova_config('DEFAULT/dhcpbridge').with_value('/usr/bin/dhcpbridge') }
|
||||
it { should contain_nova_config('DEFAULT/dhcpbridge_flagfile').with_value('/etc/nova/nova-dhcp.conf') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/network_manager').with_value('nova.network.manager.VlanManager') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/public_interface').with_value('eth0') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/fixed_range').with_value('10.0.0.0/32') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/vlan_start').with_value('100') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/vlan_interface').with_value('eth1') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/force_dhcp_release').with_value(false) }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/dhcpbridge').with_value('/usr/bin/dhcpbridge') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/dhcpbridge_flagfile').with_value('/etc/nova/nova-dhcp.conf') }
|
||||
end
|
||||
end
|
||||
|
|
|
@ -15,13 +15,13 @@ describe 'nova::objectstore' do
|
|||
:name => 'nova-objectstore',
|
||||
:package_name => 'nova-objectstore',
|
||||
:service_name => 'nova-objectstore' }
|
||||
it { should contain_nova_config('DEFAULT/s3_listen').with_value('0.0.0.0') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/s3_listen').with_value('0.0.0.0') }
|
||||
|
||||
context 'with custom bind parameter' do
|
||||
let :params do
|
||||
{ :bind_address => '192.168.0.1'}
|
||||
end
|
||||
it { should contain_nova_config('DEFAULT/s3_listen').with_value('192.168.0.1') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/s3_listen').with_value('192.168.0.1') }
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -35,13 +35,13 @@ describe 'nova::objectstore' do
|
|||
:name => 'nova-objectstore',
|
||||
:package_name => 'openstack-nova-objectstore',
|
||||
:service_name => 'openstack-nova-objectstore' }
|
||||
it { should contain_nova_config('DEFAULT/s3_listen').with_value('0.0.0.0')}
|
||||
it { is_expected.to contain_nova_config('DEFAULT/s3_listen').with_value('0.0.0.0')}
|
||||
|
||||
context 'with custom bind parameter' do
|
||||
let :params do
|
||||
{ :bind_address => '192.168.0.1'}
|
||||
end
|
||||
it { should contain_nova_config('DEFAULT/s3_listen').with_value('192.168.0.1') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/s3_listen').with_value('192.168.0.1') }
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -16,7 +16,7 @@ describe 'nova::policy' do
|
|||
end
|
||||
|
||||
it 'set up the policies' do
|
||||
should contain_openstacklib__policy__base('context_is_admin').with({
|
||||
is_expected.to contain_openstacklib__policy__base('context_is_admin').with({
|
||||
:key => 'context_is_admin',
|
||||
:value => 'foo:bar'
|
||||
})
|
||||
|
|
|
@ -10,7 +10,7 @@ describe 'nova::qpid' do
|
|||
|
||||
it 'should contain all of the default resources' do
|
||||
|
||||
should contain_class('qpid::server').with(
|
||||
is_expected.to contain_class('qpid::server').with(
|
||||
:service_ensure => 'running',
|
||||
:port => '5672'
|
||||
)
|
||||
|
@ -19,7 +19,7 @@ describe 'nova::qpid' do
|
|||
|
||||
it 'should contain user' do
|
||||
|
||||
should contain_qpid_user('guest').with(
|
||||
is_expected.to contain_qpid_user('guest').with(
|
||||
:password => 'guest',
|
||||
:file => '/var/lib/qpidd/qpidd.sasldb',
|
||||
:realm => 'OPENSTACK',
|
||||
|
@ -39,8 +39,8 @@ describe 'nova::qpid' do
|
|||
|
||||
it 'should be disabled' do
|
||||
|
||||
should_not contain_qpid_user('guest')
|
||||
should contain_class('qpid::server').with(
|
||||
is_expected.to_not contain_qpid_user('guest')
|
||||
is_expected.to contain_class('qpid::server').with(
|
||||
:service_ensure => 'stopped'
|
||||
)
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ describe 'nova::quota' do
|
|||
|
||||
it 'configures quota in nova.conf' do
|
||||
params_hash.each_pair do |config,value|
|
||||
should contain_nova_config("DEFAULT/#{config}").with_value( value )
|
||||
is_expected.to contain_nova_config("DEFAULT/#{config}").with_value( value )
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -74,13 +74,13 @@ describe 'nova::quota' do
|
|||
end
|
||||
|
||||
it {
|
||||
should contain_nova_config('DEFAULT/quota_injected_files').with_value('10')
|
||||
should contain_nova_config('DEFAULT/quota_injected_file_content_bytes').with_value('20480')
|
||||
should contain_nova_config('DEFAULT/quota_injected_file_path_length').with_value('254')
|
||||
is_expected.to contain_nova_config('DEFAULT/quota_injected_files').with_value('10')
|
||||
is_expected.to contain_nova_config('DEFAULT/quota_injected_file_content_bytes').with_value('20480')
|
||||
is_expected.to contain_nova_config('DEFAULT/quota_injected_file_path_length').with_value('254')
|
||||
}
|
||||
end
|
||||
|
||||
it { should contain_nova_config('DEFAULT/quota_ram').with_value('51200') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/quota_ram').with_value('51200') }
|
||||
|
||||
describe 'when overriding params' do
|
||||
|
||||
|
@ -88,7 +88,7 @@ describe 'nova::quota' do
|
|||
{:quota_ram => '1'}
|
||||
end
|
||||
|
||||
it { should contain_nova_config('DEFAULT/quota_ram').with_value('1') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/quota_ram').with_value('1') }
|
||||
|
||||
end
|
||||
|
||||
|
|
|
@ -13,13 +13,13 @@ describe 'nova::rabbitmq' do
|
|||
|
||||
it 'should contain all of the default resources' do
|
||||
|
||||
should contain_class('rabbitmq::server').with(
|
||||
is_expected.to contain_class('rabbitmq::server').with(
|
||||
:service_ensure => 'running',
|
||||
:port => '5672',
|
||||
:delete_guest_user => false
|
||||
)
|
||||
|
||||
should contain_rabbitmq_vhost('/').with(
|
||||
is_expected.to contain_rabbitmq_vhost('/').with(
|
||||
:provider => 'rabbitmqctl'
|
||||
)
|
||||
end
|
||||
|
@ -37,13 +37,13 @@ describe 'nova::rabbitmq' do
|
|||
|
||||
it 'should contain user and permissions' do
|
||||
|
||||
should contain_rabbitmq_user('dan').with(
|
||||
is_expected.to contain_rabbitmq_user('dan').with(
|
||||
:admin => true,
|
||||
:password => 'pass',
|
||||
:provider => 'rabbitmqctl'
|
||||
)
|
||||
|
||||
should contain_rabbitmq_user_permissions('dan@/').with(
|
||||
is_expected.to contain_rabbitmq_user_permissions('dan@/').with(
|
||||
:configure_permission => '.*',
|
||||
:write_permission => '.*',
|
||||
:read_permission => '.*',
|
||||
|
@ -65,15 +65,15 @@ describe 'nova::rabbitmq' do
|
|||
|
||||
it 'should be disabled' do
|
||||
|
||||
should_not contain_rabbitmq_user('dan')
|
||||
should_not contain_rabbitmq_user_permissions('dan@/')
|
||||
should contain_class('rabbitmq::server').with(
|
||||
is_expected.to_not contain_rabbitmq_user('dan')
|
||||
is_expected.to_not contain_rabbitmq_user_permissions('dan@/')
|
||||
is_expected.to contain_class('rabbitmq::server').with(
|
||||
:service_ensure => 'stopped',
|
||||
:port => '5672',
|
||||
:delete_guest_user => false
|
||||
)
|
||||
|
||||
should_not contain_rabbitmq_vhost('/')
|
||||
is_expected.to_not contain_rabbitmq_vhost('/')
|
||||
|
||||
end
|
||||
end
|
||||
|
@ -88,7 +88,7 @@ describe 'nova::rabbitmq' do
|
|||
|
||||
it 'should contain all the clustering resources' do
|
||||
|
||||
should contain_class('rabbitmq::server').with(
|
||||
is_expected.to contain_class('rabbitmq::server').with(
|
||||
:service_ensure => 'running',
|
||||
:port => '5672',
|
||||
:delete_guest_user => false,
|
||||
|
@ -111,7 +111,7 @@ describe 'nova::rabbitmq' do
|
|||
|
||||
it 'should not contain rabbitmq class calls' do
|
||||
|
||||
should_not contain_class('rabbitmq::server')
|
||||
is_expected.to_not contain_class('rabbitmq::server')
|
||||
|
||||
end
|
||||
|
||||
|
|
|
@ -2,16 +2,16 @@ require 'spec_helper'
|
|||
|
||||
describe 'nova::scheduler::filter' do
|
||||
|
||||
it { should contain_nova_config('DEFAULT/scheduler_host_manager').with_value('nova.scheduler.host_manager.HostManager') }
|
||||
it { should contain_nova_config('DEFAULT/scheduler_max_attempts').with_value('3') }
|
||||
it { should contain_nova_config('DEFAULT/scheduler_host_subset_size').with_value('1') }
|
||||
it { should contain_nova_config('DEFAULT/cpu_allocation_ratio').with_value('16.0') }
|
||||
it { should contain_nova_config('DEFAULT/disk_allocation_ratio').with_value('1.0') }
|
||||
it { should contain_nova_config('DEFAULT/max_io_ops_per_host').with_value('8') }
|
||||
it { should contain_nova_config('DEFAULT/max_instances_per_host').with_value('50') }
|
||||
it { should contain_nova_config('DEFAULT/ram_allocation_ratio').with_value('1.5') }
|
||||
it { should contain_nova_config('DEFAULT/scheduler_available_filters').with_value('nova.scheduler.filters.all_filters') }
|
||||
it { should contain_nova_config('DEFAULT/scheduler_weight_classes').with_value('nova.scheduler.weights.all_weighers') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/scheduler_host_manager').with_value('nova.scheduler.host_manager.HostManager') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/scheduler_max_attempts').with_value('3') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/scheduler_host_subset_size').with_value('1') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/cpu_allocation_ratio').with_value('16.0') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/disk_allocation_ratio').with_value('1.0') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/max_io_ops_per_host').with_value('8') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/max_instances_per_host').with_value('50') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/ram_allocation_ratio').with_value('1.5') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/scheduler_available_filters').with_value('nova.scheduler.filters.all_filters') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/scheduler_weight_classes').with_value('nova.scheduler.weights.all_weighers') }
|
||||
|
||||
describe 'when overriding params' do
|
||||
|
||||
|
@ -23,10 +23,10 @@ describe 'nova::scheduler::filter' do
|
|||
}
|
||||
end
|
||||
|
||||
it { should contain_nova_config('DEFAULT/scheduler_max_attempts').with_value('4') }
|
||||
it { should contain_nova_config('DEFAULT/isolated_images').with_value('ubuntu1,centos2') }
|
||||
it { should contain_nova_config('DEFAULT/isolated_hosts').with_value('192.168.1.2,192.168.1.3') }
|
||||
it { should contain_nova_config('DEFAULT/scheduler_default_filters').with_value('RetryFilter,AvailabilityZoneFilter,RamFilter') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/scheduler_max_attempts').with_value('4') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/isolated_images').with_value('ubuntu1,centos2') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/isolated_hosts').with_value('192.168.1.2,192.168.1.3') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/scheduler_default_filters').with_value('RetryFilter,AvailabilityZoneFilter,RamFilter') }
|
||||
|
||||
end
|
||||
|
||||
|
|
|
@ -13,12 +13,12 @@ describe 'nova::scheduler' do
|
|||
shared_examples 'nova-scheduler' do
|
||||
|
||||
|
||||
it { should contain_package('nova-scheduler').with(
|
||||
it { is_expected.to contain_package('nova-scheduler').with(
|
||||
:name => platform_params[:scheduler_package_name],
|
||||
:ensure => 'present'
|
||||
) }
|
||||
|
||||
it { should contain_service('nova-scheduler').with(
|
||||
it { is_expected.to contain_service('nova-scheduler').with(
|
||||
:name => platform_params[:scheduler_service_name],
|
||||
:hasstatus => 'true',
|
||||
:ensure => 'running'
|
||||
|
@ -30,7 +30,7 @@ describe 'nova::scheduler' do
|
|||
:manage_service => false
|
||||
}
|
||||
end
|
||||
it { should contain_service('nova-scheduler').without_ensure }
|
||||
it { is_expected.to contain_service('nova-scheduler').without_ensure }
|
||||
end
|
||||
|
||||
context 'with package version' do
|
||||
|
@ -38,7 +38,7 @@ describe 'nova::scheduler' do
|
|||
{ :ensure_package => '2012.1-2' }
|
||||
end
|
||||
|
||||
it { should contain_package('nova-scheduler').with(
|
||||
it { is_expected.to contain_package('nova-scheduler').with(
|
||||
:ensure => params[:ensure_package]
|
||||
)}
|
||||
end
|
||||
|
@ -48,9 +48,9 @@ describe 'nova::scheduler' do
|
|||
"include nova"
|
||||
end
|
||||
|
||||
it { should_not contain_nova_config('database/connection') }
|
||||
it { should_not contain_nova_config('database/slave_connection') }
|
||||
it { should_not contain_nova_config('database/idle_timeout').with_value('3600') }
|
||||
it { is_expected.to_not contain_nova_config('database/connection') }
|
||||
it { is_expected.to_not contain_nova_config('database/slave_connection') }
|
||||
it { is_expected.to_not contain_nova_config('database/idle_timeout').with_value('3600') }
|
||||
end
|
||||
|
||||
context 'with overridden database parameters' do
|
||||
|
@ -63,9 +63,9 @@ describe 'nova::scheduler' do
|
|||
"
|
||||
end
|
||||
|
||||
it { should contain_nova_config('database/connection').with_value('mysql://user:pass@db/db').with_secret(true) }
|
||||
it { should contain_nova_config('database/slave_connection').with_value('mysql://user:pass@slave/db').with_secret(true) }
|
||||
it { should contain_nova_config('database/idle_timeout').with_value('30') }
|
||||
it { is_expected.to contain_nova_config('database/connection').with_value('mysql://user:pass@db/db').with_secret(true) }
|
||||
it { is_expected.to contain_nova_config('database/slave_connection').with_value('mysql://user:pass@slave/db').with_secret(true) }
|
||||
it { is_expected.to contain_nova_config('database/idle_timeout').with_value('30') }
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -13,16 +13,16 @@ describe 'nova::serialproxy' do
|
|||
shared_examples 'nova-serialproxy' do
|
||||
|
||||
it 'configures nova.conf' do
|
||||
should contain_nova_config('serial_console/serialproxy_host').with(:value => '0.0.0.0')
|
||||
should contain_nova_config('serial_console/serialproxy_port').with(:value => '6083')
|
||||
is_expected.to contain_nova_config('serial_console/serialproxy_host').with(:value => '0.0.0.0')
|
||||
is_expected.to contain_nova_config('serial_console/serialproxy_port').with(:value => '6083')
|
||||
end
|
||||
|
||||
it { should contain_package('nova-serialproxy').with(
|
||||
it { is_expected.to contain_package('nova-serialproxy').with(
|
||||
:name => platform_params[:serialproxy_package_name],
|
||||
:ensure => 'present'
|
||||
) }
|
||||
|
||||
it { should contain_service('nova-serialproxy').with(
|
||||
it { is_expected.to contain_service('nova-serialproxy').with(
|
||||
:name => platform_params[:serialproxy_service_name],
|
||||
:hasstatus => 'true',
|
||||
:ensure => 'running'
|
||||
|
@ -34,7 +34,7 @@ describe 'nova::serialproxy' do
|
|||
:manage_service => false
|
||||
}
|
||||
end
|
||||
it { should contain_service('nova-serialproxy').without_ensure }
|
||||
it { is_expected.to contain_service('nova-serialproxy').without_ensure }
|
||||
end
|
||||
|
||||
context 'with package version' do
|
||||
|
@ -42,7 +42,7 @@ describe 'nova::serialproxy' do
|
|||
{ :ensure_package => '2012.2' }
|
||||
end
|
||||
|
||||
it { should contain_package('nova-serialproxy').with(
|
||||
it { is_expected.to contain_package('nova-serialproxy').with(
|
||||
:ensure => params[:ensure_package]
|
||||
)}
|
||||
end
|
||||
|
|
|
@ -13,16 +13,16 @@ describe 'nova::spicehtml5proxy' do
|
|||
shared_examples 'nova-spicehtml5proxy' do
|
||||
|
||||
it 'configures nova.conf' do
|
||||
should contain_nova_config('DEFAULT/spicehtml5proxy_host').with(:value => '0.0.0.0')
|
||||
should contain_nova_config('DEFAULT/spicehtml5proxy_port').with(:value => '6082')
|
||||
is_expected.to contain_nova_config('DEFAULT/spicehtml5proxy_host').with(:value => '0.0.0.0')
|
||||
is_expected.to contain_nova_config('DEFAULT/spicehtml5proxy_port').with(:value => '6082')
|
||||
end
|
||||
|
||||
it { should contain_package('nova-spicehtml5proxy').with(
|
||||
it { is_expected.to contain_package('nova-spicehtml5proxy').with(
|
||||
:name => platform_params[:spicehtml5proxy_package_name],
|
||||
:ensure => 'present'
|
||||
) }
|
||||
|
||||
it { should contain_service('nova-spicehtml5proxy').with(
|
||||
it { is_expected.to contain_service('nova-spicehtml5proxy').with(
|
||||
:name => platform_params[:spicehtml5proxy_service_name],
|
||||
:hasstatus => 'true',
|
||||
:ensure => 'running'
|
||||
|
@ -34,7 +34,7 @@ describe 'nova::spicehtml5proxy' do
|
|||
:manage_service => false
|
||||
}
|
||||
end
|
||||
it { should contain_service('nova-spicehtml5proxy').without_ensure }
|
||||
it { is_expected.to contain_service('nova-spicehtml5proxy').without_ensure }
|
||||
end
|
||||
|
||||
context 'with package version' do
|
||||
|
@ -42,7 +42,7 @@ describe 'nova::spicehtml5proxy' do
|
|||
{ :ensure_package => '2012.1-2' }
|
||||
end
|
||||
|
||||
it { should contain_package('nova-spicehtml5proxy').with(
|
||||
it { is_expected.to contain_package('nova-spicehtml5proxy').with(
|
||||
:ensure => params[:ensure_package]
|
||||
)}
|
||||
end
|
||||
|
|
|
@ -8,12 +8,12 @@ describe 'nova::utilities' do
|
|||
end
|
||||
|
||||
it 'installes utilities' do
|
||||
should contain_package('unzip').with_ensure('present')
|
||||
should contain_package('screen').with_ensure('present')
|
||||
should contain_package('parted').with_ensure('present')
|
||||
should contain_package('curl').with_ensure('present')
|
||||
should contain_package('euca2ools').with_ensure('present')
|
||||
should contain_package('libguestfs-tools').with_ensure('present')
|
||||
is_expected.to contain_package('unzip').with_ensure('present')
|
||||
is_expected.to contain_package('screen').with_ensure('present')
|
||||
is_expected.to contain_package('parted').with_ensure('present')
|
||||
is_expected.to contain_package('curl').with_ensure('present')
|
||||
is_expected.to contain_package('euca2ools').with_ensure('present')
|
||||
is_expected.to contain_package('libguestfs-tools').with_ensure('present')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -15,19 +15,19 @@ describe 'nova::vncproxy' do
|
|||
{ :osfamily => 'Debian' }
|
||||
end
|
||||
|
||||
it { should contain_package('python-numpy').with(
|
||||
it { is_expected.to contain_package('python-numpy').with(
|
||||
:ensure => 'present',
|
||||
:name => 'python-numpy'
|
||||
)}
|
||||
|
||||
it { should contain_nova_config('DEFAULT/novncproxy_host').with(:value => '0.0.0.0') }
|
||||
it { should contain_nova_config('DEFAULT/novncproxy_port').with(:value => '6080') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/novncproxy_host').with(:value => '0.0.0.0') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/novncproxy_port').with(:value => '6080') }
|
||||
|
||||
it { should contain_package('nova-vncproxy').with(
|
||||
it { is_expected.to contain_package('nova-vncproxy').with(
|
||||
:name => 'nova-novncproxy',
|
||||
:ensure => 'present'
|
||||
) }
|
||||
it { should contain_service('nova-vncproxy').with(
|
||||
it { is_expected.to contain_service('nova-vncproxy').with(
|
||||
:name => 'nova-novncproxy',
|
||||
:hasstatus => true,
|
||||
:ensure => 'running'
|
||||
|
@ -39,14 +39,14 @@ describe 'nova::vncproxy' do
|
|||
:manage_service => false
|
||||
}
|
||||
end
|
||||
it { should contain_service('nova-vncproxy').without_ensure }
|
||||
it { is_expected.to contain_service('nova-vncproxy').without_ensure }
|
||||
end
|
||||
|
||||
describe 'with package version' do
|
||||
let :params do
|
||||
{:ensure_package => '2012.1-2'}
|
||||
end
|
||||
it { should contain_package('nova-vncproxy').with(
|
||||
it { is_expected.to contain_package('nova-vncproxy').with(
|
||||
'ensure' => '2012.1-2'
|
||||
)}
|
||||
end
|
||||
|
@ -57,11 +57,11 @@ describe 'nova::vncproxy' do
|
|||
let :facts do
|
||||
{ :osfamily => 'Debian', :operatingsystem => 'Debian' }
|
||||
end
|
||||
it { should contain_package('nova-vncproxy').with(
|
||||
it { is_expected.to contain_package('nova-vncproxy').with(
|
||||
:name => "nova-consoleproxy",
|
||||
:ensure => 'present'
|
||||
)}
|
||||
it { should contain_service('nova-vncproxy').with(
|
||||
it { is_expected.to contain_service('nova-vncproxy').with(
|
||||
:name => 'nova-novncproxy',
|
||||
:hasstatus => true,
|
||||
:ensure => 'running'
|
||||
|
@ -75,7 +75,7 @@ describe 'nova::vncproxy' do
|
|||
{ :osfamily => 'Redhat' }
|
||||
end
|
||||
|
||||
it { should contain_package('python-numpy').with(
|
||||
it { is_expected.to contain_package('python-numpy').with(
|
||||
:name => 'numpy',
|
||||
:ensure => 'present'
|
||||
)}
|
||||
|
|
|
@ -13,7 +13,7 @@ describe 'nova::generic_service' do
|
|||
:enabled => true
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
let :facts do
|
||||
{ :osfamily => 'Debian' }
|
||||
end
|
||||
|
@ -22,7 +22,7 @@ describe 'nova::generic_service' do
|
|||
'foo'
|
||||
end
|
||||
|
||||
it { should contain_service('nova-foo').with(
|
||||
it { is_expected.to contain_service('nova-foo').with(
|
||||
'name' => 'food',
|
||||
'ensure' => 'running',
|
||||
'enable' => true,
|
||||
|
|
|
@ -20,7 +20,7 @@ describe 'nova::manage::network' do
|
|||
:network => '10.0.0.0/24'
|
||||
}
|
||||
end
|
||||
it { should contain_nova_network('foo').with(
|
||||
it { is_expected.to contain_nova_network('foo').with(
|
||||
:ensure => 'present',
|
||||
:network => '10.0.0.0/24',
|
||||
:label => 'novanetwork',
|
||||
|
@ -35,7 +35,7 @@ describe 'nova::manage::network' do
|
|||
:num_networks => 2
|
||||
}
|
||||
end
|
||||
it { should contain_nova_network('foo').with(
|
||||
it { is_expected.to contain_nova_network('foo').with(
|
||||
:network => '10.0.0.0/20',
|
||||
:num_networks => 2
|
||||
) }
|
||||
|
@ -48,7 +48,7 @@ describe 'nova::manage::network' do
|
|||
:project => 'foo'
|
||||
}
|
||||
end
|
||||
it { should contain_nova_network('foo').with(
|
||||
it { is_expected.to contain_nova_network('foo').with(
|
||||
:network => '10.0.0.0/20',
|
||||
:project => 'foo'
|
||||
) }
|
||||
|
|
|
@ -9,11 +9,11 @@ describe 'test-001.example.org' do
|
|||
|
||||
# Bug #1278452
|
||||
it 'nova::consoleauth and nova::spicehtml5proxy do not conflict' do
|
||||
should contain_class('nova::consoleauth')
|
||||
should contain_class('nova::spicehtml5proxy')
|
||||
is_expected.to contain_class('nova::consoleauth')
|
||||
is_expected.to contain_class('nova::spicehtml5proxy')
|
||||
|
||||
should contain_nova__generic_service('consoleauth')
|
||||
should contain_nova__generic_service('spicehtml5proxy')
|
||||
is_expected.to contain_nova__generic_service('consoleauth')
|
||||
is_expected.to contain_nova__generic_service('spicehtml5proxy')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
shared_examples_for "a Puppet::Error" do |description|
|
||||
it "with message matching #{description.inspect}" do
|
||||
expect { should have_class_count(1) }.to raise_error(Puppet::Error, description)
|
||||
expect { is_expected.to have_class_count(1) }.to raise_error(Puppet::Error, description)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -8,13 +8,13 @@ shared_examples 'generic nova service' do |service|
|
|||
|
||||
context 'with default parameters' do
|
||||
it 'installs package and service' do
|
||||
should contain_package(service[:name]).with({
|
||||
is_expected.to contain_package(service[:name]).with({
|
||||
:name => service[:package_name],
|
||||
:ensure => 'present',
|
||||
:notify => "Service[#{service[:name]}]",
|
||||
:tag => ['openstack']
|
||||
})
|
||||
should contain_service(service[:name]).with({
|
||||
is_expected.to contain_service(service[:name]).with({
|
||||
:name => service[:service_name],
|
||||
:ensure => 'stopped',
|
||||
:hasstatus => true,
|
||||
|
@ -30,12 +30,12 @@ shared_examples 'generic nova service' do |service|
|
|||
end
|
||||
|
||||
it 'installs package and service' do
|
||||
should contain_package(service[:name]).with({
|
||||
is_expected.to contain_package(service[:name]).with({
|
||||
:name => service[:package_name],
|
||||
:ensure => '2012.1-2',
|
||||
:notify => "Service[#{service[:name]}]"
|
||||
})
|
||||
should contain_service(service[:name]).with({
|
||||
is_expected.to contain_service(service[:name]).with({
|
||||
:name => service[:service_name],
|
||||
:ensure => 'running',
|
||||
:hasstatus => true,
|
||||
|
@ -51,7 +51,7 @@ shared_examples 'generic nova service' do |service|
|
|||
end
|
||||
|
||||
it 'does not control service state' do
|
||||
should contain_service(service[:name]).without_ensure
|
||||
is_expected.to contain_service(service[:name]).without_ensure
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue