fuel-library/tests/noop/spec/hosts/openstack-cinder/db_spec.rb
Aleksandr Didenko 6908722cfc Switch from RUN: to ROLE: annotation
* RUN annotation caused duplication for tasks in the old folder
* RUN should only be used if you need non-standard run configuration
* With ROLE annotation there's no need to update all the tests
  when you add new astute.yaml fixture for existing role
* Fix manifest variable in broken tests

Change-Id: I7a1c98bdb51590d8d80cee387de35d5581cf1da2
Partial-bug: #1535339
2016-04-07 15:46:46 +02:00

42 lines
1.3 KiB
Ruby

# ROLE: primary-controller
require 'spec_helper'
require 'shared-examples'
manifest = 'openstack-cinder/db.pp'
describe manifest do
shared_examples 'catalog' do
cinder_db_user = 'cinder'
cinder_db_password = Noop.hiera_structure 'cinder/db_password'
cinder_db_dbname = 'cinder'
allowed_hosts = ['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_class('mysql::client').with(
'package_name' => pkg_name,
)
end
it 'should declare cinder::db::mysql class with user,password,dbname' do
should contain_class('cinder::db::mysql').with(
'user' => cinder_db_user,
'password' => cinder_db_password,
'dbname' => cinder_db_dbname,
'allowed_hosts' => allowed_hosts,
)
end
allowed_hosts.each do |host|
it "should define openstacklib::db::mysql::host_access for #{cinder_db_dbname} DB for #{host}" do
should contain_openstacklib__db__mysql__host_access("#{cinder_db_dbname}_#{host}")
end
end
end # end of shared_examples
test_ubuntu_and_centos manifest
end