cookbook-openstack-ops-data.../spec/openstack-db_spec.rb

35 lines
1.1 KiB
Ruby

# encoding: UTF-8
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 }
let(:chef_run) { runner.converge(described_recipe) }
it 'creates all openstack service databases and the corresponding users' do
{
'bare-metal' => 'ironic',
'block-storage' => 'cinder',
'compute' => 'nova',
'dashboard' => 'horizon',
'database' => 'trove',
'identity' => 'keystone',
'image' => 'glance',
'network' => 'neutron',
'object-storage' => 'swift',
'orchestration' => 'heat',
'telemetry' => 'ceilometer'
}.each do |service, _project|
expect(chef_run).to create_openstack_common_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