Merge pull request #644 from enovance/qa-rspec

QA Rspec and puppet-lint
This commit is contained in:
Emilien Macchi 2014-09-30 08:11:31 -04:00
commit 02af63547d
60 changed files with 509 additions and 506 deletions

View File

@ -2,14 +2,11 @@ source 'https://rubygems.org'
group :development, :test do group :development, :test do
gem 'puppetlabs_spec_helper', :require => false gem 'puppetlabs_spec_helper', :require => false
gem 'puppet-lint', '~> 0.3.2' gem 'puppet-lint'
gem 'rake', '10.1.1' gem 'rake', '10.1.1'
gem 'puppet-syntax' gem 'puppet-syntax'
gem 'rspec-puppet', :git => 'https://github.com/rodjek/rspec-puppet.git' gem 'rspec-puppet', :git => 'https://github.com/rodjek/rspec-puppet.git'
# rspec-puppet fetch the latest rspec (3.0.0) gem 'rspec'
# this version is a bit incompat. with older specs...
# http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3
gem 'rspec', '< 2.99'
gem 'json' gem 'json'
gem 'webmock' gem 'webmock'
end end

View File

@ -124,7 +124,9 @@ class cloud::dashboard(
keystone_url => $keystone_url, keystone_url => $keystone_url,
cache_server_ip => false, cache_server_ip => false,
django_debug => $debug, django_debug => $debug,
neutron_options => { 'enable_lb' => true }, neutron_options => {
'enable_lb' => true
},
listen_ssl => $listen_ssl, listen_ssl => $listen_ssl,
horizon_cert => $horizon_cert, horizon_cert => $horizon_cert,
horizon_key => $horizon_key, horizon_key => $horizon_key,

View File

@ -267,7 +267,11 @@ class cloud::database::sql (
config_file => $mysql_server_config_file, config_file => $mysql_server_config_file,
package_name => $mysql_server_package_name, package_name => $mysql_server_package_name,
service_name => $mysql_service_name, service_name => $mysql_service_name,
override_options => { 'mysqld' => { 'bind-address' => $api_eth } }, override_options => {
'mysqld' => {
'bind-address' => $api_eth
}
},
root_password => $mysql_root_password_real, root_password => $mysql_root_password_real,
notify => Service['xinetd'], notify => Service['xinetd'],
} }

View File

