Enable acceptance tests for openstack_config
With the keystone_config provider inheriting from the openstack_config provider we can now add acceptance tests in openstacklib to be sure that all the dependant providers (every config provider in every puppet-openstack modules) behave correctly. Change-Id: I4dce9b8a89139f0b37f5c92dd9acf608e16ee6c1 Depends-On: I7c880518f0323e44e7c72f0ff5548482a0b1413c
This commit is contained in:
parent
3b85306d04
commit
04fa19c741
57
spec/acceptance/openstacklib_config_provider_spec.rb
Normal file
57
spec/acceptance/openstacklib_config_provider_spec.rb
Normal file
@ -0,0 +1,57 @@
|
||||
require 'spec_helper_acceptance'
|
||||
|
||||
describe 'basic config provider resource' do
|
||||
|
||||
context 'default parameters' do
|
||||
|
||||
it 'should work with no errors' do
|
||||
pp= <<-EOS
|
||||
Exec { logoutput => 'on_failure' }
|
||||
|
||||
# We create the file manually here because we only want to test
|
||||
# the logic of the provider hence installing the whole stack would
|
||||
# result in some overhead that is already tested in puppet-keystone
|
||||
File <||> -> Keystone_config <||>
|
||||
file { '/etc/keystone' :
|
||||
ensure => directory,
|
||||
}
|
||||
file { '/etc/keystone/keystone.conf' :
|
||||
ensure => file,
|
||||
}
|
||||
|
||||
keystone_config { 'DEFAULT/thisshouldexist' :
|
||||
value => 'foo',
|
||||
}
|
||||
|
||||
keystone_config { 'DEFAULT/thisshouldnotexist' :
|
||||
value => '<SERVICE DEFAULT>',
|
||||
}
|
||||
|
||||
keystone_config { 'DEFAULT/thisshouldexist2' :
|
||||
value => '<SERVICE DEFAULT>',
|
||||
ensure_absent_val => 'toto',
|
||||
}
|
||||
|
||||
keystone_config { 'DEFAULT/thisshouldnotexist2' :
|
||||
value => 'toto',
|
||||
ensure_absent_val => 'toto',
|
||||
}
|
||||
EOS
|
||||
|
||||
|
||||
# Run it twice and test for idempotency
|
||||
apply_manifest(pp, :catch_failures => true)
|
||||
apply_manifest(pp, :catch_changes => true)
|
||||
end
|
||||
|
||||
describe file('/etc/keystone/keystone.conf') do
|
||||
it { should exist }
|
||||
it { should contain('thisshouldexist=foo') }
|
||||
it { should contain('thisshouldexist2=<SERVICE DEFAULT>') }
|
||||
|
||||
its(:content) { should_not match /thisshouldnotexist/ }
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user