forked from redhat-openstack/openstack-puppet-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WSGI: make it work, and test it with acceptance
* Finalize httpd service name support in API class following puppet-keystone model. * Implement unit tests. * Implement separated acceptance tests that deploy Ceilometer API in WSGI. This patch aims to finalize and validate we can deploy Ceilometer API in WSGI with puppet-ceilometer. Also that we can update from eventlet to WSGI (it's tested in our beaker jobs). Closes-bug: #1481532 Change-Id: I3695acf5522457837e079c36d68a0e35dbf6b72c (cherry picked from commit 257a60ce79f00f96239d06d84c9660f14a31bd68)
- Loading branch information
Showing
5 changed files
with
222 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
require 'spec_helper_acceptance' | ||
|
||
describe 'ceilometer with mysql' do | ||
|
||
context 'default parameters' do | ||
|
||
it 'should work with no errors' do | ||
pp= <<-EOS | ||
Exec { logoutput => 'on_failure' } | ||
# Common resources | ||
case $::osfamily { | ||
'Debian': { | ||
include ::apt | ||
class { '::openstack_extras::repo::debian::ubuntu': | ||
release => 'kilo', | ||
package_require => true, | ||
} | ||
$package_provider = 'apt' | ||
} | ||
'RedHat': { | ||
class { '::openstack_extras::repo::redhat::redhat': | ||
release => 'kilo', | ||
} | ||
package { 'openstack-selinux': ensure => 'latest' } | ||
$package_provider = 'yum' | ||
} | ||
default: { | ||
fail("Unsupported osfamily (${::osfamily})") | ||
} | ||
} | ||
class { '::mysql::server': } | ||
class { '::rabbitmq': | ||
delete_guest_user => true, | ||
package_provider => $package_provider, | ||
} | ||
rabbitmq_vhost { '/': | ||
provider => 'rabbitmqctl', | ||
require => Class['rabbitmq'], | ||
} | ||
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://keystone:[email protected]/keystone', | ||
admin_token => 'admin_token', | ||
enabled => true, | ||
} | ||
class { '::keystone::roles::admin': | ||
email => '[email protected]', | ||
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', | ||
} | ||
# Until https://review.openstack.org/177593 is merged: | ||
Package<| title == 'python-mysqldb' |> -> Class['ceilometer::db'] | ||
class { '::ceilometer::db::mysql': | ||
password => 'a_big_secret', | ||
} | ||
class { '::ceilometer::db': | ||
database_connection => 'mysql://ceilometer:[email protected]/ceilometer?charset=utf8', | ||
} | ||
class { '::ceilometer::keystone::auth': | ||
password => 'a_big_secret', | ||
} | ||
class { '::ceilometer::client': } | ||
class { '::ceilometer::collector': } | ||
class { '::ceilometer::expirer': } | ||
class { '::ceilometer::alarm::evaluator': } | ||
class { '::ceilometer::alarm::notifier': } | ||
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/', | ||
service_name => 'httpd', | ||
} | ||
include ::apache | ||
class { '::ceilometer::wsgi::apache': | ||
ssl => false, | ||
} | ||
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 } | ||
end | ||
|
||
describe cron do | ||
it { is_expected.to have_entry('1 0 * * * ceilometer-expirer').with_user('ceilometer') } | ||
end | ||
|
||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters