puppet-ceilometer/spec/acceptance/ceilometer_with_mysql_spec.rb
Emilien Macchi b787d19d9e beaker: stop testing ceilometer-alarm
Ceilometer Alarm has been replaced by Aodh, and does not exist anymore
in Mitaka.
This change just stop testing the Puppet classes, but still allow to use
the classes.

Partial-Bug: #1535382

Change-Id: I387273a60e29c4be40a5c9937c077ffdb40b4816
2016-01-18 12:31:34 -05:00

103 lines
3.1 KiB
Ruby

require 'spec_helper_acceptance'
describe 'ceilometer with mysql' do
context 'default parameters' do
it 'should work with no errors' do
pp= <<-EOS
# make sure apache is stopped before ceilometer-api eventlet
# in case of wsgi was run before
class { '::apache':
service_ensure => 'stopped',
}
Service['httpd'] -> Service['keystone']
include ::openstack_integration
include ::openstack_integration::repos
include ::openstack_integration::rabbitmq
include ::openstack_integration::mysql
rabbitmq_user { 'ceilometer':
admin => true,
password => 'an_even_bigger_secret',
provider => 'rabbitmqctl',
require => Class['rabbitmq'],
}
rabbitmq_user_permissions { 'ceilometer@/':
configure_permission => '.*',
write_permission => '.*',
read_permission => '.*',
provider => 'rabbitmqctl',
require => Class['rabbitmq'],
}
# Keystone resources, needed by Ceilometer to run
class { '::keystone::db::mysql':
password => 'keystone',
}
class { '::keystone':
verbose => true,
debug => true,
database_connection => 'mysql+pymysql://keystone:keystone@127.0.0.1/keystone',
admin_token => 'admin_token',
enabled => true,
}
class { '::keystone::roles::admin':
email => 'test@example.tld',
password => 'a_big_secret',
}
class { '::keystone::endpoint':
public_url => "https://${::fqdn}:5000/",
admin_url => "https://${::fqdn}:35357/",
}
# Ceilometer resources
class { '::ceilometer':
metering_secret => 'secrete',
rabbit_userid => 'ceilometer',
rabbit_password => 'an_even_bigger_secret',
rabbit_host => '127.0.0.1',
debug => true,
verbose => true,
}
class { '::ceilometer::db::mysql':
password => 'a_big_secret',
}
class { '::ceilometer::db':
database_connection => 'mysql+pymysql://ceilometer:a_big_secret@127.0.0.1/ceilometer?charset=utf8',
}
class { '::ceilometer::keystone::auth':
password => 'a_big_secret',
}
class { '::ceilometer::client': }
class { '::ceilometer::collector': }
class { '::ceilometer::expirer': }
class { '::ceilometer::agent::central': }
class { '::ceilometer::agent::notification': }
class { '::ceilometer::api':
enabled => true,
keystone_password => 'a_big_secret',
keystone_identity_uri => 'http://127.0.0.1:35357/',
}
class { '::ceilometer::dispatcher::gnocchi': }
EOS
# Run it twice and test for idempotency
apply_manifest(pp, :catch_failures => true)
apply_manifest(pp, :catch_changes => true)
end
describe port(8777) do
it { is_expected.to be_listening.with('tcp') }
end
describe cron do
it { is_expected.to have_entry('1 0 * * * ceilometer-expirer').with_user('ceilometer') }
end
end
end