summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorwenchma <wenchma@cn.ibm.com>2015-04-10 11:33:00 +0800
committerwenchma <wenchma@cn.ibm.com>2015-04-23 18:11:06 +0800
commit226d27a12db4c347991080cec55d410edbc3a67a (patch)
treef8bc4316ef3f55a7529df5b852d574a7cd11af7c /spec
parent6b59429a66a846535d960d8de7f855623a23ed81 (diff)
Update the deprecated group/name to Kilo release
For Kilo release, there are many deprecated group/name in conf files of openstack, so we need to change the deprecated group/name to new group/name. blueprint conf-section-update-for-kilo Closes-bug: #1436170 Change-Id: Iec23f1b98fbf0c0772df7aba6ece9e0b32a85dc1
Notes
Notes (review): Verified+2: Jenkins Code-Review+2: Mark Vanderwiel <vanderwl@us.ibm.com> Workflow+1: Mark Vanderwiel <vanderwl@us.ibm.com> Code-Review+2: Zhiwei Chen <zhiwchen@cn.ibm.com> Submitted-by: Jenkins Submitted-at: Thu, 23 Apr 2015 15:07:48 +0000 Reviewed-on: https://review.openstack.org/172296 Project: stackforge/cookbook-openstack-block-storage Branch: refs/heads/master
Diffstat (limited to 'spec')
-rw-r--r--spec/cinder_common_spec.rb72
1 files changed, 50 insertions, 22 deletions
diff --git a/spec/cinder_common_spec.rb b/spec/cinder_common_spec.rb
index 95e3cf2..9d0c96e 100644
--- a/spec/cinder_common_spec.rb
+++ b/spec/cinder_common_spec.rb
@@ -167,7 +167,7 @@ describe 'openstack-block-storage::cinder-common' do
167 context 'template contents' do 167 context 'template contents' do
168 168
169 context 'commonly named attributes' do 169 context 'commonly named attributes' do
170 %w(debug verbose lock_path notification_driver 170 %w(debug verbose notification_driver
171 storage_availability_zone quota_volumes quota_gigabytes quota_driver 171 storage_availability_zone quota_volumes quota_gigabytes quota_driver
172 volume_name_template snapshot_name_template osapi_volume_workers 172 volume_name_template snapshot_name_template osapi_volume_workers
173 use_default_quota_class quota_snapshots no_snapshot_gb_quota 173 use_default_quota_class quota_snapshots no_snapshot_gb_quota
@@ -192,6 +192,10 @@ describe 'openstack-block-storage::cinder-common' do
192 end 192 end
193 end 193 end
194 194
195 it 'has a lock_path attribute' do
196 expect(chef_run).to render_config_file(file.name).with_section_content('oslo_concurrency', %r(^lock_path=/var/lock/cinder$))
197 end
198
195 context 'netapp driver' do 199 context 'netapp driver' do
196 # FIXME(galstrom21): this block needs to check all of the default 200 # FIXME(galstrom21): this block needs to check all of the default
197 # netapp_* configuration options 201 # netapp_* configuration options
@@ -220,12 +224,16 @@ describe 'openstack-block-storage::cinder-common' do
220 end 224 end
221 end 225 end
222 226
223 it 'has a sql_connection attribute' do 227 it 'has a db connection attribute' do
224 allow_any_instance_of(Chef::Recipe).to receive(:db_uri) 228 allow_any_instance_of(Chef::Recipe).to receive(:db_uri)
225 .with('block-storage', anything, '').and_return('sql_connection_value') 229 .with('block-storage', anything, '').and_return('sql_connection_value')
226 230
227 expect(chef_run).to render_file(file.name) 231 expect(chef_run).to render_config_file(file.name)
228 .with_content(/^sql_connection=sql_connection_value$/) 232 .with_section_content('database', /^connection=sql_connection_value$/)
233 end
234
235 it 'has a db backend attribute' do
236 expect(chef_run).to render_config_file(file.name).with_section_content('database', /^backend=sqlalchemy$/)
229 end 237 end
230 238
231 it 'has a volume_driver attribute' do 239 it 'has a volume_driver attribute' do
@@ -287,6 +295,13 @@ describe 'openstack-block-storage::cinder-common' do
287 it 'has osapi_volume_listen_port set' do 295 it 'has osapi_volume_listen_port set' do
288 expect(chef_run).to render_file(file.name).with_content(/^osapi_volume_listen_port=8776$/) 296 expect(chef_run).to render_file(file.name).with_content(/^osapi_volume_listen_port=8776$/)
289 end 297 end
298
299 it 'has default api version set' do
300 [/^enable_v1_api=false$/,
301 /^enable_v2_api=true$/].each do |line|
302 expect(chef_run).to render_config_file(file.name).with_section_content('DEFAULT', line)
303 end
304 end
290 end 305 end
291 306
292 it 'has a rpc_backend attribute' do 307 it 'has a rpc_backend attribute' do
@@ -297,10 +312,7 @@ describe 'openstack-block-storage::cinder-common' do
297 it 'has default RPC/AMQP options set' do 312 it 'has default RPC/AMQP options set' do
298 [/^rpc_backend=cinder.openstack.common.rpc.impl_kombu$/, 313 [/^rpc_backend=cinder.openstack.common.rpc.impl_kombu$/,
299 /^rpc_thread_pool_size=64$/, 314 /^rpc_thread_pool_size=64$/,
300 /^rpc_conn_pool_size=30$/, 315 /^rpc_response_timeout=60$/].each do |line|
301 /^rpc_response_timeout=60$/,
302 /^amqp_durable_queues=false$/,
303 /^amqp_auto_delete=false$/].each do |line|
304 expect(chef_run).to render_file(file.name).with_content(line) 316 expect(chef_run).to render_file(file.name).with_content(line)
305 end 317 end
306 end 318 end
@@ -310,6 +322,14 @@ describe 'openstack-block-storage::cinder-common' do
310 node.set['openstack']['mq']['block-storage']['service_type'] = 'rabbitmq' 322 node.set['openstack']['mq']['block-storage']['service_type'] = 'rabbitmq'
311 end 323 end
312 324
325 it 'has default RPC/AMQP options set' do
326 [/^rpc_conn_pool_size=30$/,
327 /^amqp_durable_queues=false$/,
328 /^amqp_auto_delete=false$/].each do |line|
329 expect(chef_run).to render_config_file(file.name).with_section_content('oslo_messaging_rabbit', line)
330 end
331 end
332
313 context 'ha attributes' do 333 context 'ha attributes' do
314 before do 334 before do
315 node.set['openstack']['mq']['block-storage']['rabbit']['ha'] = true 335 node.set['openstack']['mq']['block-storage']['rabbit']['ha'] = true
@@ -319,12 +339,12 @@ describe 'openstack-block-storage::cinder-common' do
319 allow_any_instance_of(Chef::Recipe).to receive(:rabbit_servers) 339 allow_any_instance_of(Chef::Recipe).to receive(:rabbit_servers)
320 .and_return('rabbit_servers_value') 340 .and_return('rabbit_servers_value')
321 341
322 expect(chef_run).to render_file(file.name).with_content(/^rabbit_hosts=rabbit_servers_value$/) 342 expect(chef_run).to render_config_file(file.name).with_section_content('oslo_messaging_rabbit', /^rabbit_hosts=rabbit_servers_value$/)
323 end 343 end
324 344
325 %w(host port).each do |attr| 345 %w(host port).each do |attr|
326 it "does not have rabbit_#{attr} attribute" do 346 it "does not have rabbit_#{attr} attribute" do
327 expect(chef_run).not_to render_file(file.name).with_content(/^rabbit_#{attr}=/) 347 expect(chef_run).not_to render_config_file(file.name).with_section_content('oslo_messaging_rabbit', /^rabbit_#{attr}=/)
328 end 348 end
329 end 349 end
330 end 350 end
@@ -337,40 +357,40 @@ describe 'openstack-block-storage::cinder-common' do
337 %w(host port).each do |attr| 357 %w(host port).each do |attr|
338 it "has rabbit_#{attr} attribute" do 358 it "has rabbit_#{attr} attribute" do
339 node.set['openstack']['mq']['block-storage']['rabbit'][attr] = "rabbit_#{attr}_value" 359 node.set['openstack']['mq']['block-storage']['rabbit'][attr] = "rabbit_#{attr}_value"
340 expect(chef_run).to render_file(file.name).with_content(/^rabbit_#{attr}=rabbit_#{attr}_value$/) 360 expect(chef_run).to render_config_file(file.name).with_section_content('oslo_messaging_rabbit', /^rabbit_#{attr}=rabbit_#{attr}_value$/)
341 end 361 end
342 end 362 end
343 363
344 it 'does not have a rabbit_hosts attribute' do 364 it 'does not have a rabbit_hosts attribute' do
345 expect(chef_run).not_to render_file(file.name).with_content(/^rabbit_hosts=/) 365 expect(chef_run).not_to render_config_file(file.name).with_section_content('oslo_messaging_rabbit', /^rabbit_hosts=/)
346 end 366 end
347 end 367 end
348 368
349 %w(use_ssl userid).each do |attr| 369 %w(use_ssl userid).each do |attr|
350 it "has rabbit_#{attr}" do 370 it "has rabbit_#{attr}" do
351 node.set['openstack']['mq']['block-storage']['rabbit'][attr] = "rabbit_#{attr}_value" 371 node.set['openstack']['mq']['block-storage']['rabbit'][attr] = "rabbit_#{attr}_value"
352 expect(chef_run).to render_file(file.name).with_content(/^rabbit_#{attr}=rabbit_#{attr}_value$/) 372 expect(chef_run).to render_config_file(file.name).with_section_content('oslo_messaging_rabbit', /^rabbit_#{attr}=rabbit_#{attr}_value$/)
353 end 373 end
354 end 374 end
355 375
356 it 'has rabbit_password' do 376 it 'has rabbit_password' do
357 expect(chef_run).to render_file(file.name).with_content(/^rabbit_password=#{test_pass}$/) 377 expect(chef_run).to render_config_file(file.name).with_section_content('oslo_messaging_rabbit', /^rabbit_password=#{test_pass}$/)
358 end 378 end
359 379
360 it 'has rabbit_virtual_host' do 380 it 'has rabbit_virtual_host' do
361 node.set['openstack']['mq']['block-storage']['rabbit']['vhost'] = 'vhost_value' 381 node.set['openstack']['mq']['block-storage']['rabbit']['vhost'] = 'vhost_value'
362 expect(chef_run).to render_file(file.name).with_content(/^rabbit_virtual_host=vhost_value$/) 382 expect(chef_run).to render_config_file(file.name).with_section_content('oslo_messaging_rabbit', /^rabbit_virtual_host=vhost_value$/)
363 end 383 end
364 384
365 it 'does not have kombu ssl version set' do 385 it 'does not have kombu ssl version set' do
366 expect(chef_run).not_to render_config_file(file.name).with_section_content('DEFAULT', /^kombu_ssl_version=TLSv1.2$/) 386 expect(chef_run).not_to render_config_file(file.name).with_section_content('oslo_messaging_rabbit', /^kombu_ssl_version=TLSv1.2$/)
367 end 387 end
368 388
369 it 'sets kombu ssl version' do 389 it 'sets kombu ssl version' do
370 node.set['openstack']['mq']['block-storage']['rabbit']['use_ssl'] = true 390 node.set['openstack']['mq']['block-storage']['rabbit']['use_ssl'] = true
371 node.set['openstack']['mq']['block-storage']['rabbit']['kombu_ssl_version'] = 'TLSv1.2' 391 node.set['openstack']['mq']['block-storage']['rabbit']['kombu_ssl_version'] = 'TLSv1.2'
372 392
373 expect(chef_run).to render_config_file(file.name).with_section_content('DEFAULT', /^kombu_ssl_version=TLSv1.2$/) 393 expect(chef_run).to render_config_file(file.name).with_section_content('oslo_messaging_rabbit', /^kombu_ssl_version=TLSv1.2$/)
374 end 394 end
375 end 395 end
376 396
@@ -379,31 +399,39 @@ describe 'openstack-block-storage::cinder-common' do
379 node.set['openstack']['mq']['block-storage']['service_type'] = 'qpid' 399 node.set['openstack']['mq']['block-storage']['service_type'] = 'qpid'
380 end 400 end
381 401
402 it 'has default RPC/AMQP options set' do
403 [/^rpc_conn_pool_size=30$/,
404 /^amqp_durable_queues=false$/,
405 /^amqp_auto_delete=false$/].each do |line|
406 expect(chef_run).to render_config_file(file.name).with_section_content('oslo_messaging_qpid', line)
407 end
408 end
409
382 %w(port username sasl_mechanisms reconnect reconnect_timeout reconnect_limit 410 %w(port username sasl_mechanisms reconnect reconnect_timeout reconnect_limit
383 reconnect_interval_min reconnect_interval_max reconnect_interval heartbeat protocol 411 reconnect_interval_min reconnect_interval_max reconnect_interval heartbeat protocol
384 tcp_nodelay).each do |attr| 412 tcp_nodelay).each do |attr|
385 it "has qpid_#{attr} attribute" do 413 it "has qpid_#{attr} attribute" do
386 node.set['openstack']['mq']['block-storage']['qpid'][attr] = "qpid_#{attr}_value" 414 node.set['openstack']['mq']['block-storage']['qpid'][attr] = "qpid_#{attr}_value"
387 expect(chef_run).to render_file(file.name).with_content(/^qpid_#{attr}=qpid_#{attr}_value$/) 415 expect(chef_run).to render_config_file(file.name).with_section_content('oslo_messaging_qpid', /^qpid_#{attr}=qpid_#{attr}_value$/)
388 end 416 end
389 end 417 end
390 418
391 it 'has qpid_hostname' do 419 it 'has qpid_hostname' do
392 node.set['openstack']['mq']['block-storage']['qpid']['host'] = 'qpid_host_value' 420 node.set['openstack']['mq']['block-storage']['qpid']['host'] = 'qpid_host_value'
393 expect(chef_run).to render_file(file.name).with_content(/^qpid_hostname=qpid_host_value$/) 421 expect(chef_run).to render_config_file(file.name).with_section_content('oslo_messaging_qpid', /^qpid_hostname=qpid_host_value$/)
394 end 422 end
395 423
396 it 'has qpid_password' do 424 it 'has qpid_password' do
397 expect(chef_run).to render_file(file.name).with_content(/^qpid_password=#{test_pass}$/) 425 expect(chef_run).to render_config_file(file.name).with_section_content('oslo_messaging_qpid', /^qpid_password=#{test_pass}$/)
398 end 426 end
399 427
400 it 'has default qpid topology version' do 428 it 'has default qpid topology version' do
401 expect(chef_run).to render_file(file.name).with_content(/^qpid_topology_version=1$/) 429 expect(chef_run).to render_config_file(file.name).with_section_content('oslo_messaging_qpid', /^qpid_topology_version=1$/)
402 end 430 end
403 431
404 it 'has qpid notification_topics' do 432 it 'has qpid notification_topics' do
405 node.set['openstack']['mq']['block-storage']['qpid']['notification_topic'] = 'qpid_notification_topic_value' 433 node.set['openstack']['mq']['block-storage']['qpid']['notification_topic'] = 'qpid_notification_topic_value'
406 expect(chef_run).to render_file(file.name).with_content(/^notification_topics=qpid_notification_topic_value$/) 434 expect(chef_run).to render_config_file(file.name).with_section_content('oslo_messaging_qpid', /^notification_topics=qpid_notification_topic_value$/)
407 end 435 end
408 end 436 end
409 437