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: I2d049160ba010331330bc9026819299096f12b7f
This commit is contained in:
Tobias Urdin 2019-01-18 10:11:13 +01:00
parent 9612852390
commit c366d5d6ba
1 changed files with 4 additions and 65 deletions

View File

@ -3,6 +3,8 @@ require 'spec_helper'
describe 'cinder::db' do
shared_examples 'cinder::db' do
context 'with default parameters' do
it { should contain_class('cinder::deps') }
it { should contain_oslo__db('cinder_config').with(
:db_max_retries => '<SERVICE DEFAULT>',
:connection => 'sqlite:////var/lib/cinder/cinder.sqlite',
@ -31,6 +33,8 @@ describe 'cinder::db' do
}
end
it { should contain_class('cinder::deps') }
it { should contain_oslo__db('cinder_config').with(
:db_max_retries => '-1',
:connection => 'mysql+pymysql://cinder:cinder@localhost/cinder',
@ -43,70 +47,6 @@ describe 'cinder::db' do
:pool_timeout => '21',
)}
end
context 'with postgresql backend' do
let :params do
{
:database_connection => 'postgresql://cinder:cinder@localhost/cinder'
}
end
it { should contain_package('python-psycopg2').with(:ensure => 'present') }
end
context 'with MySQL-python library as backend package' do
let :params do
{
:database_connection => 'mysql+pymysql://cinder:cinder@localhost/cinder'
}
end
it { should contain_package('python-mysqldb').with(:ensure => 'present') }
end
context 'with incorrect database_connection string' do
let :params do
{
:database_connection => 'redis://cinder:cinder@localhost/cinder'
}
end
it { should raise_error(Puppet::Error, /validate_re/) }
end
context 'with incorrect pymysql database_connection string' do
let :params do
{
:database_connection => 'foo+pymysql://cinder:cinder@localhost/cinder'
}
end
it { should raise_error(Puppet::Error, /validate_re/) }
end
end
shared_examples 'cinder::db on Debian' do
let :params do
{
:database_connection => 'mysql+pymysql://cinder:cinder@localhost/cinder'
}
end
it { should contain_package('python-pymysql').with(
:ensure => 'present',
:name => 'python-pymysql',
:tag => 'openstack'
)}
end
shared_examples 'cinder::db on RedHat' do
let :params do
{
:database_connection => 'mysql+pymysql://cinder:cinder@localhost/cinder'
}
end
it { should_not contain_package('python-pymysql') }
end
on_supported_os({
@ -118,7 +58,6 @@ describe 'cinder::db' do
end
it_behaves_like 'cinder::db'
it_behaves_like "cinder::db on #{facts[:osfamily]}"
end
end
end