fuel-library/tests/noop/spec/hosts/keystone/db_spec.rb
Aleksandr Didenko a06f41a94d Install proper mysql-client package
We should not install default mysql-client package, that is
defined in mysql::params::client_package_name. But instead we need
to calculate proper version of mysql-client in exactly the same
way as we do it in database.pp task when evaluate mysql::server
class. To do so we introduce new class galera::client and declare
it instead of ::mysql.

Change-Id: Ib118450656f99f68358e84a61b1684b8025e483c
Closes-bug: #1476599
2015-07-28 21:04:17 +03:00

39 lines
1.2 KiB
Ruby

require 'spec_helper'
require 'shared-examples'
manifest = 'keystone/db.pp'
describe manifest do
shared_examples 'catalog' do
keystone_db_user = 'keystone'
keystone_db_dbname = 'keystone'
keystone_db_password = Noop.hiera_structure 'keystone/db_password'
allowed_hosts = [Noop.hostname,'localhost','127.0.0.1','%']
it 'should install proper mysql-client' do
if facts[:osfamily] == 'RedHat'
pkg_name = 'MySQL-client-wsrep'
elsif facts[:osfamily] == 'Debian'
pkg_name = 'mysql-client-5.6'
end
should contain_package('mysql-client').with(
'name' => pkg_name,
)
end
it 'should declare keystone::db::mysql class with user,password,dbname' do
should contain_class('keystone::db::mysql').with(
'user' => keystone_db_user,
'password' => keystone_db_password,
'dbname' => keystone_db_dbname,
'allowed_hosts' => allowed_hosts,
)
end
allowed_hosts.each do |host|
it "should define openstacklib::db::mysql::host_access for #{keystone_db_dbname} DB for #{host}" do
should contain_openstacklib__db__mysql__host_access("#{keystone_db_dbname}_#{host}")
end
end
end # end of shared_examples
test_ubuntu_and_centos manifest
end