puppet-keystone/spec/spec_helper.rb
Sofer Athlan-Guyot 961c64e143 Fix default domain.
After the move to composite namevar a problem could occur if another
module was using indirection to find resource by name.

If the manifest didn't have any
keystone_user/keystone_tenant/keystone_user_role definition, then, the
'Default' domain would be appended to the name.

This patch, fix that by simplifying the rule for calculating the default
domain.

It now strictly follows what is described there https://review.openstack.org/#/c/219127/

Change-Id: Ic2efb51fe76d055307c8c27fa79015764417160b
Closes-Bug: #1517187
2015-11-20 11:50:24 +01:00

28 lines
910 B
Ruby

# Load libraries from openstacklib here to simulate how they live together in a real puppet run (for provider unit tests)
$LOAD_PATH.push(File.join(File.dirname(__FILE__), 'fixtures', 'modules', 'openstacklib', 'lib'))
require 'puppetlabs_spec_helper/module_spec_helper'
require 'shared_examples'
require 'webmock/rspec'
RSpec.configure do |c|
c.alias_it_should_behave_like_to :it_configures, 'configures'
c.alias_it_should_behave_like_to :it_raises, 'raises'
end
at_exit { RSpec::Puppet::Coverage.report! }
def setup_provider_tests
Puppet::Provider::Keystone.class_exec do
def self.reset
@admin_endpoint = nil
@tenant_hash = nil
@admin_token = nil
@keystone_file = nil
Puppet::Provider::Keystone.class_variable_set('@@default_domain_id', nil)
@domain_hash = nil
end
end
end
Dir[File.dirname(__FILE__) + '/support/**/*.rb'].each { |f| require f }