Files
puppet-cloudkitty/spec/acceptance/basic_cloudkitty_spec.rb
ZhongShengping 507e865c29 Add the acceptance test to deploy the cloudkitty service
1) Already have the cloudkitty package in RedHat system, so we can
   add the acceptance test to deploy the service now.
2) Add auth_section and keystone_version in group "keystone_fetcher"
   to load plugin specific options and use specific keystone version.
3) Change the collector valume to 'ceilometer' by default
4) Update releated to test.

Change-Id: Ic2f8fafba1664273d89bd706768416da4d9b93e1
2016-12-14 17:05:53 +08:00

79 lines
2.2 KiB
Ruby

require 'spec_helper_acceptance'
describe 'basic cloudkitty' do
context 'default parameters' do
it 'should work with no errors' do
pp= <<-EOS
include ::openstack_integration
include ::openstack_integration::repos
include ::openstack_integration::rabbitmq
include ::openstack_integration::mysql
include ::openstack_integration::keystone
rabbitmq_user { 'cloudkitty':
admin => true,
password => 'an_even_bigger_secret',
provider => 'rabbitmqctl',
require => Class['rabbitmq'],
}
rabbitmq_user_permissions { 'cloudkitty@/':
configure_permission => '.*',
write_permission => '.*',
read_permission => '.*',
provider => 'rabbitmqctl',
require => Class['rabbitmq'],
}
# Cloudkitty resources
case $::osfamily {
'Debian': {
warning('Cloudkitty is not yet packaged on Debian systems.')
}
'RedHat': {
class { '::cloudkitty::db':
database_connection => 'mysql+pymysql://cloudkitty:a_big_secret@127.0.0.1/cloudkitty?charset=utf8',
}
class { '::cloudkitty::logging':
debug => true,
}
class { '::cloudkitty':
default_transport_url => 'rabbit://cloudkitty:an_even_bigger_secret@127.0.0.1:5672',
}
class { '::cloudkitty::keystone::auth':
password => 'a_big_secret',
}
class { '::cloudkitty::keystone::authtoken':
password => 'a_big_secret',
}
class { '::cloudkitty::db::mysql':
password => 'a_big_secret',
}
class { '::cloudkitty::api': }
class { '::cloudkitty::processor': }
class { '::cloudkitty::client': }
}
default: {
fail("Unsupported osfamily (${::osfamily})")
}
}
EOS
# 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 port(8889) do
it { is_expected.to be_listening }
end
end
end
end