fuel-library/tests/noop/spec/hosts/openstack-cinder/cinder_db_spec.rb
vsaienko 10a2fe87b9 Adapt synced openstacklib module
* All this changes are temporary, they should be removed when
    mysql module is updated
  * add mysql_module parameter to provide backward compatibility
    for mysql < 2.2
  * disable rspec tests for openstacklib
  * bind default value of mysql_module to '0.3' to avoid
    changes in upstream modules
  * added noop tests for mysql databases

It should fail noop tests and it's OK. It will start passing noop
tests for Openstacklib::Db::Mysql::Host_access only when we sync
all modules that use it with upstream.

Partially Implements: blueprint upgrade-openstack-puppet-modules

Change-Id: I5a31ecac08d30ff82abfe678b6eaad00849c317a
2015-07-07 12:14:37 +03:00

30 lines
1019 B
Ruby

require 'spec_helper'
require 'shared-examples'
manifest = 'openstack-cinder/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 = [Noop.hostname,'localhost','127.0.0.1','%']
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
#TODO: uncomment in keystone module adaptation patch
# 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