summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorMin Min Ren <rminmin@cn.ibm.com>2015-08-28 08:34:39 +0800
committerMin Min Ren <rminmin@cn.ibm.com>2015-08-28 13:36:33 +0800
commit528cb177f677aa61191011bf7e4bd7869f9d7387 (patch)
tree7854bc48c55ecc025f894ffc7b38eb49ad50dfe3 /spec
parentea2fbba04a53cc38201a5db92491dc4d45150aac (diff)
Add database slave connection configure
- According to the bool attribute node['openstack']['endpoints']['db']['enabled_slave'], enable/disable nova database slave_connection - Add the slave_connection generated from db_uri function Implements: blueprint sql-slave-connection-support Change-Id: I9520441952993e8c6b4205e6886778815b5a2e4b
Notes
Notes (review): Verified+2: Jenkins Code-Review+2: Mark Vanderwiel <vanderwl@us.ibm.com> Code-Review+2: Zhiwei Chen <zhiwchen@cn.ibm.com> Workflow+1: Zhiwei Chen <zhiwchen@cn.ibm.com> Submitted-by: Jenkins Submitted-at: Wed, 02 Sep 2015 07:38:03 +0000 Reviewed-on: https://review.openstack.org/217989 Project: openstack/cookbook-openstack-block-storage Branch: refs/heads/master
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