diff --git a/spec/classes/cinder_ceilometer_spec.rb b/spec/classes/cinder_ceilometer_spec.rb index 630dabfb..4e881605 100644 --- a/spec/classes/cinder_ceilometer_spec.rb +++ b/spec/classes/cinder_ceilometer_spec.rb @@ -3,9 +3,9 @@ require 'spec_helper' describe 'cinder::ceilometer' do shared_examples 'cinder::ceilometer' do context 'with default parameters' do - it { should contain_cinder_config('oslo_messaging_notifications/transport_url').with_value('') } - it { should contain_cinder_config('oslo_messaging_notifications/driver').with_value('messagingv2') } - it { should contain_cinder_config('oslo_messaging_notifications/topics').with_value('') } + it { is_expected.to contain_cinder_config('oslo_messaging_notifications/transport_url').with_value('') } + it { is_expected.to contain_cinder_config('oslo_messaging_notifications/driver').with_value('messagingv2') } + it { is_expected.to contain_cinder_config('oslo_messaging_notifications/topics').with_value('') } end end diff --git a/spec/classes/cinder_client_spec.rb b/spec/classes/cinder_client_spec.rb index dd0432d7..635fc82f 100644 --- a/spec/classes/cinder_client_spec.rb +++ b/spec/classes/cinder_client_spec.rb @@ -26,7 +26,7 @@ describe 'cinder::client' do ) end - it { should contain_class('openstacklib::openstackclient') } + it { is_expected.to contain_class('openstacklib::openstackclient') } end on_supported_os({ diff --git a/spec/classes/cinder_coordination_spec.rb b/spec/classes/cinder_coordination_spec.rb index e558e52b..02e6ff11 100644 --- a/spec/classes/cinder_coordination_spec.rb +++ b/spec/classes/cinder_coordination_spec.rb @@ -4,7 +4,7 @@ describe 'cinder::coordination' do shared_examples 'cinder::coordination' do context 'with default parameters' do it { - should contain_cinder_config('coordination/backend_url').with_value('') + is_expected.to contain_cinder_config('coordination/backend_url').with_value('') } end @@ -16,7 +16,7 @@ describe 'cinder::coordination' do end it { - should contain_cinder_config('coordination/backend_url').with_value('etcd3+http://127.0.0.1:2379') + is_expected.to contain_cinder_config('coordination/backend_url').with_value('etcd3+http://127.0.0.1:2379') } end end diff --git a/spec/classes/cinder_cron_db_purge_spec.rb b/spec/classes/cinder_cron_db_purge_spec.rb index 913440e4..eb54a7de 100644 --- a/spec/classes/cinder_cron_db_purge_spec.rb +++ b/spec/classes/cinder_cron_db_purge_spec.rb @@ -16,7 +16,7 @@ describe 'cinder::cron::db_purge' do shared_examples 'cinder::cron::db_purge' do context 'with required parameters' do - it { should contain_cron('cinder-manage db purge').with( + it { is_expected.to contain_cron('cinder-manage db purge').with( :command => "cinder-manage db purge #{params[:age]} >>#{params[:destination]} 2>&1", :environment => 'PATH=/bin:/usr/bin:/usr/sbin SHELL=/bin/sh', :user => params[:user], diff --git a/spec/classes/cinder_db_mysql_spec.rb b/spec/classes/cinder_db_mysql_spec.rb index 652c3dc7..c7cb5654 100644 --- a/spec/classes/cinder_db_mysql_spec.rb +++ b/spec/classes/cinder_db_mysql_spec.rb @@ -17,7 +17,7 @@ describe 'cinder::db::mysql' do req_params end - it { should contain_openstacklib__db__mysql('cinder').with( + it { is_expected.to contain_openstacklib__db__mysql('cinder').with( :user => 'cinder', :password_hash => '*D821809F681A40A6E379B50D0463EFAE20BDD122', :host => '127.0.0.1', @@ -34,7 +34,7 @@ describe 'cinder::db::mysql' do } end - it { should contain_openstacklib__db__mysql('cinder').with( + it { is_expected.to contain_openstacklib__db__mysql('cinder').with( :user => 'cinder', :password_hash => '*1C8A189441ED992638DD234B6711CD5064DA8C6E', :host => '127.0.0.1', @@ -52,7 +52,7 @@ describe 'cinder::db::mysql' do } end - it { should contain_openstacklib__db__mysql('cinder').with( + it { is_expected.to contain_openstacklib__db__mysql('cinder').with( :user => 'cinder', :password_hash => '*0E9E710049E74D36D29D615DFC55F3FFD45413BC', :host => '127.0.0.1', @@ -70,7 +70,7 @@ describe 'cinder::db::mysql' do } end - it { should contain_openstacklib__db__mysql('cinder').with( + it { is_expected.to contain_openstacklib__db__mysql('cinder').with( :user => 'cinder', :password_hash => '*0E9E710049E74D36D29D615DFC55F3FFD45413BC', :host => '127.0.0.1', diff --git a/spec/classes/cinder_db_spec.rb b/spec/classes/cinder_db_spec.rb index 4561806e..b6dc3d0b 100644 --- a/spec/classes/cinder_db_spec.rb +++ b/spec/classes/cinder_db_spec.rb @@ -3,9 +3,9 @@ require 'spec_helper' describe 'cinder::db' do shared_examples 'cinder::db' do context 'with default parameters' do - it { should contain_class('cinder::deps') } + it { is_expected.to contain_class('cinder::deps') } - it { should contain_oslo__db('cinder_config').with( + it { is_expected.to contain_oslo__db('cinder_config').with( :db_max_retries => '', :connection => 'sqlite:////var/lib/cinder/cinder.sqlite', :idle_timeout => '', @@ -33,9 +33,9 @@ describe 'cinder::db' do } end - it { should contain_class('cinder::deps') } + it { is_expected.to contain_class('cinder::deps') } - it { should contain_oslo__db('cinder_config').with( + it { is_expected.to contain_oslo__db('cinder_config').with( :db_max_retries => '-1', :connection => 'mysql+pymysql://cinder:cinder@localhost/cinder', :idle_timeout => '3601', diff --git a/spec/classes/cinder_init_spec.rb b/spec/classes/cinder_init_spec.rb index 0308122f..20caae72 100644 --- a/spec/classes/cinder_init_spec.rb +++ b/spec/classes/cinder_init_spec.rb @@ -14,33 +14,33 @@ describe 'cinder' do req_params end - it { should contain_class('cinder::params') } - it { should contain_class('mysql::bindings::python') } + it { is_expected.to contain_class('cinder::params') } + it { is_expected.to contain_class('mysql::bindings::python') } - it { should contain_resources('cinder_config').with_purge(false) } + it { is_expected.to contain_resources('cinder_config').with_purge(false) } it { - should contain_cinder_config('DEFAULT/transport_url').with(:value => '') - should contain_cinder_config('DEFAULT/rpc_response_timeout').with(:value => '') - should contain_cinder_config('DEFAULT/control_exchange').with(:value => 'openstack') - should contain_cinder_config('DEFAULT/report_interval').with(:value => '') - should contain_cinder_config('DEFAULT/service_down_time').with(:value => '') - should contain_cinder_config('oslo_messaging_rabbit/rabbit_ha_queues').with(:value => '') - should contain_cinder_config('oslo_messaging_rabbit/heartbeat_timeout_threshold').with_value('') - should contain_cinder_config('oslo_messaging_rabbit/heartbeat_rate').with_value('') - should contain_cinder_config('oslo_messaging_rabbit/kombu_reconnect_delay').with(:value => '') - should contain_cinder_config('oslo_messaging_rabbit/kombu_failover_strategy').with(:value => '') - should contain_cinder_config('oslo_messaging_rabbit/kombu_compression').with(:value => '') - should contain_cinder_config('DEFAULT/storage_availability_zone').with(:value => 'nova') - should contain_cinder_config('DEFAULT/default_availability_zone').with(:value => 'nova') - should contain_cinder_config('DEFAULT/allow_availability_zone_fallback').with(:value => '') - should contain_cinder_config('DEFAULT/api_paste_config').with(:value => '/etc/cinder/api-paste.ini') - should contain_cinder_config('DEFAULT/host').with_value('') - should contain_cinder_config('DEFAULT/enable_new_services').with_value('') - should contain_cinder_config('oslo_concurrency/lock_path').with(:value => '/var/lock/cinder') + is_expected.to contain_cinder_config('DEFAULT/transport_url').with(:value => '') + is_expected.to contain_cinder_config('DEFAULT/rpc_response_timeout').with(:value => '') + is_expected.to contain_cinder_config('DEFAULT/control_exchange').with(:value => 'openstack') + is_expected.to contain_cinder_config('DEFAULT/report_interval').with(:value => '') + is_expected.to contain_cinder_config('DEFAULT/service_down_time').with(:value => '') + is_expected.to contain_cinder_config('oslo_messaging_rabbit/rabbit_ha_queues').with(:value => '') + is_expected.to contain_cinder_config('oslo_messaging_rabbit/heartbeat_timeout_threshold').with_value('') + is_expected.to contain_cinder_config('oslo_messaging_rabbit/heartbeat_rate').with_value('') + is_expected.to contain_cinder_config('oslo_messaging_rabbit/kombu_reconnect_delay').with(:value => '') + is_expected.to contain_cinder_config('oslo_messaging_rabbit/kombu_failover_strategy').with(:value => '') + is_expected.to contain_cinder_config('oslo_messaging_rabbit/kombu_compression').with(:value => '') + is_expected.to contain_cinder_config('DEFAULT/storage_availability_zone').with(:value => 'nova') + is_expected.to contain_cinder_config('DEFAULT/default_availability_zone').with(:value => 'nova') + is_expected.to contain_cinder_config('DEFAULT/allow_availability_zone_fallback').with(:value => '') + is_expected.to contain_cinder_config('DEFAULT/api_paste_config').with(:value => '/etc/cinder/api-paste.ini') + is_expected.to contain_cinder_config('DEFAULT/host').with_value('') + is_expected.to contain_cinder_config('DEFAULT/enable_new_services').with_value('') + is_expected.to contain_cinder_config('oslo_concurrency/lock_path').with(:value => '/var/lock/cinder') # backend_host should not be written to DEFAULT section - should_not contain_cinder_config('DEFAULT/backend_host') + is_expected.not_to contain_cinder_config('DEFAULT/backend_host') } end @@ -49,7 +49,7 @@ describe 'cinder' do req_params.merge( :rabbit_ha_queues => true ) end - it { should contain_cinder_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value(true) } + it { is_expected.to contain_cinder_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value(true) } end context 'with rabbitmq heartbeats' do @@ -58,8 +58,8 @@ describe 'cinder' do :rabbit_heartbeat_rate => '10' ) end - it { should contain_cinder_config('oslo_messaging_rabbit/heartbeat_timeout_threshold').with_value('60') } - it { should contain_cinder_config('oslo_messaging_rabbit/heartbeat_rate').with_value('10') } + it { is_expected.to contain_cinder_config('oslo_messaging_rabbit/heartbeat_timeout_threshold').with_value('60') } + it { is_expected.to contain_cinder_config('oslo_messaging_rabbit/heartbeat_rate').with_value('10') } end context 'with SSL enabled with kombu' do @@ -73,7 +73,7 @@ describe 'cinder' do }) end - it { should contain_oslo__messaging__rabbit('cinder_config').with( + it { is_expected.to contain_oslo__messaging__rabbit('cinder_config').with( :rabbit_use_ssl => true, :kombu_ssl_ca_certs => '/path/to/ssl/ca/certs', :kombu_ssl_certfile => '/path/to/ssl/cert/file', @@ -89,7 +89,7 @@ describe 'cinder' do }) end - it { should contain_oslo__messaging__rabbit('cinder_config').with( + it { is_expected.to contain_oslo__messaging__rabbit('cinder_config').with( :rabbit_use_ssl => true, )} end @@ -105,7 +105,7 @@ describe 'cinder' do }) end - it { should contain_oslo__messaging__rabbit('cinder_config').with( + it { is_expected.to contain_oslo__messaging__rabbit('cinder_config').with( :rabbit_use_ssl => false, :kombu_ssl_ca_certs => '', :kombu_ssl_certfile => '', @@ -119,7 +119,7 @@ describe 'cinder' do req_params.merge!( :lock_path => '/var/run/cinder.locks' ) end - it { should contain_cinder_config('oslo_concurrency/lock_path').with_value('/var/run/cinder.locks') } + it { is_expected.to contain_cinder_config('oslo_concurrency/lock_path').with_value('/var/run/cinder.locks') } end context 'with amqp_durable_queues disabled' do @@ -127,7 +127,7 @@ describe 'cinder' do req_params end - it { should contain_cinder_config('oslo_messaging_rabbit/amqp_durable_queues').with_value('') } + it { is_expected.to contain_cinder_config('oslo_messaging_rabbit/amqp_durable_queues').with_value('') } end context 'with amqp_durable_queues enabled' do @@ -137,27 +137,27 @@ describe 'cinder' do }) end - it { should contain_cinder_config('oslo_messaging_rabbit/amqp_durable_queues').with_value(true) } + it { is_expected.to contain_cinder_config('oslo_messaging_rabbit/amqp_durable_queues').with_value(true) } end context 'with amqp defaults' do it { - should contain_cinder_config('oslo_messaging_amqp/server_request_prefix').with_value('') - should contain_cinder_config('oslo_messaging_amqp/broadcast_prefix').with_value('') - should contain_cinder_config('oslo_messaging_amqp/group_request_prefix').with_value('') - should contain_cinder_config('oslo_messaging_amqp/container_name').with_value('') - should contain_cinder_config('oslo_messaging_amqp/idle_timeout').with_value('') - should contain_cinder_config('oslo_messaging_amqp/trace').with_value('') - should contain_cinder_config('oslo_messaging_amqp/ssl_ca_file').with_value('') - should contain_cinder_config('oslo_messaging_amqp/ssl_cert_file').with_value('') - should contain_cinder_config('oslo_messaging_amqp/ssl_key_file').with_value('') - should contain_cinder_config('oslo_messaging_amqp/ssl_key_password').with_value('') - should contain_cinder_config('oslo_messaging_amqp/allow_insecure_clients').with_value('') - should contain_cinder_config('oslo_messaging_amqp/sasl_mechanisms').with_value('') - should contain_cinder_config('oslo_messaging_amqp/sasl_config_dir').with_value('') - should contain_cinder_config('oslo_messaging_amqp/sasl_config_name').with_value('') - should contain_cinder_config('oslo_messaging_amqp/username').with_value('') - should contain_cinder_config('oslo_messaging_amqp/password').with_value('') + is_expected.to contain_cinder_config('oslo_messaging_amqp/server_request_prefix').with_value('') + is_expected.to contain_cinder_config('oslo_messaging_amqp/broadcast_prefix').with_value('') + is_expected.to contain_cinder_config('oslo_messaging_amqp/group_request_prefix').with_value('') + is_expected.to contain_cinder_config('oslo_messaging_amqp/container_name').with_value('') + is_expected.to contain_cinder_config('oslo_messaging_amqp/idle_timeout').with_value('') + is_expected.to contain_cinder_config('oslo_messaging_amqp/trace').with_value('') + is_expected.to contain_cinder_config('oslo_messaging_amqp/ssl_ca_file').with_value('') + is_expected.to contain_cinder_config('oslo_messaging_amqp/ssl_cert_file').with_value('') + is_expected.to contain_cinder_config('oslo_messaging_amqp/ssl_key_file').with_value('') + is_expected.to contain_cinder_config('oslo_messaging_amqp/ssl_key_password').with_value('') + is_expected.to contain_cinder_config('oslo_messaging_amqp/allow_insecure_clients').with_value('') + is_expected.to contain_cinder_config('oslo_messaging_amqp/sasl_mechanisms').with_value('') + is_expected.to contain_cinder_config('oslo_messaging_amqp/sasl_config_dir').with_value('') + is_expected.to contain_cinder_config('oslo_messaging_amqp/sasl_config_name').with_value('') + is_expected.to contain_cinder_config('oslo_messaging_amqp/username').with_value('') + is_expected.to contain_cinder_config('oslo_messaging_amqp/password').with_value('') } end @@ -175,21 +175,21 @@ describe 'cinder' do end it { - should contain_cinder_config('oslo_messaging_amqp/server_request_prefix').with_value('') - should contain_cinder_config('oslo_messaging_amqp/broadcast_prefix').with_value('') - should contain_cinder_config('oslo_messaging_amqp/group_request_prefix').with_value('') - should contain_cinder_config('oslo_messaging_amqp/container_name').with_value('') - should contain_cinder_config('oslo_messaging_amqp/idle_timeout').with_value('60') - should contain_cinder_config('oslo_messaging_amqp/trace').with_value('true') - should contain_cinder_config('oslo_messaging_amqp/ssl_ca_file').with_value('/path/to/ca.cert') - should contain_cinder_config('oslo_messaging_amqp/ssl_cert_file').with_value('/path/to/certfile') - should contain_cinder_config('oslo_messaging_amqp/ssl_key_file').with_value('/path/to/key') - should contain_cinder_config('oslo_messaging_amqp/allow_insecure_clients').with_value('') - should contain_cinder_config('oslo_messaging_amqp/sasl_mechanisms').with_value('') - should contain_cinder_config('oslo_messaging_amqp/sasl_config_dir').with_value('') - should contain_cinder_config('oslo_messaging_amqp/sasl_config_name').with_value('') - should contain_cinder_config('oslo_messaging_amqp/username').with_value('amqp_user') - should contain_cinder_config('oslo_messaging_amqp/password').with_value('password') + is_expected.to contain_cinder_config('oslo_messaging_amqp/server_request_prefix').with_value('') + is_expected.to contain_cinder_config('oslo_messaging_amqp/broadcast_prefix').with_value('') + is_expected.to contain_cinder_config('oslo_messaging_amqp/group_request_prefix').with_value('') + is_expected.to contain_cinder_config('oslo_messaging_amqp/container_name').with_value('') + is_expected.to contain_cinder_config('oslo_messaging_amqp/idle_timeout').with_value('60') + is_expected.to contain_cinder_config('oslo_messaging_amqp/trace').with_value('true') + is_expected.to contain_cinder_config('oslo_messaging_amqp/ssl_ca_file').with_value('/path/to/ca.cert') + is_expected.to contain_cinder_config('oslo_messaging_amqp/ssl_cert_file').with_value('/path/to/certfile') + is_expected.to contain_cinder_config('oslo_messaging_amqp/ssl_key_file').with_value('/path/to/key') + is_expected.to contain_cinder_config('oslo_messaging_amqp/allow_insecure_clients').with_value('') + is_expected.to contain_cinder_config('oslo_messaging_amqp/sasl_mechanisms').with_value('') + is_expected.to contain_cinder_config('oslo_messaging_amqp/sasl_config_dir').with_value('') + is_expected.to contain_cinder_config('oslo_messaging_amqp/sasl_config_name').with_value('') + is_expected.to contain_cinder_config('oslo_messaging_amqp/username').with_value('amqp_user') + is_expected.to contain_cinder_config('oslo_messaging_amqp/password').with_value('password') } end @@ -200,9 +200,9 @@ describe 'cinder' do } end - it { should_not contain_class('mysql::python') } - it { should_not contain_class('mysql::bindings') } - it { should_not contain_class('mysql::bindings::python') } + it { is_expected.not_to contain_class('mysql::python') } + it { is_expected.not_to contain_class('mysql::bindings') } + it { is_expected.not_to contain_class('mysql::bindings::python') } end context 'with APIs set for Mitaka (proposed)' do @@ -212,7 +212,7 @@ describe 'cinder' do } end - it { should contain_cinder_config('DEFAULT/enable_v3_api').with_value(true) } + it { is_expected.to contain_cinder_config('DEFAULT/enable_v3_api').with_value(true) } end context 'with image_conversion_dir' do @@ -222,7 +222,7 @@ describe 'cinder' do }) end - it { should contain_cinder_config('DEFAULT/image_conversion_dir').with_value('/tmp/foo') } + it { is_expected.to contain_cinder_config('DEFAULT/image_conversion_dir').with_value('/tmp/foo') } end context 'with host and enable_new_services' do @@ -233,8 +233,8 @@ describe 'cinder' do }) end - it { should contain_cinder_config('DEFAULT/host').with_value('mystring') } - it { should contain_cinder_config('DEFAULT/enable_new_services').with_value(true) } + it { is_expected.to contain_cinder_config('DEFAULT/host').with_value('mystring') } + it { is_expected.to contain_cinder_config('DEFAULT/enable_new_services').with_value(true) } end context 'with transport_url' do @@ -244,7 +244,7 @@ describe 'cinder' do }) end - it { should contain_cinder_config('DEFAULT/transport_url').with_value('rabbit://rabbit_user:password@localhost:5673') } + it { is_expected.to contain_cinder_config('DEFAULT/transport_url').with_value('rabbit://rabbit_user:password@localhost:5673') } end end diff --git a/spec/classes/cinder_keystone_auth_spec.rb b/spec/classes/cinder_keystone_auth_spec.rb index 3dfb0a2a..5ed0a67c 100644 --- a/spec/classes/cinder_keystone_auth_spec.rb +++ b/spec/classes/cinder_keystone_auth_spec.rb @@ -9,35 +9,35 @@ describe 'cinder::keystone::auth' do shared_examples 'cinder::keystone::auth' do context 'with required parameters' do - it { should contain_keystone_user('cinder').with( + it { is_expected.to contain_keystone_user('cinder').with( :ensure => 'present', :password => 'pw', :email => 'cinder@localhost', )} - it { should contain_keystone_user_role('cinder@services').with( + it { is_expected.to contain_keystone_user_role('cinder@services').with( :ensure => 'present', :roles => ['admin'] )} - it { should contain_keystone_service('cinderv2::volumev2').with( + it { is_expected.to contain_keystone_service('cinderv2::volumev2').with( :ensure => 'present', :description => 'Cinder Service v2' )} - it { should contain_keystone_service('cinderv3::volumev3').with( + it { is_expected.to contain_keystone_service('cinderv3::volumev3').with( :ensure => 'present', :description => 'Cinder Service v3' )} - it { should contain_keystone_endpoint('RegionOne/cinderv2::volumev2').with( + it { is_expected.to contain_keystone_endpoint('RegionOne/cinderv2::volumev2').with( :ensure => 'present', :public_url => 'http://127.0.0.1:8776/v2/%(tenant_id)s', :admin_url => 'http://127.0.0.1:8776/v2/%(tenant_id)s', :internal_url => 'http://127.0.0.1:8776/v2/%(tenant_id)s' )} - it { should contain_keystone_endpoint('RegionOne/cinderv3::volumev3').with( + it { is_expected.to contain_keystone_endpoint('RegionOne/cinderv3::volumev3').with( :ensure => 'present', :public_url => 'http://127.0.0.1:8776/v3/%(tenant_id)s', :admin_url => 'http://127.0.0.1:8776/v3/%(tenant_id)s', @@ -58,14 +58,14 @@ describe 'cinder::keystone::auth' do }) end - it { should contain_keystone_endpoint('RegionThree/cinderv2::volumev2').with( + it { is_expected.to contain_keystone_endpoint('RegionThree/cinderv2::volumev2').with( :ensure => 'present', :public_url => 'https://10.0.42.1:4242/v42/%(tenant_id)s', :admin_url => 'https://10.0.42.2:4242/v42/%(tenant_id)s', :internal_url => 'https://10.0.42.3:4242/v42/%(tenant_id)s' )} - it { should contain_keystone_endpoint('RegionThree/cinderv3::volumev3').with( + it { is_expected.to contain_keystone_endpoint('RegionThree/cinderv3::volumev3').with( :ensure => 'present', :public_url => 'https://10.0.42.1:4242/v43/%(tenant_id)s', :admin_url => 'https://10.0.42.2:4242/v43/%(tenant_id)s', @@ -81,8 +81,8 @@ describe 'cinder::keystone::auth' do ) end - it { should_not contain_keystone_endpoint('RegionOne/cinderv2::volumev2') } - it { should_not contain_keystone_endpoint('RegionOne/cinderv3::volumev3') } + it { is_expected.not_to contain_keystone_endpoint('RegionOne/cinderv2::volumev2') } + it { is_expected.not_to contain_keystone_endpoint('RegionOne/cinderv3::volumev3') } end context 'when user should not be configured' do @@ -92,10 +92,10 @@ describe 'cinder::keystone::auth' do ) end - it { should_not contain_keystone_user('cinder') } - it { should contain_keystone_user_role('cinder@services') } + it { is_expected.not_to contain_keystone_user('cinder') } + it { is_expected.to contain_keystone_user_role('cinder@services') } - it { should contain_keystone_service('cinderv3::volumev3').with( + it { is_expected.to contain_keystone_service('cinderv3::volumev3').with( :ensure => 'present', :description => 'Cinder Service v3' )} @@ -109,10 +109,10 @@ describe 'cinder::keystone::auth' do ) end - it { should_not contain_keystone_user('cinder') } - it { should_not contain_keystone_user_role('cinder@services') } + it { is_expected.not_to contain_keystone_user('cinder') } + it { is_expected.not_to contain_keystone_user_role('cinder@services') } - it { should contain_keystone_service('cinderv3::volumev3').with( + it { is_expected.to contain_keystone_service('cinderv3::volumev3').with( :ensure => 'present', :description => 'Cinder Service v3' )} @@ -126,7 +126,7 @@ describe 'cinder::keystone::auth' do ) end - it { should contain_keystone__resource__service_identity('cinderv2').with( + it { is_expected.to contain_keystone__resource__service_identity('cinderv2').with( :configure_user => true, :configure_user_role => true, :email => 'cinderv2@localhost', @@ -142,7 +142,7 @@ describe 'cinder::keystone::auth' do ) end - it { should contain_keystone__resource__service_identity('cinderv3').with( + it { is_expected.to contain_keystone__resource__service_identity('cinderv3').with( :configure_user => true, :configure_user_role => true, :email => 'cinderv3@localhost', @@ -158,12 +158,12 @@ describe 'cinder::keystone::auth' do ) end - it { should contain_keystone_user('cinder') } - it { should contain_keystone_user_role('cinder@services') } - it { should contain_keystone_service('cinder_service_v2::volumev2') } - it { should contain_keystone_service('cinder_service_v3::volumev3') } - it { should contain_keystone_endpoint('RegionOne/cinder_service_v2::volumev2') } - it { should contain_keystone_endpoint('RegionOne/cinder_service_v3::volumev3') } + it { is_expected.to contain_keystone_user('cinder') } + it { is_expected.to contain_keystone_user_role('cinder@services') } + it { is_expected.to contain_keystone_service('cinder_service_v2::volumev2') } + it { is_expected.to contain_keystone_service('cinder_service_v3::volumev3') } + it { is_expected.to contain_keystone_endpoint('RegionOne/cinder_service_v2::volumev2') } + it { is_expected.to contain_keystone_endpoint('RegionOne/cinder_service_v3::volumev3') } end end diff --git a/spec/classes/cinder_nova_spec.rb b/spec/classes/cinder_nova_spec.rb index f46dbe98..e3811b01 100644 --- a/spec/classes/cinder_nova_spec.rb +++ b/spec/classes/cinder_nova_spec.rb @@ -4,26 +4,26 @@ describe 'cinder::nova' do shared_examples 'cinder::nova' do context 'with default parameters' do it { - should contain_cinder_config('nova/region_name').with_value('') - should contain_cinder_config('nova/interface').with_value('') - should contain_cinder_config('nova/token_auth_url').with_value('') - should contain_cinder_config('nova/cafile').with_value('') - should contain_cinder_config('nova/certfile').with_value('') - should contain_cinder_config('nova/keyfile').with_value('') - should contain_cinder_config('nova/insecure').with_value('') - should contain_cinder_config('nova/timeout').with_value('') - should contain_cinder_config('nova/collect_timing').with_value('') - should contain_cinder_config('nova/split_loggers').with_value('') - should contain_cinder_config('nova/auth_type').with_value('') - should contain_cinder_config('nova/auth_section').with_value('') + is_expected.to contain_cinder_config('nova/region_name').with_value('') + is_expected.to contain_cinder_config('nova/interface').with_value('') + is_expected.to contain_cinder_config('nova/token_auth_url').with_value('') + is_expected.to contain_cinder_config('nova/cafile').with_value('') + is_expected.to contain_cinder_config('nova/certfile').with_value('') + is_expected.to contain_cinder_config('nova/keyfile').with_value('') + is_expected.to contain_cinder_config('nova/insecure').with_value('') + is_expected.to contain_cinder_config('nova/timeout').with_value('') + is_expected.to contain_cinder_config('nova/collect_timing').with_value('') + is_expected.to contain_cinder_config('nova/split_loggers').with_value('') + is_expected.to contain_cinder_config('nova/auth_type').with_value('') + is_expected.to contain_cinder_config('nova/auth_section').with_value('') # These should be added only when auth_type is 'password' - should_not contain_cinder_config('nova/auth_url') - should_not contain_cinder_config('nova/username') - should_not contain_cinder_config('nova/user_domain_name') - should_not contain_cinder_config('nova/password') - should_not contain_cinder_config('nova/project_name') - should_not contain_cinder_config('nova/project_domain_name') + is_expected.not_to contain_cinder_config('nova/auth_url') + is_expected.not_to contain_cinder_config('nova/username') + is_expected.not_to contain_cinder_config('nova/user_domain_name') + is_expected.not_to contain_cinder_config('nova/password') + is_expected.not_to contain_cinder_config('nova/project_name') + is_expected.not_to contain_cinder_config('nova/project_domain_name') } end @@ -48,24 +48,24 @@ describe 'cinder::nova' do end it { - should contain_cinder_config('nova/region_name').with_value('RegionOne') - should contain_cinder_config('nova/interface').with_value('internal') - should contain_cinder_config('nova/token_auth_url').with_value('http://127.0.0.1:5000/v3') - should contain_cinder_config('nova/cafile').with_value('/etc/ssl/certs/ca.crt') - should contain_cinder_config('nova/certfile').with_value('/etc/ssl/certs/cert.crt') - should contain_cinder_config('nova/keyfile').with_value('/etc/ssl/private/key.key') - should contain_cinder_config('nova/insecure').with_value(false) - should contain_cinder_config('nova/timeout').with_value(30) - should contain_cinder_config('nova/collect_timing').with_value(true) - should contain_cinder_config('nova/split_loggers').with_value(true) - should contain_cinder_config('nova/auth_type').with_value('password') - should contain_cinder_config('nova/auth_section').with_value('my_section') - should contain_cinder_config('nova/auth_url').with_value('http://127.0.0.2:5000') - should contain_cinder_config('nova/username').with_value('nova') - should contain_cinder_config('nova/user_domain_name').with_value('Default') - should contain_cinder_config('nova/password').with_value('foo') - should contain_cinder_config('nova/project_name').with_value('service') - should contain_cinder_config('nova/project_domain_name').with_value('Default') + is_expected.to contain_cinder_config('nova/region_name').with_value('RegionOne') + is_expected.to contain_cinder_config('nova/interface').with_value('internal') + is_expected.to contain_cinder_config('nova/token_auth_url').with_value('http://127.0.0.1:5000/v3') + is_expected.to contain_cinder_config('nova/cafile').with_value('/etc/ssl/certs/ca.crt') + is_expected.to contain_cinder_config('nova/certfile').with_value('/etc/ssl/certs/cert.crt') + is_expected.to contain_cinder_config('nova/keyfile').with_value('/etc/ssl/private/key.key') + is_expected.to contain_cinder_config('nova/insecure').with_value(false) + is_expected.to contain_cinder_config('nova/timeout').with_value(30) + is_expected.to contain_cinder_config('nova/collect_timing').with_value(true) + is_expected.to contain_cinder_config('nova/split_loggers').with_value(true) + is_expected.to contain_cinder_config('nova/auth_type').with_value('password') + is_expected.to contain_cinder_config('nova/auth_section').with_value('my_section') + is_expected.to contain_cinder_config('nova/auth_url').with_value('http://127.0.0.2:5000') + is_expected.to contain_cinder_config('nova/username').with_value('nova') + is_expected.to contain_cinder_config('nova/user_domain_name').with_value('Default') + is_expected.to contain_cinder_config('nova/password').with_value('foo') + is_expected.to contain_cinder_config('nova/project_name').with_value('service') + is_expected.to contain_cinder_config('nova/project_domain_name').with_value('Default') } end end diff --git a/spec/classes/cinder_scheduler_spec.rb b/spec/classes/cinder_scheduler_spec.rb index bc83d09c..b3f3d9e5 100644 --- a/spec/classes/cinder_scheduler_spec.rb +++ b/spec/classes/cinder_scheduler_spec.rb @@ -3,16 +3,16 @@ require 'spec_helper' describe 'cinder::scheduler' do shared_examples 'cinder::scheduler on Debian' do context 'with default parameters' do - it { should contain_class('cinder::params') } - it { should contain_cinder_config('DEFAULT/scheduler_driver').with_value('') } + it { is_expected.to contain_class('cinder::params') } + it { is_expected.to contain_cinder_config('DEFAULT/scheduler_driver').with_value('') } - it { should contain_package('cinder-scheduler').with( + it { is_expected.to contain_package('cinder-scheduler').with( :name => 'cinder-scheduler', :ensure => 'present', :tag => ['openstack', 'cinder-package'], )} - it { should contain_service('cinder-scheduler').with( + it { is_expected.to contain_service('cinder-scheduler').with( :name => 'cinder-scheduler', :enable => true, :ensure => 'running', @@ -29,8 +29,8 @@ describe 'cinder::scheduler' do } end - it { should contain_cinder_config('DEFAULT/scheduler_driver').with_value('cinder.scheduler.filter_scheduler.FilterScheduler') } - it { should contain_package('cinder-scheduler').with_ensure('present') } + it { is_expected.to contain_cinder_config('DEFAULT/scheduler_driver').with_value('cinder.scheduler.filter_scheduler.FilterScheduler') } + it { is_expected.to contain_package('cinder-scheduler').with_ensure('present') } end context 'with manage_service false' do @@ -40,15 +40,15 @@ describe 'cinder::scheduler' do } end - it { should contain_service('cinder-scheduler').without_ensure } + it { is_expected.to contain_service('cinder-scheduler').without_ensure } end end shared_examples 'cinder::scheduler on RedHat' do context 'with default parameters' do - it { should contain_class('cinder::params') } + it { is_expected.to contain_class('cinder::params') } - it { should contain_service('cinder-scheduler').with( + it { is_expected.to contain_service('cinder-scheduler').with( :name => 'openstack-cinder-scheduler', :enable => true, :ensure => 'running', @@ -62,7 +62,7 @@ describe 'cinder::scheduler' do } end - it { should contain_cinder_config('DEFAULT/scheduler_driver').with_value('cinder.scheduler.filter_scheduler.FilterScheduler') } + it { is_expected.to contain_cinder_config('DEFAULT/scheduler_driver').with_value('cinder.scheduler.filter_scheduler.FilterScheduler') } end end diff --git a/spec/classes/cinder_setup_test_volume_spec.rb b/spec/classes/cinder_setup_test_volume_spec.rb index cc645cc5..a48310f3 100644 --- a/spec/classes/cinder_setup_test_volume_spec.rb +++ b/spec/classes/cinder_setup_test_volume_spec.rb @@ -2,19 +2,19 @@ require 'spec_helper' describe 'cinder::setup_test_volume' do shared_examples 'cinder::setup_test_volume' do - it { should contain_package('lvm2').with_ensure('present') } + it { is_expected.to contain_package('lvm2').with_ensure('present') } - it { should contain_exec('create_/var/lib/cinder/cinder-volumes').with( + it { is_expected.to contain_exec('create_/var/lib/cinder/cinder-volumes').with( :command => 'dd if=/dev/zero of="/var/lib/cinder/cinder-volumes" bs=1 count=0 seek=4G' )} it { - should contain_exec('losetup /dev/loop2 /var/lib/cinder/cinder-volumes') - should contain_exec('pvcreate /dev/loop2') - should contain_exec('vgcreate cinder-volumes /dev/loop2') + is_expected.to contain_exec('losetup /dev/loop2 /var/lib/cinder/cinder-volumes') + is_expected.to contain_exec('pvcreate /dev/loop2') + is_expected.to contain_exec('vgcreate cinder-volumes /dev/loop2') } - it { should contain_file('/var/lib/cinder/cinder-volumes').with_mode('0640') } + it { is_expected.to contain_file('/var/lib/cinder/cinder-volumes').with_mode('0640') } end on_supported_os({ diff --git a/spec/classes/cinder_vmware_spec.rb b/spec/classes/cinder_vmware_spec.rb index 6732e622..b8c7c2d4 100644 --- a/spec/classes/cinder_vmware_spec.rb +++ b/spec/classes/cinder_vmware_spec.rb @@ -3,27 +3,27 @@ require 'spec_helper' describe 'cinder::vmware' do shared_examples 'cinder::vmware' do context 'with defaults' do - it { should contain_cinder_type('vmware-thin').with( + it { is_expected.to contain_cinder_type('vmware-thin').with( :ensure => :present, :properties => ['vmware:vmdk_type=thin'] )} - it { should contain_cinder_type('vmware-thick').with( + it { is_expected.to contain_cinder_type('vmware-thick').with( :ensure => :present, :properties => ['vmware:vmdk_type=thick'] )} - it { should contain_cinder_type('vmware-eagerZeroedThick').with( + it { is_expected.to contain_cinder_type('vmware-eagerZeroedThick').with( :ensure => :present, :properties => ['vmware:vmdk_type=eagerZeroedThick'] )} - it { should contain_cinder_type('vmware-full').with( + it { is_expected.to contain_cinder_type('vmware-full').with( :ensure => :present, :properties => ['vmware:clone_type=full'] )} - it { should contain_cinder_type('vmware-linked').with( + it { is_expected.to contain_cinder_type('vmware-linked').with( :ensure => :present, :properties => ['vmware:clone_type=linked'] )} diff --git a/spec/classes/cinder_volume_spec.rb b/spec/classes/cinder_volume_spec.rb index 95c2c7f2..18aa3f98 100644 --- a/spec/classes/cinder_volume_spec.rb +++ b/spec/classes/cinder_volume_spec.rb @@ -8,15 +8,15 @@ describe 'cinder::volume' do end shared_examples 'cinder::volume' do - it { should contain_service('cinder-volume').with( + it { is_expected.to contain_service('cinder-volume').with( :hasstatus => true, :tag => 'cinder-service', )} - it { should contain_cinder_config('DEFAULT/cluster').with_value('') } - it { should contain_cinder_config('DEFAULT/volume_clear').with_value('') } - it { should contain_cinder_config('DEFAULT/volume_clear_size').with_value('') } - it { should contain_cinder_config('DEFAULT/volume_clear_ionice').with_value('') } + it { is_expected.to contain_cinder_config('DEFAULT/cluster').with_value('') } + it { is_expected.to contain_cinder_config('DEFAULT/volume_clear').with_value('') } + it { is_expected.to contain_cinder_config('DEFAULT/volume_clear_size').with_value('') } + it { is_expected.to contain_cinder_config('DEFAULT/volume_clear_ionice').with_value('') } context 'with manage_service false' do let :params do @@ -25,7 +25,7 @@ describe 'cinder::volume' do } end - it { should contain_service('cinder-volume').without_ensure } + it { is_expected.to contain_service('cinder-volume').without_ensure } end context 'with volume_clear parameters' do @@ -38,9 +38,9 @@ describe 'cinder::volume' do end it { - should contain_cinder_config('DEFAULT/volume_clear').with_value('none') - should contain_cinder_config('DEFAULT/volume_clear_size').with_value('10') - should contain_cinder_config('DEFAULT/volume_clear_ionice').with_value('-c3') + is_expected.to contain_cinder_config('DEFAULT/volume_clear').with_value('none') + is_expected.to contain_cinder_config('DEFAULT/volume_clear_size').with_value('10') + is_expected.to contain_cinder_config('DEFAULT/volume_clear_ionice').with_value('-c3') } end @@ -52,13 +52,13 @@ describe 'cinder::volume' do end it { - should contain_cinder_config('DEFAULT/cluster').with_value('my_cluster') + is_expected.to contain_cinder_config('DEFAULT/cluster').with_value('my_cluster') } end end shared_examples 'cinder::volume on Debian' do - it { should contain_package('cinder-volume').with_ensure('present') } + it { is_expected.to contain_package('cinder-volume').with_ensure('present') } end on_supported_os({