
* Update spec tests in order to match rspec 3.x syntax (and puppet-rspec 2.x) * Remove gems over-specifications (puppetlabs_spec_helper already add runtime deps on rpsec, puppet-rspec and rake) * Fix RedHat fact (cherry-pick of commit https://review.openstack.org/106555/) * Pin fixtures to stable/icehouse (this module is EOL) * Pin concat to 1.2.1 Partial-Bug: #1326034 Change-Id: If299e1f9591f21d9410f2a5744d29823f913c000
132 lines
4.1 KiB
Ruby
132 lines
4.1 KiB
Ruby
require 'spec_helper'
|
|
|
|
describe 'openstack::nova::controller' do
|
|
|
|
let :default_params do
|
|
{
|
|
:public_address => '127.0.0.1',
|
|
:db_host => '127.0.0.1',
|
|
:api_bind_address => '0.0.0.0',
|
|
:rabbit_password => 'rabbit_pass',
|
|
:nova_user_password => 'nova_user_pass',
|
|
:neutron_user_password => 'neutron_user_pass',
|
|
:nova_db_password => 'nova_db_pass',
|
|
:neutron => true,
|
|
:memcached_servers => false,
|
|
:metadata_shared_secret => 'secret'
|
|
}
|
|
end
|
|
|
|
let :facts do
|
|
{:osfamily => 'Debian' }
|
|
end
|
|
|
|
let :params do
|
|
default_params
|
|
end
|
|
|
|
it { is_expected.to contain_class('openstack::nova::controller') }
|
|
|
|
context 'when configuring neutron' do
|
|
|
|
it 'should configure nova with neutron' do
|
|
|
|
is_expected.to contain_class('nova::rabbitmq').with(
|
|
:userid => 'openstack',
|
|
:password => 'rabbit_pass',
|
|
:enabled => true,
|
|
:cluster_disk_nodes => false,
|
|
:virtual_host => '/'
|
|
)
|
|
is_expected.to contain_class('nova').with(
|
|
:sql_connection => 'mysql://nova:nova_db_pass@127.0.0.1/nova',
|
|
:rabbit_userid => 'openstack',
|
|
:rabbit_password => 'rabbit_pass',
|
|
:rabbit_virtual_host => '/',
|
|
:image_service => 'nova.image.glance.GlanceImageService',
|
|
:glance_api_servers => '127.0.0.1:9292',
|
|
:debug => false,
|
|
:verbose => false,
|
|
:rabbit_hosts => false,
|
|
:rabbit_host => '127.0.0.1',
|
|
:memcached_servers => false,
|
|
:use_syslog => false,
|
|
:log_facility => 'LOG_USER'
|
|
)
|
|
|
|
is_expected.to contain_class('nova::api').with(
|
|
:enabled => true,
|
|
:admin_tenant_name => 'services',
|
|
:admin_user => 'nova',
|
|
:admin_password => 'nova_user_pass',
|
|
:enabled_apis => 'ec2,osapi_compute,metadata',
|
|
:api_bind_address => '0.0.0.0',
|
|
:auth_host => '127.0.0.1',
|
|
:neutron_metadata_proxy_shared_secret => 'secret'
|
|
)
|
|
|
|
is_expected.to contain_class('nova::network::neutron').with(
|
|
:neutron_admin_password => 'neutron_user_pass',
|
|
:neutron_auth_strategy => 'keystone',
|
|
:neutron_url => "http://127.0.0.1:9696",
|
|
:neutron_admin_tenant_name => 'services',
|
|
:neutron_admin_username => 'neutron',
|
|
:neutron_admin_auth_url => "http://127.0.0.1:35357/v2.0",
|
|
:security_group_api => 'neutron'
|
|
)
|
|
|
|
['nova::scheduler', 'nova::objectstore', 'nova::cert', 'nova::consoleauth', 'nova::conductor'].each do |x|
|
|
is_expected.to contain_class(x).with_enabled(true)
|
|
end
|
|
|
|
is_expected.to contain_class('nova::vncproxy').with(
|
|
:host => '127.0.0.1',
|
|
:enabled => true
|
|
)
|
|
end
|
|
end
|
|
|
|
context 'when configuring memcached' do
|
|
let :params do
|
|
default_params.merge(
|
|
:memcached_servers => ['memcached01:11211', 'memcached02:11211']
|
|
)
|
|
end
|
|
it 'should configure nova with memcached' do
|
|
is_expected.to contain_class('nova').with(
|
|
:memcached_servers => ['memcached01:11211', 'memcached02:11211']
|
|
)
|
|
end
|
|
end
|
|
|
|
context 'when configuring SSL' do
|
|
let :params do
|
|
default_params.merge(
|
|
:db_ssl => true,
|
|
:db_ssl_ca => '/etc/mysql/ca.pem'
|
|
)
|
|
end
|
|
it 'should configure SSL' do
|
|
is_expected.to contain_class('nova').with(
|
|
:sql_connection => 'mysql://nova:nova_db_pass@127.0.0.1/nova?ssl_ca=/etc/mysql/ca.pem'
|
|
)
|
|
end
|
|
end
|
|
|
|
context 'with custom syslog settings' do
|
|
let :params do
|
|
default_params.merge(
|
|
:use_syslog => true,
|
|
:log_facility => 'LOG_LOCAL0'
|
|
)
|
|
end
|
|
it do
|
|
is_expected.to contain_class('nova').with(
|
|
:use_syslog => true,
|
|
:log_facility => 'LOG_LOCAL0'
|
|
)
|
|
end
|
|
end
|
|
|
|
end
|