Convert specs to RSpec 2.99.2 syntax with Transpec

This conversion is done by Transpec 2.3.7
This commit is contained in:
Sebastien Badia 2014-09-30 12:27:42 +02:00
parent 3af9b767db
commit c53d5b84ec
50 changed files with 431 additions and 431 deletions

View File

@ -27,7 +27,7 @@ describe 'cloud::cache' do
end
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',
:max_memory => '60%'
)

View File

@ -56,7 +56,7 @@ describe 'cloud::compute::api' do
end
it 'configure nova common' do
should contain_class('nova').with(
is_expected.to contain_class('nova').with(
:verbose => true,
:debug => true,
:use_syslog => true,
@ -70,14 +70,14 @@ describe 'cloud::compute::api' do
:glance_api_servers => 'http://10.0.0.1:9292',
:log_dir => false
)
should contain_nova_config('DEFAULT/resume_guests_state_on_host_boot').with('value' => true)
should contain_nova_config('DEFAULT/default_availability_zone').with('value' => 'MyZone')
should 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/resume_guests_state_on_host_boot').with('value' => true)
is_expected.to contain_nova_config('DEFAULT/default_availability_zone').with('value' => 'MyZone')
is_expected.to contain_nova_config('DEFAULT/servicegroup_driver').with_value('mc')
is_expected.to contain_nova_config('DEFAULT/glance_num_retries').with_value('10')
end
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
context "when enabling nova db slave" do
@ -89,13 +89,13 @@ describe 'cloud::compute::api' do
nova_db_password => 'secrete' }"
end
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')
end
end
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_auth_url => 'http://10.0.0.1:35357/v2.0',
:neutron_region_name => 'MyRegion',
@ -104,7 +104,7 @@ describe 'cloud::compute::api' do
end
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',
:user => 'nova',
:path => '/usr/bin',
@ -113,7 +113,7 @@ describe 'cloud::compute::api' do
end
it 'configure nova-api' do
should contain_class('nova::api').with(
is_expected.to contain_class('nova::api').with(
:enabled => true,
:auth_host => '127.0.0.1',
:auth_protocol => 'https',

View File

@ -44,7 +44,7 @@ describe 'cloud::compute::cert' do
end
it 'configure nova common' do
should contain_class('nova').with(
is_expected.to contain_class('nova').with(
:verbose => true,
:debug => true,
:use_syslog => true,
@ -58,14 +58,14 @@ describe 'cloud::compute::cert' do
:glance_api_servers => 'http://10.0.0.1:9292',
:log_dir => false
)
should contain_nova_config('DEFAULT/resume_guests_state_on_host_boot').with('value' => true)
should contain_nova_config('DEFAULT/default_availability_zone').with('value' => 'MyZone')
should 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/resume_guests_state_on_host_boot').with('value' => true)
is_expected.to contain_nova_config('DEFAULT/default_availability_zone').with('value' => 'MyZone')
is_expected.to contain_nova_config('DEFAULT/servicegroup_driver').with_value('mc')
is_expected.to contain_nova_config('DEFAULT/glance_num_retries').with_value('10')
end
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_auth_url => 'http://10.0.0.1:35357/v2.0',
:neutron_region_name => 'MyRegion',
@ -74,7 +74,7 @@ describe 'cloud::compute::cert' do
end
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',
:user => 'nova',
:path => '/usr/bin',
@ -83,7 +83,7 @@ describe 'cloud::compute::cert' do
end
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

View File

@ -44,7 +44,7 @@ describe 'cloud::compute::conductor' do
end
it 'configure nova common' do
should contain_class('nova').with(
is_expected.to contain_class('nova').with(
:verbose => true,
:debug => true,
:use_syslog => true,
@ -58,14 +58,14 @@ describe 'cloud::compute::conductor' do
:glance_api_servers => 'http://10.0.0.1:9292',
:log_dir => false
)
should contain_nova_config('DEFAULT/resume_guests_state_on_host_boot').with('value' => true)
should contain_nova_config('DEFAULT/default_availability_zone').with('value' => 'MyZone')
should 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/resume_guests_state_on_host_boot').with('value' => true)
is_expected.to contain_nova_config('DEFAULT/default_availability_zone').with('value' => 'MyZone')
is_expected.to contain_nova_config('DEFAULT/servicegroup_driver').with_value('mc')
is_expected.to contain_nova_config('DEFAULT/glance_num_retries').with_value('10')
end
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_auth_url => 'http://10.0.0.1:35357/v2.0',
:neutron_region_name => 'MyRegion',
@ -74,7 +74,7 @@ describe 'cloud::compute::conductor' do
end
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',
:user => 'nova',
:path => '/usr/bin',
@ -83,7 +83,7 @@ describe 'cloud::compute::conductor' do
end
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

View File

@ -44,7 +44,7 @@ describe 'cloud::compute::consoleauth' do
end
it 'configure nova common' do
should contain_class('nova').with(
is_expected.to contain_class('nova').with(
:verbose => true,
:debug => true,
:use_syslog => true,
@ -58,14 +58,14 @@ describe 'cloud::compute::consoleauth' do
:glance_api_servers => 'http://10.0.0.1:9292',
:log_dir => false
)
should contain_nova_config('DEFAULT/resume_guests_state_on_host_boot').with('value' => true)
should contain_nova_config('DEFAULT/default_availability_zone').with('value' => 'MyZone')
should 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/resume_guests_state_on_host_boot').with('value' => true)
is_expected.to contain_nova_config('DEFAULT/default_availability_zone').with('value' => 'MyZone')
is_expected.to contain_nova_config('DEFAULT/servicegroup_driver').with_value('mc')
is_expected.to contain_nova_config('DEFAULT/glance_num_retries').with_value('10')
end
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_auth_url => 'http://10.0.0.1:35357/v2.0',
:neutron_region_name => 'MyRegion',
@ -74,7 +74,7 @@ describe 'cloud::compute::consoleauth' do
end
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',
:user => 'nova',
:path => '/usr/bin',
@ -83,7 +83,7 @@ describe 'cloud::compute::consoleauth' do
end
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

View File

@ -49,7 +49,7 @@ describe 'cloud::compute::consoleproxy' do
end
it 'configure nova common' do
should contain_class('nova').with(
is_expected.to contain_class('nova').with(
:verbose => true,
:debug => true,
:use_syslog => true,
@ -63,14 +63,14 @@ describe 'cloud::compute::consoleproxy' do
:glance_api_servers => 'http://10.0.0.1:9292',
:log_dir => false
)
should contain_nova_config('DEFAULT/resume_guests_state_on_host_boot').with('value' => true)
should contain_nova_config('DEFAULT/default_availability_zone').with('value' => 'MyZone')
should 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/resume_guests_state_on_host_boot').with('value' => true)
is_expected.to contain_nova_config('DEFAULT/default_availability_zone').with('value' => 'MyZone')
is_expected.to contain_nova_config('DEFAULT/servicegroup_driver').with_value('mc')
is_expected.to contain_nova_config('DEFAULT/glance_num_retries').with_value('10')
end
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_auth_url => 'http://10.0.0.1:35357/v2.0',
:neutron_region_name => 'MyRegion',
@ -79,7 +79,7 @@ describe 'cloud::compute::consoleproxy' do
end
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',
:user => 'nova',
:path => '/usr/bin',
@ -88,7 +88,7 @@ describe 'cloud::compute::consoleproxy' do
end
it 'configure nova-spicehtml5proxy' do
should contain_class('nova::spicehtml5proxy').with(
is_expected.to contain_class('nova::spicehtml5proxy').with(
:enabled => true,
:host => '10.0.0.1'
)

View File

@ -56,7 +56,7 @@ describe 'cloud::compute::controller' do
end
it 'configure nova common' do
should contain_class('nova').with(
is_expected.to contain_class('nova').with(
:verbose => true,
:debug => true,
:use_syslog => true,
@ -70,15 +70,15 @@ describe 'cloud::compute::controller' do
:glance_api_servers => 'http://10.0.0.1:9292',
:log_dir => false
)
should contain_nova_config('DEFAULT/resume_guests_state_on_host_boot').with('value' => true)
should contain_nova_config('DEFAULT/default_availability_zone').with('value' => 'MyZone')
should contain_nova_config('DEFAULT/servicegroup_driver').with_value('mc')
should 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/resume_guests_state_on_host_boot').with('value' => true)
is_expected.to contain_nova_config('DEFAULT/default_availability_zone').with('value' => 'MyZone')
is_expected.to contain_nova_config('DEFAULT/servicegroup_driver').with_value('mc')
is_expected.to contain_nova_config('DEFAULT/glance_num_retries').with_value('10')
is_expected.to contain_nova_config('DEFAULT/cinder_catalog_info').with_value('volume:cinder:adminURL')
end
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_auth_url => 'http://10.0.0.1:35357/v2.0',
:neutron_region_name => 'MyRegion',
@ -87,7 +87,7 @@ describe 'cloud::compute::controller' do
end
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',
:user => 'nova',
:path => '/usr/bin',
@ -96,30 +96,30 @@ describe 'cloud::compute::controller' do
end
it 'configure nova-scheduler' do
should contain_class('nova::scheduler').with(:enabled => true)
is_expected.to contain_class('nova::scheduler').with(:enabled => true)
end
it 'configure nova-spicehtml5proxy' do
should contain_class('nova::spicehtml5proxy').with(
is_expected.to contain_class('nova::spicehtml5proxy').with(
:enabled => true,
:host => '10.0.0.1'
)
end
it 'configure nova-cert' do
should contain_class('nova::cert').with(:enabled => true)
is_expected.to contain_class('nova::cert').with(:enabled => true)
end
it 'configure nova-consoleauth' do
should contain_class('nova::consoleauth').with(:enabled => true)
is_expected.to contain_class('nova::consoleauth').with(:enabled => true)
end
it 'configure nova-conductor' do
should contain_class('nova::conductor').with(:enabled => true)
is_expected.to contain_class('nova::conductor').with(:enabled => true)
end
it 'configure nova-api' do
should contain_class('nova::api').with(
is_expected.to contain_class('nova::api').with(
:enabled => true,
:auth_host => '10.0.0.1',
:admin_password => 'secrete',

View File

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

View File

@ -50,7 +50,7 @@ describe 'cloud::compute::scheduler' do
end
it 'configure nova common' do
should contain_class('nova').with(
is_expected.to contain_class('nova').with(
:verbose => true,
:debug => true,
:use_syslog => true,
@ -64,14 +64,14 @@ describe 'cloud::compute::scheduler' do
:glance_api_servers => 'http://10.0.0.1:9292',
:log_dir => false
)
should contain_nova_config('DEFAULT/resume_guests_state_on_host_boot').with('value' => true)
should contain_nova_config('DEFAULT/default_availability_zone').with('value' => 'MyZone')
should 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/resume_guests_state_on_host_boot').with('value' => true)
is_expected.to contain_nova_config('DEFAULT/default_availability_zone').with('value' => 'MyZone')
is_expected.to contain_nova_config('DEFAULT/servicegroup_driver').with_value('mc')
is_expected.to contain_nova_config('DEFAULT/glance_num_retries').with_value('10')
end
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_auth_url => 'http://10.0.0.1:35357/v2.0',
:neutron_region_name => 'MyRegion',
@ -80,7 +80,7 @@ describe 'cloud::compute::scheduler' do
end
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',
:user => 'nova',
:path => '/usr/bin',
@ -89,7 +89,7 @@ describe 'cloud::compute::scheduler' do
end
it 'configure nova-scheduler' do
should contain_class('nova::scheduler').with(:enabled => true)
is_expected.to contain_class('nova::scheduler').with(:enabled => true)
end
context 'openstack compute scheduler with nova-scheduler filters' do
@ -98,7 +98,7 @@ describe 'cloud::compute::scheduler' do
:scheduler_default_filters => ['RamFilter', 'ComputeFilter']
)
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"
)}
end

View File

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

View File

@ -46,7 +46,7 @@ describe 'cloud::database::dbaas::api' do
end
it 'configure trove common' do
should contain_class('trove').with(
is_expected.to contain_class('trove').with(
:rabbit_userid => 'trove',
:rabbit_hosts => ['10.0.0.1'],
:rabbit_password => 'secrete',
@ -59,7 +59,7 @@ describe 'cloud::database::dbaas::api' do
end
it 'configure trove api' do
should contain_class('trove::api').with(
is_expected.to contain_class('trove::api').with(
:verbose => true,
:debug => true,
:use_syslog => true,
@ -71,7 +71,7 @@ describe 'cloud::database::dbaas::api' do
end
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',
:user => 'trove',
:path => '/usr/bin',

View File

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

View File

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

View File

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

View File

@ -70,28 +70,28 @@ describe 'cloud::database::sql' do
end
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]
)
should contain_class('mysql::server').with(
is_expected.to contain_class('mysql::server').with(
:package_name => platform_params[:mysql_server_package_name],
:override_options => { 'mysqld' => { 'bind-address' => '10.0.0.1' } },
:notify => 'Service[xinetd]'
)
should 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]}"$/)
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_cluster_name\s*= "galera_cluster"$/)
is_expected.to 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_incoming_address\s*= "#{params[:api_eth]}"$/)
end # configure mysql galera server
context 'configure mysqlchk http replication' do
it { should contain_file('/etc/xinetd.d/mysqlchk').with_mode('0755') }
it { should contain_file('/usr/bin/clustercheck').with_mode('0755') }
it { should 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 { 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_mode('0755') }
it { is_expected.to contain_file('/usr/bin/clustercheck').with_mode('0755') }
it { is_expected.to 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_PASSWORD='#{params[:galera_clustercheck_dbpassword]}'/)}
it { is_expected.to contain_file('/etc/xinetd.d/mysqlchk').with_content(/bind = #{params[:galera_clustercheck_ipaddress]}/)}
end # configure mysqlchk http replication
@ -102,7 +102,7 @@ describe 'cloud::database::sql' do
end
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],
:root_password => 'secrete',
:override_options => { 'mysqld' => { 'bind-address' => '10.0.0.1' } },
@ -111,7 +111,7 @@ describe 'cloud::database::sql' do
end
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',
:dbname => 'keystone',
:user => 'keystone',
@ -121,7 +121,7 @@ describe 'cloud::database::sql' do
end
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',
:dbname => 'glance',
:user => 'glance',
@ -131,7 +131,7 @@ describe 'cloud::database::sql' do
end
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',
:dbname => 'nova',
:user => 'nova',
@ -141,7 +141,7 @@ describe 'cloud::database::sql' do
end
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',
:dbname => 'cinder',
:user => 'cinder',
@ -151,7 +151,7 @@ describe 'cloud::database::sql' do
end
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',
:dbname => 'neutron',
:user => 'neutron',
@ -161,7 +161,7 @@ describe 'cloud::database::sql' do
end
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',
:dbname => 'heat',
:user => 'heat',
@ -171,7 +171,7 @@ describe 'cloud::database::sql' do
end
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',
:dbname => 'trove',
:user => 'trove',
@ -181,15 +181,15 @@ describe 'cloud::database::sql' do
end
it 'configure monitoring database' do
should contain_mysql_database('monitoring').with(
is_expected.to contain_mysql_database('monitoring').with(
:ensure => 'present',
: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',
: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'
)
end # configure monitoring database
@ -200,7 +200,7 @@ describe 'cloud::database::sql' do
facts.merge!( :osfamily => 'RedHat' )
end
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',
:unless => "test -d /var/lib/mysql/mysql",
:before => 'Service[mysqld]'

View File

@ -117,7 +117,7 @@ describe 'cloud::identity' do
end
it 'configure keystone server' do
should contain_class('keystone').with(
is_expected.to contain_class('keystone').with(
:enabled => true,
:admin_token => 'SECRETE',
:compute_port => '8774',
@ -137,13 +137,13 @@ describe 'cloud::identity' do
:log_file => false,
:admin_endpoint => 'https://10.0.0.1:35357/v2.0'
)
should contain_keystone_config('ec2/driver').with('value' => 'keystone.contrib.ec2.backends.sql.Ec2')
should 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('ec2/driver').with('value' => 'keystone.contrib.ec2.backends.sql.Ec2')
is_expected.to contain_keystone_config('DEFAULT/log_file').with_ensure('absent')
is_expected.to contain_keystone_config('DEFAULT/log_dir').with_ensure('absent')
end
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',
:path => '/usr/bin',
:user => 'keystone',
@ -152,7 +152,7 @@ describe 'cloud::identity' do
end
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',
:password => 'secrete',
:admin_tenant => 'admin'
@ -171,7 +171,7 @@ describe 'cloud::identity' do
# end
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',
:admin_url => 'https://10.0.0.1:35357',
:internal_url => 'https://10.0.0.1:5000',
@ -180,7 +180,7 @@ describe 'cloud::identity' do
end
it 'configure swift endpoints' do
should contain_class('swift::keystone::auth').with(
is_expected.to contain_class('swift::keystone::auth').with(
:password => 'secrete',
:public_address => '10.0.0.1',
:public_port => '8080',
@ -194,11 +194,11 @@ describe 'cloud::identity' do
end
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
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',
:internal_address => '10.0.0.1',
:password => 'secrete',
@ -212,11 +212,11 @@ describe 'cloud::identity' do
end
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
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',
:cinder => true,
:internal_address => '10.0.0.1',
@ -232,7 +232,7 @@ describe 'cloud::identity' do
end
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',
:internal_address => '10.0.0.1',
:password => 'secrete',
@ -246,7 +246,7 @@ describe 'cloud::identity' do
end
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',
:internal_address => '10.0.0.1',
:password => 'secrete',
@ -257,7 +257,7 @@ describe 'cloud::identity' do
end
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',
:internal_address => '10.0.0.1',
:password => 'secrete',
@ -271,7 +271,7 @@ describe 'cloud::identity' do
end
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',
:internal_address => '10.0.0.1',
:password => 'secrete',
@ -285,7 +285,7 @@ describe 'cloud::identity' do
end
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',
:internal_address => '10.0.0.1',
:password => 'secrete',
@ -299,7 +299,7 @@ describe 'cloud::identity' do
end
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
context 'without syslog' do
@ -307,7 +307,7 @@ describe 'cloud::identity' do
params.merge!(:use_syslog => false)
end
it 'configure keystone server' do
should contain_class('keystone').with(
is_expected.to contain_class('keystone').with(
:use_syslog => false,
:log_dir => '/var/log/keystone',
:log_file => 'keystone.log'
@ -320,8 +320,8 @@ describe 'cloud::identity' do
params.merge!(:swift_enabled => false)
end
it 'should not configure swift endpoints and users' do
should_not contain_class('swift::keystone::auth')
should_not contain_class('swift::keystone::dispersion')
is_expected.not_to contain_class('swift::keystone::auth')
is_expected.not_to contain_class('swift::keystone::dispersion')
end
end
@ -330,7 +330,7 @@ describe 'cloud::identity' do
params.merge!(:trove_enabled => true)
end
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',
:internal_address => '10.0.0.1',
:password => 'secrete',

View File

@ -47,7 +47,7 @@ describe 'cloud::image::api' do
shared_examples_for 'openstack image 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',
:keystone_password => 'secrete',
:registry_host => '10.0.0.42',
@ -79,18 +79,18 @@ describe 'cloud::image::api' do
# :rabbit_host => '10.0.0.1'
# )
# 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
should contain_class('glance::backend::rbd').with(
is_expected.to contain_class('glance::backend::rbd').with(
:rbd_store_pool => 'images',
:rbd_store_user => 'glance'
)
end
it 'configure crontab to clean glance cache' do
should contain_class('glance::cache::cleaner')
should contain_class('glance::cache::pruner')
is_expected.to contain_class('glance::cache::cleaner')
is_expected.to contain_class('glance::cache::pruner')
end
context 'with file Glance backend' do
@ -99,10 +99,10 @@ describe 'cloud::image::api' do
end
it 'configure Glance with file backend' do
should contain_class('glance::backend::file')
should_not contain_class('glance::backend::rbd')
should 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_class('glance::backend::file')
is_expected.not_to contain_class('glance::backend::rbd')
is_expected.to contain_glance_api_config('DEFAULT/filesystem_store_datadir').with('value' => '/var/lib/glance/images/')
is_expected.to contain_glance_api_config('DEFAULT/default_store').with('value' => 'file')
end
end
@ -114,11 +114,11 @@ describe 'cloud::image::api' do
end
it 'configure Glance with NFS backend' do
should contain_class('glance::backend::file')
should_not contain_class('glance::backend::rbd')
should contain_glance_api_config('DEFAULT/filesystem_store_datadir').with('value' => '/srv/images/')
should contain_glance_api_config('DEFAULT/default_store').with('value' => 'file')
should contain_mount('/srv/images/').with({
is_expected.to contain_class('glance::backend::file')
is_expected.not_to contain_class('glance::backend::rbd')
is_expected.to contain_glance_api_config('DEFAULT/filesystem_store_datadir').with('value' => '/srv/images/')
is_expected.to contain_glance_api_config('DEFAULT/default_store').with('value' => 'file')
is_expected.to contain_mount('/srv/images/').with({
'ensure' => 'present',
'fstype' => 'nfs',
'device' => 'nfs.example.com:/vol1',
@ -131,14 +131,14 @@ describe 'cloud::image::api' do
params.merge!(:backend => 'nfs',
:nfs_device => false )
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
context 'with wrong Glance backend' do
before :each do
params.merge!(:backend => 'Something')
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

View File

@ -39,7 +39,7 @@ describe 'cloud::image::registry' do
shared_examples_for 'openstack image 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',
:keystone_password => 'secrete',
:keystone_tenant => 'services',
@ -58,7 +58,7 @@ describe 'cloud::image::registry' do
end
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',
:user => 'glance',
:path => '/usr/bin',

View File

@ -44,7 +44,7 @@ describe 'cloud::image' do
shared_examples_for 'openstack image' 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',
:keystone_password => 'secrete',
:registry_host => '10.0.0.42',
@ -65,7 +65,7 @@ describe 'cloud::image' do
end
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',
:keystone_password => 'secrete',
:keystone_tenant => 'services',
@ -92,22 +92,22 @@ describe 'cloud::image' do
# :rabbit_host => '10.0.0.1'
# )
# 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
should contain_class('glance::backend::rbd').with(
is_expected.to contain_class('glance::backend::rbd').with(
:rbd_store_pool => 'images',
:rbd_store_user => 'glance'
)
end
it 'configure crontab to clean glance cache' do
should contain_class('glance::cache::cleaner')
should contain_class('glance::cache::pruner')
is_expected.to contain_class('glance::cache::cleaner')
is_expected.to contain_class('glance::cache::pruner')
end
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',
:user => 'glance',
:path => '/usr/bin',

View File

@ -38,13 +38,13 @@ describe 'cloud' do
}
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)
)}
it { should contain_service('cron').with({
it { is_expected.to contain_service('cron').with({
:name => platform_params[:cron_service_name],
:ensure => 'running',
:enable => true
@ -84,7 +84,7 @@ describe 'cloud' do
#it_configures 'private cloud node'
xit { should contain_rhn_register('rhn-redhat1') }
xit { is_expected.to contain_rhn_register('rhn-redhat1') }
end
context 'on other platforms' do
@ -92,7 +92,7 @@ describe 'cloud' do
{ :osfamily => 'Solaris' }
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

View File

@ -87,15 +87,15 @@ describe 'cloud::loadbalancer' do
end
it 'configure haproxy server' do
should contain_class('haproxy')
is_expected.to contain_class('haproxy')
end # configure haproxy server
it 'configure keepalived server' do
should contain_class('keepalived')
is_expected.to contain_class('keepalived')
end # configure keepalived server
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'
)
end
@ -105,7 +105,7 @@ describe 'cloud::loadbalancer' do
params.merge!(:keepalived_internal_ipvs => ['192.168.0.1'])
end
it 'configure an internal VRRP instance' do
should contain_keepalived__instance('2').with({
is_expected.to contain_keepalived__instance('2').with({
'interface' => 'eth1',
'virtual_ips' => ['192.168.0.1 dev eth1'],
'track_script' => ['haproxy'],
@ -127,7 +127,7 @@ describe 'cloud::loadbalancer' do
)
end
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',
'virtual_ips' => ['192.168.0.2 dev eth3'],
'track_script' => ['haproxy'],
@ -144,7 +144,7 @@ describe 'cloud::loadbalancer' do
params.merge!(:keepalived_vrrp_interface => 'eth2')
end
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',
})
end
@ -152,7 +152,7 @@ describe 'cloud::loadbalancer' do
context 'when keepalived and HAproxy are in backup' 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],
'virtual_ips' => ['10.0.0.1 dev eth0', '10.0.0.2 dev eth0'],
'track_script' => ['haproxy'],
@ -163,7 +163,7 @@ describe 'cloud::loadbalancer' do
})
end # configure vrrp_instance with BACKUP state
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 keepalived in backup
@ -172,7 +172,7 @@ describe 'cloud::loadbalancer' do
params.merge!( :keepalived_state => 'MASTER' )
end
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],
'track_script' => ['haproxy'],
'state' => 'MASTER',
@ -182,12 +182,12 @@ describe 'cloud::loadbalancer' do
})
end
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 keepalived in master
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',
:mode => '0644',
:owner => 'root',
@ -196,14 +196,14 @@ describe 'cloud::loadbalancer' do
end # configure logrotate file
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],
:ports => '9300'
)}
end # configure monitor haproxy listen
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],
:ports => '3306',
:options => {
@ -218,14 +218,14 @@ describe 'cloud::loadbalancer' do
end # configure monitor haproxy listen
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
context 'configure galera slave haproxy listen' do
before do
params.merge!( :galera_slave => true )
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],
:ports => '3307',
:options => {
@ -241,7 +241,7 @@ describe 'cloud::loadbalancer' do
# test backward compatibility
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]],
:ports => '6082',
:options => {
@ -265,7 +265,7 @@ describe 'cloud::loadbalancer' do
:keepalived_internal_ipvs => ['192.168.0.1', '192.168.0.2']
)
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'],
:ports => '8774'
)}
@ -282,7 +282,7 @@ describe 'cloud::loadbalancer' do
:keepalived_internal_ipvs => ['192.168.0.1', '192.168.0.2']
)
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'],
:ports => '8774'
)}
@ -292,7 +292,7 @@ describe 'cloud::loadbalancer' do
before do
params.merge!(:metadata_api => false)
end
it { should_not contain_haproxy__listen('metadata_api_cluster') }
it { is_expected.not_to contain_haproxy__listen('metadata_api_cluster') }
end
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']
)
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]],
:ports => '8774',
:options => {
@ -378,7 +378,7 @@ describe 'cloud::loadbalancer' do
:cinder_bind_options => 'something not secure',
)
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]],
:ports => '8776',
:options => {
@ -392,7 +392,7 @@ describe 'cloud::loadbalancer' do
end
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]],
:ports => '80',
:options => {
@ -414,7 +414,7 @@ describe 'cloud::loadbalancer' do
:horizon_bind_options => ['ssl', 'crt']
)
end
it { should contain_haproxy__listen('horizon_cluster').with(
it { is_expected.to contain_haproxy__listen('horizon_cluster').with(
:ipaddress => [params[:vip_public_ip]],
:ports => '443',
:options => {
@ -436,7 +436,7 @@ describe 'cloud::loadbalancer' do
:horizon_ssl_port => '443'
)
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]],
:ports => '443',
:options => {
@ -454,7 +454,7 @@ describe 'cloud::loadbalancer' do
:heat_api_bind_options => ['ssl', 'crt']
)
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]],
:ports => '8004',
:options => {

View File

@ -51,15 +51,15 @@ describe 'cloud::logging::agent' do
end
it 'include cloud::loging' do
it should contain_class('cloud::logging')
it is_expected.to contain_class('cloud::logging')
end
it 'include rsyslog::client' do
it should contain_class('rsyglog::client')
it is_expected.to contain_class('rsyglog::client')
end
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',
:owner => 'td-agent',
:group => 'td-agent',
@ -74,15 +74,15 @@ describe 'cloud::logging::agent' do
end
it 'include cloud::loging' do
it should contain_class('cloud::logging')
it is_expected.to contain_class('cloud::logging')
end
it 'include rsyslog::client' do
it should_not contain_class('rsyglog::client')
it is_expected.not_to contain_class('rsyglog::client')
end
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',
:owner => 'td-agent',
:group => 'td-agent',
@ -90,7 +90,7 @@ describe 'cloud::logging::agent' do
end
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',
:rotate => '30',
:compress => 'true',
@ -102,7 +102,7 @@ describe 'cloud::logging::agent' do
context 'logrotate rule with default parameters' 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',
:rotate => '30',
:compress => 'true',
@ -117,7 +117,7 @@ describe 'cloud::logging::agent' do
end
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',
:rotate => '5',
:compress => 'false',

View File

@ -28,15 +28,15 @@ describe 'cloud::logging::server' do
end
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
it 'configure kibana' do
should contain_class('kibana3').with(:ws_port => '8001')
is_expected.to contain_class('kibana3').with(:ws_port => '8001')
end
it 'configure an elasticsearch instance' do
should contain_elasticsearch__instance('fluentd')
is_expected.to contain_elasticsearch__instance('fluentd')
end
end

View File

@ -31,7 +31,7 @@ describe 'cloud::messaging' do
end
it 'configure rabbitmq-server with default values' do
should contain_class('rabbitmq').with(
is_expected.to contain_class('rabbitmq').with(
:delete_guest_user => true,
:config_cluster => true,
:cluster_nodes => params[:rabbit_names],
@ -46,7 +46,7 @@ describe 'cloud::messaging' do
end
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
@ -70,11 +70,11 @@ describe 'cloud::messaging' do
it_configures 'openstack messaging'
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',
: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',
: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
it 'include ::sensu' do
should contain_class('sensu')
is_expected.to contain_class('sensu')
end
end

View File

@ -57,7 +57,7 @@ describe 'cloud::network::controller' do
end
it 'configure neutron common' do
should contain_class('neutron').with(
is_expected.to contain_class('neutron').with(
:allow_overlapping_ips => true,
:dhcp_agents_per_network => '2',
:verbose => true,
@ -75,7 +75,7 @@ describe 'cloud::network::controller' do
:dhcp_lease_duration => '10',
: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'],
:tenant_network_types => ['vxlan'],
:mechanism_drivers => ['openvswitch','l2population'],
@ -87,7 +87,7 @@ describe 'cloud::network::controller' do
end
it 'configure neutron server' do
should contain_class('neutron::server').with(
is_expected.to contain_class('neutron::server').with(
:auth_password => 'secrete',
:auth_host => '10.0.0.1',
:auth_port => '5000',
@ -99,7 +99,7 @@ describe 'cloud::network::controller' do
end
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_admin_auth_url => 'http://127.0.0.1:5000/v2.0',
:nova_admin_username => 'nova',
@ -109,7 +109,7 @@ describe 'cloud::network::controller' do
)
end
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',
:path => '/usr/bin',
:user => 'neutron',
@ -120,7 +120,7 @@ describe 'cloud::network::controller' do
end
it 'should not configure provider external network' do
should_not contain__neutron_network('public')
is_expected.not_to contain__neutron_network('public')
end
end

View File

@ -44,7 +44,7 @@ describe 'cloud::network::dhcp' do
end
it 'configure neutron common' do
should contain_class('neutron').with(
is_expected.to contain_class('neutron').with(
:allow_overlapping_ips => true,
:dhcp_agents_per_network => '2',
:verbose => true,
@ -62,7 +62,7 @@ describe 'cloud::network::dhcp' do
:dhcp_lease_duration => '10',
: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'],
:tenant_network_types => ['vxlan'],
:mechanism_drivers => ['openvswitch','l2population'],
@ -71,24 +71,24 @@ describe 'cloud::network::dhcp' do
:flat_networks => ['public'],
:enable_security_group => true
)
should_not contain__neutron_network('public')
is_expected.not_to contain__neutron_network('public')
end
it 'configure neutron dhcp' do
should contain_class('neutron::agents::dhcp').with(
is_expected.to contain_class('neutron::agents::dhcp').with(
:debug => true,
:dnsmasq_config_file => '/etc/neutron/dnsmasq-neutron.conf',
: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',
:owner => '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
@ -116,20 +116,20 @@ describe 'cloud::network::dhcp' do
end
it 'configure neutron dhcp' do
should contain_class('neutron::agents::dhcp').with(
is_expected.to contain_class('neutron::agents::dhcp').with(
:debug => true
)
should 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)
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_config_file').with_value('/etc/neutron/dnsmasq-neutron.conf')
is_expected.to contain_neutron_dhcp_agent_config('DEFAULT/enable_isolated_metadata').with_value(true)
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',
:owner => '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

View File

@ -44,7 +44,7 @@ describe 'cloud::network::l3' do
end
it 'configure neutron common' do
should contain_class('neutron').with(
is_expected.to contain_class('neutron').with(
:allow_overlapping_ips => true,
:dhcp_agents_per_network => '2',
:verbose => true,
@ -62,7 +62,7 @@ describe 'cloud::network::l3' do
:dhcp_lease_duration => '10',
: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'],
:tenant_network_types => ['vxlan'],
:mechanism_drivers => ['openvswitch','l2population'],
@ -71,21 +71,21 @@ describe 'cloud::network::l3' do
:flat_networks => ['public'],
:enable_security_group => true
)
should_not contain__neutron_network('public')
is_expected.not_to contain__neutron_network('public')
end
it 'configure neutron l3' do
should contain_class('neutron::agents::l3').with(
is_expected.to contain_class('neutron::agents::l3').with(
:debug => true,
:external_network_bridge => 'br-ex'
)
end
it 'configure br-ex bridge' do
should_not contain__vs_bridge('br-ex')
is_expected.not_to contain__vs_bridge('br-ex')
end
it 'configure neutron metering agent' do
should contain_class('neutron::agents::metering').with(
is_expected.to contain_class('neutron::agents::metering').with(
:debug => true
)
end
@ -96,14 +96,14 @@ describe 'cloud::network::l3' do
end
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',
:unless => '/bin/ls /etc/rc*.d | /bin/grep disable-tso',
:onlyif => '/usr/bin/test -f /etc/init.d/disable-tso'
)
end
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',
:unless => '/usr/bin/test -f /var/run/disable-tso.pid',
:onlyif => '/usr/bin/test -f /etc/init.d/disable-tso'
@ -117,14 +117,14 @@ describe 'cloud::network::l3' do
end
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',
:unless => '/bin/ls /etc/rc*.d | /bin/grep disable-tso',
:onlyif => '/usr/bin/test -f /etc/init.d/disable-tso'
)
end
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',
:unless => '/usr/bin/test -f /var/run/disable-tso.pid',
:onlyif => '/usr/bin/test -f /etc/init.d/disable-tso'
@ -137,10 +137,10 @@ describe 'cloud::network::l3' do
params.merge!( :manage_tso => false)
end
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
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

View File

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

View File

@ -52,7 +52,7 @@ describe 'cloud::network::metadata' do
end
it 'configure neutron common' do
should contain_class('neutron').with(
is_expected.to contain_class('neutron').with(
:allow_overlapping_ips => true,
:dhcp_agents_per_network => '2',
:verbose => true,
@ -70,7 +70,7 @@ describe 'cloud::network::metadata' do
:dhcp_lease_duration => '10',
: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'],
:tenant_network_types => ['vxlan'],
:mechanism_drivers => ['openvswitch','l2population'],
@ -79,11 +79,11 @@ describe 'cloud::network::metadata' do
:flat_networks => ['public'],
:enable_security_group => true
)
should_not contain__neutron_network('public')
is_expected.not_to contain__neutron_network('public')
end
it 'configure neutron metadata' do
should contain_class('neutron::agents::metadata').with(
is_expected.to contain_class('neutron::agents::metadata').with(
:debug => true,
:enabled => true,
:shared_secret => 'secrete',
@ -93,7 +93,7 @@ describe 'cloud::network::metadata' do
:auth_region => 'MyRegion',
: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

View File

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

View File

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

View File

@ -14,7 +14,7 @@ describe 'cloud::object::ringbuilder' do
end
it 'create the three rings' do
should contain_class('swift::ringbuilder').with({
is_expected.to contain_class('swift::ringbuilder').with({
'part_power' => '15',
'replicas' => '3',
'min_part_hours' => '24',
@ -22,7 +22,7 @@ describe 'cloud::object::ringbuilder' do
end
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',
'max_connections' => '5',
})
@ -35,7 +35,7 @@ describe 'cloud::object::ringbuilder' do
)
end
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

View File

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

View File

@ -52,7 +52,7 @@ describe 'cloud::orchestration::api' do
end
it 'configure heat common' do
should contain_class('heat').with(
is_expected.to contain_class('heat').with(
:verbose => true,
:debug => true,
:log_facility => 'LOG_LOCAL0',
@ -71,17 +71,17 @@ describe 'cloud::orchestration::api' do
end
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_port => '8004',
: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_port => '8000',
: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_port => '8003',
:workers => '8'
@ -89,7 +89,7 @@ describe 'cloud::orchestration::api' do
end
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',
:user => 'heat',
:path => '/usr/bin',

View File

@ -56,7 +56,7 @@ describe 'cloud::orchestration::engine' do
end
it 'configure heat common' do
should contain_class('heat').with(
is_expected.to contain_class('heat').with(
:verbose => true,
:debug => true,
: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',
: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
it 'configure heat engine' do
should contain_class('heat::engine').with(
is_expected.to contain_class('heat::engine').with(
:enabled => true,
:auth_encryption_key => 'secrete',
:heat_metadata_server_url => 'http://10.0.0.1:8000',

View File

@ -35,20 +35,20 @@ describe 'cloud::spof' do
end
it 'configure pacemaker/corosync' do
should contain_class('corosync').with(
is_expected.to contain_class('corosync').with(
:enable_secauth => false,
:authkey => '/var/lib/puppet/ssl/certs/ca.pem',
:bind_address => '10.0.0.1',
: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',
:mode => '0755',
:owner => 'root',
:group => 'root'
)
should contain_class('cloud::telemetry::centralagent').with(:enabled => false)
should contain_exec('cleanup_ceilometer_agent_central').with(
is_expected.to contain_class('cloud::telemetry::centralagent').with(:enabled => false)
is_expected.to contain_exec('cleanup_ceilometer_agent_central').with(
:command => 'crm resource cleanup ceilometer-agent-central',
:path => ['/usr/sbin', '/bin'],
:user => 'root',
@ -64,28 +64,28 @@ describe 'cloud::spof' do
end
it 'configure pacemaker/corosync' do
should contain_class('pacemaker').with(:hacluster_pwd => 'verysecrete')
should contain_class('pacemaker::stonith').with(:disable => true)
should contain_class('pacemaker::corosync').with(
is_expected.to contain_class('pacemaker').with(:hacluster_pwd => 'verysecrete')
is_expected.to contain_class('pacemaker::stonith').with(:disable => true)
is_expected.to contain_class('pacemaker::corosync').with(
:cluster_name => 'openstack',
:settle_timeout => 10,
:settle_tries => 2,
:settle_try_sleep => 5,
:manage_fw => false,
: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',
:mode => '0755',
:owner => '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',
:path => ['/usr/bin','/usr/sbin','/sbin/','/bin'],
:user => 'root',
: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
@ -94,7 +94,7 @@ describe 'cloud::spof' do
facts.merge!( :osfamily => 'RedHat' )
params.merge!( :cluster_members => false)
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

View File

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

View File

@ -36,7 +36,7 @@ describe 'cloud::storage::rbd::osd' do
end
it 'configure ceph common' do
should contain_class('ceph::conf').with(
is_expected.to contain_class('ceph::conf').with(
:fsid => '123',
:auth_type => 'cephx',
:cluster_network => '10.0.0.0/24',
@ -46,11 +46,11 @@ describe 'cloud::storage::rbd::osd' do
end
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',
: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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -52,7 +52,7 @@ describe 'cloud::volume::controller' do
end
it 'configure cinder common' do
should contain_class('cinder').with(
is_expected.to contain_class('cinder').with(
:verbose => true,
:debug => true,
:rabbit_userid => 'cinder',
@ -64,12 +64,12 @@ describe 'cloud::volume::controller' do
:log_dir => false,
:storage_availability_zone => 'nova'
)
should contain_class('cinder::ceilometer')
should contain_cinder_config('DEFAULT/nova_catalog_info').with('value' => 'compute:nova:internalURL')
is_expected.to contain_class('cinder::ceilometer')
is_expected.to contain_cinder_config('DEFAULT/nova_catalog_info').with('value' => 'compute:nova:internalURL')
end
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',
:user => 'cinder',
:path => '/usr/bin',
@ -78,7 +78,7 @@ describe 'cloud::volume::controller' do
end
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
)
end
@ -91,10 +91,10 @@ describe 'cloud::volume::controller' do
)
end
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'
)
should contain_class('cinder::api').with(:default_volume_type => 'ceph')
is_expected.to contain_class('cinder::api').with(:default_volume_type => 'ceph')
end
end
@ -106,12 +106,12 @@ describe 'cloud::volume::controller' do
)
end
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
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_request_timeout => '10',
:glance_num_retries => '10'
@ -119,13 +119,13 @@ describe 'cloud::volume::controller' do
end
it 'configure cinder api' do
should contain_class('cinder::api').with(
is_expected.to contain_class('cinder::api').with(
:keystone_password => 'secrete',
:keystone_auth_host => '10.0.0.1',
:keystone_auth_protocol => 'https',
: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
# TODO(EmilienM) Disabled for now: http://git.io/kfTmcA

View File

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

View File

@ -1,5 +1,5 @@
shared_examples_for "a Puppet::Error" do |description|
it "with message matching #{description.inspect}" do
expect { should have_class_count(1) }.to raise_error(Puppet::Error, description)
expect { is_expected.to have_class_count(1) }.to raise_error(Puppet::Error, description)
end
end