summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2015-09-02 07:38:03 +0000
committerGerrit Code Review <review@openstack.org>2015-09-02 07:38:03 +0000
commitd921c1fdd97e9dbaf64ad651c3b9db76fe7668ff (patch)
tree7d1fbc21f699992793973f1d5e4ff23f74ca4e09 /spec
parentb2b093cc3bde6989f686995eb4a0058e3ed66163 (diff)
parent528cb177f677aa61191011bf7e4bd7869f9d7387 (diff)
Merge "Add database slave connection configure"
Diffstat (limited to 'spec')
-rw-r--r--spec/cinder_common_spec.rb16
1 files changed, 15 insertions, 1 deletions
diff --git a/spec/cinder_common_spec.rb b/spec/cinder_common_spec.rb
index dacc1e0..40c928f 100644
--- a/spec/cinder_common_spec.rb
+++ b/spec/cinder_common_spec.rb
@@ -275,11 +275,25 @@ describe 'openstack-block-storage::cinder-common' do
275 end 275 end
276 276
277 it 'has a db connection attribute' do 277 it 'has a db connection attribute' do
278 node.set['openstack']['endpoints']['db']['enabled_slave'] = false
278 allow_any_instance_of(Chef::Recipe).to receive(:db_uri) 279 allow_any_instance_of(Chef::Recipe).to receive(:db_uri)
279 .with('block-storage', anything, '').and_return('sql_connection_value') 280 .and_return('sql_connection_value')
280 281
281 expect(chef_run).to render_config_file(file.name) 282 expect(chef_run).to render_config_file(file.name)
282 .with_section_content('database', /^connection=sql_connection_value$/) 283 .with_section_content('database', /^connection=sql_connection_value$/)
284 expect(chef_run).to_not render_config_file(file.name)
285 .with_section_content('database', /^slave_connection=sql_connection_value$/)
286 end
287
288 it 'has a slave db connection attribute' do
289 node.set['openstack']['endpoints']['db']['enabled_slave'] = true
290 allow_any_instance_of(Chef::Recipe).to receive(:db_uri)
291 .and_return('sql_connection_value')
292
293 expect(chef_run).to render_config_file(file.name)
294 .with_section_content('database', /^connection=sql_connection_value$/)
295 expect(chef_run).to render_config_file(file.name)
296 .with_section_content('database', /^slave_connection=sql_connection_value$/)
283 end 297 end
284 298
285 it 'has a db backend attribute' do 299 it 'has a db backend attribute' do