2012-04-05 23:58:36 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2012-04-23 07:29:00 +00:00
|
|
|
describe 'keystone::db::mysql' do
|
2012-04-05 23:58:36 +00:00
|
|
|
|
2012-10-14 03:54:37 +00:00
|
|
|
let :pre_condition do
|
2014-03-27 00:46:01 +00:00
|
|
|
[
|
|
|
|
'include mysql::server',
|
|
|
|
'include keystone::db::sync'
|
|
|
|
]
|
2012-10-14 03:54:37 +00:00
|
|
|
end
|
|
|
|
|
2012-04-05 23:58:36 +00:00
|
|
|
let :facts do
|
2015-11-21 03:24:54 +00:00
|
|
|
@default_facts.merge({ :osfamily => 'Debian' })
|
2012-04-05 23:58:36 +00:00
|
|
|
end
|
|
|
|
|
2014-07-11 17:47:18 +00:00
|
|
|
let :params do
|
2012-04-05 23:58:36 +00:00
|
|
|
{
|
2015-11-16 17:10:17 +00:00
|
|
|
:password => 'keystone_default_password',
|
2012-04-05 23:58:36 +00:00
|
|
|
}
|
|
|
|
end
|
|
|
|
|
2014-07-11 17:47:18 +00:00
|
|
|
describe 'with only required params' do
|
2015-03-15 15:32:35 +00:00
|
|
|
it { is_expected.to contain_openstacklib__db__mysql('keystone').with(
|
2015-11-16 17:10:17 +00:00
|
|
|
:user => 'keystone',
|
|
|
|
:password_hash => '*B552157B14BCEDDCEAA06767A012F31BDAA9CE3D',
|
|
|
|
:dbname => 'keystone',
|
|
|
|
:host => '127.0.0.1',
|
|
|
|
:charset => 'utf8',
|
|
|
|
:collate => 'utf8_general_ci',
|
2012-04-05 23:58:36 +00:00
|
|
|
)}
|
|
|
|
end
|
2014-07-11 17:47:18 +00:00
|
|
|
|
2013-07-30 10:03:22 +00:00
|
|
|
describe "overriding allowed_hosts param to array" do
|
|
|
|
let :params do
|
|
|
|
{
|
|
|
|
:password => 'keystonepass',
|
|
|
|
:allowed_hosts => ['127.0.0.1','%']
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
2015-11-16 17:10:17 +00:00
|
|
|
it { is_expected.to contain_openstacklib__db__mysql('keystone').with(
|
|
|
|
:user => 'keystone',
|
|
|
|
:password_hash => '*706BFA85E15D0C1D8467D0D81D784F6A04CE4ABB',
|
|
|
|
:dbname => 'keystone',
|
|
|
|
:host => '127.0.0.1',
|
|
|
|
:charset => 'utf8',
|
|
|
|
:collate => 'utf8_general_ci',
|
|
|
|
:allowed_hosts => ['127.0.0.1','%'],
|
|
|
|
)}
|
|
|
|
|
2013-07-30 10:03:22 +00:00
|
|
|
end
|
|
|
|
describe "overriding allowed_hosts param to string" do
|
|
|
|
let :params do
|
|
|
|
{
|
|
|
|
:password => 'keystonepass2',
|
|
|
|
:allowed_hosts => '192.168.1.1'
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
2015-11-16 17:10:17 +00:00
|
|
|
it { is_expected.to contain_openstacklib__db__mysql('keystone').with(
|
|
|
|
:user => 'keystone',
|
|
|
|
:password_hash => '*47651CDAAB340A79CC838378072877FFFBF0B239',
|
|
|
|
:dbname => 'keystone',
|
|
|
|
:host => '127.0.0.1',
|
|
|
|
:charset => 'utf8',
|
|
|
|
:collate => 'utf8_general_ci',
|
|
|
|
:allowed_hosts => '192.168.1.1',
|
|
|
|
)}
|
|
|
|
|
2013-07-30 10:03:22 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
describe "overriding allowed_hosts param equals to host param " do
|
|
|
|
let :params do
|
|
|
|
{
|
|
|
|
:password => 'keystonepass2',
|
|
|
|
:allowed_hosts => '127.0.0.1'
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
2015-11-16 17:10:17 +00:00
|
|
|
it { is_expected.to contain_openstacklib__db__mysql('keystone').with(
|
|
|
|
:user => 'keystone',
|
|
|
|
:password_hash => '*47651CDAAB340A79CC838378072877FFFBF0B239',
|
|
|
|
:dbname => 'keystone',
|
|
|
|
:host => '127.0.0.1',
|
|
|
|
:charset => 'utf8',
|
|
|
|
:collate => 'utf8_general_ci',
|
|
|
|
:allowed_hosts => '127.0.0.1',
|
|
|
|
)}
|
|
|
|
|
2013-07-30 10:03:22 +00:00
|
|
|
end
|
2012-04-05 23:58:36 +00:00
|
|
|
|
|
|
|
end
|