From edea0a06a5b50f5d2c388f5343a737d2840e67f3 Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Tue, 15 Apr 2014 09:46:15 +0200 Subject: [PATCH] RBD cleanup Signed-off-by: Emilien Macchi --- .fixtures.yml | 2 +- Puppetfile | 2 +- spec/classes/cloud_volume_storage_spec.rb | 96 +++++++++++------------ 3 files changed, 49 insertions(+), 51 deletions(-) diff --git a/.fixtures.yml b/.fixtures.yml index 99906c03..08ab1f87 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -2,7 +2,7 @@ fixtures: repositories: 'cinder': repo: 'git://github.com/enovance/puppet-cinder' - ref: 'd92b38a8c7bb484e935ed21510843ef6be8e31d3' + ref: 'bd1536626f2b5d66f9ea77bcd69ba7d1f5f33961' 'keystone': repo: 'git://github.com/enovance/puppet-keystone.git' ref: '9802add6566646dc1e4a2812d19c2ab4724ff594' diff --git a/Puppetfile b/Puppetfile index 7fcd59ca..e59f0851 100644 --- a/Puppetfile +++ b/Puppetfile @@ -22,7 +22,7 @@ mod 'ceilometer', :ref => 'f71f935a3e41dcd11f8f5986a1fe0708b124e589' mod 'cinder', :git => 'git://github.com/enovance/puppet-cinder.git', - :ref => 'd92b38a8c7bb484e935ed21510843ef6be8e31d3' + :ref => 'bd1536626f2b5d66f9ea77bcd69ba7d1f5f33961' mod 'glance', :git => 'git://github.com/enovance/puppet-glance.git', :ref => '001f1b6a8ef6bd0fde8fbe0a4b3362f31e6bbcda' diff --git a/spec/classes/cloud_volume_storage_spec.rb b/spec/classes/cloud_volume_storage_spec.rb index 6d1fe444..637437d2 100644 --- a/spec/classes/cloud_volume_storage_spec.rb +++ b/spec/classes/cloud_volume_storage_spec.rb @@ -123,55 +123,53 @@ describe 'cloud::volume::storage' do end end -# This context can't work now, because of https://bugs.launchpad.net/puppet-cinder/+bug/1294138 -# context 'with two RBD backends' do -# before :each do -# params.merge!( -# :cinder_backends => { -# 'rbd' => { -# 'lowcost' => { -# 'rbd_pool' => 'low', -# 'rbd_user' => 'cinder', -# 'rbd_secret_uuid' => 'secret', -# }, -# 'normal' => { -# 'rbd_pool' => 'normal', -# 'rbd_user' => 'cinder', -# 'rbd_secret_uuid' => 'secret', -# } -# } -# } -# ) -# 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__type('lowcost').with( -# :set_key => 'volume_backend_name', -# :set_value => 'lowcost', -# :os_tenant_name => 'services', -# :os_username => 'cinder', -# :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__type('normal').with( -# :set_key => 'volume_backend_name', -# :set_value => 'normal', -# :os_tenant_name => 'services', -# :os_username => 'cinder', -# :os_password => 'secret', -# :os_auth_url => 'http://keystone.host:5000/v2.0' -# ) -# end -# end + context 'with two RBD backends' do + before :each do + params.merge!( + :cinder_backends => { + 'rbd' => { + 'lowcost' => { + 'rbd_pool' => 'low', + 'rbd_user' => 'cinder', + 'rbd_secret_uuid' => 'secret', + }, + 'normal' => { + 'rbd_pool' => 'normal', + 'rbd_user' => 'cinder', + 'rbd_secret_uuid' => 'secret', + } + } + } + ) + 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__type('lowcost').with( + :set_key => 'volume_backend_name', + :set_value => 'lowcost', + :os_tenant_name => 'services', + :os_username => 'cinder', + :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__type('normal').with( + :set_key => 'volume_backend_name', + :set_value => 'normal', + :os_tenant_name => 'services', + :os_username => 'cinder', + :os_password => 'secret', + :os_auth_url => 'http://keystone.host:5000/v2.0' + ) + end + end context 'with all backends enabled' do it 'configure all cinder backends' do