Files
puppet-barbican/spec/acceptance/basic_barbican_spec.rb
Ade Lee 74c76bdadb Add keystone notification options to barbican-api manifest
Change-Id: Ifc3f016611268f3dc7d9e39428b423852536982d
2016-04-01 10:14:18 -04:00

62 lines
1.6 KiB
Ruby

require 'spec_helper_acceptance'
describe 'barbican::api class' do
context 'default parameters' do
pp= <<-EOS
include ::openstack_integration
include ::openstack_integration::repos
include ::openstack_integration::mysql
case $::osfamily {
'Debian': {
warning('Barbican is not yet packaged on Ubuntu systems.')
}
'RedHat': {
# Barbican resources
include ::barbican
class { '::barbican::api::logging':
verbose => true,
}
class { '::barbican::quota':
}
class { '::barbican::keystone::notification':
}
class { '::barbican::api':
}
}
}
EOS
it 'should work with no errors' do
# Run it twice and test for idempotency
apply_manifest(pp, :catch_failures => true)
apply_manifest(pp, :catch_changes => true)
end
if os[:family].casecmp('RedHat') == 0
describe 'store a secret' do
it 'should store a secret' do
shell('barbican -N --os-project-id 12345 --endpoint http://localhost:9311 secret store --payload "my big bad secret"') do |r|
expect(r.stdout).to match(/ACTIVE/)
end
end
end
describe 'generate a secret' do
it 'should generate a secret' do
shell('barbican -N --os-project-id 12345 --endpoint http://localhost:9311 secret order create key --name foo') do |r|
expect(r.stdout).to match(/Order href/)
end
end
end
describe port(9311) do
it { is_expected.to be_listening.with('tcp') }
end
end
end
end