@ -508,10 +508,10 @@ class cloud::identity (
keystone_role { $identity_roles_addons: ensure => present } keystone_role { $identity_roles_addons: ensure => present }
class {'keystone::endpoint': class {'keystone::endpoint':
public_url => "${ks_keystone_public_proto}://${ks_keystone_public_host}:${ks_keystone_public_port}", public_url => "${ks_keystone_public_proto}://${ks_keystone_public_host}:${ks_keystone_public_port}",
internal_url => "${ks_keystone_internal_proto}://${ks_keystone_internal_host}:${ks_keystone_internal_port}", internal_url => "${ks_keystone_internal_proto}://${ks_keystone_internal_host}:${ks_keystone_internal_port}",
admin_url => "${ks_keystone_admin_proto}://${ks_keystone_admin_host}:${ks_keystone_admin_port}", admin_url => "${ks_keystone_admin_proto}://${ks_keystone_admin_host}:${ks_keystone_admin_port}",
region => $region, region => $region,
} }
# TODO(EmilienM) Disable WSGI - bug #98 # TODO(EmilienM) Disable WSGI - bug #98
@ -556,29 +556,29 @@ class cloud::identity (
} }
class { 'nova::keystone::auth': class { 'nova::keystone::auth':
cinder => true, cinder => true,
admin_address => $ks_nova_admin_host, admin_address => $ks_nova_admin_host,
internal_address => $ks_nova_internal_host, internal_address => $ks_nova_internal_host,
public_address => $ks_nova_public_host, public_address => $ks_nova_public_host,
compute_port => $ks_nova_public_port, compute_port => $ks_nova_public_port,
public_protocol => $ks_nova_public_proto, public_protocol => $ks_nova_public_proto,
admin_protocol => $ks_nova_admin_proto, admin_protocol => $ks_nova_admin_proto,
internal_protocol => $ks_nova_internal_proto, internal_protocol => $ks_nova_internal_proto,
ec2_port => $ks_ec2_public_port, ec2_port => $ks_ec2_public_port,
region => $region, region => $region,
password => $ks_nova_password password => $ks_nova_password
} }
class { 'neutron::keystone::auth': class { 'neutron::keystone::auth':
admin_address => $ks_neutron_admin_host, admin_address => $ks_neutron_admin_host,
internal_address => $ks_neutron_internal_host, internal_address => $ks_neutron_internal_host,
public_address => $ks_neutron_public_host, public_address => $ks_neutron_public_host,
public_protocol => $ks_neutron_public_proto, public_protocol => $ks_neutron_public_proto,
internal_protocol => $ks_neutron_internal_proto, internal_protocol => $ks_neutron_internal_proto,
admin_protocol => $ks_neutron_admin_proto, admin_protocol => $ks_neutron_admin_proto,
port => $ks_neutron_public_port, port => $ks_neutron_public_port,
region => $region, region => $region,
password => $ks_neutron_password password => $ks_neutron_password
} }
class { 'cinder::keystone::auth': class { 'cinder::keystone::auth':

View File

@ -62,10 +62,10 @@ This node is under the control of Puppet ${::puppetversion}.
# Strong root password for all servers # Strong root password for all servers
user { 'root': user { 'root':
ensure => 'present', ensure => 'present',
gid => '0', gid => '0',
password => $root_password, password => $root_password,
uid => '0', uid => '0',
} }
$cron_service_name = $::osfamily ? { $cron_service_name = $::osfamily ? {

View File

@ -359,16 +359,16 @@ class cloud::loadbalancer(
bind_options => $metadata_bind_options, bind_options => $metadata_bind_options,
} }
cloud::loadbalancer::binding { 'spice_cluster': cloud::loadbalancer::binding { 'spice_cluster':
ip => $spice, ip => $spice,
port => $spice_port, port => $spice_port,
options => { options => {
'mode' => 'tcp', 'mode' => 'tcp',
'option' => ['tcpka', 'tcplog', 'forwardfor'], 'option' => ['tcpka', 'tcplog', 'forwardfor'],
'balance' => 'source', 'balance' => 'source',
'timeout server' => '120m', 'timeout server' => '120m',
'timeout client' => '120m', 'timeout client' => '120m',
}, },
bind_options => $spice_bind_options, bind_options => $spice_bind_options,
} }
cloud::loadbalancer::binding { 'trove_api_cluster': cloud::loadbalancer::binding { 'trove_api_cluster':
ip => $trove_api, ip => $trove_api,
@ -376,16 +376,16 @@ class cloud::loadbalancer(
bind_options => $trove_bind_options, bind_options => $trove_bind_options,
} }
cloud::loadbalancer::binding { 'glance_api_cluster': cloud::loadbalancer::binding { 'glance_api_cluster':
ip => $glance_api, ip => $glance_api,
options => { options => {
'mode' => 'tcp', 'mode' => 'tcp',
'balance' => 'source', 'balance' => 'source',
'option' => ['tcpka', 'tcplog', 'forwardfor'], 'option' => ['tcpka', 'tcplog', 'forwardfor'],
'timeout server' => '120m', 'timeout server' => '120m',
'timeout client' => '120m', 'timeout client' => '120m',
}, },
port => $ks_glance_api_public_port, port => $ks_glance_api_public_port,
bind_options => $glance_api_bind_options, bind_options => $glance_api_bind_options,
} }
cloud::loadbalancer::binding { 'glance_registry_cluster': cloud::loadbalancer::binding { 'glance_registry_cluster':
ip => $glance_registry, ip => $glance_registry,

View File

@ -84,17 +84,17 @@ allow_versions = on
ensure_resource('cloud::object::set_io_scheduler', keys($device_config_hash)) ensure_resource('cloud::object::set_io_scheduler', keys($device_config_hash))
@@ring_container_device { "${storage_eth}:${container_port}/${ring_container_device}": @@ring_container_device { "${storage_eth}:${container_port}/${ring_container_device}":
zone => $swift_zone, zone => $swift_zone,
weight => '100.0', weight => '100.0',
} }
@@ring_account_device { "${storage_eth}:${account_port}/${ring_account_device}": @@ring_account_device { "${storage_eth}:${account_port}/${ring_account_device}":
zone => $swift_zone, zone => $swift_zone,
weight => '100.0', weight => '100.0',
} }
$object_urls = prefix(keys($device_config_hash), "${storage_eth}:${object_port}/") $object_urls = prefix(keys($device_config_hash), "${storage_eth}:${object_port}/")
@@ring_object_device {$object_urls: @@ring_object_device {$object_urls:
zone => $swift_zone, zone => $swift_zone,
weight => '100.0', weight => '100.0',
} }
Swift::Ringsync<<| |>> -> Swift::Ringsync<<| |>> ->

View File

@ -58,10 +58,10 @@ class cloud::spof(
disable => true disable => true
} }
file { '/usr/lib/ocf/resource.d/heartbeat/ceilometer-agent-central': file { '/usr/lib/ocf/resource.d/heartbeat/ceilometer-agent-central':
source => 'puppet:///modules/cloud/heartbeat/ceilometer-agent-central', source => 'puppet:///modules/cloud/heartbeat/ceilometer-agent-central',
mode => '0755', mode => '0755',
owner => 'root', owner => 'root',
group => 'root', group => 'root',
} -> } ->
exec {'pcmk_ceilometer_agent_central': exec {'pcmk_ceilometer_agent_central':
command => 'pcs resource create ceilometer-agent-central ocf:heartbeat:ceilometer-agent-central', command => 'pcs resource create ceilometer-agent-central ocf:heartbeat:ceilometer-agent-central',
@ -91,10 +91,10 @@ class cloud::spof(
'cluster-recheck-interval': value => '5min'; 'cluster-recheck-interval': value => '5min';
} -> } ->
file { '/usr/lib/ocf/resource.d/heartbeat/ceilometer-agent-central': file { '/usr/lib/ocf/resource.d/heartbeat/ceilometer-agent-central':
source => 'puppet:///modules/cloud/heartbeat/ceilometer-agent-central', source => 'puppet:///modules/cloud/heartbeat/ceilometer-agent-central',
mode => '0755', mode => '0755',
owner => 'root', owner => 'root',
group => 'root', group => 'root',
} -> } ->
cs_primitive { 'ceilometer-agent-central': cs_primitive { 'ceilometer-agent-central':
primitive_class => 'ocf', primitive_class => 'ocf',

View File

@ -102,9 +102,9 @@ class cloud::storage::rbd::pools(
} }
@@exec { 'set_secret_value_virsh': @@exec { 'set_secret_value_virsh':
command => "virsh secret-set-value --secret ${ceph_fsid} --base64 ${::ceph_keyring_cinder}", command => "virsh secret-set-value --secret ${ceph_fsid} --base64 ${::ceph_keyring_cinder}",
tag => 'ceph_compute_set_secret', tag => 'ceph_compute_set_secret',
refreshonly => true, refreshonly => true,
} }
} # !empty($::ceph_admin_key) } # !empty($::ceph_admin_key)

View File

@ -133,21 +133,21 @@ define cloud::volume::backend::netapp (
cinder::backend::netapp { $name: cinder::backend::netapp { $name:
netapp_server_hostname => $netapp_server_hostname, netapp_server_hostname => $netapp_server_hostname,
netapp_login => $netapp_login, netapp_login => $netapp_login,
netapp_password => $netapp_password, netapp_password => $netapp_password,
netapp_server_port => $netapp_server_port, netapp_server_port => $netapp_server_port,
netapp_size_multiplier => $netapp_size_multiplier, netapp_size_multiplier => $netapp_size_multiplier,
netapp_storage_family => $netapp_storage_family, netapp_storage_family => $netapp_storage_family,
netapp_storage_protocol => $netapp_storage_protocol, netapp_storage_protocol => $netapp_storage_protocol,
netapp_transport_type => $netapp_transport_type, netapp_transport_type => $netapp_transport_type,
netapp_vfiler => $netapp_vfiler, netapp_vfiler => $netapp_vfiler,
netapp_volume_list => $netapp_volume_list, netapp_volume_list => $netapp_volume_list,
netapp_vserver => $netapp_vserver, netapp_vserver => $netapp_vserver,
expiry_thres_minutes => $expiry_thres_minutes, expiry_thres_minutes => $expiry_thres_minutes,
thres_avl_size_perc_start => $thres_avl_size_perc_start, thres_avl_size_perc_start => $thres_avl_size_perc_start,
thres_avl_size_perc_stop => $thres_avl_size_perc_stop, thres_avl_size_perc_stop => $thres_avl_size_perc_stop,
nfs_shares_config => $nfs_shares_config, nfs_shares_config => $nfs_shares_config,
} }
@cinder::type { $volume_backend_name: @cinder::type { $volume_backend_name:

View File

@ -27,7 +27,7 @@ describe 'cloud::cache' do
end end
it 'configure memcached with some params' do it 'configure memcached with some params' do
should contain_class('memcached').with( is_expected.to contain_class('memcached').with(
:listen_ip => '10.0.0.1', :listen_ip => '10.0.0.1',
:max_memory => '60%' :max_memory => '60%'
) )

View File

@ -56,7 +56,7 @@ describe 'cloud::compute::api' do
end end
it 'configure nova common' do it 'configure nova common' do
should contain_class('nova').with( is_expected.to contain_class('nova').with(
:verbose => true, :verbose => true,
:debug => true, :debug => true,
:use_syslog => true, :use_syslog => true,
@ -70,14 +70,14 @@ describe 'cloud::compute::api' do
:glance_api_servers => 'http://10.0.0.1:9292', :glance_api_servers => 'http://10.0.0.1:9292',
:log_dir => false :log_dir => false
) )
should contain_nova_config('DEFAULT/resume_guests_state_on_host_boot').with('value' => true) is_expected.to contain_nova_config('DEFAULT/resume_guests_state_on_host_boot').with('value' => true)
should contain_nova_config('DEFAULT/default_availability_zone').with('value' => 'MyZone') is_expected.to contain_nova_config('DEFAULT/default_availability_zone').with('value' => 'MyZone')
should contain_nova_config('DEFAULT/servicegroup_driver').with_value('mc') is_expected.to contain_nova_config('DEFAULT/servicegroup_driver').with_value('mc')
should contain_nova_config('DEFAULT/glance_num_retries').with_value('10') is_expected.to contain_nova_config('DEFAULT/glance_num_retries').with_value('10')
end end
it 'does not configure nova db slave' do it 'does not configure nova db slave' do
should contain_nova_config('database/slave_connection').with('ensure' => 'absent') is_expected.to contain_nova_config('database/slave_connection').with('ensure' => 'absent')
end end
context "when enabling nova db slave" do context "when enabling nova db slave" do
@ -89,13 +89,13 @@ describe 'cloud::compute::api' do
nova_db_password => 'secrete' }" nova_db_password => 'secrete' }"
end end
it 'configure nova db slave' do it 'configure nova db slave' do
should contain_nova_config('database/slave_connection').with( is_expected.to contain_nova_config('database/slave_connection').with(
'value' => 'mysql://nova:secrete@10.0.0.1:3307/nova?charset=utf8') 'value' => 'mysql://nova:secrete@10.0.0.1:3307/nova?charset=utf8')
end end
end end
it 'configure neutron on compute node' do it 'configure neutron on compute node' do
should contain_class('nova::network::neutron').with( is_expected.to contain_class('nova::network::neutron').with(
:neutron_admin_password => 'secrete', :neutron_admin_password => 'secrete',
:neutron_admin_auth_url => 'http://10.0.0.1:35357/v2.0', :neutron_admin_auth_url => 'http://10.0.0.1:35357/v2.0',
:neutron_region_name => 'MyRegion', :neutron_region_name => 'MyRegion',
@ -104,7 +104,7 @@ describe 'cloud::compute::api' do
end end
it 'checks if Nova DB is populated' do it 'checks if Nova DB is populated' do
should contain_exec('nova_db_sync').with( is_expected.to contain_exec('nova_db_sync').with(
:command => 'nova-manage db sync', :command => 'nova-manage db sync',
:user => 'nova', :user => 'nova',
:path => '/usr/bin', :path => '/usr/bin',
@ -113,7 +113,7 @@ describe 'cloud::compute::api' do
end end
it 'configure nova-api' do it 'configure nova-api' do
should contain_class('nova::api').with( is_expected.to contain_class('nova::api').with(
:enabled => true, :enabled => true,
:auth_host => '127.0.0.1', :auth_host => '127.0.0.1',
:auth_protocol => 'https', :auth_protocol => 'https',

View File

@ -44,7 +44,7 @@ describe 'cloud::compute::cert' do
end end
it 'configure nova common' do it 'configure nova common' do
should contain_class('nova').with( is_expected.to contain_class('nova').with(
:verbose => true, :verbose => true,
:debug => true, :debug => true,
:use_syslog => true, :use_syslog => true,
@ -58,14 +58,14 @@ describe 'cloud::compute::cert' do
:glance_api_servers => 'http://10.0.0.1:9292', :glance_api_servers => 'http://10.0.0.1:9292',
:log_dir => false :log_dir => false
) )
should contain_nova_config('DEFAULT/resume_guests_state_on_host_boot').with('value' => true) is_expected.to contain_nova_config('DEFAULT/resume_guests_state_on_host_boot').with('value' => true)
should contain_nova_config('DEFAULT/default_availability_zone').with('value' => 'MyZone') is_expected.to contain_nova_config('DEFAULT/default_availability_zone').with('value' => 'MyZone')
should contain_nova_config('DEFAULT/servicegroup_driver').with_value('mc') is_expected.to contain_nova_config('DEFAULT/servicegroup_driver').with_value('mc')
should contain_nova_config('DEFAULT/glance_num_retries').with_value('10') is_expected.to contain_nova_config('DEFAULT/glance_num_retries').with_value('10')
end end
it 'configure neutron on compute node' do it 'configure neutron on compute node' do
should contain_class('nova::network::neutron').with( is_expected.to contain_class('nova::network::neutron').with(
:neutron_admin_password => 'secrete', :neutron_admin_password => 'secrete',
:neutron_admin_auth_url => 'http://10.0.0.1:35357/v2.0', :neutron_admin_auth_url => 'http://10.0.0.1:35357/v2.0',
:neutron_region_name => 'MyRegion', :neutron_region_name => 'MyRegion',
@ -74,7 +74,7 @@ describe 'cloud::compute::cert' do
end end
it 'checks if Nova DB is populated' do it 'checks if Nova DB is populated' do
should contain_exec('nova_db_sync').with( is_expected.to contain_exec('nova_db_sync').with(
:command => 'nova-manage db sync', :command => 'nova-manage db sync',
:user => 'nova', :user => 'nova',
:path => '/usr/bin', :path => '/usr/bin',
@ -83,7 +83,7 @@ describe 'cloud::compute::cert' do
end end
it 'configure nova-cert' do it 'configure nova-cert' do
should contain_class('nova::cert').with(:enabled => true) is_expected.to contain_class('nova::cert').with(:enabled => true)
end end
end end

View File

@ -44,7 +44,7 @@ describe 'cloud::compute::conductor' do
end end
it 'configure nova common' do it 'configure nova common' do
should contain_class('nova').with( is_expected.to contain_class('nova').with(
:verbose => true, :verbose => true,
:debug => true, :debug => true,
:use_syslog => true, :use_syslog => true,
@ -58,14 +58,14 @@ describe 'cloud::compute::conductor' do
:glance_api_servers => 'http://10.0.0.1:9292', :glance_api_servers => 'http://10.0.0.1:9292',
:log_dir => false :log_dir => false
) )
should contain_nova_config('DEFAULT/resume_guests_state_on_host_boot').with('value' => true) is_expected.to contain_nova_config('DEFAULT/resume_guests_state_on_host_boot').with('value' => true)
should contain_nova_config('DEFAULT/default_availability_zone').with('value' => 'MyZone') is_expected.to contain_nova_config('DEFAULT/default_availability_zone').with('value' => 'MyZone')
should contain_nova_config('DEFAULT/servicegroup_driver').with_value('mc') is_expected.to contain_nova_config('DEFAULT/servicegroup_driver').with_value('mc')
should contain_nova_config('DEFAULT/glance_num_retries').with_value('10') is_expected.to contain_nova_config('DEFAULT/glance_num_retries').with_value('10')
end end
it 'configure neutron on compute node' do it 'configure neutron on compute node' do
should contain_class('nova::network::neutron').with( is_expected.to contain_class('nova::network::neutron').with(
:neutron_admin_password => 'secrete', :neutron_admin_password => 'secrete',
:neutron_admin_auth_url => 'http://10.0.0.1:35357/v2.0', :neutron_admin_auth_url => 'http://10.0.0.1:35357/v2.0',
:neutron_region_name => 'MyRegion', :neutron_region_name => 'MyRegion',
@ -74,7 +74,7 @@ describe 'cloud::compute::conductor' do
end end
it 'checks if Nova DB is populated' do it 'checks if Nova DB is populated' do
should contain_exec('nova_db_sync').with( is_expected.to contain_exec('nova_db_sync').with(
:command => 'nova-manage db sync', :command => 'nova-manage db sync',
:user => 'nova', :user => 'nova',
:path => '/usr/bin', :path => '/usr/bin',
@ -83,7 +83,7 @@ describe 'cloud::compute::conductor' do
end end
it 'configure nova-conductor' do it 'configure nova-conductor' do
should contain_class('nova::conductor').with(:enabled => true) is_expected.to contain_class('nova::conductor').with(:enabled => true)
end end
end end

View File

@ -44,7 +44,7 @@ describe 'cloud::compute::consoleauth' do
end end
it 'configure nova common' do it 'configure nova common' do
should contain_class('nova').with( is_expected.to contain_class('nova').with(
:verbose => true, :verbose => true,
:debug => true, :debug => true,
:use_syslog => true, :use_syslog => true,
@ -58,14 +58,14 @@ describe 'cloud::compute::consoleauth' do
:glance_api_servers => 'http://10.0.0.1:9292', :glance_api_servers => 'http://10.0.0.1:9292',
:log_dir => false :log_dir => false
) )
should contain_nova_config('DEFAULT/resume_guests_state_on_host_boot').with('value' => true) is_expected.to contain_nova_config('DEFAULT/resume_guests_state_on_host_boot').with('value' => true)
should contain_nova_config('DEFAULT/default_availability_zone').with('value' => 'MyZone') is_expected.to contain_nova_config('DEFAULT/default_availability_zone').with('value' => 'MyZone')
should contain_nova_config('DEFAULT/servicegroup_driver').with_value('mc') is_expected.to contain_nova_config('DEFAULT/servicegroup_driver').with_value('mc')
should contain_nova_config('DEFAULT/glance_num_retries').with_value('10') is_expected.to contain_nova_config('DEFAULT/glance_num_retries').with_value('10')
end end
it 'configure neutron on compute node' do it 'configure neutron on compute node' do
should contain_class('nova::network::neutron').with( is_expected.to contain_class('nova::network::neutron').with(
:neutron_admin_password => 'secrete', :neutron_admin_password => 'secrete',
:neutron_admin_auth_url => 'http://10.0.0.1:35357/v2.0', :neutron_admin_auth_url => 'http://10.0.0.1:35357/v2.0',
:neutron_region_name => 'MyRegion', :neutron_region_name => 'MyRegion',
@ -74,7 +74,7 @@ describe 'cloud::compute::consoleauth' do
end end
it 'checks if Nova DB is populated' do it 'checks if Nova DB is populated' do
should contain_exec('nova_db_sync').with( is_expected.to contain_exec('nova_db_sync').with(
:command => 'nova-manage db sync', :command => 'nova-manage db sync',
:user => 'nova', :user => 'nova',
:path => '/usr/bin', :path => '/usr/bin',
@ -83,7 +83,7 @@ describe 'cloud::compute::consoleauth' do
end end
it 'configure nova-consoleauth' do it 'configure nova-consoleauth' do
should contain_class('nova::consoleauth').with(:enabled => true) is_expected.to contain_class('nova::consoleauth').with(:enabled => true)
end end
end end

View File

@ -49,7 +49,7 @@ describe 'cloud::compute::consoleproxy' do
end end
it 'configure nova common' do it 'configure nova common' do
should contain_class('nova').with( is_expected.to contain_class('nova').with(
:verbose => true, :verbose => true,
:debug => true, :debug => true,
:use_syslog => true, :use_syslog => true,
@ -63,14 +63,14 @@ describe 'cloud::compute::consoleproxy' do
:glance_api_servers => 'http://10.0.0.1:9292', :glance_api_servers => 'http://10.0.0.1:9292',
:log_dir => false :log_dir => false
) )
should contain_nova_config('DEFAULT/resume_guests_state_on_host_boot').with('value' => true) is_expected.to contain_nova_config('DEFAULT/resume_guests_state_on_host_boot').with('value' => true)
should contain_nova_config('DEFAULT/default_availability_zone').with('value' => 'MyZone') is_expected.to contain_nova_config('DEFAULT/default_availability_zone').with('value' => 'MyZone')
should contain_nova_config('DEFAULT/servicegroup_driver').with_value('mc') is_expected.to contain_nova_config('DEFAULT/servicegroup_driver').with_value('mc')
should contain_nova_config('DEFAULT/glance_num_retries').with_value('10') is_expected.to contain_nova_config('DEFAULT/glance_num_retries').with_value('10')
end end
it 'configure neutron on compute node' do it 'configure neutron on compute node' do
should contain_class('nova::network::neutron').with( is_expected.to contain_class('nova::network::neutron').with(
:neutron_admin_password => 'secrete', :neutron_admin_password => 'secrete',
:neutron_admin_auth_url => 'http://10.0.0.1:35357/v2.0', :neutron_admin_auth_url => 'http://10.0.0.1:35357/v2.0',
:neutron_region_name => 'MyRegion', :neutron_region_name => 'MyRegion',
@ -79,7 +79,7 @@ describe 'cloud::compute::consoleproxy' do
end end
it 'checks if Nova DB is populated' do it 'checks if Nova DB is populated' do
should contain_exec('nova_db_sync').with( is_expected.to contain_exec('nova_db_sync').with(
:command => 'nova-manage db sync', :command => 'nova-manage db sync',
:user => 'nova', :user => 'nova',
:path => '/usr/bin', :path => '/usr/bin',
@ -88,7 +88,7 @@ describe 'cloud::compute::consoleproxy' do
end end
it 'configure nova-spicehtml5proxy' do it 'configure nova-spicehtml5proxy' do
should contain_class('nova::spicehtml5proxy').with( is_expected.to contain_class('nova::spicehtml5proxy').with(
:enabled => true, :enabled => true,
:host => '10.0.0.1' :host => '10.0.0.1'
) )

View File

@ -56,7 +56,7 @@ describe 'cloud::compute::controller' do
end end
it 'configure nova common' do it 'configure nova common' do
should contain_class('nova').with( is_expected.to contain_class('nova').with(
:verbose => true, :verbose => true,
:debug => true, :debug => true,
:use_syslog => true, :use_syslog => true,
@ -70,15 +70,15 @@ describe 'cloud::compute::controller' do
:glance_api_servers => 'http://10.0.0.1:9292', :glance_api_servers => 'http://10.0.0.1:9292',
:log_dir => false :log_dir => false
) )
should contain_nova_config('DEFAULT/resume_guests_state_on_host_boot').with('value' => true) is_expected.to contain_nova_config('DEFAULT/resume_guests_state_on_host_boot').with('value' => true)
should contain_nova_config('DEFAULT/default_availability_zone').with('value' => 'MyZone') is_expected.to contain_nova_config('DEFAULT/default_availability_zone').with('value' => 'MyZone')
should contain_nova_config('DEFAULT/servicegroup_driver').with_value('mc') is_expected.to contain_nova_config('DEFAULT/servicegroup_driver').with_value('mc')
should contain_nova_config('DEFAULT/glance_num_retries').with_value('10') is_expected.to contain_nova_config('DEFAULT/glance_num_retries').with_value('10')
should contain_nova_config('DEFAULT/cinder_catalog_info').with_value('volume:cinder:adminURL') is_expected.to contain_nova_config('DEFAULT/cinder_catalog_info').with_value('volume:cinder:adminURL')
end end
it 'configure neutron on compute node' do it 'configure neutron on compute node' do
should contain_class('nova::network::neutron').with( is_expected.to contain_class('nova::network::neutron').with(
:neutron_admin_password => 'secrete', :neutron_admin_password => 'secrete',
:neutron_admin_auth_url => 'http://10.0.0.1:35357/v2.0', :neutron_admin_auth_url => 'http://10.0.0.1:35357/v2.0',
:neutron_region_name => 'MyRegion', :neutron_region_name => 'MyRegion',
@ -87,7 +87,7 @@ describe 'cloud::compute::controller' do
end end
it 'checks if Nova DB is populated' do it 'checks if Nova DB is populated' do
should contain_exec('nova_db_sync').with( is_expected.to contain_exec('nova_db_sync').with(
:command => 'nova-manage db sync', :command => 'nova-manage db sync',
:user => 'nova', :user => 'nova',
:path => '/usr/bin', :path => '/usr/bin',
@ -96,30 +96,30 @@ describe 'cloud::compute::controller' do
end end
it 'configure nova-scheduler' do it 'configure nova-scheduler' do
should contain_class('nova::scheduler').with(:enabled => true) is_expected.to contain_class('nova::scheduler').with(:enabled => true)
end end
it 'configure nova-spicehtml5proxy' do it 'configure nova-spicehtml5proxy' do
should contain_class('nova::spicehtml5proxy').with( is_expected.to contain_class('nova::spicehtml5proxy').with(
:enabled => true, :enabled => true,
:host => '10.0.0.1' :host => '10.0.0.1'
) )
end end
it 'configure nova-cert' do it 'configure nova-cert' do
should contain_class('nova::cert').with(:enabled => true) is_expected.to contain_class('nova::cert').with(:enabled => true)
end end
it 'configure nova-consoleauth' do it 'configure nova-consoleauth' do
should contain_class('nova::consoleauth').with(:enabled => true) is_expected.to contain_class('nova::consoleauth').with(:enabled => true)
end end
it 'configure nova-conductor' do it 'configure nova-conductor' do
should contain_class('nova::conductor').with(:enabled => true) is_expected.to contain_class('nova::conductor').with(:enabled => true)
end end
it 'configure nova-api' do it 'configure nova-api' do
should contain_class('nova::api').with( is_expected.to contain_class('nova::api').with(
:enabled => true, :enabled => true,
:auth_host => '10.0.0.1', :auth_host => '10.0.0.1',
:admin_password => 'secrete', :admin_password => 'secrete',

View File

@ -85,7 +85,7 @@ describe 'cloud::compute::hypervisor' do
end end
it 'configure nova common' do it 'configure nova common' do
should contain_class('nova').with( is_expected.to contain_class('nova').with(
:verbose => true, :verbose => true,
:debug => true, :debug => true,
:use_syslog => true, :use_syslog => true,
@ -100,14 +100,14 @@ describe 'cloud::compute::hypervisor' do
:log_dir => false, :log_dir => false,
:nova_shell => '/bin/bash' :nova_shell => '/bin/bash'
) )
should contain_nova_config('DEFAULT/resume_guests_state_on_host_boot').with('value' => true) is_expected.to contain_nova_config('DEFAULT/resume_guests_state_on_host_boot').with('value' => true)
should contain_nova_config('DEFAULT/default_availability_zone').with('value' => 'MyZone') is_expected.to contain_nova_config('DEFAULT/default_availability_zone').with('value' => 'MyZone')
should contain_nova_config('DEFAULT/servicegroup_driver').with_value('mc') is_expected.to contain_nova_config('DEFAULT/servicegroup_driver').with_value('mc')
should contain_nova_config('DEFAULT/glance_num_retries').with_value('10') is_expected.to contain_nova_config('DEFAULT/glance_num_retries').with_value('10')
end end
it 'configure neutron on compute node' do it 'configure neutron on compute node' do
should contain_class('nova::network::neutron').with( is_expected.to contain_class('nova::network::neutron').with(
:neutron_admin_password => 'secrete', :neutron_admin_password => 'secrete',
:neutron_admin_auth_url => 'http://10.0.0.1:35357/v2.0', :neutron_admin_auth_url => 'http://10.0.0.1:35357/v2.0',
:neutron_region_name => 'MyRegion', :neutron_region_name => 'MyRegion',
@ -116,7 +116,7 @@ describe 'cloud::compute::hypervisor' do
end end
it 'configure ceilometer common' do it 'configure ceilometer common' do
should contain_class('ceilometer').with( is_expected.to contain_class('ceilometer').with(
:verbose => true, :verbose => true,
:debug => true, :debug => true,
:rabbit_userid => 'ceilometer', :rabbit_userid => 'ceilometer',
@ -126,14 +126,14 @@ describe 'cloud::compute::hypervisor' do
:use_syslog => true, :use_syslog => true,
:log_facility => 'LOG_LOCAL0' :log_facility => 'LOG_LOCAL0'
) )
should contain_class('ceilometer::agent::auth').with( is_expected.to contain_class('ceilometer::agent::auth').with(
:auth_password => 'secrete', :auth_password => 'secrete',
:auth_url => 'http://10.0.0.1:5000/v2.0' :auth_url => 'http://10.0.0.1:5000/v2.0'
) )
end end
it 'configure neutron common' do it 'configure neutron common' do
should contain_class('neutron').with( is_expected.to contain_class('neutron').with(
:allow_overlapping_ips => true, :allow_overlapping_ips => true,
:dhcp_agents_per_network => '2', :dhcp_agents_per_network => '2',
:verbose => true, :verbose => true,
@ -150,7 +150,7 @@ describe 'cloud::compute::hypervisor' do
:log_dir => false, :log_dir => false,
:report_interval => '30' :report_interval => '30'
) )
should contain_class('neutron::plugins::ml2').with( is_expected.to contain_class('neutron::plugins::ml2').with(
:type_drivers => ['gre','vlan','flat'], :type_drivers => ['gre','vlan','flat'],
:tenant_network_types => ['gre'], :tenant_network_types => ['gre'],
:mechanism_drivers => ['openvswitch','l2population'], :mechanism_drivers => ['openvswitch','l2population'],
@ -159,11 +159,11 @@ describe 'cloud::compute::hypervisor' do
:flat_networks => ['public'], :flat_networks => ['public'],
:enable_security_group => true :enable_security_group => true
) )
should_not contain__neutron_network('public') is_expected.not_to contain__neutron_network('public')
end end
it 'configure neutron on compute node' do it 'configure neutron on compute node' do
should contain_class('nova::network::neutron').with( is_expected.to contain_class('nova::network::neutron').with(
:neutron_admin_password => 'secrete', :neutron_admin_password => 'secrete',
:neutron_admin_auth_url => 'http://10.0.0.1:35357/v2.0', :neutron_admin_auth_url => 'http://10.0.0.1:35357/v2.0',
:neutron_region_name => 'MyRegion', :neutron_region_name => 'MyRegion',
@ -172,7 +172,7 @@ describe 'cloud::compute::hypervisor' do
end end
it 'configure ceilometer common' do it 'configure ceilometer common' do
should contain_class('ceilometer').with( is_expected.to contain_class('ceilometer').with(
:verbose => true, :verbose => true,
:debug => true, :debug => true,
:rabbit_userid => 'ceilometer', :rabbit_userid => 'ceilometer',
@ -182,14 +182,14 @@ describe 'cloud::compute::hypervisor' do
:use_syslog => true, :use_syslog => true,
:log_facility => 'LOG_LOCAL0' :log_facility => 'LOG_LOCAL0'
) )
should contain_class('ceilometer::agent::auth').with( is_expected.to contain_class('ceilometer::agent::auth').with(
:auth_password => 'secrete', :auth_password => 'secrete',
:auth_url => 'http://10.0.0.1:5000/v2.0' :auth_url => 'http://10.0.0.1:5000/v2.0'
) )
end end
it 'checks if Nova DB is populated' do it 'checks if Nova DB is populated' do
should contain_exec('nova_db_sync').with( is_expected.to contain_exec('nova_db_sync').with(
:command => 'nova-manage db sync', :command => 'nova-manage db sync',
:path => '/usr/bin', :path => '/usr/bin',
:user => 'nova', :user => 'nova',
@ -198,7 +198,7 @@ describe 'cloud::compute::hypervisor' do
end end
it 'configure nova-compute' do it 'configure nova-compute' do
should contain_class('nova::compute').with( is_expected.to contain_class('nova::compute').with(
:enabled => true, :enabled => true,
:vnc_enabled => false, :vnc_enabled => false,
:virtio_nic => false, :virtio_nic => false,
@ -207,7 +207,7 @@ describe 'cloud::compute::hypervisor' do
end end
it 'configure spice console' do it 'configure spice console' do
should contain_class('nova::compute::spice').with( is_expected.to contain_class('nova::compute::spice').with(
:server_listen => '0.0.0.0', :server_listen => '0.0.0.0',
:server_proxyclient_address => '7.0.0.1', :server_proxyclient_address => '7.0.0.1',
:proxy_host => '10.0.0.2', :proxy_host => '10.0.0.2',
@ -217,20 +217,20 @@ describe 'cloud::compute::hypervisor' do
end end
it 'configure nova compute with neutron' do it 'configure nova compute with neutron' do
should contain_class('nova::compute::neutron') is_expected.to contain_class('nova::compute::neutron')
end end
it 'configure ceilometer agent compute' do it 'configure ceilometer agent compute' do
should contain_class('ceilometer::agent::compute') is_expected.to contain_class('ceilometer::agent::compute')
end end
it 'should not configure nova-compute for RBD backend' do it 'should not configure nova-compute for RBD backend' do
should_not contain_nova_config('libvirt/rbd_user').with('value' => 'cinder') is_expected.not_to contain_nova_config('libvirt/rbd_user').with('value' => 'cinder')
should_not contain_nova_config('libvirt/images_type').with('value' => 'rbd') is_expected.not_to contain_nova_config('libvirt/images_type').with('value' => 'rbd')
end end
it 'configure libvirt driver without disk cachemodes' do it 'configure libvirt driver without disk cachemodes' do
should contain_class('nova::compute::libvirt').with( is_expected.to contain_class('nova::compute::libvirt').with(
:libvirt_type => 'kvm', :libvirt_type => 'kvm',
:vncserver_listen => '0.0.0.0', :vncserver_listen => '0.0.0.0',
:migration_support => true, :migration_support => true,
@ -239,11 +239,11 @@ describe 'cloud::compute::hypervisor' do
end end
it 'configure nova-compute with extra parameters' do it 'configure nova-compute with extra parameters' do
should contain_nova_config('DEFAULT/default_availability_zone').with('value' => 'MyZone') is_expected.to contain_nova_config('DEFAULT/default_availability_zone').with('value' => 'MyZone')
should contain_nova_config('libvirt/inject_key').with('value' => false) is_expected.to contain_nova_config('libvirt/inject_key').with('value' => false)
should contain_nova_config('libvirt/inject_partition').with('value' => '-2') is_expected.to contain_nova_config('libvirt/inject_partition').with('value' => '-2')
should contain_nova_config('libvirt/live_migration_flag').with('value' => 'VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE,VIR_MIGRATE_PERSIST_DEST') is_expected.to contain_nova_config('libvirt/live_migration_flag').with('value' => 'VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE,VIR_MIGRATE_PERSIST_DEST')
should contain_nova_config('libvirt/block_migration_flag').with('value' => 'VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE,VIR_MIGRATE_NON_SHARED_INC') is_expected.to contain_nova_config('libvirt/block_migration_flag').with('value' => 'VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE,VIR_MIGRATE_NON_SHARED_INC')
end end
context 'with dbus on Ubuntu' do context 'with dbus on Ubuntu' do
@ -256,7 +256,7 @@ describe 'cloud::compute::hypervisor' do
end end
it 'ensure dbus is running and started at boot' do it 'ensure dbus is running and started at boot' do
should contain_service('dbus').with( is_expected.to contain_service('dbus').with(
:ensure => 'running', :ensure => 'running',
:enable => 'true' :enable => 'true'
) )
@ -271,14 +271,14 @@ describe 'cloud::compute::hypervisor' do
:concat_basedir => '/var/lib/puppet/concat' ) :concat_basedir => '/var/lib/puppet/concat' )
end end
it 'ensure TSO script is enabled at boot' do it 'ensure TSO script is enabled at boot' do
should contain_exec('enable-tso-script').with( is_expected.to contain_exec('enable-tso-script').with(
:command => '/usr/sbin/update-rc.d disable-tso defaults', :command => '/usr/sbin/update-rc.d disable-tso defaults',
:unless => '/bin/ls /etc/rc*.d | /bin/grep disable-tso', :unless => '/bin/ls /etc/rc*.d | /bin/grep disable-tso',
:onlyif => '/usr/bin/test -f /etc/init.d/disable-tso' :onlyif => '/usr/bin/test -f /etc/init.d/disable-tso'
) )
end end
it 'start TSO script' do it 'start TSO script' do
should contain_exec('start-tso-script').with( is_expected.to contain_exec('start-tso-script').with(
:command => '/etc/init.d/disable-tso start', :command => '/etc/init.d/disable-tso start',
:unless => '/usr/bin/test -f /var/run/disable-tso.pid', :unless => '/usr/bin/test -f /var/run/disable-tso.pid',
:onlyif => '/usr/bin/test -f /etc/init.d/disable-tso' :onlyif => '/usr/bin/test -f /etc/init.d/disable-tso'
@ -293,14 +293,14 @@ describe 'cloud::compute::hypervisor' do
:concat_basedir => '/var/lib/puppet/concat' ) :concat_basedir => '/var/lib/puppet/concat' )
end end
it 'ensure TSO script is enabled at boot' do it 'ensure TSO script is enabled at boot' do
should contain_exec('enable-tso-script').with( is_expected.to contain_exec('enable-tso-script').with(
:command => '/usr/sbin/chkconfig disable-tso on', :command => '/usr/sbin/chkconfig disable-tso on',
:unless => '/bin/ls /etc/rc*.d | /bin/grep disable-tso', :unless => '/bin/ls /etc/rc*.d | /bin/grep disable-tso',
:onlyif => '/usr/bin/test -f /etc/init.d/disable-tso' :onlyif => '/usr/bin/test -f /etc/init.d/disable-tso'
) )
end end
it 'start TSO script' do it 'start TSO script' do
should contain_exec('start-tso-script').with( is_expected.to contain_exec('start-tso-script').with(
:command => '/etc/init.d/disable-tso start', :command => '/etc/init.d/disable-tso start',
:unless => '/usr/bin/test -f /var/run/disable-tso.pid', :unless => '/usr/bin/test -f /var/run/disable-tso.pid',
:onlyif => '/usr/bin/test -f /etc/init.d/disable-tso' :onlyif => '/usr/bin/test -f /etc/init.d/disable-tso'
@ -313,10 +313,10 @@ describe 'cloud::compute::hypervisor' do
params.merge!( :manage_tso => false) params.merge!( :manage_tso => false)
end end
it 'ensure TSO script is not managed at boot' do it 'ensure TSO script is not managed at boot' do
should_not contain_exec('enable-tso-script') is_expected.not_to contain_exec('enable-tso-script')
end end
it 'do not start TSO script' do it 'do not start TSO script' do
should_not contain_exec('start-tso-script') is_expected.not_to contain_exec('start-tso-script')
end end
end end
@ -333,20 +333,20 @@ describe 'cloud::compute::hypervisor' do
end end
it 'configure nova-compute to support RBD backend' do it 'configure nova-compute to support RBD backend' do
should contain_nova_config('libvirt/images_type').with('value' => 'rbd') is_expected.to contain_nova_config('libvirt/images_type').with('value' => 'rbd')
should contain_nova_config('libvirt/images_rbd_pool').with('value' => 'nova') is_expected.to contain_nova_config('libvirt/images_rbd_pool').with('value' => 'nova')
should contain_nova_config('libvirt/images_rbd_ceph_conf').with('value' => '/etc/ceph/ceph.conf') is_expected.to contain_nova_config('libvirt/images_rbd_ceph_conf').with('value' => '/etc/ceph/ceph.conf')
should contain_nova_config('libvirt/rbd_user').with('value' => 'cinder') is_expected.to contain_nova_config('libvirt/rbd_user').with('value' => 'cinder')
should contain_nova_config('libvirt/rbd_secret_uuid').with('value' => 'secrete') is_expected.to contain_nova_config('libvirt/rbd_secret_uuid').with('value' => 'secrete')
should contain_group('cephkeyring').with(:ensure => 'present') is_expected.to contain_group('cephkeyring').with(:ensure => 'present')
should contain_exec('add-nova-to-group').with( is_expected.to contain_exec('add-nova-to-group').with(
:command => 'usermod -a -G cephkeyring nova', :command => 'usermod -a -G cephkeyring nova',
:unless => 'groups nova | grep cephkeyring' :unless => 'groups nova | grep cephkeyring'
) )
end end
it 'configure libvirt driver' do it 'configure libvirt driver' do
should contain_class('nova::compute::libvirt').with( is_expected.to contain_class('nova::compute::libvirt').with(
:libvirt_type => 'kvm', :libvirt_type => 'kvm',
:vncserver_listen => '0.0.0.0', :vncserver_listen => '0.0.0.0',
:migration_support => true, :migration_support => true,
@ -367,19 +367,19 @@ describe 'cloud::compute::hypervisor' do
end end
it 'configure nova-compute to support RBD backend' do it 'configure nova-compute to support RBD backend' do
should_not contain_nova_config('libvirt/images_type').with('value' => 'rbd') is_expected.not_to contain_nova_config('libvirt/images_type').with('value' => 'rbd')
should_not contain_nova_config('libvirt/images_rbd_pool').with('value' => 'nova') is_expected.not_to contain_nova_config('libvirt/images_rbd_pool').with('value' => 'nova')
should contain_nova_config('libvirt/rbd_user').with('value' => 'cinder') is_expected.to contain_nova_config('libvirt/rbd_user').with('value' => 'cinder')
should contain_nova_config('libvirt/rbd_secret_uuid').with('value' => 'secrete') is_expected.to contain_nova_config('libvirt/rbd_secret_uuid').with('value' => 'secrete')
should contain_group('cephkeyring').with(:ensure => 'present') is_expected.to contain_group('cephkeyring').with(:ensure => 'present')
should contain_exec('add-nova-to-group').with( is_expected.to contain_exec('add-nova-to-group').with(
:command => 'usermod -a -G cephkeyring nova', :command => 'usermod -a -G cephkeyring nova',
:unless => 'groups nova | grep cephkeyring' :unless => 'groups nova | grep cephkeyring'
) )
end end
it 'configure libvirt driver' do it 'configure libvirt driver' do
should contain_class('nova::compute::libvirt').with( is_expected.to contain_class('nova::compute::libvirt').with(
:libvirt_type => 'kvm', :libvirt_type => 'kvm',
:vncserver_listen => '0.0.0.0', :vncserver_listen => '0.0.0.0',
:migration_support => true, :migration_support => true,
@ -400,20 +400,20 @@ describe 'cloud::compute::hypervisor' do
end end
it 'configure nova-compute to support RBD backend' do it 'configure nova-compute to support RBD backend' do
should contain_nova_config('libvirt/images_type').with('value' => 'rbd') is_expected.to contain_nova_config('libvirt/images_type').with('value' => 'rbd')
should contain_nova_config('libvirt/images_rbd_pool').with('value' => 'nova') is_expected.to contain_nova_config('libvirt/images_rbd_pool').with('value' => 'nova')
should contain_nova_config('libvirt/images_rbd_ceph_conf').with('value' => '/etc/ceph/ceph.conf') is_expected.to contain_nova_config('libvirt/images_rbd_ceph_conf').with('value' => '/etc/ceph/ceph.conf')
should contain_nova_config('libvirt/rbd_user').with('value' => 'cinder') is_expected.to contain_nova_config('libvirt/rbd_user').with('value' => 'cinder')
should contain_nova_config('libvirt/rbd_secret_uuid').with('value' => 'secrete') is_expected.to contain_nova_config('libvirt/rbd_secret_uuid').with('value' => 'secrete')
should contain_group('cephkeyring').with(:ensure => 'present') is_expected.to contain_group('cephkeyring').with(:ensure => 'present')
should contain_exec('add-nova-to-group').with( is_expected.to contain_exec('add-nova-to-group').with(
:command => 'usermod -a -G cephkeyring nova', :command => 'usermod -a -G cephkeyring nova',
:unless => 'groups nova | grep cephkeyring' :unless => 'groups nova | grep cephkeyring'
) )
end end
it 'configure libvirt driver' do it 'configure libvirt driver' do
should contain_class('nova::compute::libvirt').with( is_expected.to contain_class('nova::compute::libvirt').with(
:libvirt_type => 'kvm', :libvirt_type => 'kvm',
:vncserver_listen => '0.0.0.0', :vncserver_listen => '0.0.0.0',
:migration_support => true, :migration_support => true,
@ -460,7 +460,7 @@ describe 'cloud::compute::hypervisor' do
:ks_spice_public_host => false ) :ks_spice_public_host => false )
end end
it 'configure spice console with nova parameters' do it 'configure spice console with nova parameters' do
should contain_class('nova::compute::spice').with( is_expected.to contain_class('nova::compute::spice').with(
:server_listen => '0.0.0.0', :server_listen => '0.0.0.0',
:server_proxyclient_address => '7.0.0.1', :server_proxyclient_address => '7.0.0.1',
:proxy_host => '10.0.0.1', :proxy_host => '10.0.0.1',
@ -477,8 +477,8 @@ describe 'cloud::compute::hypervisor' do
:nfs_device => 'nfs.example.com:/vol1' ) :nfs_device => 'nfs.example.com:/vol1' )
end end
it 'configure nova instances path and NFS mount' do it 'configure nova instances path and NFS mount' do
should contain_nova_config('DEFAULT/instances_path').with('value' => '/var/lib/nova/instances') is_expected.to contain_nova_config('DEFAULT/instances_path').with('value' => '/var/lib/nova/instances')
should contain_mount('/var/lib/nova/instances').with({ is_expected.to contain_mount('/var/lib/nova/instances').with({
'ensure' => 'present', 'ensure' => 'present',
'fstype' => 'nfs', 'fstype' => 'nfs',
'device' => 'nfs.example.com:/vol1', 'device' => 'nfs.example.com:/vol1',

View File

@ -50,7 +50,7 @@ describe 'cloud::compute::scheduler' do
end end
it 'configure nova common' do it 'configure nova common' do
should contain_class('nova').with( is_expected.to contain_class('nova').with(
:verbose => true, :verbose => true,
:debug => true, :debug => true,
:use_syslog => true, :use_syslog => true,
@ -64,14 +64,14 @@ describe 'cloud::compute::scheduler' do
:glance_api_servers => 'http://10.0.0.1:9292', :glance_api_servers => 'http://10.0.0.1:9292',
:log_dir => false :log_dir => false
) )
should contain_nova_config('DEFAULT/resume_guests_state_on_host_boot').with('value' => true) is_expected.to contain_nova_config('DEFAULT/resume_guests_state_on_host_boot').with('value' => true)
should contain_nova_config('DEFAULT/default_availability_zone').with('value' => 'MyZone') is_expected.to contain_nova_config('DEFAULT/default_availability_zone').with('value' => 'MyZone')
should contain_nova_config('DEFAULT/servicegroup_driver').with_value('mc') is_expected.to contain_nova_config('DEFAULT/servicegroup_driver').with_value('mc')
should contain_nova_config('DEFAULT/glance_num_retries').with_value('10') is_expected.to contain_nova_config('DEFAULT/glance_num_retries').with_value('10')
end end
it 'configure neutron on compute node' do it 'configure neutron on compute node' do
should contain_class('nova::network::neutron').with( is_expected.to contain_class('nova::network::neutron').with(
:neutron_admin_password => 'secrete', :neutron_admin_password => 'secrete',
:neutron_admin_auth_url => 'http://10.0.0.1:35357/v2.0', :neutron_admin_auth_url => 'http://10.0.0.1:35357/v2.0',
:neutron_region_name => 'MyRegion', :neutron_region_name => 'MyRegion',
@ -80,7 +80,7 @@ describe 'cloud::compute::scheduler' do
end end
it 'checks if Nova DB is populated' do it 'checks if Nova DB is populated' do
should contain_exec('nova_db_sync').with( is_expected.to contain_exec('nova_db_sync').with(
:command => 'nova-manage db sync', :command => 'nova-manage db sync',
:user => 'nova', :user => 'nova',
:path => '/usr/bin', :path => '/usr/bin',
@ -89,7 +89,7 @@ describe 'cloud::compute::scheduler' do
end end
it 'configure nova-scheduler' do it 'configure nova-scheduler' do
should contain_class('nova::scheduler').with(:enabled => true) is_expected.to contain_class('nova::scheduler').with(:enabled => true)
end end
context 'openstack compute scheduler with nova-scheduler filters' do context 'openstack compute scheduler with nova-scheduler filters' do
@ -98,7 +98,7 @@ describe 'cloud::compute::scheduler' do
:scheduler_default_filters => ['RamFilter', 'ComputeFilter'] :scheduler_default_filters => ['RamFilter', 'ComputeFilter']
) )
end end
it { should contain_nova_config('DEFAULT/scheduler_default_filters').with( it { is_expected.to contain_nova_config('DEFAULT/scheduler_default_filters').with(
'value' => "RamFilter,ComputeFilter" 'value' => "RamFilter,ComputeFilter"
)} )}
end end

View File

@ -38,7 +38,7 @@ describe 'cloud::dashboard' do
end end
it 'configure horizon' do it 'configure horizon' do
should contain_class('horizon').with( is_expected.to contain_class('horizon').with(
:listen_ssl => false, :listen_ssl => false,
:secret_key => '/etc/ssl/secret', :secret_key => '/etc/ssl/secret',
:can_set_mount_point => 'False', :can_set_mount_point => 'False',
@ -56,7 +56,7 @@ describe 'cloud::dashboard' do
}, },
:openstack_endpoint_type => 'internalURL' :openstack_endpoint_type => 'internalURL'
) )
should contain_class('apache').with(:default_vhost => false) is_expected.to contain_class('apache').with(:default_vhost => false)
end end
end end

View File

@ -46,7 +46,7 @@ describe 'cloud::database::dbaas::api' do
end end
it 'configure trove common' do it 'configure trove common' do
should contain_class('trove').with( is_expected.to contain_class('trove').with(
:rabbit_userid => 'trove', :rabbit_userid => 'trove',
:rabbit_hosts => ['10.0.0.1'], :rabbit_hosts => ['10.0.0.1'],
:rabbit_password => 'secrete', :rabbit_password => 'secrete',
@ -59,7 +59,7 @@ describe 'cloud::database::dbaas::api' do
end end
it 'configure trove api' do it 'configure trove api' do
should contain_class('trove::api').with( is_expected.to contain_class('trove::api').with(
:verbose => true, :verbose => true,
:debug => true, :debug => true,
:use_syslog => true, :use_syslog => true,
@ -71,7 +71,7 @@ describe 'cloud::database::dbaas::api' do
end end
it 'checks if Trove DB is populated' do it 'checks if Trove DB is populated' do
should contain_exec('trove_db_sync').with( is_expected.to contain_exec('trove_db_sync').with(
:command => 'trove-manage db_sync', :command => 'trove-manage db_sync',
:user => 'trove', :user => 'trove',
:path => '/usr/bin', :path => '/usr/bin',

View File

@ -44,7 +44,7 @@ describe 'cloud::database::dbaas::conductor' do
end end
it 'configure trove common' do it 'configure trove common' do
should contain_class('trove').with( is_expected.to contain_class('trove').with(
:rabbit_userid => 'trove', :rabbit_userid => 'trove',
:rabbit_hosts => ['10.0.0.1'], :rabbit_hosts => ['10.0.0.1'],
:rabbit_password => 'secrete', :rabbit_password => 'secrete',
@ -57,7 +57,7 @@ describe 'cloud::database::dbaas::conductor' do
end end
it 'configure trove conductor' do it 'configure trove conductor' do
should contain_class('trove::conductor').with( is_expected.to contain_class('trove::conductor').with(
:verbose => true, :verbose => true,
:debug => true, :debug => true,
:use_syslog => true, :use_syslog => true,

View File

@ -44,7 +44,7 @@ describe 'cloud::database::dbaas::taskmanager' do
end end
it 'configure trove common' do it 'configure trove common' do
should contain_class('trove').with( is_expected.to contain_class('trove').with(
:rabbit_userid => 'trove', :rabbit_userid => 'trove',
:rabbit_hosts => ['10.0.0.1'], :rabbit_hosts => ['10.0.0.1'],
:rabbit_password => 'secrete', :rabbit_password => 'secrete',
@ -57,7 +57,7 @@ describe 'cloud::database::dbaas::taskmanager' do
end end
it 'configure trove taskmanager' do it 'configure trove taskmanager' do
should contain_class('trove::taskmanager').with( is_expected.to contain_class('trove::taskmanager').with(
:verbose => true, :verbose => true,
:debug => true, :debug => true,
:use_syslog => true, :use_syslog => true,

View File

@ -29,9 +29,9 @@ describe 'cloud::database::nosql' do
end end
it 'configure mongodb server' do it 'configure mongodb server' do
should contain_class('mongodb::globals').with( :manage_package_repo => platform_params[:manage_package_repo]) is_expected.to contain_class('mongodb::globals').with( :manage_package_repo => platform_params[:manage_package_repo])
should contain_class('mongodb::globals').with_before('Class[Mongodb]') is_expected.to contain_class('mongodb::globals').with_before('Class[Mongodb]')
should contain_class('mongodb').with( is_expected.to contain_class('mongodb').with(
:bind_ip => ['10.0.0.1'], :bind_ip => ['10.0.0.1'],
:nojournal => false, :nojournal => false,
:logpath => '/var/log/mongodb/mongod.log', :logpath => '/var/log/mongodb/mongod.log',
@ -39,16 +39,16 @@ describe 'cloud::database::nosql' do
end end
it 'configure mongodb replicasets' do it 'configure mongodb replicasets' do
should contain_exec('check_mongodb').with( is_expected.to contain_exec('check_mongodb').with(
:command => "/usr/bin/mongo 10.0.0.1:27017", :command => "/usr/bin/mongo 10.0.0.1:27017",
:logoutput => false, :logoutput => false,
:tries => 60, :tries => 60,
:try_sleep => 5 :try_sleep => 5
) )
should contain_mongodb_replset('ceilometer').with( is_expected.to contain_mongodb_replset('ceilometer').with(
:members => ['node1', 'node2', 'node3'] :members => ['node1', 'node2', 'node3']
) )
should contain_anchor('mongodb setup done') is_expected.to contain_anchor('mongodb setup done')
end end
end end

View File

@ -70,28 +70,28 @@ describe 'cloud::database::sql' do
end end
it 'configure mysql galera server' do it 'configure mysql galera server' do
should contain_class('mysql::client').with( is_expected.to contain_class('mysql::client').with(
:package_name => platform_params[:mysql_client_package_name] :package_name => platform_params[:mysql_client_package_name]
) )
should contain_class('mysql::server').with( is_expected.to contain_class('mysql::server').with(
:package_name => platform_params[:mysql_server_package_name], :package_name => platform_params[:mysql_server_package_name],
:override_options => { 'mysqld' => { 'bind-address' => '10.0.0.1' } }, :override_options => { 'mysqld' => { 'bind-address' => '10.0.0.1' } },
:notify => 'Service[xinetd]' :notify => 'Service[xinetd]'
) )
should contain_file(platform_params[:mysql_server_config_file]).with_content(/^wsrep_cluster_name\s*= "galera_cluster"$/) is_expected.to contain_file(platform_params[:mysql_server_config_file]).with_content(/^wsrep_cluster_name\s*= "galera_cluster"$/)
should contain_file(platform_params[:mysql_server_config_file]).with_content(/^wsrep_node_address\s*= "#{params[:api_eth]}"$/) is_expected.to contain_file(platform_params[:mysql_server_config_file]).with_content(/^wsrep_node_address\s*= "#{params[:api_eth]}"$/)
should contain_file(platform_params[:mysql_server_config_file]).with_content(/^wsrep_node_incoming_address\s*= "#{params[:api_eth]}"$/) is_expected.to contain_file(platform_params[:mysql_server_config_file]).with_content(/^wsrep_node_incoming_address\s*= "#{params[:api_eth]}"$/)
end # configure mysql galera server end # configure mysql galera server
context 'configure mysqlchk http replication' do context 'configure mysqlchk http replication' do
it { should contain_file('/etc/xinetd.d/mysqlchk').with_mode('0755') } it { is_expected.to contain_file('/etc/xinetd.d/mysqlchk').with_mode('0755') }
it { should contain_file('/usr/bin/clustercheck').with_mode('0755') } it { is_expected.to contain_file('/usr/bin/clustercheck').with_mode('0755') }
it { should contain_file('/usr/bin/clustercheck').with_content(/MYSQL_USERNAME='#{params[:galera_clustercheck_dbuser]}'/)} it { is_expected.to contain_file('/usr/bin/clustercheck').with_content(/MYSQL_USERNAME='#{params[:galera_clustercheck_dbuser]}'/)}
it { should contain_file('/usr/bin/clustercheck').with_content(/MYSQL_PASSWORD='#{params[:galera_clustercheck_dbpassword]}'/)} it { is_expected.to contain_file('/usr/bin/clustercheck').with_content(/MYSQL_PASSWORD='#{params[:galera_clustercheck_dbpassword]}'/)}
it { should contain_file('/etc/xinetd.d/mysqlchk').with_content(/bind = #{params[:galera_clustercheck_ipaddress]}/)} it { is_expected.to contain_file('/etc/xinetd.d/mysqlchk').with_content(/bind = #{params[:galera_clustercheck_ipaddress]}/)}
end # configure mysqlchk http replication end # configure mysqlchk http replication
@ -102,7 +102,7 @@ describe 'cloud::database::sql' do
end end
it 'configure mysql server' do it 'configure mysql server' do
should contain_class('mysql::server').with( is_expected.to contain_class('mysql::server').with(
:package_name => platform_params[:mysql_server_package_name], :package_name => platform_params[:mysql_server_package_name],
:root_password => 'secrete', :root_password => 'secrete',
:override_options => { 'mysqld' => { 'bind-address' => '10.0.0.1' } }, :override_options => { 'mysqld' => { 'bind-address' => '10.0.0.1' } },
@ -111,7 +111,7 @@ describe 'cloud::database::sql' do
end end
it 'configure keystone database' do it 'configure keystone database' do
should contain_class('keystone::db::mysql').with( is_expected.to contain_class('keystone::db::mysql').with(
:mysql_module => '2.2', :mysql_module => '2.2',
:dbname => 'keystone', :dbname => 'keystone',
:user => 'keystone', :user => 'keystone',
@ -121,7 +121,7 @@ describe 'cloud::database::sql' do
end end
it 'configure glance database' do it 'configure glance database' do
should contain_class('glance::db::mysql').with( is_expected.to contain_class('glance::db::mysql').with(
:mysql_module => '2.2', :mysql_module => '2.2',
:dbname => 'glance', :dbname => 'glance',
:user => 'glance', :user => 'glance',
@ -131,7 +131,7 @@ describe 'cloud::database::sql' do
end end
it 'configure nova database' do it 'configure nova database' do
should contain_class('nova::db::mysql').with( is_expected.to contain_class('nova::db::mysql').with(
:mysql_module => '2.2', :mysql_module => '2.2',
:dbname => 'nova', :dbname => 'nova',
:user => 'nova', :user => 'nova',
@ -141,7 +141,7 @@ describe 'cloud::database::sql' do
end end
it 'configure cinder database' do it 'configure cinder database' do
should contain_class('cinder::db::mysql').with( is_expected.to contain_class('cinder::db::mysql').with(
:mysql_module => '2.2', :mysql_module => '2.2',
:dbname => 'cinder', :dbname => 'cinder',
:user => 'cinder', :user => 'cinder',
@ -151,7 +151,7 @@ describe 'cloud::database::sql' do
end end
it 'configure neutron database' do it 'configure neutron database' do
should contain_class('neutron::db::mysql').with( is_expected.to contain_class('neutron::db::mysql').with(
:mysql_module => '2.2', :mysql_module => '2.2',
:dbname => 'neutron', :dbname => 'neutron',
:user => 'neutron', :user => 'neutron',
@ -161,7 +161,7 @@ describe 'cloud::database::sql' do
end end
it 'configure heat database' do it 'configure heat database' do
should contain_class('heat::db::mysql').with( is_expected.to contain_class('heat::db::mysql').with(
:mysql_module => '2.2', :mysql_module => '2.2',
:dbname => 'heat', :dbname => 'heat',
:user => 'heat', :user => 'heat',
@ -171,7 +171,7 @@ describe 'cloud::database::sql' do
end end
it 'configure trove database' do it 'configure trove database' do
should contain_class('trove::db::mysql').with( is_expected.to contain_class('trove::db::mysql').with(
:mysql_module => '2.2', :mysql_module => '2.2',
:dbname => 'trove', :dbname => 'trove',
:user => 'trove', :user => 'trove',
@ -181,15 +181,15 @@ describe 'cloud::database::sql' do
end end
it 'configure monitoring database' do it 'configure monitoring database' do
should contain_mysql_database('monitoring').with( is_expected.to contain_mysql_database('monitoring').with(
:ensure => 'present', :ensure => 'present',
:charset => 'utf8' :charset => 'utf8'
) )
should contain_mysql_user("#{params[:galera_clustercheck_dbuser]}@localhost").with( is_expected.to contain_mysql_user("#{params[:galera_clustercheck_dbuser]}@localhost").with(
:ensure => 'present', :ensure => 'present',
:password_hash => '*FDC68394456829A7344C2E9D4CDFD43DCE2EFD8F' :password_hash => '*FDC68394456829A7344C2E9D4CDFD43DCE2EFD8F'
) )
should contain_mysql_grant("#{params[:galera_clustercheck_dbuser]}@localhost/monitoring").with( is_expected.to contain_mysql_grant("#{params[:galera_clustercheck_dbuser]}@localhost/monitoring").with(
:privileges => 'ALL' :privileges => 'ALL'
) )
end # configure monitoring database end # configure monitoring database
@ -200,7 +200,7 @@ describe 'cloud::database::sql' do
facts.merge!( :osfamily => 'RedHat' ) facts.merge!( :osfamily => 'RedHat' )
end end
it 'configure mysql database' do it 'configure mysql database' do
should contain_exec('bootstrap-mysql').with( is_expected.to contain_exec('bootstrap-mysql').with(
:command => '/usr/bin/mysql_install_db --rpm --user=mysql', :command => '/usr/bin/mysql_install_db --rpm --user=mysql',
:unless => "test -d /var/lib/mysql/mysql", :unless => "test -d /var/lib/mysql/mysql",
:before => 'Service[mysqld]' :before => 'Service[mysqld]'

View File

@ -117,7 +117,7 @@ describe 'cloud::identity' do
end end
it 'configure keystone server' do it 'configure keystone server' do
should contain_class('keystone').with( is_expected.to contain_class('keystone').with(
:enabled => true, :enabled => true,
:admin_token => 'SECRETE', :admin_token => 'SECRETE',
:compute_port => '8774', :compute_port => '8774',
@ -137,13 +137,13 @@ describe 'cloud::identity' do
:log_file => false, :log_file => false,
:admin_endpoint => 'https://10.0.0.1:35357/v2.0' :admin_endpoint => 'https://10.0.0.1:35357/v2.0'
) )
should contain_keystone_config('ec2/driver').with('value' => 'keystone.contrib.ec2.backends.sql.Ec2') is_expected.to contain_keystone_config('ec2/driver').with('value' => 'keystone.contrib.ec2.backends.sql.Ec2')
should contain_keystone_config('DEFAULT/log_file').with_ensure('absent') is_expected.to contain_keystone_config('DEFAULT/log_file').with_ensure('absent')
should contain_keystone_config('DEFAULT/log_dir').with_ensure('absent') is_expected.to contain_keystone_config('DEFAULT/log_dir').with_ensure('absent')
end end
it 'checks if Keystone DB is populated' do it 'checks if Keystone DB is populated' do
should contain_exec('keystone_db_sync').with( is_expected.to contain_exec('keystone_db_sync').with(
:command => 'keystone-manage db_sync', :command => 'keystone-manage db_sync',
:path => '/usr/bin', :path => '/usr/bin',
:user => 'keystone', :user => 'keystone',
@ -152,7 +152,7 @@ describe 'cloud::identity' do
end end
it 'configure keystone admin role' do it 'configure keystone admin role' do
should contain_class('keystone::roles::admin').with( is_expected.to contain_class('keystone::roles::admin').with(
:email => 'admin@openstack.org', :email => 'admin@openstack.org',
:password => 'secrete', :password => 'secrete',
:admin_tenant => 'admin' :admin_tenant => 'admin'
@ -171,7 +171,7 @@ describe 'cloud::identity' do
# end # end
it 'configure keystone endpoint' do it 'configure keystone endpoint' do
should contain_class('keystone::endpoint').with( is_expected.to contain_class('keystone::endpoint').with(
:public_url => 'https://10.0.0.1:5000', :public_url => 'https://10.0.0.1:5000',
:admin_url => 'https://10.0.0.1:35357', :admin_url => 'https://10.0.0.1:35357',
:internal_url => 'https://10.0.0.1:5000', :internal_url => 'https://10.0.0.1:5000',
@ -180,7 +180,7 @@ describe 'cloud::identity' do
end end
it 'configure swift endpoints' do it 'configure swift endpoints' do
should contain_class('swift::keystone::auth').with( is_expected.to contain_class('swift::keystone::auth').with(
:password => 'secrete', :password => 'secrete',
:public_address => '10.0.0.1', :public_address => '10.0.0.1',
:public_port => '8080', :public_port => '8080',
@ -194,11 +194,11 @@ describe 'cloud::identity' do
end end
it 'configure swift dispersion' do it 'configure swift dispersion' do
should contain_class('swift::keystone::dispersion').with( :auth_pass => 'secrete' ) is_expected.to contain_class('swift::keystone::dispersion').with( :auth_pass => 'secrete' )
end end
it 'configure ceilometer endpoints' do it 'configure ceilometer endpoints' do
should contain_class('ceilometer::keystone::auth').with( is_expected.to contain_class('ceilometer::keystone::auth').with(
:admin_address => '10.0.0.1', :admin_address => '10.0.0.1',
:internal_address => '10.0.0.1', :internal_address => '10.0.0.1',
:password => 'secrete', :password => 'secrete',
@ -212,11 +212,11 @@ describe 'cloud::identity' do
end end
it 'should not configure trove endpoint by default' do it 'should not configure trove endpoint by default' do
should_not contain_class('trove::keystone::auth') is_expected.not_to contain_class('trove::keystone::auth')
end end
it 'configure nova endpoints' do it 'configure nova endpoints' do
should contain_class('nova::keystone::auth').with( is_expected.to contain_class('nova::keystone::auth').with(
:admin_address => '10.0.0.1', :admin_address => '10.0.0.1',
:cinder => true, :cinder => true,
:internal_address => '10.0.0.1', :internal_address => '10.0.0.1',
@ -232,7 +232,7 @@ describe 'cloud::identity' do
end end
it 'configure neutron endpoints' do it 'configure neutron endpoints' do
should contain_class('neutron::keystone::auth').with( is_expected.to contain_class('neutron::keystone::auth').with(
:admin_address => '10.0.0.1', :admin_address => '10.0.0.1',
:internal_address => '10.0.0.1', :internal_address => '10.0.0.1',
:password => 'secrete', :password => 'secrete',
@ -246,7 +246,7 @@ describe 'cloud::identity' do
end end
it 'configure cinder endpoints' do it 'configure cinder endpoints' do
should contain_class('cinder::keystone::auth').with( is_expected.to contain_class('cinder::keystone::auth').with(
:admin_address => '10.0.0.1', :admin_address => '10.0.0.1',
:internal_address => '10.0.0.1', :internal_address => '10.0.0.1',
:password => 'secrete', :password => 'secrete',
@ -257,7 +257,7 @@ describe 'cloud::identity' do
end end
it 'configure glance endpoints' do it 'configure glance endpoints' do
should contain_class('glance::keystone::auth').with( is_expected.to contain_class('glance::keystone::auth').with(
:admin_address => '10.0.0.1', :admin_address => '10.0.0.1',
:internal_address => '10.0.0.1', :internal_address => '10.0.0.1',
:password => 'secrete', :password => 'secrete',
@ -271,7 +271,7 @@ describe 'cloud::identity' do
end end
it 'configure heat endpoints' do it 'configure heat endpoints' do
should contain_class('heat::keystone::auth').with( is_expected.to contain_class('heat::keystone::auth').with(
:admin_address => '10.0.0.1', :admin_address => '10.0.0.1',
:internal_address => '10.0.0.1', :internal_address => '10.0.0.1',
:password => 'secrete', :password => 'secrete',
@ -285,7 +285,7 @@ describe 'cloud::identity' do
end end
it 'configure heat cloudformation endpoints' do it 'configure heat cloudformation endpoints' do
should contain_class('heat::keystone::auth_cfn').with( is_expected.to contain_class('heat::keystone::auth_cfn').with(
:admin_address => '10.0.0.1', :admin_address => '10.0.0.1',
:internal_address => '10.0.0.1', :internal_address => '10.0.0.1',
:password => 'secrete', :password => 'secrete',
@ -299,7 +299,7 @@ describe 'cloud::identity' do
end end
it 'configure a crontab to purge tokens every days at midnight' do it 'configure a crontab to purge tokens every days at midnight' do
should contain_class('keystone::cron::token_flush') is_expected.to contain_class('keystone::cron::token_flush')
end end
context 'without syslog' do context 'without syslog' do
@ -307,7 +307,7 @@ describe 'cloud::identity' do
params.merge!(:use_syslog => false) params.merge!(:use_syslog => false)
end end
it 'configure keystone server' do it 'configure keystone server' do
should contain_class('keystone').with( is_expected.to contain_class('keystone').with(
:use_syslog => false, :use_syslog => false,
:log_dir => '/var/log/keystone', :log_dir => '/var/log/keystone',
:log_file => 'keystone.log' :log_file => 'keystone.log'
@ -320,8 +320,8 @@ describe 'cloud::identity' do
params.merge!(:swift_enabled => false) params.merge!(:swift_enabled => false)
end end
it 'should not configure swift endpoints and users' do it 'should not configure swift endpoints and users' do
should_not contain_class('swift::keystone::auth') is_expected.not_to contain_class('swift::keystone::auth')
should_not contain_class('swift::keystone::dispersion') is_expected.not_to contain_class('swift::keystone::dispersion')
end end
end end
@ -330,7 +330,7 @@ describe 'cloud::identity' do
params.merge!(:trove_enabled => true) params.merge!(:trove_enabled => true)
end end
it 'configure trove endpoints' do it 'configure trove endpoints' do
should contain_class('trove::keystone::auth').with( is_expected.to contain_class('trove::keystone::auth').with(
:admin_address => '10.0.0.1', :admin_address => '10.0.0.1',
:internal_address => '10.0.0.1', :internal_address => '10.0.0.1',
:password => 'secrete', :password => 'secrete',

View File

@ -47,7 +47,7 @@ describe 'cloud::image::api' do
shared_examples_for 'openstack image api' do shared_examples_for 'openstack image api' do
it 'configure glance-api' do it 'configure glance-api' do
should contain_class('glance::api').with( is_expected.to contain_class('glance::api').with(
:database_connection => 'mysql://glance:secrete@10.0.0.1/glance?charset=utf8', :database_connection => 'mysql://glance:secrete@10.0.0.1/glance?charset=utf8',
:keystone_password => 'secrete', :keystone_password => 'secrete',
:registry_host => '10.0.0.42', :registry_host => '10.0.0.42',
@ -79,18 +79,18 @@ describe 'cloud::image::api' do
# :rabbit_host => '10.0.0.1' # :rabbit_host => '10.0.0.1'
# ) # )
# end # end
it { should contain_glance_api_config('DEFAULT/notifier_driver').with_value('noop') } it { is_expected.to contain_glance_api_config('DEFAULT/notifier_driver').with_value('noop') }
it 'configure glance rbd backend' do it 'configure glance rbd backend' do
should contain_class('glance::backend::rbd').with( is_expected.to contain_class('glance::backend::rbd').with(
:rbd_store_pool => 'images', :rbd_store_pool => 'images',
:rbd_store_user => 'glance' :rbd_store_user => 'glance'
) )
end end
it 'configure crontab to clean glance cache' do it 'configure crontab to clean glance cache' do
should contain_class('glance::cache::cleaner') is_expected.to contain_class('glance::cache::cleaner')
should contain_class('glance::cache::pruner') is_expected.to contain_class('glance::cache::pruner')
end end
context 'with file Glance backend' do context 'with file Glance backend' do
@ -99,10 +99,10 @@ describe 'cloud::image::api' do
end end
it 'configure Glance with file backend' do it 'configure Glance with file backend' do
should contain_class('glance::backend::file') is_expected.to contain_class('glance::backend::file')
should_not contain_class('glance::backend::rbd') is_expected.not_to contain_class('glance::backend::rbd')
should contain_glance_api_config('DEFAULT/filesystem_store_datadir').with('value' => '/var/lib/glance/images/') is_expected.to contain_glance_api_config('DEFAULT/filesystem_store_datadir').with('value' => '/var/lib/glance/images/')
should contain_glance_api_config('DEFAULT/default_store').with('value' => 'file') is_expected.to contain_glance_api_config('DEFAULT/default_store').with('value' => 'file')
end end
end end
@ -114,11 +114,11 @@ describe 'cloud::image::api' do
end end
it 'configure Glance with NFS backend' do it 'configure Glance with NFS backend' do
should contain_class('glance::backend::file') is_expected.to contain_class('glance::backend::file')
should_not contain_class('glance::backend::rbd') is_expected.not_to contain_class('glance::backend::rbd')
should contain_glance_api_config('DEFAULT/filesystem_store_datadir').with('value' => '/srv/images/') is_expected.to contain_glance_api_config('DEFAULT/filesystem_store_datadir').with('value' => '/srv/images/')
should contain_glance_api_config('DEFAULT/default_store').with('value' => 'file') is_expected.to contain_glance_api_config('DEFAULT/default_store').with('value' => 'file')
should contain_mount('/srv/images/').with({ is_expected.to contain_mount('/srv/images/').with({
'ensure' => 'present', 'ensure' => 'present',
'fstype' => 'nfs', 'fstype' => 'nfs',
'device' => 'nfs.example.com:/vol1', 'device' => 'nfs.example.com:/vol1',
@ -131,14 +131,14 @@ describe 'cloud::image::api' do
params.merge!(:backend => 'nfs', params.merge!(:backend => 'nfs',
:nfs_device => false ) :nfs_device => false )
end end
it { should compile.and_raise_error(/When running NFS backend, you need to provide nfs_device parameter./) } it { is_expected.to compile.and_raise_error(/When running NFS backend, you need to provide nfs_device parameter./) }
end end
context 'with wrong Glance backend' do context 'with wrong Glance backend' do
before :each do before :each do
params.merge!(:backend => 'Something') params.merge!(:backend => 'Something')
end end
it { should compile.and_raise_error(/Something is not a Glance supported backend./) } it { is_expected.to compile.and_raise_error(/Something is not a Glance supported backend./) }
end end
end end

View File

@ -39,7 +39,7 @@ describe 'cloud::image::registry' do
shared_examples_for 'openstack image registry' do shared_examples_for 'openstack image registry' do
it 'configure glance-registry' do it 'configure glance-registry' do
should contain_class('glance::registry').with( is_expected.to contain_class('glance::registry').with(
:database_connection => 'mysql://glance:secrete@10.0.0.1/glance?charset=utf8', :database_connection => 'mysql://glance:secrete@10.0.0.1/glance?charset=utf8',
:keystone_password => 'secrete', :keystone_password => 'secrete',
:keystone_tenant => 'services', :keystone_tenant => 'services',
@ -58,7 +58,7 @@ describe 'cloud::image::registry' do
end end
it 'checks if Glance DB is populated' do it 'checks if Glance DB is populated' do
should contain_exec('glance_db_sync').with( is_expected.to contain_exec('glance_db_sync').with(
:command => 'glance-manage db_sync', :command => 'glance-manage db_sync',
:user => 'glance', :user => 'glance',
:path => '/usr/bin', :path => '/usr/bin',

View File

@ -44,7 +44,7 @@ describe 'cloud::image' do
shared_examples_for 'openstack image' do shared_examples_for 'openstack image' do
it 'configure glance-api' do it 'configure glance-api' do
should contain_class('glance::api').with( is_expected.to contain_class('glance::api').with(
:database_connection => 'mysql://glance:secrete@10.0.0.1/glance?charset=utf8', :database_connection => 'mysql://glance:secrete@10.0.0.1/glance?charset=utf8',
:keystone_password => 'secrete', :keystone_password => 'secrete',
:registry_host => '10.0.0.42', :registry_host => '10.0.0.42',
@ -65,7 +65,7 @@ describe 'cloud::image' do
end end
it 'configure glance-registry' do it 'configure glance-registry' do
should contain_class('glance::registry').with( is_expected.to contain_class('glance::registry').with(
:database_connection => 'mysql://glance:secrete@10.0.0.1/glance?charset=utf8', :database_connection => 'mysql://glance:secrete@10.0.0.1/glance?charset=utf8',
:keystone_password => 'secrete', :keystone_password => 'secrete',
:keystone_tenant => 'services', :keystone_tenant => 'services',
@ -92,22 +92,22 @@ describe 'cloud::image' do
# :rabbit_host => '10.0.0.1' # :rabbit_host => '10.0.0.1'
# ) # )
# end # end
it { should contain_glance_api_config('DEFAULT/notifier_driver').with_value('noop') } it { is_expected.to contain_glance_api_config('DEFAULT/notifier_driver').with_value('noop') }
it 'configure glance rbd backend' do it 'configure glance rbd backend' do
should contain_class('glance::backend::rbd').with( is_expected.to contain_class('glance::backend::rbd').with(
:rbd_store_pool => 'images', :rbd_store_pool => 'images',
:rbd_store_user => 'glance' :rbd_store_user => 'glance'
) )
end end
it 'configure crontab to clean glance cache' do it 'configure crontab to clean glance cache' do
should contain_class('glance::cache::cleaner') is_expected.to contain_class('glance::cache::cleaner')
should contain_class('glance::cache::pruner') is_expected.to contain_class('glance::cache::pruner')
end end
it 'checks if Glance DB is populated' do it 'checks if Glance DB is populated' do
should contain_exec('glance_db_sync').with( is_expected.to contain_exec('glance_db_sync').with(
:command => 'glance-manage db_sync', :command => 'glance-manage db_sync',
:user => 'glance', :user => 'glance',
:path => '/usr/bin', :path => '/usr/bin',

View File

@ -38,13 +38,13 @@ describe 'cloud' do
} }
end end
it {should contain_class('ntp')} it {is_expected.to contain_class('ntp')}
it {should contain_file('/etc/motd').with( it {is_expected.to contain_file('/etc/motd').with(
{:ensure => 'file'}.merge(file_defaults) {:ensure => 'file'}.merge(file_defaults)
)} )}
it { should contain_service('cron').with({ it { is_expected.to contain_service('cron').with({
:name => platform_params[:cron_service_name], :name => platform_params[:cron_service_name],
:ensure => 'running', :ensure => 'running',
:enable => true :enable => true
@ -84,7 +84,7 @@ describe 'cloud' do
#it_configures 'private cloud node' #it_configures 'private cloud node'
xit { should contain_rhn_register('rhn-redhat1') } xit { is_expected.to contain_rhn_register('rhn-redhat1') }
end end
context 'on other platforms' do context 'on other platforms' do
@ -92,7 +92,7 @@ describe 'cloud' do
{ :osfamily => 'Solaris' } { :osfamily => 'Solaris' }
end end
it { should compile.and_raise_error(/module puppet-openstack-cloud only support/) } it { is_expected.to compile.and_raise_error(/module puppet-openstack-cloud only support/) }
end end
end end

View File

@ -87,15 +87,15 @@ describe 'cloud::loadbalancer' do
end end
it 'configure haproxy server' do it 'configure haproxy server' do
should contain_class('haproxy') is_expected.to contain_class('haproxy')
end # configure haproxy server end # configure haproxy server
it 'configure keepalived server' do it 'configure keepalived server' do
should contain_class('keepalived') is_expected.to contain_class('keepalived')
end # configure keepalived server end # configure keepalived server
it 'configure sysctl to allow HAproxy to bind to a non-local IP address' do it 'configure sysctl to allow HAproxy to bind to a non-local IP address' do
should contain_exec('exec_sysctl_net.ipv4.ip_nonlocal_bind').with_command( is_expected.to contain_exec('exec_sysctl_net.ipv4.ip_nonlocal_bind').with_command(
'sysctl -w net.ipv4.ip_nonlocal_bind=1' 'sysctl -w net.ipv4.ip_nonlocal_bind=1'
) )
end end
@ -105,7 +105,7 @@ describe 'cloud::loadbalancer' do
params.merge!(:keepalived_internal_ipvs => ['192.168.0.1']) params.merge!(:keepalived_internal_ipvs => ['192.168.0.1'])
end end
it 'configure an internal VRRP instance' do it 'configure an internal VRRP instance' do
should contain_keepalived__instance('2').with({ is_expected.to contain_keepalived__instance('2').with({
'interface' => 'eth1', 'interface' => 'eth1',
'virtual_ips' => ['192.168.0.1 dev eth1'], 'virtual_ips' => ['192.168.0.1 dev eth1'],
'track_script' => ['haproxy'], 'track_script' => ['haproxy'],
@ -127,7 +127,7 @@ describe 'cloud::loadbalancer' do
) )
end end
it 'configure a public VRRP instance with deprecated parameters' do it 'configure a public VRRP instance with deprecated parameters' do
should contain_keepalived__instance('1').with({ is_expected.to contain_keepalived__instance('1').with({
'interface' => 'eth3', 'interface' => 'eth3',
'virtual_ips' => ['192.168.0.2 dev eth3'], 'virtual_ips' => ['192.168.0.2 dev eth3'],
'track_script' => ['haproxy'], 'track_script' => ['haproxy'],
@ -144,7 +144,7 @@ describe 'cloud::loadbalancer' do
params.merge!(:keepalived_vrrp_interface => 'eth2') params.merge!(:keepalived_vrrp_interface => 'eth2')
end end
it 'configure keepalived with a dedicated interface for vrrp' do it 'configure keepalived with a dedicated interface for vrrp' do
should contain_keepalived__instance('1').with({ is_expected.to contain_keepalived__instance('1').with({
'interface' => 'eth2', 'interface' => 'eth2',
}) })
end end
@ -152,7 +152,7 @@ describe 'cloud::loadbalancer' do
context 'when keepalived and HAproxy are in backup' do context 'when keepalived and HAproxy are in backup' do
it 'configure vrrp_instance with BACKUP state' do it 'configure vrrp_instance with BACKUP state' do
should contain_keepalived__instance('1').with({ is_expected.to contain_keepalived__instance('1').with({
'interface' => params[:keepalived_public_interface], 'interface' => params[:keepalived_public_interface],
'virtual_ips' => ['10.0.0.1 dev eth0', '10.0.0.2 dev eth0'], 'virtual_ips' => ['10.0.0.1 dev eth0', '10.0.0.2 dev eth0'],
'track_script' => ['haproxy'], 'track_script' => ['haproxy'],
@ -163,7 +163,7 @@ describe 'cloud::loadbalancer' do
}) })
end # configure vrrp_instance with BACKUP state end # configure vrrp_instance with BACKUP state
it 'configure haproxy server without service managed' do it 'configure haproxy server without service managed' do
should contain_class('haproxy').with(:service_manage => true) is_expected.to contain_class('haproxy').with(:service_manage => true)
end # configure haproxy server end # configure haproxy server
end # configure keepalived in backup end # configure keepalived in backup
@ -172,7 +172,7 @@ describe 'cloud::loadbalancer' do
params.merge!( :keepalived_state => 'MASTER' ) params.merge!( :keepalived_state => 'MASTER' )
end end
it 'configure vrrp_instance with MASTER state' do it 'configure vrrp_instance with MASTER state' do
should contain_keepalived__instance('1').with({ is_expected.to contain_keepalived__instance('1').with({
'interface' => params[:keepalived_public_interface], 'interface' => params[:keepalived_public_interface],
'track_script' => ['haproxy'], 'track_script' => ['haproxy'],
'state' => 'MASTER', 'state' => 'MASTER',
@ -182,12 +182,12 @@ describe 'cloud::loadbalancer' do
}) })
end end
it 'configure haproxy server with service managed' do it 'configure haproxy server with service managed' do
should contain_class('haproxy').with(:service_manage => true) is_expected.to contain_class('haproxy').with(:service_manage => true)
end # configure haproxy server end # configure haproxy server
end # configure keepalived in master end # configure keepalived in master
context 'configure logrotate file' do context 'configure logrotate file' do
it { should contain_file('/etc/logrotate.d/haproxy').with( it { is_expected.to contain_file('/etc/logrotate.d/haproxy').with(
:source => 'puppet:///modules/cloud/logrotate/haproxy', :source => 'puppet:///modules/cloud/logrotate/haproxy',
:mode => '0644', :mode => '0644',
:owner => 'root', :owner => 'root',
@ -196,14 +196,14 @@ describe 'cloud::loadbalancer' do
end # configure logrotate file end # configure logrotate file
context 'configure monitor haproxy listen' do context 'configure monitor haproxy listen' do
it { should contain_haproxy__listen('monitor').with( it { is_expected.to contain_haproxy__listen('monitor').with(
:ipaddress => params[:vip_public_ip], :ipaddress => params[:vip_public_ip],
:ports => '9300' :ports => '9300'
)} )}
end # configure monitor haproxy listen end # configure monitor haproxy listen
context 'configure galera haproxy listen' do context 'configure galera haproxy listen' do
it { should contain_haproxy__listen('galera_cluster').with( it { is_expected.to contain_haproxy__listen('galera_cluster').with(
:ipaddress => params[:galera_ip], :ipaddress => params[:galera_ip],
:ports => '3306', :ports => '3306',
:options => { :options => {
@ -218,14 +218,14 @@ describe 'cloud::loadbalancer' do
end # configure monitor haproxy listen end # configure monitor haproxy listen
context 'not configure galera slave haproxy listen' do context 'not configure galera slave haproxy listen' do
it { should_not contain_haproxy__listen('galera_readonly_cluster') } it { is_expected.not_to contain_haproxy__listen('galera_readonly_cluster') }
end # configure monitor haproxy listen end # configure monitor haproxy listen
context 'configure galera slave haproxy listen' do context 'configure galera slave haproxy listen' do
before do before do
params.merge!( :galera_slave => true ) params.merge!( :galera_slave => true )
end end
it { should contain_haproxy__listen('galera_readonly_cluster').with( it { is_expected.to contain_haproxy__listen('galera_readonly_cluster').with(
:ipaddress => params[:galera_ip], :ipaddress => params[:galera_ip],
:ports => '3307', :ports => '3307',
:options => { :options => {
@ -241,7 +241,7 @@ describe 'cloud::loadbalancer' do
# test backward compatibility # test backward compatibility
context 'configure OpenStack binding on public network only' do context 'configure OpenStack binding on public network only' do
it { should contain_haproxy__listen('spice_cluster').with( it { is_expected.to contain_haproxy__listen('spice_cluster').with(
:ipaddress => [params[:vip_public_ip]], :ipaddress => [params[:vip_public_ip]],
:ports => '6082', :ports => '6082',
:options => { :options => {
@ -265,7 +265,7 @@ describe 'cloud::loadbalancer' do
:keepalived_internal_ipvs => ['192.168.0.1', '192.168.0.2'] :keepalived_internal_ipvs => ['192.168.0.1', '192.168.0.2']
) )
end end
it { should contain_haproxy__listen('nova_api_cluster').with( it { is_expected.to contain_haproxy__listen('nova_api_cluster').with(
:ipaddress => ['172.16.0.1', '192.168.0.1'], :ipaddress => ['172.16.0.1', '192.168.0.1'],
:ports => '8774' :ports => '8774'
)} )}
@ -282,7 +282,7 @@ describe 'cloud::loadbalancer' do
:keepalived_internal_ipvs => ['192.168.0.1', '192.168.0.2'] :keepalived_internal_ipvs => ['192.168.0.1', '192.168.0.2']
) )
end end
it { should contain_haproxy__listen('nova_api_cluster').with( it { is_expected.to contain_haproxy__listen('nova_api_cluster').with(
:ipaddress => ['172.16.0.1', '2001:0db8:85a3:0000:0000:8a2e:0370:7334', '192.168.0.1'], :ipaddress => ['172.16.0.1', '2001:0db8:85a3:0000:0000:8a2e:0370:7334', '192.168.0.1'],
:ports => '8774' :ports => '8774'
)} )}
@ -292,7 +292,7 @@ describe 'cloud::loadbalancer' do
before do before do
params.merge!(:metadata_api => false) params.merge!(:metadata_api => false)
end end
it { should_not contain_haproxy__listen('metadata_api_cluster') } it { is_expected.not_to contain_haproxy__listen('metadata_api_cluster') }
end end
context 'should fail to configure OpenStack binding when vip_public_ip and vip_internal_ip are missing' do context 'should fail to configure OpenStack binding when vip_public_ip and vip_internal_ip are missing' do
@ -359,7 +359,7 @@ describe 'cloud::loadbalancer' do
:nova_bind_options => ['ssl', 'crt'] :nova_bind_options => ['ssl', 'crt']
) )
end end
it { should contain_haproxy__listen('nova_api_cluster').with( it { is_expected.to contain_haproxy__listen('nova_api_cluster').with(
:ipaddress => [params[:vip_public_ip]], :ipaddress => [params[:vip_public_ip]],
:ports => '8774', :ports => '8774',
:options => { :options => {
@ -378,7 +378,7 @@ describe 'cloud::loadbalancer' do
:cinder_bind_options => 'something not secure', :cinder_bind_options => 'something not secure',
) )
end end
it { should contain_haproxy__listen('cinder_api_cluster').with( it { is_expected.to contain_haproxy__listen('cinder_api_cluster').with(
:ipaddress => [params[:vip_public_ip]], :ipaddress => [params[:vip_public_ip]],
:ports => '8776', :ports => '8776',
:options => { :options => {
@ -392,7 +392,7 @@ describe 'cloud::loadbalancer' do
end end
context 'configure OpenStack Horizon' do context 'configure OpenStack Horizon' do
it { should contain_haproxy__listen('horizon_cluster').with( it { is_expected.to contain_haproxy__listen('horizon_cluster').with(
:ipaddress => [params[:vip_public_ip]], :ipaddress => [params[:vip_public_ip]],
:ports => '80', :ports => '80',
:options => { :options => {
@ -414,7 +414,7 @@ describe 'cloud::loadbalancer' do
:horizon_bind_options => ['ssl', 'crt'] :horizon_bind_options => ['ssl', 'crt']
) )
end end
it { should contain_haproxy__listen('horizon_cluster').with( it { is_expected.to contain_haproxy__listen('horizon_cluster').with(
:ipaddress => [params[:vip_public_ip]], :ipaddress => [params[:vip_public_ip]],
:ports => '443', :ports => '443',
:options => { :options => {
@ -436,7 +436,7 @@ describe 'cloud::loadbalancer' do
:horizon_ssl_port => '443' :horizon_ssl_port => '443'
) )
end end
it { should contain_haproxy__listen('horizon_ssl_cluster').with( it { is_expected.to contain_haproxy__listen('horizon_ssl_cluster').with(
:ipaddress => [params[:vip_public_ip]], :ipaddress => [params[:vip_public_ip]],
:ports => '443', :ports => '443',
:options => { :options => {
@ -454,7 +454,7 @@ describe 'cloud::loadbalancer' do
:heat_api_bind_options => ['ssl', 'crt'] :heat_api_bind_options => ['ssl', 'crt']
) )
end end
it { should contain_haproxy__listen('heat_api_cluster').with( it { is_expected.to contain_haproxy__listen('heat_api_cluster').with(
:ipaddress => [params[:vip_public_ip]], :ipaddress => [params[:vip_public_ip]],
:ports => '8004', :ports => '8004',
:options => { :options => {

View File

@ -51,15 +51,15 @@ describe 'cloud::logging::agent' do
end end
it 'include cloud::loging' do it 'include cloud::loging' do
it should contain_class('cloud::logging') it is_expected.to contain_class('cloud::logging')
end end
it 'include rsyslog::client' do it 'include rsyslog::client' do
it should contain_class('rsyglog::client') it is_expected.to contain_class('rsyglog::client')
end end
it 'create /var/db/td-agent' do it 'create /var/db/td-agent' do
it should contain_file('/var/db/td-agent').with({ it is_expected.to contain_file('/var/db/td-agent').with({
:ensure => 'directory', :ensure => 'directory',
:owner => 'td-agent', :owner => 'td-agent',
:group => 'td-agent', :group => 'td-agent',
@ -74,15 +74,15 @@ describe 'cloud::logging::agent' do
end end
it 'include cloud::loging' do it 'include cloud::loging' do
it should contain_class('cloud::logging') it is_expected.to contain_class('cloud::logging')
end end
it 'include rsyslog::client' do it 'include rsyslog::client' do
it should_not contain_class('rsyglog::client') it is_expected.not_to contain_class('rsyglog::client')
end end
it 'create /var/db/td-agent' do it 'create /var/db/td-agent' do
it should contain_file('/var/db/td-agent').with({ it is_expected.to contain_file('/var/db/td-agent').with({
:ensure => 'directory', :ensure => 'directory',
:owner => 'td-agent', :owner => 'td-agent',
:group => 'td-agent', :group => 'td-agent',
@ -90,7 +90,7 @@ describe 'cloud::logging::agent' do
end end
it 'has a logrotate rule for td-agent.log' do it 'has a logrotate rule for td-agent.log' do
it should contain_logrotate__rule('td-agent').with({ it is_expected.to contain_logrotate__rule('td-agent').with({
:path => '/var/log/td-agent/td-agent.log', :path => '/var/log/td-agent/td-agent.log',
:rotate => '30', :rotate => '30',
:compress => 'true', :compress => 'true',
@ -102,7 +102,7 @@ describe 'cloud::logging::agent' do
context 'logrotate rule with default parameters' do context 'logrotate rule with default parameters' do
it 'has a logrotate rule for td-agent.log' do it 'has a logrotate rule for td-agent.log' do
it should contain_logrotate__rule('td-agent').with({ it is_expected.to contain_logrotate__rule('td-agent').with({
:path => '/var/log/td-agent/td-agent.log', :path => '/var/log/td-agent/td-agent.log',
:rotate => '30', :rotate => '30',
:compress => 'true', :compress => 'true',
@ -117,7 +117,7 @@ describe 'cloud::logging::agent' do
end end
it 'has a logrotate rule for td-agent.log' do it 'has a logrotate rule for td-agent.log' do
it should contain_logrotate__rule('td-agent').with({ it is_expected.to contain_logrotate__rule('td-agent').with({
:path => '/foo/bar', :path => '/foo/bar',
:rotate => '5', :rotate => '5',
:compress => 'false', :compress => 'false',

View File

@ -28,15 +28,15 @@ describe 'cloud::logging::server' do
end end
it 'configure logging common' do it 'configure logging common' do
it should contain_concat("/etc/td-agent/config.d/forward.conf") it is_expected.to contain_concat("/etc/td-agent/config.d/forward.conf")
end end
it 'configure kibana' do it 'configure kibana' do
should contain_class('kibana3').with(:ws_port => '8001') is_expected.to contain_class('kibana3').with(:ws_port => '8001')
end end
it 'configure an elasticsearch instance' do it 'configure an elasticsearch instance' do
should contain_elasticsearch__instance('fluentd') is_expected.to contain_elasticsearch__instance('fluentd')
end end
end end

View File

@ -31,7 +31,7 @@ describe 'cloud::messaging' do
end end
it 'configure rabbitmq-server with default values' do it 'configure rabbitmq-server with default values' do
should contain_class('rabbitmq').with( is_expected.to contain_class('rabbitmq').with(
:delete_guest_user => true, :delete_guest_user => true,
:config_cluster => true, :config_cluster => true,
:cluster_nodes => params[:rabbit_names], :cluster_nodes => params[:rabbit_names],
@ -46,7 +46,7 @@ describe 'cloud::messaging' do
end end
it 'configure rabbitmq-server in RAM mode' do it 'configure rabbitmq-server in RAM mode' do
should contain_class('rabbitmq').with( :cluster_node_type => 'ram' ) is_expected.to contain_class('rabbitmq').with( :cluster_node_type => 'ram' )
end end
end end
@ -70,11 +70,11 @@ describe 'cloud::messaging' do
it_configures 'openstack messaging' it_configures 'openstack messaging'
it 'should create rabbitmq binaries symbolic links' do it 'should create rabbitmq binaries symbolic links' do
should contain_file('/usr/sbin/rabbitmq-plugins').with( is_expected.to contain_file('/usr/sbin/rabbitmq-plugins').with(
:ensure => 'link', :ensure => 'link',
:target => '/usr/lib/rabbitmq/bin/rabbitmq-plugins' :target => '/usr/lib/rabbitmq/bin/rabbitmq-plugins'
) )
should contain_file('/usr/sbin/rabbitmq-env').with( is_expected.to contain_file('/usr/sbin/rabbitmq-env').with(
:ensure => 'link', :ensure => 'link',
:target => '/usr/lib/rabbitmq/bin/rabbitmq-env' :target => '/usr/lib/rabbitmq/bin/rabbitmq-env'
) )

View File

@ -23,7 +23,7 @@ describe 'cloud::monitoring::agent::sensu' do
shared_examples_for 'openstack sensu monitoring agent' do shared_examples_for 'openstack sensu monitoring agent' do
it 'include ::sensu' do it 'include ::sensu' do
should contain_class('sensu') is_expected.to contain_class('sensu')
end end
end end

View File

@ -57,7 +57,7 @@ describe 'cloud::network::controller' do
end end
it 'configure neutron common' do it 'configure neutron common' do
should contain_class('neutron').with( is_expected.to contain_class('neutron').with(
:allow_overlapping_ips => true, :allow_overlapping_ips => true,
:dhcp_agents_per_network => '2', :dhcp_agents_per_network => '2',
:verbose => true, :verbose => true,
@ -75,7 +75,7 @@ describe 'cloud::network::controller' do
:dhcp_lease_duration => '10', :dhcp_lease_duration => '10',
:report_interval => '30' :report_interval => '30'
) )
should contain_class('neutron::plugins::ml2').with( is_expected.to contain_class('neutron::plugins::ml2').with(
:type_drivers => ['gre', 'vlan', 'flat', 'vxlan'], :type_drivers => ['gre', 'vlan', 'flat', 'vxlan'],
:tenant_network_types => ['vxlan'], :tenant_network_types => ['vxlan'],
:mechanism_drivers => ['openvswitch','l2population'], :mechanism_drivers => ['openvswitch','l2population'],
@ -87,7 +87,7 @@ describe 'cloud::network::controller' do
end end
it 'configure neutron server' do it 'configure neutron server' do
should contain_class('neutron::server').with( is_expected.to contain_class('neutron::server').with(
:auth_password => 'secrete', :auth_password => 'secrete',
:auth_host => '10.0.0.1', :auth_host => '10.0.0.1',
:auth_port => '5000', :auth_port => '5000',
@ -99,7 +99,7 @@ describe 'cloud::network::controller' do
end end
it 'configure neutron server notifications to nova' do it 'configure neutron server notifications to nova' do
should contain_class('neutron::server::notifications').with( is_expected.to contain_class('neutron::server::notifications').with(
:nova_url => 'http://127.0.0.1:8774/v2', :nova_url => 'http://127.0.0.1:8774/v2',
:nova_admin_auth_url => 'http://127.0.0.1:5000/v2.0', :nova_admin_auth_url => 'http://127.0.0.1:5000/v2.0',
:nova_admin_username => 'nova', :nova_admin_username => 'nova',
@ -109,7 +109,7 @@ describe 'cloud::network::controller' do
) )
end end
it 'checks if Neutron DB is populated' do it 'checks if Neutron DB is populated' do
should contain_exec('neutron_db_sync').with( is_expected.to contain_exec('neutron_db_sync').with(
:command => 'neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugin.ini upgrade head', :command => 'neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugin.ini upgrade head',
:path => '/usr/bin', :path => '/usr/bin',
:user => 'neutron', :user => 'neutron',
@ -120,7 +120,7 @@ describe 'cloud::network::controller' do
end end
it 'should not configure provider external network' do it 'should not configure provider external network' do
should_not contain__neutron_network('public') is_expected.not_to contain__neutron_network('public')
end end
end end

View File

@ -44,7 +44,7 @@ describe 'cloud::network::dhcp' do
end end
it 'configure neutron common' do it 'configure neutron common' do
should contain_class('neutron').with( is_expected.to contain_class('neutron').with(
:allow_overlapping_ips => true, :allow_overlapping_ips => true,
:dhcp_agents_per_network => '2', :dhcp_agents_per_network => '2',
:verbose => true, :verbose => true,
@ -62,7 +62,7 @@ describe 'cloud::network::dhcp' do
:dhcp_lease_duration => '10', :dhcp_lease_duration => '10',
:report_interval => '30' :report_interval => '30'
) )
should contain_class('neutron::plugins::ml2').with( is_expected.to contain_class('neutron::plugins::ml2').with(
:type_drivers => ['gre', 'vlan', 'flat', 'vxlan'], :type_drivers => ['gre', 'vlan', 'flat', 'vxlan'],
:tenant_network_types => ['vxlan'], :tenant_network_types => ['vxlan'],
:mechanism_drivers => ['openvswitch','l2population'], :mechanism_drivers => ['openvswitch','l2population'],
@ -71,24 +71,24 @@ describe 'cloud::network::dhcp' do
:flat_networks => ['public'], :flat_networks => ['public'],
:enable_security_group => true :enable_security_group => true
) )
should_not contain__neutron_network('public') is_expected.not_to contain__neutron_network('public')
end end
it 'configure neutron dhcp' do it 'configure neutron dhcp' do
should contain_class('neutron::agents::dhcp').with( is_expected.to contain_class('neutron::agents::dhcp').with(
:debug => true, :debug => true,
:dnsmasq_config_file => '/etc/neutron/dnsmasq-neutron.conf', :dnsmasq_config_file => '/etc/neutron/dnsmasq-neutron.conf',
:enable_isolated_metadata => true :enable_isolated_metadata => true
) )
should contain_neutron_dhcp_agent_config('DEFAULT/dnsmasq_dns_server').with_ensure('absent') is_expected.to contain_neutron_dhcp_agent_config('DEFAULT/dnsmasq_dns_server').with_ensure('absent')
should contain_file('/etc/neutron/dnsmasq-neutron.conf').with( is_expected.to contain_file('/etc/neutron/dnsmasq-neutron.conf').with(
:mode => '0755', :mode => '0755',
:owner => 'root', :owner => 'root',
:group => 'root' :group => 'root'
) )
should contain_file('/etc/neutron/dnsmasq-neutron.conf').with_content(/^dhcp-option-force=26,1400$/) is_expected.to contain_file('/etc/neutron/dnsmasq-neutron.conf').with_content(/^dhcp-option-force=26,1400$/)
end end
end end
@ -116,20 +116,20 @@ describe 'cloud::network::dhcp' do
end end
it 'configure neutron dhcp' do it 'configure neutron dhcp' do
should contain_class('neutron::agents::dhcp').with( is_expected.to contain_class('neutron::agents::dhcp').with(
:debug => true :debug => true
) )
should contain_neutron_dhcp_agent_config('DEFAULT/dnsmasq_config_file').with_value('/etc/neutron/dnsmasq-neutron.conf') is_expected.to contain_neutron_dhcp_agent_config('DEFAULT/dnsmasq_config_file').with_value('/etc/neutron/dnsmasq-neutron.conf')
should contain_neutron_dhcp_agent_config('DEFAULT/enable_isolated_metadata').with_value(true) is_expected.to contain_neutron_dhcp_agent_config('DEFAULT/enable_isolated_metadata').with_value(true)
should contain_neutron_dhcp_agent_config('DEFAULT/dnsmasq_dns_server').with_value('1.2.3.4') is_expected.to contain_neutron_dhcp_agent_config('DEFAULT/dnsmasq_dns_server').with_value('1.2.3.4')
should contain_file('/etc/neutron/dnsmasq-neutron.conf').with( is_expected.to contain_file('/etc/neutron/dnsmasq-neutron.conf').with(
:mode => '0755', :mode => '0755',
:owner => 'root', :owner => 'root',
:group => 'root' :group => 'root'
) )
should contain_file('/etc/neutron/dnsmasq-neutron.conf').with_content(/^dhcp-option-force=26,1400$/) is_expected.to contain_file('/etc/neutron/dnsmasq-neutron.conf').with_content(/^dhcp-option-force=26,1400$/)
end end
end end

View File

@ -44,7 +44,7 @@ describe 'cloud::network::l3' do
end end
it 'configure neutron common' do it 'configure neutron common' do
should contain_class('neutron').with( is_expected.to contain_class('neutron').with(
:allow_overlapping_ips => true, :allow_overlapping_ips => true,
:dhcp_agents_per_network => '2', :dhcp_agents_per_network => '2',
:verbose => true, :verbose => true,
@ -62,7 +62,7 @@ describe 'cloud::network::l3' do
:dhcp_lease_duration => '10', :dhcp_lease_duration => '10',
:report_interval => '30' :report_interval => '30'
) )
should contain_class('neutron::plugins::ml2').with( is_expected.to contain_class('neutron::plugins::ml2').with(
:type_drivers => ['gre', 'vlan', 'flat', 'vxlan'], :type_drivers => ['gre', 'vlan', 'flat', 'vxlan'],
:tenant_network_types => ['vxlan'], :tenant_network_types => ['vxlan'],
:mechanism_drivers => ['openvswitch','l2population'], :mechanism_drivers => ['openvswitch','l2population'],
@ -71,21 +71,21 @@ describe 'cloud::network::l3' do
:flat_networks => ['public'], :flat_networks => ['public'],
:enable_security_group => true :enable_security_group => true
) )
should_not contain__neutron_network('public') is_expected.not_to contain__neutron_network('public')
end end
it 'configure neutron l3' do it 'configure neutron l3' do
should contain_class('neutron::agents::l3').with( is_expected.to contain_class('neutron::agents::l3').with(
:debug => true, :debug => true,
:external_network_bridge => 'br-ex' :external_network_bridge => 'br-ex'
) )
end end
it 'configure br-ex bridge' do it 'configure br-ex bridge' do
should_not contain__vs_bridge('br-ex') is_expected.not_to contain__vs_bridge('br-ex')
end end
it 'configure neutron metering agent' do it 'configure neutron metering agent' do
should contain_class('neutron::agents::metering').with( is_expected.to contain_class('neutron::agents::metering').with(
:debug => true :debug => true
) )
end end
@ -96,14 +96,14 @@ describe 'cloud::network::l3' do
end end
it 'ensure TSO script is enabled at boot' do it 'ensure TSO script is enabled at boot' do
should contain_exec('enable-tso-script').with( is_expected.to contain_exec('enable-tso-script').with(
:command => '/usr/sbin/chkconfig disable-tso on', :command => '/usr/sbin/chkconfig disable-tso on',
:unless => '/bin/ls /etc/rc*.d | /bin/grep disable-tso', :unless => '/bin/ls /etc/rc*.d | /bin/grep disable-tso',
:onlyif => '/usr/bin/test -f /etc/init.d/disable-tso' :onlyif => '/usr/bin/test -f /etc/init.d/disable-tso'
) )
end end
it 'start TSO script' do it 'start TSO script' do
should contain_exec('start-tso-script').with( is_expected.to contain_exec('start-tso-script').with(
:command => '/etc/init.d/disable-tso start', :command => '/etc/init.d/disable-tso start',
:unless => '/usr/bin/test -f /var/run/disable-tso.pid', :unless => '/usr/bin/test -f /var/run/disable-tso.pid',
:onlyif => '/usr/bin/test -f /etc/init.d/disable-tso' :onlyif => '/usr/bin/test -f /etc/init.d/disable-tso'
@ -117,14 +117,14 @@ describe 'cloud::network::l3' do
end end
it 'ensure TSO script is enabled at boot' do it 'ensure TSO script is enabled at boot' do
should contain_exec('enable-tso-script').with( is_expected.to contain_exec('enable-tso-script').with(
:command => '/usr/sbin/update-rc.d disable-tso defaults', :command => '/usr/sbin/update-rc.d disable-tso defaults',
:unless => '/bin/ls /etc/rc*.d | /bin/grep disable-tso', :unless => '/bin/ls /etc/rc*.d | /bin/grep disable-tso',
:onlyif => '/usr/bin/test -f /etc/init.d/disable-tso' :onlyif => '/usr/bin/test -f /etc/init.d/disable-tso'
) )
end end
it 'start TSO script' do it 'start TSO script' do
should contain_exec('start-tso-script').with( is_expected.to contain_exec('start-tso-script').with(
:command => '/etc/init.d/disable-tso start', :command => '/etc/init.d/disable-tso start',
:unless => '/usr/bin/test -f /var/run/disable-tso.pid', :unless => '/usr/bin/test -f /var/run/disable-tso.pid',
:onlyif => '/usr/bin/test -f /etc/init.d/disable-tso' :onlyif => '/usr/bin/test -f /etc/init.d/disable-tso'
@ -137,10 +137,10 @@ describe 'cloud::network::l3' do
params.merge!( :manage_tso => false) params.merge!( :manage_tso => false)
end end
it 'ensure TSO script is not enabled at boot' do it 'ensure TSO script is not enabled at boot' do
should_not contain_exec('enable-tso-script') is_expected.not_to contain_exec('enable-tso-script')
end end
it 'do not start TSO script' do it 'do not start TSO script' do
should_not contain_exec('start-tso-script') is_expected.not_to contain_exec('start-tso-script')
end end
end end
end end

View File

@ -44,7 +44,7 @@ describe 'cloud::network::lbaas' do
end end
it 'configure neutron common' do it 'configure neutron common' do
should contain_class('neutron').with( is_expected.to contain_class('neutron').with(
:allow_overlapping_ips => true, :allow_overlapping_ips => true,
:dhcp_agents_per_network => '2', :dhcp_agents_per_network => '2',
:verbose => true, :verbose => true,
@ -62,7 +62,7 @@ describe 'cloud::network::lbaas' do
:dhcp_lease_duration => '10', :dhcp_lease_duration => '10',
:report_interval => '30' :report_interval => '30'
) )
should contain_class('neutron::plugins::ml2').with( is_expected.to contain_class('neutron::plugins::ml2').with(
:type_drivers => ['gre', 'vlan', 'flat', 'vxlan'], :type_drivers => ['gre', 'vlan', 'flat', 'vxlan'],
:tenant_network_types => ['vxlan'], :tenant_network_types => ['vxlan'],
:mechanism_drivers => ['openvswitch','l2population'], :mechanism_drivers => ['openvswitch','l2population'],
@ -71,11 +71,11 @@ describe 'cloud::network::lbaas' do
:flat_networks => ['public'], :flat_networks => ['public'],
:enable_security_group => true :enable_security_group => true
) )
should_not contain__neutron_network('public') is_expected.not_to contain__neutron_network('public')
end end
it 'configure neutron lbaas' do it 'configure neutron lbaas' do
should contain_class('neutron::agents::lbaas').with( is_expected.to contain_class('neutron::agents::lbaas').with(
:debug => true, :debug => true,
:manage_haproxy_package => true :manage_haproxy_package => true
) )
@ -101,8 +101,8 @@ describe 'cloud::network::lbaas' do
params.merge!(:manage_haproxy_pkg => false) params.merge!(:manage_haproxy_pkg => false)
end end
it 'configure neutron lbaas agent without managing haproxy package' do it 'configure neutron lbaas agent without managing haproxy package' do
should contain_class('neutron::agents::lbaas').with(:manage_haproxy_package => false) is_expected.to contain_class('neutron::agents::lbaas').with(:manage_haproxy_package => false)
should contain_package('haproxy').with(:ensure => 'present') is_expected.to contain_package('haproxy').with(:ensure => 'present')
end end
end end
end end

View File

@ -52,7 +52,7 @@ describe 'cloud::network::metadata' do
end end
it 'configure neutron common' do it 'configure neutron common' do
should contain_class('neutron').with( is_expected.to contain_class('neutron').with(
:allow_overlapping_ips => true, :allow_overlapping_ips => true,
:dhcp_agents_per_network => '2', :dhcp_agents_per_network => '2',
:verbose => true, :verbose => true,
@ -70,7 +70,7 @@ describe 'cloud::network::metadata' do
:dhcp_lease_duration => '10', :dhcp_lease_duration => '10',
:report_interval => '30' :report_interval => '30'
) )
should contain_class('neutron::plugins::ml2').with( is_expected.to contain_class('neutron::plugins::ml2').with(
:type_drivers => ['gre', 'vlan', 'flat', 'vxlan'], :type_drivers => ['gre', 'vlan', 'flat', 'vxlan'],
:tenant_network_types => ['vxlan'], :tenant_network_types => ['vxlan'],
:mechanism_drivers => ['openvswitch','l2population'], :mechanism_drivers => ['openvswitch','l2population'],
@ -79,11 +79,11 @@ describe 'cloud::network::metadata' do
:flat_networks => ['public'], :flat_networks => ['public'],
:enable_security_group => true :enable_security_group => true
) )
should_not contain__neutron_network('public') is_expected.not_to contain__neutron_network('public')
end end
it 'configure neutron metadata' do it 'configure neutron metadata' do
should contain_class('neutron::agents::metadata').with( is_expected.to contain_class('neutron::agents::metadata').with(
:debug => true, :debug => true,
:enabled => true, :enabled => true,
:shared_secret => 'secrete', :shared_secret => 'secrete',
@ -93,7 +93,7 @@ describe 'cloud::network::metadata' do
:auth_region => 'MyRegion', :auth_region => 'MyRegion',
:metadata_workers => '8' :metadata_workers => '8'
) )
should contain_neutron_metadata_agent_config('DEFAULT/nova_metadata_protocol').with(:value => 'https') is_expected.to contain_neutron_metadata_agent_config('DEFAULT/nova_metadata_protocol').with(:value => 'https')
end end
end end

View File

@ -39,7 +39,7 @@ describe 'cloud::network::vpn' do
end end
it 'configure neutron common' do it 'configure neutron common' do
should contain_class('neutron').with( is_expected.to contain_class('neutron').with(
:allow_overlapping_ips => true, :allow_overlapping_ips => true,
:dhcp_agents_per_network => '2', :dhcp_agents_per_network => '2',
:verbose => true, :verbose => true,
@ -57,7 +57,7 @@ describe 'cloud::network::vpn' do
:dhcp_lease_duration => '10', :dhcp_lease_duration => '10',
:report_interval => '30' :report_interval => '30'
) )
should contain_class('neutron::plugins::ml2').with( is_expected.to contain_class('neutron::plugins::ml2').with(
:type_drivers => ['gre', 'vlan', 'flat', 'vxlan'], :type_drivers => ['gre', 'vlan', 'flat', 'vxlan'],
:tenant_network_types => ['vxlan'], :tenant_network_types => ['vxlan'],
:mechanism_drivers => ['openvswitch','l2population'], :mechanism_drivers => ['openvswitch','l2population'],
@ -66,11 +66,11 @@ describe 'cloud::network::vpn' do
:flat_networks => ['public'], :flat_networks => ['public'],
:enable_security_group => true :enable_security_group => true
) )
should_not contain__neutron_network('public') is_expected.not_to contain__neutron_network('public')
end end
it 'configure neutron vpnaas' do it 'configure neutron vpnaas' do
should contain_class('neutron::agents::vpnaas') is_expected.to contain_class('neutron::agents::vpnaas')
end end
end end

View File

@ -43,7 +43,7 @@ describe 'cloud::network::vswitch' do
end end
it 'configure neutron common' do it 'configure neutron common' do
should contain_class('neutron').with( is_expected.to contain_class('neutron').with(
:allow_overlapping_ips => true, :allow_overlapping_ips => true,
:dhcp_agents_per_network => '2', :dhcp_agents_per_network => '2',
:verbose => true, :verbose => true,
@ -61,7 +61,7 @@ describe 'cloud::network::vswitch' do
:dhcp_lease_duration => '10', :dhcp_lease_duration => '10',
:report_interval => '30' :report_interval => '30'
) )
should contain_class('neutron::plugins::ml2').with( is_expected.to contain_class('neutron::plugins::ml2').with(
:type_drivers => ['gre', 'vlan', 'flat', 'vxlan'], :type_drivers => ['gre', 'vlan', 'flat', 'vxlan'],
:tenant_network_types => ['vxlan'], :tenant_network_types => ['vxlan'],
:mechanism_drivers => ['openvswitch','l2population'], :mechanism_drivers => ['openvswitch','l2population'],
@ -74,7 +74,7 @@ describe 'cloud::network::vswitch' do
context 'when running ML2 plugin with OVS driver' do context 'when running ML2 plugin with OVS driver' do
it 'configure neutron vswitch' do it 'configure neutron vswitch' do
should contain_class('neutron::agents::ml2::ovs').with( is_expected.to contain_class('neutron::agents::ml2::ovs').with(
:enable_tunneling => true, :enable_tunneling => true,
:tunnel_types => ['gre'], :tunnel_types => ['gre'],
:bridge_mappings => ['public:br-pub'], :bridge_mappings => ['public:br-pub'],
@ -91,10 +91,10 @@ describe 'cloud::network::vswitch' do
end end
it 'configure br-pub bridge' do it 'configure br-pub bridge' do
should contain_vs_bridge('br-pub') is_expected.to contain_vs_bridge('br-pub')
end end
it 'configure eth1 in br-pub' do it 'configure eth1 in br-pub' do
should contain_vs_port('eth1').with( is_expected.to contain_vs_port('eth1').with(
:ensure => 'present', :ensure => 'present',
:bridge => 'br-pub' :bridge => 'br-pub'
) )

View File

@ -14,7 +14,7 @@ describe 'cloud::object::ringbuilder' do
end end
it 'create the three rings' do it 'create the three rings' do
should contain_class('swift::ringbuilder').with({ is_expected.to contain_class('swift::ringbuilder').with({
'part_power' => '15', 'part_power' => '15',
'replicas' => '3', 'replicas' => '3',
'min_part_hours' => '24', 'min_part_hours' => '24',
@ -22,7 +22,7 @@ describe 'cloud::object::ringbuilder' do
end end
it 'create the ring rsync server' do it 'create the ring rsync server' do
should contain_class('swift::ringserver').with({ is_expected.to contain_class('swift::ringserver').with({
'local_net_ip' => '127.0.0.1', 'local_net_ip' => '127.0.0.1',
'max_connections' => '5', 'max_connections' => '5',
}) })
@ -35,7 +35,7 @@ describe 'cloud::object::ringbuilder' do
) )
end end
it 'should not configure swift ring builder' do it 'should not configure swift ring builder' do
should_not contain_class('swift::ringbuilder') is_expected.not_to contain_class('swift::ringbuilder')
end end
end end
end end

View File

@ -35,11 +35,11 @@ describe 'cloud::object::storage' do
it 'create and configure storage server' do it 'create and configure storage server' do
should contain_class('swift::storage').with({ is_expected.to contain_class('swift::storage').with({
'storage_local_net_ip' => '127.0.0.1', 'storage_local_net_ip' => '127.0.0.1',
}) })
should contain_swift__storage__server('6000').with({ is_expected.to contain_swift__storage__server('6000').with({
'type' => 'object', 'type' => 'object',
'config_file_path' => 'object-server.conf', 'config_file_path' => 'object-server.conf',
'log_facility' => 'LOG_LOCAL6', 'log_facility' => 'LOG_LOCAL6',
@ -52,7 +52,7 @@ describe 'cloud::object::storage' do
'require' => 'Class[Swift]', 'require' => 'Class[Swift]',
}) })
should contain_swift__storage__server('6001').with({ is_expected.to contain_swift__storage__server('6001').with({
'type' => 'container', 'type' => 'container',
'config_file_path' => 'container-server.conf', 'config_file_path' => 'container-server.conf',
'log_facility' => 'LOG_LOCAL4', 'log_facility' => 'LOG_LOCAL4',
@ -65,7 +65,7 @@ describe 'cloud::object::storage' do
'require' => 'Class[Swift]', 'require' => 'Class[Swift]',
}) })
should contain_swift__storage__server('6002').with({ is_expected.to contain_swift__storage__server('6002').with({
'type' => 'account', 'type' => 'account',
'config_file_path' => 'account-server.conf', 'config_file_path' => 'account-server.conf',
'log_facility' => 'LOG_LOCAL2', 'log_facility' => 'LOG_LOCAL2',
@ -81,16 +81,16 @@ describe 'cloud::object::storage' do
end end
it 'create and configure the hard drive' do it 'create and configure the hard drive' do
should contain_swift__storage__xfs('sdc') is_expected.to contain_swift__storage__xfs('sdc')
should contain_swift__storage__xfs('sdd') is_expected.to contain_swift__storage__xfs('sdd')
should contain_cloud__object__set_io_scheduler('sdc') is_expected.to contain_cloud__object__set_io_scheduler('sdc')
should contain_cloud__object__set_io_scheduler('sdd') is_expected.to contain_cloud__object__set_io_scheduler('sdd')
end end
['account', 'container', 'object'].each do |swift_component| ['account', 'container', 'object'].each do |swift_component|
it "configures #{swift_component} filter" do it "configures #{swift_component} filter" do
should contain_swift__storage__filter__recon(swift_component) is_expected.to contain_swift__storage__filter__recon(swift_component)
should contain_swift__storage__filter__healthcheck(swift_component) is_expected.to contain_swift__storage__filter__healthcheck(swift_component)
end end
end end

View File

@ -52,7 +52,7 @@ describe 'cloud::orchestration::api' do
end end
it 'configure heat common' do it 'configure heat common' do
should contain_class('heat').with( is_expected.to contain_class('heat').with(
:verbose => true, :verbose => true,
:debug => true, :debug => true,
:log_facility => 'LOG_LOCAL0', :log_facility => 'LOG_LOCAL0',
@ -71,17 +71,17 @@ describe 'cloud::orchestration::api' do
end end
it 'configure heat api' do it 'configure heat api' do
should contain_class('heat::api').with( is_expected.to contain_class('heat::api').with(
:bind_host => '10.0.0.1', :bind_host => '10.0.0.1',
:bind_port => '8004', :bind_port => '8004',
:workers => '8' :workers => '8'
) )
should contain_class('heat::api_cfn').with( is_expected.to contain_class('heat::api_cfn').with(
:bind_host => '10.0.0.1', :bind_host => '10.0.0.1',
:bind_port => '8000', :bind_port => '8000',
:workers => '8' :workers => '8'
) )
should contain_class('heat::api_cloudwatch').with( is_expected.to contain_class('heat::api_cloudwatch').with(
:bind_host => '10.0.0.1', :bind_host => '10.0.0.1',
:bind_port => '8003', :bind_port => '8003',
:workers => '8' :workers => '8'
@ -89,7 +89,7 @@ describe 'cloud::orchestration::api' do
end end
it 'checks if Heat DB is populated' do it 'checks if Heat DB is populated' do
should contain_exec('heat_db_sync').with( is_expected.to contain_exec('heat_db_sync').with(
:command => 'heat-manage --config-file /etc/heat/heat.conf db_sync', :command => 'heat-manage --config-file /etc/heat/heat.conf db_sync',
:user => 'heat', :user => 'heat',
:path => '/usr/bin', :path => '/usr/bin',

View File

@ -56,7 +56,7 @@ describe 'cloud::orchestration::engine' do
end end
it 'configure heat common' do it 'configure heat common' do
should contain_class('heat').with( is_expected.to contain_class('heat').with(
:verbose => true, :verbose => true,
:debug => true, :debug => true,
:log_facility => 'LOG_LOCAL0', :log_facility => 'LOG_LOCAL0',
@ -72,11 +72,11 @@ describe 'cloud::orchestration::engine' do
:sql_connection => 'mysql://heat:secrete@10.0.0.1/heat?charset=utf8', :sql_connection => 'mysql://heat:secrete@10.0.0.1/heat?charset=utf8',
:log_dir => false :log_dir => false
) )
should contain_heat_config('clients/endpoint_type').with('value' => 'internalURL') is_expected.to contain_heat_config('clients/endpoint_type').with('value' => 'internalURL')
end end
it 'configure heat engine' do it 'configure heat engine' do
should contain_class('heat::engine').with( is_expected.to contain_class('heat::engine').with(
:enabled => true, :enabled => true,
:auth_encryption_key => 'secrete', :auth_encryption_key => 'secrete',
:heat_metadata_server_url => 'http://10.0.0.1:8000', :heat_metadata_server_url => 'http://10.0.0.1:8000',

View File

@ -35,20 +35,20 @@ describe 'cloud::spof' do
end end
it 'configure pacemaker/corosync' do it 'configure pacemaker/corosync' do
should contain_class('corosync').with( is_expected.to contain_class('corosync').with(
:enable_secauth => false, :enable_secauth => false,
:authkey => '/var/lib/puppet/ssl/certs/ca.pem', :authkey => '/var/lib/puppet/ssl/certs/ca.pem',
:bind_address => '10.0.0.1', :bind_address => '10.0.0.1',
:multicast_address => '239.1.1.2', :multicast_address => '239.1.1.2',
) )
should contain_file('/usr/lib/ocf/resource.d/heartbeat/ceilometer-agent-central').with( is_expected.to contain_file('/usr/lib/ocf/resource.d/heartbeat/ceilometer-agent-central').with(
:source => 'puppet:///modules/cloud/heartbeat/ceilometer-agent-central', :source => 'puppet:///modules/cloud/heartbeat/ceilometer-agent-central',
:mode => '0755', :mode => '0755',
:owner => 'root', :owner => 'root',
:group => 'root' :group => 'root'
) )
should contain_class('cloud::telemetry::centralagent').with(:enabled => false) is_expected.to contain_class('cloud::telemetry::centralagent').with(:enabled => false)
should contain_exec('cleanup_ceilometer_agent_central').with( is_expected.to contain_exec('cleanup_ceilometer_agent_central').with(
:command => 'crm resource cleanup ceilometer-agent-central', :command => 'crm resource cleanup ceilometer-agent-central',
:path => ['/usr/sbin', '/bin'], :path => ['/usr/sbin', '/bin'],
:user => 'root', :user => 'root',
@ -64,28 +64,28 @@ describe 'cloud::spof' do
end end
it 'configure pacemaker/corosync' do it 'configure pacemaker/corosync' do
should contain_class('pacemaker').with(:hacluster_pwd => 'verysecrete') is_expected.to contain_class('pacemaker').with(:hacluster_pwd => 'verysecrete')
should contain_class('pacemaker::stonith').with(:disable => true) is_expected.to contain_class('pacemaker::stonith').with(:disable => true)
should contain_class('pacemaker::corosync').with( is_expected.to contain_class('pacemaker::corosync').with(
:cluster_name => 'openstack', :cluster_name => 'openstack',
:settle_timeout => 10, :settle_timeout => 10,
:settle_tries => 2, :settle_tries => 2,
:settle_try_sleep => 5, :settle_try_sleep => 5,
:manage_fw => false, :manage_fw => false,
:cluster_members => 'srv1 srv2 srv3') :cluster_members => 'srv1 srv2 srv3')
should contain_file('/usr/lib/ocf/resource.d/heartbeat/ceilometer-agent-central').with( is_expected.to contain_file('/usr/lib/ocf/resource.d/heartbeat/ceilometer-agent-central').with(
:source => 'puppet:///modules/cloud/heartbeat/ceilometer-agent-central', :source => 'puppet:///modules/cloud/heartbeat/ceilometer-agent-central',
:mode => '0755', :mode => '0755',
:owner => 'root', :owner => 'root',
:group => 'root' :group => 'root'
) )
should contain_exec('pcmk_ceilometer_agent_central').with( is_expected.to contain_exec('pcmk_ceilometer_agent_central').with(
:command => 'pcs resource create ceilometer-agent-central ocf:heartbeat:ceilometer-agent-central', :command => 'pcs resource create ceilometer-agent-central ocf:heartbeat:ceilometer-agent-central',
:path => ['/usr/bin','/usr/sbin','/sbin/','/bin'], :path => ['/usr/bin','/usr/sbin','/sbin/','/bin'],
:user => 'root', :user => 'root',
:unless => '/usr/sbin/pcs resource | /bin/grep ceilometer-agent-central | /bin/grep Started' :unless => '/usr/sbin/pcs resource | /bin/grep ceilometer-agent-central | /bin/grep Started'
) )
should contain_class('cloud::telemetry::centralagent').with(:enabled => false) is_expected.to contain_class('cloud::telemetry::centralagent').with(:enabled => false)
end end
end end
@ -94,7 +94,7 @@ describe 'cloud::spof' do
facts.merge!( :osfamily => 'RedHat' ) facts.merge!( :osfamily => 'RedHat' )
params.merge!( :cluster_members => false) params.merge!( :cluster_members => false)
end end
it { should compile.and_raise_error(/cluster_members is a required parameter./) } it { is_expected.to compile.and_raise_error(/cluster_members is a required parameter./) }
end end
end end

View File

@ -35,7 +35,7 @@ describe 'cloud::storage::rbd::monitor' do
end end
it 'configure ceph common' do it 'configure ceph common' do
should contain_class('ceph::conf').with( is_expected.to contain_class('ceph::conf').with(
:fsid => '123', :fsid => '123',
:auth_type => 'cephx', :auth_type => 'cephx',
:cluster_network => '10.0.0.0/24', :cluster_network => '10.0.0.0/24',
@ -45,7 +45,7 @@ describe 'cloud::storage::rbd::monitor' do
end end
it 'configure ceph mon' do it 'configure ceph mon' do
should contain_ceph__mon('123').with( is_expected.to contain_ceph__mon('123').with(
:monitor_secret => 'secret', :monitor_secret => 'secret',
:mon_port => '6789', :mon_port => '6789',
:mon_addr => '10.0.0.1' :mon_addr => '10.0.0.1'

View File

@ -36,7 +36,7 @@ describe 'cloud::storage::rbd::osd' do
end end
it 'configure ceph common' do it 'configure ceph common' do
should contain_class('ceph::conf').with( is_expected.to contain_class('ceph::conf').with(
:fsid => '123', :fsid => '123',
:auth_type => 'cephx', :auth_type => 'cephx',
:cluster_network => '10.0.0.0/24', :cluster_network => '10.0.0.0/24',
@ -46,11 +46,11 @@ describe 'cloud::storage::rbd::osd' do
end end
it 'configure ceph osd' do it 'configure ceph osd' do
should contain_class('ceph::osd').with( is_expected.to contain_class('ceph::osd').with(
:public_address => '10.0.0.1', :public_address => '10.0.0.1',
:cluster_address => '192.168.0.1' :cluster_address => '192.168.0.1'
) )
should contain_ceph__osd__device('/dev/sdb','/dev/sdc','/dev/sdd') is_expected.to contain_ceph__osd__device('/dev/sdb','/dev/sdc','/dev/sdd')
end end
end end

View File

@ -39,7 +39,7 @@ describe 'cloud::telemetry::alarmevaluator' do
end end
it 'configure ceilometer common' do it 'configure ceilometer common' do
should contain_class('ceilometer').with( is_expected.to contain_class('ceilometer').with(
:verbose => true, :verbose => true,
:debug => true, :debug => true,
:rabbit_userid => 'ceilometer', :rabbit_userid => 'ceilometer',
@ -50,7 +50,7 @@ describe 'cloud::telemetry::alarmevaluator' do
:log_facility => 'LOG_LOCAL0', :log_facility => 'LOG_LOCAL0',
:log_dir => false :log_dir => false
) )
should contain_class('ceilometer::agent::auth').with( is_expected.to contain_class('ceilometer::agent::auth').with(
:auth_password => 'secrete', :auth_password => 'secrete',
:auth_url => 'http://10.0.0.1:5000/v2.0', :auth_url => 'http://10.0.0.1:5000/v2.0',
:auth_region => 'MyRegion' :auth_region => 'MyRegion'
@ -58,7 +58,7 @@ describe 'cloud::telemetry::alarmevaluator' do
end end
it 'configure ceilometer alarm evaluator' do it 'configure ceilometer alarm evaluator' do
should contain_class('ceilometer::alarm::evaluator') is_expected.to contain_class('ceilometer::alarm::evaluator')
end end
end end

View File

@ -39,7 +39,7 @@ describe 'cloud::telemetry::alarmnotifier' do
end end
it 'configure ceilometer common' do it 'configure ceilometer common' do
should contain_class('ceilometer').with( is_expected.to contain_class('ceilometer').with(
:verbose => true, :verbose => true,
:debug => true, :debug => true,
:rabbit_userid => 'ceilometer', :rabbit_userid => 'ceilometer',
@ -50,7 +50,7 @@ describe 'cloud::telemetry::alarmnotifier' do
:log_facility => 'LOG_LOCAL0', :log_facility => 'LOG_LOCAL0',
:log_dir => false :log_dir => false
) )
should contain_class('ceilometer::agent::auth').with( is_expected.to contain_class('ceilometer::agent::auth').with(
:auth_password => 'secrete', :auth_password => 'secrete',
:auth_url => 'http://10.0.0.1:5000/v2.0', :auth_url => 'http://10.0.0.1:5000/v2.0',
:auth_region => 'MyRegion' :auth_region => 'MyRegion'
@ -58,7 +58,7 @@ describe 'cloud::telemetry::alarmnotifier' do
end end
it 'configure ceilometer alarm notifier' do it 'configure ceilometer alarm notifier' do
should contain_class('ceilometer::alarm::notifier') is_expected.to contain_class('ceilometer::alarm::notifier')
end end
end end

View File

@ -47,7 +47,7 @@ describe 'cloud::telemetry::api' do
end end
it 'configure ceilometer common' do it 'configure ceilometer common' do
should contain_class('ceilometer').with( is_expected.to contain_class('ceilometer').with(
:verbose => true, :verbose => true,
:debug => true, :debug => true,
:rabbit_userid => 'ceilometer', :rabbit_userid => 'ceilometer',
@ -58,7 +58,7 @@ describe 'cloud::telemetry::api' do
:log_facility => 'LOG_LOCAL0', :log_facility => 'LOG_LOCAL0',
:log_dir => false :log_dir => false
) )
should contain_class('ceilometer::agent::auth').with( is_expected.to contain_class('ceilometer::agent::auth').with(
:auth_password => 'secrete', :auth_password => 'secrete',
:auth_url => 'http://10.0.0.1:5000/v2.0', :auth_url => 'http://10.0.0.1:5000/v2.0',
:auth_region => 'MyRegion' :auth_region => 'MyRegion'
@ -66,7 +66,7 @@ describe 'cloud::telemetry::api' do
end end
it 'configure ceilometer-api' do it 'configure ceilometer-api' do
should contain_class('ceilometer::api').with( is_expected.to contain_class('ceilometer::api').with(
:keystone_password => 'rabbitpassword', :keystone_password => 'rabbitpassword',
:keystone_host => '127.0.0.1', :keystone_host => '127.0.0.1',
:keystone_protocol => 'http', :keystone_protocol => 'http',
@ -75,7 +75,7 @@ describe 'cloud::telemetry::api' do
end end
it 'configure ceilometer-expirer' do it 'configure ceilometer-expirer' do
should contain_class('ceilometer::expirer').with( is_expected.to contain_class('ceilometer::expirer').with(
:time_to_live => '2592000', :time_to_live => '2592000',
:minute => '0', :minute => '0',
:hour => '0' :hour => '0'

View File

@ -43,7 +43,7 @@ describe 'cloud::telemetry::centralagent' do
end end
it 'configure ceilometer common' do it 'configure ceilometer common' do
should contain_class('ceilometer').with( is_expected.to contain_class('ceilometer').with(
:verbose => true, :verbose => true,
:debug => true, :debug => true,
:rabbit_userid => 'ceilometer', :rabbit_userid => 'ceilometer',
@ -54,7 +54,7 @@ describe 'cloud::telemetry::centralagent' do
:log_facility => 'LOG_LOCAL0', :log_facility => 'LOG_LOCAL0',
:log_dir => false :log_dir => false
) )
should contain_class('ceilometer::agent::auth').with( is_expected.to contain_class('ceilometer::agent::auth').with(
:auth_password => 'secrete', :auth_password => 'secrete',
:auth_url => 'http://10.0.0.1:5000/v2.0', :auth_url => 'http://10.0.0.1:5000/v2.0',
:auth_region => 'MyRegion' :auth_region => 'MyRegion'
@ -62,7 +62,7 @@ describe 'cloud::telemetry::centralagent' do
end end
it 'configure ceilometer central agent' do it 'configure ceilometer central agent' do
should contain_class('ceilometer::agent::central').with({ is_expected.to contain_class('ceilometer::agent::central').with({
'enabled' => 'true', 'enabled' => 'true',
}) })
end end

View File

@ -43,7 +43,7 @@ describe 'cloud::telemetry::collector' do
end end
it 'configure ceilometer common' do it 'configure ceilometer common' do
should contain_class('ceilometer').with( is_expected.to contain_class('ceilometer').with(
:verbose => true, :verbose => true,
:debug => true, :debug => true,
:rabbit_userid => 'ceilometer', :rabbit_userid => 'ceilometer',
@ -54,7 +54,7 @@ describe 'cloud::telemetry::collector' do
:log_facility => 'LOG_LOCAL0', :log_facility => 'LOG_LOCAL0',
:log_dir => false :log_dir => false
) )
should contain_class('ceilometer::agent::auth').with( is_expected.to contain_class('ceilometer::agent::auth').with(
:auth_password => 'secrete', :auth_password => 'secrete',
:auth_url => 'http://10.0.0.1:5000/v2.0', :auth_url => 'http://10.0.0.1:5000/v2.0',
:auth_region => 'MyRegion' :auth_region => 'MyRegion'
@ -62,11 +62,11 @@ describe 'cloud::telemetry::collector' do
end end
it 'configure ceilometer collector' do it 'configure ceilometer collector' do
should contain_class('ceilometer::collector') is_expected.to contain_class('ceilometer::collector')
end end
it 'synchronize ceilometer db indexes' do it 'synchronize ceilometer db indexes' do
should contain_class('ceilometer::db').with( is_expected.to contain_class('ceilometer::db').with(
:sync_db => true, :sync_db => true,
:database_connection => 'mongodb://node1,node2,node3/ceilometer?replicaSet=ceilometer' :database_connection => 'mongodb://node1,node2,node3/ceilometer?replicaSet=ceilometer'
) )

View File

@ -39,7 +39,7 @@ describe 'cloud::telemetry::notification' do
end end
it 'configure ceilometer common' do it 'configure ceilometer common' do
should contain_class('ceilometer').with( is_expected.to contain_class('ceilometer').with(
:verbose => true, :verbose => true,
:debug => true, :debug => true,
:rabbit_userid => 'ceilometer', :rabbit_userid => 'ceilometer',
@ -50,7 +50,7 @@ describe 'cloud::telemetry::notification' do
:log_facility => 'LOG_LOCAL0', :log_facility => 'LOG_LOCAL0',
:log_dir => false :log_dir => false
) )
should contain_class('ceilometer::agent::auth').with( is_expected.to contain_class('ceilometer::agent::auth').with(
:auth_password => 'secrete', :auth_password => 'secrete',
:auth_url => 'http://10.0.0.1:5000/v2.0', :auth_url => 'http://10.0.0.1:5000/v2.0',
:auth_region => 'MyRegion' :auth_region => 'MyRegion'
@ -58,7 +58,7 @@ describe 'cloud::telemetry::notification' do
end end
it 'configure ceilometer notification agent' do it 'configure ceilometer notification agent' do
should contain_class('ceilometer::agent::notification') is_expected.to contain_class('ceilometer::agent::notification')
end end
end end

View File

@ -48,7 +48,7 @@ describe 'cloud::telemetry::server' do
end end
it 'configure ceilometer common' do it 'configure ceilometer common' do
should contain_class('ceilometer').with( is_expected.to contain_class('ceilometer').with(
:verbose => true, :verbose => true,
:debug => true, :debug => true,
:rabbit_userid => 'ceilometer', :rabbit_userid => 'ceilometer',
@ -59,7 +59,7 @@ describe 'cloud::telemetry::server' do
:log_facility => 'LOG_LOCAL0', :log_facility => 'LOG_LOCAL0',
:log_dir => false :log_dir => false
) )
should contain_class('ceilometer::agent::auth').with( is_expected.to contain_class('ceilometer::agent::auth').with(
:auth_password => 'secrete', :auth_password => 'secrete',
:auth_url => 'http://10.0.0.1:5000/v2.0', :auth_url => 'http://10.0.0.1:5000/v2.0',
:auth_region => 'MyRegion' :auth_region => 'MyRegion'
@ -67,23 +67,23 @@ describe 'cloud::telemetry::server' do
end end
it 'configure ceilometer collector' do it 'configure ceilometer collector' do
should contain_class('ceilometer::collector') is_expected.to contain_class('ceilometer::collector')
end end
it 'configure ceilometer notification agent' do it 'configure ceilometer notification agent' do
should contain_class('ceilometer::agent::notification') is_expected.to contain_class('ceilometer::agent::notification')
end end
it 'configure ceilometer alarm evaluator' do it 'configure ceilometer alarm evaluator' do
should contain_class('ceilometer::alarm::evaluator') is_expected.to contain_class('ceilometer::alarm::evaluator')
end end
it 'configure ceilometer alarm notifier' do it 'configure ceilometer alarm notifier' do
should contain_class('ceilometer::alarm::notifier') is_expected.to contain_class('ceilometer::alarm::notifier')
end end
it 'configure ceilometer-api' do it 'configure ceilometer-api' do
should contain_class('ceilometer::api').with( is_expected.to contain_class('ceilometer::api').with(
:keystone_password => 'secrete', :keystone_password => 'secrete',
:keystone_host => '10.0.0.1', :keystone_host => '10.0.0.1',
:keystone_protocol => 'http', :keystone_protocol => 'http',
@ -92,7 +92,7 @@ describe 'cloud::telemetry::server' do
end end
it 'configure ceilometer-expirer' do it 'configure ceilometer-expirer' do
should contain_class('ceilometer::expirer').with( is_expected.to contain_class('ceilometer::expirer').with(
:time_to_live => '2592000', :time_to_live => '2592000',
:minute => '0', :minute => '0',
:hour => '0' :hour => '0'
@ -100,7 +100,7 @@ describe 'cloud::telemetry::server' do
end end
it 'synchronize ceilometer db indexes' do it 'synchronize ceilometer db indexes' do
should contain_class('ceilometer::db').with( is_expected.to contain_class('ceilometer::db').with(
:sync_db => true, :sync_db => true,
:database_connection => 'mongodb://node1,node2,node3/ceilometer?replicaSet=ceilometer' :database_connection => 'mongodb://node1,node2,node3/ceilometer?replicaSet=ceilometer'
) )

View File

@ -49,7 +49,7 @@ describe 'cloud::telemetry::server' do
end end
it 'configure ceilometer common' do it 'configure ceilometer common' do
should contain_class('ceilometer').with( is_expected.to contain_class('ceilometer').with(
:verbose => true, :verbose => true,
:debug => true, :debug => true,
:rabbit_userid => 'ceilometer', :rabbit_userid => 'ceilometer',
@ -60,33 +60,33 @@ describe 'cloud::telemetry::server' do
:log_facility => 'LOG_LOCAL0', :log_facility => 'LOG_LOCAL0',
:log_dir => false :log_dir => false
) )
should contain_class('ceilometer::agent::auth').with( is_expected.to contain_class('ceilometer::agent::auth').with(
:auth_password => 'secrete', :auth_password => 'secrete',
:auth_url => 'http://10.0.0.1:5000/v2.0', :auth_url => 'http://10.0.0.1:5000/v2.0',
:auth_region => 'MyRegion' :auth_region => 'MyRegion'
) )
should contain_ceilometer_config('service_credentials/os_endpoint_type').with('value' => 'internalURL') is_expected.to contain_ceilometer_config('service_credentials/os_endpoint_type').with('value' => 'internalURL')
end end
it 'configure ceilometer collector' do it 'configure ceilometer collector' do
should contain_class('ceilometer::collector') is_expected.to contain_class('ceilometer::collector')
end end
it 'configure ceilometer notification agent' do it 'configure ceilometer notification agent' do
should contain_class('ceilometer::agent::notification') is_expected.to contain_class('ceilometer::agent::notification')
end end
it 'configure ceilometer alarm evaluator' do it 'configure ceilometer alarm evaluator' do
should contain_class('ceilometer::alarm::evaluator') is_expected.to contain_class('ceilometer::alarm::evaluator')
end end
it 'configure ceilometer alarm notifier' do it 'configure ceilometer alarm notifier' do
should contain_class('ceilometer::alarm::notifier') is_expected.to contain_class('ceilometer::alarm::notifier')
end end
it 'configure ceilometer-api' do it 'configure ceilometer-api' do
should contain_class('ceilometer::api').with( is_expected.to contain_class('ceilometer::api').with(
:keystone_password => 'secrete', :keystone_password => 'secrete',
:keystone_host => '10.0.0.1', :keystone_host => '10.0.0.1',
:keystone_protocol => 'http', :keystone_protocol => 'http',
@ -95,7 +95,7 @@ describe 'cloud::telemetry::server' do
end end
it 'configure ceilometer-expirer' do it 'configure ceilometer-expirer' do
should contain_class('ceilometer::expirer').with( is_expected.to contain_class('ceilometer::expirer').with(
:time_to_live => '2592000', :time_to_live => '2592000',
:minute => '0', :minute => '0',
:hour => '0' :hour => '0'
@ -103,7 +103,7 @@ describe 'cloud::telemetry::server' do
end end
it 'synchronize ceilometer db indexes' do it 'synchronize ceilometer db indexes' do
should contain_class('ceilometer::db').with( is_expected.to contain_class('ceilometer::db').with(
:sync_db => true, :sync_db => true,
:database_connection => 'mongodb://node1,node2,node3/ceilometer?replicaSet=ceilometer' :database_connection => 'mongodb://node1,node2,node3/ceilometer?replicaSet=ceilometer'
) )

View File

@ -52,7 +52,7 @@ describe 'cloud::volume::controller' do
end end
it 'configure cinder common' do it 'configure cinder common' do
should contain_class('cinder').with( is_expected.to contain_class('cinder').with(
:verbose => true, :verbose => true,
:debug => true, :debug => true,
:rabbit_userid => 'cinder', :rabbit_userid => 'cinder',
@ -64,12 +64,12 @@ describe 'cloud::volume::controller' do
:log_dir => false, :log_dir => false,
:storage_availability_zone => 'nova' :storage_availability_zone => 'nova'
) )
should contain_class('cinder::ceilometer') is_expected.to contain_class('cinder::ceilometer')
should contain_cinder_config('DEFAULT/nova_catalog_info').with('value' => 'compute:nova:internalURL') is_expected.to contain_cinder_config('DEFAULT/nova_catalog_info').with('value' => 'compute:nova:internalURL')
end end
it 'checks if Cinder DB is populated' do it 'checks if Cinder DB is populated' do
should contain_exec('cinder_db_sync').with( is_expected.to contain_exec('cinder_db_sync').with(
:command => 'cinder-manage db sync', :command => 'cinder-manage db sync',
:user => 'cinder', :user => 'cinder',
:path => '/usr/bin', :path => '/usr/bin',
@ -78,7 +78,7 @@ describe 'cloud::volume::controller' do
end end
it 'configure cinder scheduler without multi-backend' do it 'configure cinder scheduler without multi-backend' do
should contain_class('cinder::scheduler').with( is_expected.to contain_class('cinder::scheduler').with(
:scheduler_driver => false :scheduler_driver => false
) )
end end
@ -91,10 +91,10 @@ describe 'cloud::volume::controller' do
) )
end end
it 'configure cinder scheduler with multi-backend' do it 'configure cinder scheduler with multi-backend' do
should contain_class('cinder::scheduler').with( is_expected.to contain_class('cinder::scheduler').with(
:scheduler_driver => 'cinder.scheduler.filter_scheduler.FilterScheduler' :scheduler_driver => 'cinder.scheduler.filter_scheduler.FilterScheduler'
) )
should contain_class('cinder::api').with(:default_volume_type => 'ceph') is_expected.to contain_class('cinder::api').with(:default_volume_type => 'ceph')
end end
end end
@ -106,12 +106,12 @@ describe 'cloud::volume::controller' do
) )
end end
xit 'should raise an error and fail' do xit 'should raise an error and fail' do
should compile.and_raise_error(/when using multi-backend, you should define a default_volume_type value in cloud::volume::controller/) is_expected.to compile.and_raise_error(/when using multi-backend, you should define a default_volume_type value in cloud::volume::controller/)
end end
end end
it 'configure cinder glance backend' do it 'configure cinder glance backend' do
should contain_class('cinder::glance').with( is_expected.to contain_class('cinder::glance').with(
:glance_api_servers => 'http://10.0.0.2:9292', :glance_api_servers => 'http://10.0.0.2:9292',
:glance_request_timeout => '10', :glance_request_timeout => '10',
:glance_num_retries => '10' :glance_num_retries => '10'
@ -119,13 +119,13 @@ describe 'cloud::volume::controller' do
end end
it 'configure cinder api' do it 'configure cinder api' do
should contain_class('cinder::api').with( is_expected.to contain_class('cinder::api').with(
:keystone_password => 'secrete', :keystone_password => 'secrete',
:keystone_auth_host => '10.0.0.1', :keystone_auth_host => '10.0.0.1',
:keystone_auth_protocol => 'https', :keystone_auth_protocol => 'https',
:bind_host => '10.0.0.1' :bind_host => '10.0.0.1'
) )
should contain_cinder_config('DEFAULT/default_volume_type').with(:ensure => 'absent') is_expected.to contain_cinder_config('DEFAULT/default_volume_type').with(:ensure => 'absent')
end end
# TODO(EmilienM) Disabled for now: http://git.io/kfTmcA # TODO(EmilienM) Disabled for now: http://git.io/kfTmcA

View File

@ -70,7 +70,7 @@ describe 'cloud::volume::storage' do
end end
it 'configure cinder common' do it 'configure cinder common' do
should contain_class('cinder').with( is_expected.to contain_class('cinder').with(
:verbose => true, :verbose => true,
:debug => true, :debug => true,
:rabbit_userid => 'cinder', :rabbit_userid => 'cinder',
@ -83,12 +83,12 @@ describe 'cloud::volume::storage' do
:storage_availability_zone => 'nova' :storage_availability_zone => 'nova'
) )
should contain_cinder_config('DEFAULT/notification_driver').with('value' => 'cinder.openstack.common.notifier.rpc_notifier') is_expected.to contain_cinder_config('DEFAULT/notification_driver').with('value' => 'cinder.openstack.common.notifier.rpc_notifier')
end end
it 'checks if Cinder DB is populated' do it 'checks if Cinder DB is populated' do
should contain_exec('cinder_db_sync').with( is_expected.to contain_exec('cinder_db_sync').with(
:command => 'cinder-manage db sync', :command => 'cinder-manage db sync',
:user => 'cinder', :user => 'cinder',
:path => '/usr/bin', :path => '/usr/bin',
@ -97,17 +97,17 @@ describe 'cloud::volume::storage' do
end end
it 'configure cinder volume service' do it 'configure cinder volume service' do
should contain_class('cinder::volume') is_expected.to contain_class('cinder::volume')
end end
context 'with RBD backend' do context 'with RBD backend' do
it 'configures rbd volume driver' do it 'configures rbd volume driver' do
should contain_cinder_config('lowcost/volume_backend_name').with_value('lowcost') is_expected.to contain_cinder_config('lowcost/volume_backend_name').with_value('lowcost')
should contain_cinder_config('lowcost/rbd_pool').with_value('ceph_cinder') is_expected.to contain_cinder_config('lowcost/rbd_pool').with_value('ceph_cinder')
should contain_cinder_config('lowcost/rbd_user').with_value('cinder') is_expected.to contain_cinder_config('lowcost/rbd_user').with_value('cinder')
should contain_cinder_config('lowcost/rbd_secret_uuid').with_value('secret') is_expected.to contain_cinder_config('lowcost/rbd_secret_uuid').with_value('secret')
should contain_cinder_config('lowcost/volume_tmp_dir').with_value('/tmp') is_expected.to contain_cinder_config('lowcost/volume_tmp_dir').with_value('/tmp')
should contain_cinder__type('lowcost').with( is_expected.to contain_cinder__type('lowcost').with(
:set_key => 'volume_backend_name', :set_key => 'volume_backend_name',
:set_value => 'lowcost', :set_value => 'lowcost',
:os_tenant_name => 'services', :os_tenant_name => 'services',
@ -115,8 +115,8 @@ describe 'cloud::volume::storage' do
:os_password => 'secret', :os_password => 'secret',
:os_auth_url => 'http://keystone.host:5000/v2.0' :os_auth_url => 'http://keystone.host:5000/v2.0'
) )
should contain_group('cephkeyring').with(:ensure => 'present') is_expected.to contain_group('cephkeyring').with(:ensure => 'present')
should contain_exec('add-cinder-to-group').with( is_expected.to contain_exec('add-cinder-to-group').with(
:command => 'usermod -a -G cephkeyring cinder', :command => 'usermod -a -G cephkeyring cinder',
:path => ['/usr/sbin', '/usr/bin', '/bin', '/sbin'], :path => ['/usr/sbin', '/usr/bin', '/bin', '/sbin'],
:unless => 'groups cinder | grep cephkeyring' :unless => 'groups cinder | grep cephkeyring'
@ -126,11 +126,11 @@ describe 'cloud::volume::storage' do
context 'with NetApp backend' do context 'with NetApp backend' do
it 'configures netapp volume driver' do it 'configures netapp volume driver' do
should contain_cinder_config('premium/volume_backend_name').with_value('premium') is_expected.to contain_cinder_config('premium/volume_backend_name').with_value('premium')
should contain_cinder_config('premium/netapp_login').with_value('joe') is_expected.to contain_cinder_config('premium/netapp_login').with_value('joe')
should contain_cinder_config('premium/netapp_password').with_value('secret') is_expected.to contain_cinder_config('premium/netapp_password').with_value('secret')
should contain_cinder_config('premium/netapp_server_hostname').with_value('netapp-server.host') is_expected.to contain_cinder_config('premium/netapp_server_hostname').with_value('netapp-server.host')
should contain_cinder__type('premium').with( is_expected.to contain_cinder__type('premium').with(
:set_key => 'volume_backend_name', :set_key => 'volume_backend_name',
:set_value => 'premium', :set_value => 'premium',
:notify => 'Service[cinder-volume]' :notify => 'Service[cinder-volume]'
@ -140,10 +140,10 @@ describe 'cloud::volume::storage' do
context 'with iSCSI backend' do context 'with iSCSI backend' do
it 'configures iSCSI volume driver' do it 'configures iSCSI volume driver' do
should contain_cinder_config('fast/volume_backend_name').with_value('fast') is_expected.to contain_cinder_config('fast/volume_backend_name').with_value('fast')
should contain_cinder_config('fast/iscsi_ip_address').with_value('10.0.0.1') is_expected.to contain_cinder_config('fast/iscsi_ip_address').with_value('10.0.0.1')
should contain_cinder_config('fast/volume_group').with_value('fast-vol') is_expected.to contain_cinder_config('fast/volume_group').with_value('fast-vol')
should contain_cinder__type('fast').with( is_expected.to contain_cinder__type('fast').with(
:set_key => 'volume_backend_name', :set_key => 'volume_backend_name',
:set_value => 'fast', :set_value => 'fast',
:notify => 'Service[cinder-volume]' :notify => 'Service[cinder-volume]'
@ -172,12 +172,12 @@ describe 'cloud::volume::storage' do
end end
it 'configures two rbd volume backends' do it 'configures two rbd volume backends' do
should contain_cinder_config('lowcost/volume_backend_name').with_value('lowcost') is_expected.to contain_cinder_config('lowcost/volume_backend_name').with_value('lowcost')
should contain_cinder_config('lowcost/rbd_pool').with_value('low') is_expected.to contain_cinder_config('lowcost/rbd_pool').with_value('low')
should contain_cinder_config('lowcost/rbd_user').with_value('cinder') is_expected.to contain_cinder_config('lowcost/rbd_user').with_value('cinder')
should contain_cinder_config('lowcost/rbd_secret_uuid').with_value('secret') is_expected.to contain_cinder_config('lowcost/rbd_secret_uuid').with_value('secret')
should contain_cinder_config('lowcost/volume_tmp_dir').with_value('/tmp') is_expected.to contain_cinder_config('lowcost/volume_tmp_dir').with_value('/tmp')
should contain_cinder__type('lowcost').with( is_expected.to contain_cinder__type('lowcost').with(
:set_key => 'volume_backend_name', :set_key => 'volume_backend_name',
:set_value => 'lowcost', :set_value => 'lowcost',
:os_tenant_name => 'services', :os_tenant_name => 'services',
@ -185,12 +185,12 @@ describe 'cloud::volume::storage' do
:os_password => 'secret', :os_password => 'secret',
:os_auth_url => 'http://keystone.host:5000/v2.0' :os_auth_url => 'http://keystone.host:5000/v2.0'
) )
should contain_cinder_config('normal/volume_backend_name').with_value('normal') is_expected.to contain_cinder_config('normal/volume_backend_name').with_value('normal')
should contain_cinder_config('normal/rbd_pool').with_value('normal') is_expected.to contain_cinder_config('normal/rbd_pool').with_value('normal')
should contain_cinder_config('normal/rbd_user').with_value('cinder') is_expected.to contain_cinder_config('normal/rbd_user').with_value('cinder')
should contain_cinder_config('normal/rbd_secret_uuid').with_value('secret') is_expected.to contain_cinder_config('normal/rbd_secret_uuid').with_value('secret')
should contain_cinder_config('normal/volume_tmp_dir').with_value('/tmp') is_expected.to contain_cinder_config('normal/volume_tmp_dir').with_value('/tmp')
should contain_cinder__type('normal').with( is_expected.to contain_cinder__type('normal').with(
:set_key => 'volume_backend_name', :set_key => 'volume_backend_name',
:set_value => 'normal', :set_value => 'normal',
:os_tenant_name => 'services', :os_tenant_name => 'services',
@ -203,7 +203,7 @@ describe 'cloud::volume::storage' do
context 'with all backends enabled' do context 'with all backends enabled' do
it 'configure all cinder backends' do it 'configure all cinder backends' do
should contain_class('cinder::backends').with( is_expected.to contain_class('cinder::backends').with(
:enabled_backends => ['lowcost', 'premium', 'fast'] :enabled_backends => ['lowcost', 'premium', 'fast']
) )
end end
@ -214,7 +214,7 @@ describe 'cloud::volume::storage' do
params.merge!(:cinder_backends => false) params.merge!(:cinder_backends => false)
end end
it 'configure rbd volume driver without multi-backend' do it 'configure rbd volume driver without multi-backend' do
should contain_cinder__backend__rbd('DEFAULT').with( is_expected.to contain_cinder__backend__rbd('DEFAULT').with(
:rbd_pool => 'ceph_cinder', :rbd_pool => 'ceph_cinder',
:rbd_user => 'cinder', :rbd_user => 'cinder',
:rbd_secret_uuid => 'secret', :rbd_secret_uuid => 'secret',

View File

@ -1,5 +1,5 @@
shared_examples_for "a Puppet::Error" do |description| shared_examples_for "a Puppet::Error" do |description|
it "with message matching #{description.inspect}" do 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
end end