Fix broken unit tests with puppetlabs-postgresql >= v9.2.0

The default password encryption in Ubuntu/Debian has been changed from
md5 to scram-sha-256 by [1].

[1] 985309e2df

Change-Id: I7f1218a3dc1377305b5eb7296b3ef03645f6a085
This commit is contained in:
Takashi Kajinami 2023-10-31 02:13:53 +09:00
parent 4dc548c81b
commit 4ca1c521ef
1 changed files with 19 additions and 1 deletions

View File

@ -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,15 @@ describe 'openstacklib::db::postgresql' do
}))
end
let :platform_params do
case os[:os]['family']
when 'Debian'
{ :password_encryption => 'scram-sha-256' }
when 'RedHat'
{ :password_encryption => 'ms5' }
end
end
it_behaves_like 'openstacklib::db::postgresql examples'
end
end