CentOS 9: Disable unit tests dependent on puppet-postgresql
The puppt-postgresql module does not support CentOS 9 yet and requires some version parameters to be run on CentOS 9. This change disables unit tests requiring that module, until the module supports CentOS 9. Change-Id: I81ed92c6027778cf374a210d383cce8a62fec8c3
This commit is contained in:
@@ -122,6 +122,24 @@ describe 'oslo::db' do
|
|||||||
it { is_expected.to contain_keystone_config('database/connection').with_value('mysql+pymysql://db:db@localhost/db').with_secret(true) }
|
it { is_expected.to contain_keystone_config('database/connection').with_value('mysql+pymysql://db:db@localhost/db').with_secret(true) }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'with incorrect database_connection string' do
|
||||||
|
let :params do
|
||||||
|
{ :connection => 'foo://db:db@localhost/db', }
|
||||||
|
end
|
||||||
|
|
||||||
|
it { should raise_error(Puppet::Error) }
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'with incorrect pymysql database_connection string' do
|
||||||
|
let :params do
|
||||||
|
{ :connection => 'foo+pymysql://db:db@localhost/db', }
|
||||||
|
end
|
||||||
|
|
||||||
|
it { should raise_error(Puppet::Error) }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
shared_examples 'oslo-db with postgresql' do
|
||||||
context 'with postgresql backend' do
|
context 'with postgresql backend' do
|
||||||
let :params do
|
let :params do
|
||||||
{ :connection => 'postgresql://db:db@localhost/db', }
|
{ :connection => 'postgresql://db:db@localhost/db', }
|
||||||
@@ -151,22 +169,6 @@ describe 'oslo::db' do
|
|||||||
|
|
||||||
it { is_expected.to contain_keystone_config('database/connection').with_value('postgresql+psycopg2://db:db@localhost/db').with_secret(true) }
|
it { is_expected.to contain_keystone_config('database/connection').with_value('postgresql+psycopg2://db:db@localhost/db').with_secret(true) }
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with incorrect database_connection string' do
|
|
||||||
let :params do
|
|
||||||
{ :connection => 'foo://db:db@localhost/db', }
|
|
||||||
end
|
|
||||||
|
|
||||||
it { should raise_error(Puppet::Error) }
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'with incorrect pymysql database_connection string' do
|
|
||||||
let :params do
|
|
||||||
{ :connection => 'foo+pymysql://db:db@localhost/db', }
|
|
||||||
end
|
|
||||||
|
|
||||||
it { should raise_error(Puppet::Error) }
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
shared_examples 'oslo-db on Debian' do
|
shared_examples 'oslo-db on Debian' do
|
||||||
@@ -257,6 +259,10 @@ describe 'oslo::db' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it_behaves_like 'oslo-db'
|
it_behaves_like 'oslo-db'
|
||||||
|
# TODO(tkajinam): Remove this once puppet-postgresql supports CentOS 9
|
||||||
|
unless facts[:osfamily] == 'RedHat' and facts[:operatingsystemmajrelease].to_i >= 9
|
||||||
|
it_behaves_like 'oslo-db with postgresql'
|
||||||
|
end
|
||||||
it_behaves_like "oslo-db on #{facts[:osfamily]}"
|
it_behaves_like "oslo-db on #{facts[:osfamily]}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user