Files
cookbook-openstack-ops-data…/spec/openstack-db_spec.rb
Lance Albertson f3c9fca120 Cookstyle 6.19.5 fixes
Depends-On: https://review.opendev.org/756168
Change-Id: Ia379098ac40eee7a6627fe10b9320ff59468391f
Signed-off-by: Lance Albertson <lance@osuosl.org>
2020-10-05 17:04:22 -07:00

29 lines
983 B
Ruby

require_relative 'spec_helper'
describe 'openstack-ops-database::openstack-db' do
include_context 'database-stubs'
describe 'ubuntu' do
let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) }
let(:node) { runner.node }
cached(:chef_run) { runner.converge(described_recipe) }
it 'creates all openstack service databases and the corresponding users' do
{
'compute' => 'nova',
'dashboard' => 'horizon',
'database' => 'trove',
'identity' => 'keystone',
'image' => 'glance',
'network' => 'neutron',
'orchestration' => 'heat',
'telemetry' => 'ceilometer',
}.each do |service, _project|
expect(chef_run).to create_openstack_database(service)
.with(user: node['openstack']['db'][service]['username'], pass: 'test-pass')
end
## TODO: utilize _project and create test for rescue with specific log message
## when databag does not exist
end
end
end