From f95c8214062baeb330378dab1351a80b2c189668 Mon Sep 17 00:00:00 2001 From: Darren Birkett Date: Mon, 28 Apr 2014 13:41:09 +0100 Subject: [PATCH] Move all cinder-common tests into cinder-common_spec The cinder.conf template resource exists in the cinder-common recipe, and therefore all tests for that template should sit in the cinder-common_spec Also, this removes a duplicated test that was in both (syslog config) Change-Id: I00add345d961eb4502ec9dc9a3b8e7b29096ff7c --- spec/api_spec.rb | 40 -------------------------------------- spec/cinder_common_spec.rb | 24 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 40 deletions(-) diff --git a/spec/api_spec.rb b/spec/api_spec.rb index 191c65f..a8dfb49 100644 --- a/spec/api_spec.rb +++ b/spec/api_spec.rb @@ -48,46 +48,6 @@ describe 'openstack-block-storage::api' do end end - describe 'cinder.conf' do - let(:file) { chef_run.template('/etc/cinder/cinder.conf') } - - it 'runs logging recipe if node attributes say to' do - node.set['openstack']['block-storage']['syslog']['use'] = true - - expect(chef_run).to render_file(file.name).with_content('log_config = /etc/openstack/logging.conf') - end - - context 'rdb driver' do - before do - node.set['openstack']['block-storage']['volume'] = { - 'driver' => 'cinder.volume.drivers.rbd.RBDDriver' - } - end - - # FIXME(galstrom21): this block needs to check all of the default - # rdb_* configuration options - it 'has default rbd_* options set' do - expect(chef_run).to render_file(file.name).with_content(/^rbd_/) - expect(chef_run).not_to render_file(file.name).with_content(/^netapp_/) - end - end - - context 'netapp driver' do - before do - node.set['openstack']['block-storage']['volume'] = { - 'driver' => 'cinder.volume.drivers.netapp.NetAppISCSIDriver' - } - end - - # FIXME(galstrom21): this block needs to check all of the default - # netapp_* configuration options - it 'has default netapp_* options set' do - expect(chef_run).to render_file(file.name).with_content(/^netapp_/) - expect(chef_run).not_to render_file(file.name).with_content(/^rbd_/) - end - end - end - it 'runs db migrations' do expect(chef_run).to run_execute('cinder-manage db sync') end diff --git a/spec/cinder_common_spec.rb b/spec/cinder_common_spec.rb index 99429f1..f162560 100644 --- a/spec/cinder_common_spec.rb +++ b/spec/cinder_common_spec.rb @@ -74,6 +74,30 @@ describe 'openstack-block-storage::cinder-common' do end end + context 'rdb driver' do + # FIXME(galstrom21): this block needs to check all of the default + # rdb_* configuration options + it 'has default rbd_* options set' do + node.set['openstack']['block-storage']['volume'] = { + 'driver' => 'cinder.volume.drivers.rbd.RBDDriver' + } + expect(chef_run).to render_file(file.name).with_content(/^rbd_/) + expect(chef_run).not_to render_file(file.name).with_content(/^netapp_/) + end + end + + context 'netapp driver' do + # FIXME(galstrom21): this block needs to check all of the default + # netapp_* configuration options + it 'has default netapp_* options set' do + node.set['openstack']['block-storage']['volume'] = { + 'driver' => 'cinder.volume.drivers.netapp.NetAppISCSIDriver' + } + expect(chef_run).to render_file(file.name).with_content(/^netapp_/) + expect(chef_run).not_to render_file(file.name).with_content(/^rbd_/) + end + end + context 'syslog use' do it 'sets the log_config value when syslog is in use' do node.set['openstack']['block-storage']['syslog']['use'] = true