Fix broken unit tests with puppetlabs-postgresql >= v9.2.0
The default password encryption in Ubuntu 22.04 has been changed from
md5 to scram-sha-256 by [1].
[1] 985309e2df
Change-Id: I7f1218a3dc1377305b5eb7296b3ef03645f6a085
This commit is contained in:
parent
4dc548c81b
commit
6adbd49b9f
@ -19,9 +19,18 @@ describe 'openstacklib::db::postgresql' do
|
||||
required_params
|
||||
end
|
||||
|
||||
let :password_hash do
|
||||
case platform_params[:password_encryption]
|
||||
when 'scram-sha-256'
|
||||
'SCRAM-SHA-256$4096:bm92YQ==$LiUdLrky9dt8Js3NPwLr3TrmmuQBa0NG/xmahcp98UM=:dVY0oEQewk/17+9zFMDkBTek1NRyTAt3iyyfLKHIR8M='
|
||||
else
|
||||
'md557ae0608fad632bf0155cb9502a6b454'
|
||||
end
|
||||
end
|
||||
|
||||
it { should contain_postgresql__server__db(title).with(
|
||||
:user => title,
|
||||
:password => 'md557ae0608fad632bf0155cb9502a6b454'
|
||||
:password => password_hash,
|
||||
)}
|
||||
end
|
||||
|
||||
@ -95,6 +104,20 @@ describe 'openstacklib::db::postgresql' do
|
||||
}))
|
||||
end
|
||||
|
||||
let :platform_params do
|
||||
case facts[:os]['family']
|
||||
when 'Debian'
|
||||
case facts[:os]['name']
|
||||
when 'Debian'
|
||||
{ :password_encryption => 'md5' }
|
||||
when 'Ubuntu'
|
||||
{ :password_encryption => 'scram-sha-256' }
|
||||
end
|
||||
when 'RedHat'
|
||||
{ :password_encryption => 'ms5' }
|
||||
end
|
||||
end
|
||||
|
||||
it_behaves_like 'openstacklib::db::postgresql examples'
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user