Remove redundantly tested code
Remove code that is redundantly tested. This should not be tested here but in puppet-oslo where this logic resides. If we keep this and we do changes in puppet-oslo we will break these unit tests, this is something we need to sort out for all modules. Change-Id: I0802fdd41954034270f4c67754891a82eb39ef5b
This commit is contained in:
parent
9c74563d67
commit
c6e7817053
@ -14,7 +14,6 @@ describe 'neutron::db' do
|
|||||||
:max_overflow => '<SERVICE DEFAULT>',
|
:max_overflow => '<SERVICE DEFAULT>',
|
||||||
:pool_timeout => '<SERVICE DEFAULT>',
|
:pool_timeout => '<SERVICE DEFAULT>',
|
||||||
)}
|
)}
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with specific parameters' do
|
context 'with specific parameters' do
|
||||||
@ -43,55 +42,6 @@ describe 'neutron::db' do
|
|||||||
:max_overflow => '21',
|
:max_overflow => '21',
|
||||||
:pool_timeout => '21',
|
:pool_timeout => '21',
|
||||||
)}
|
)}
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'with MySQL-python library as backend package' do
|
|
||||||
let :params do
|
|
||||||
{ :database_connection => 'mysql+pymysql://neutron:neutron@localhost/neutron' }
|
|
||||||
end
|
|
||||||
|
|
||||||
it { should contain_oslo__db('neutron_config').with(
|
|
||||||
:connection => 'mysql+pymysql://neutron:neutron@localhost/neutron',
|
|
||||||
)}
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'with postgresql backend' do
|
|
||||||
let :params do
|
|
||||||
{ :database_connection => 'postgresql://neutron:neutron@localhost/neutron', }
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'install the proper backend package' do
|
|
||||||
should contain_package('python-psycopg2').with(:ensure => 'present')
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'with incorrect database_connection string' do
|
|
||||||
let :params do
|
|
||||||
{ :database_connection => 'redis://neutron:neutron@localhost/neutron', }
|
|
||||||
end
|
|
||||||
|
|
||||||
it { should raise_error(Puppet::Error, /validate_re/) }
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'with incorrect database_connection string' do
|
|
||||||
let :params do
|
|
||||||
{ :database_connection => 'foo+pymysql://neutron:neutron@localhost/neutron', }
|
|
||||||
end
|
|
||||||
|
|
||||||
it { should raise_error(Puppet::Error, /validate_re/) }
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
shared_examples 'neutron::db on Debian' do
|
|
||||||
context 'using pymysql driver' do
|
|
||||||
let :params do
|
|
||||||
{ :database_connection => 'mysql+pymysql://neutron:neutron@localhost/neutron' }
|
|
||||||
end
|
|
||||||
|
|
||||||
it { should contain_package('python-pymysql').with({ :ensure => 'present', :name => 'python-pymysql' }) }
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -104,10 +54,6 @@ describe 'neutron::db' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it_behaves_like 'neutron::db'
|
it_behaves_like 'neutron::db'
|
||||||
|
|
||||||
if facts[:osfamily] == 'Debian'
|
|
||||||
it_behaves_like 'neutron::db on Debian'
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user