Files
puppet-openstacklib/spec/acceptance/openstacklib_policy_base_spec.rb
Takashi Kajinami 0ffc8e1c4b Fix support for policy.yaml
This change fixes support for policy.yaml, which was broken because
of the following problems.
 - The default content was still formatted in json
 - Augeas doesn't support flat yaml contents required

Change-Id: Ie308a481eb70d5f930633b18d8044f9542a142af
2021-01-07 16:37:30 +09:00

37 lines
972 B
Ruby

require 'spec_helper_acceptance'
describe 'policy file management' do
context 'with policy.yaml' do
it 'should work with no errors' do
pp= <<-EOS
Exec { logoutput => 'on_failure' }
openstacklib::policy::base { 'is_admin':
file_path => '/tmp/policy.yaml',
key => 'is_admin',
value => 'role:admin',
file_format => 'yaml',
}
openstacklib::policy::base { 'is_member':
file_path => '/tmp/policy.yaml',
key => 'is_member',
value => 'role:member',
file_format => 'yaml',
}
EOS
# Run it twice and test for idempotency
apply_manifest(pp, :catch_failures => true)
apply_manifest(pp, :catch_changes => true)
end
describe file('/tmp/policy.yaml') do
it { should exist }
it { should contain("'is_admin': 'role:admin'") }
it { should contain("'is_member': 'role:member'") }
end
end
end