Ceilometer $::os_service_default for db and log

Switch to $::os_service_default all params in logging and db.
Changes: logging.pp, db.pp and tests.

Related-bug: #1515273

Change-Id: I412104bf46c4b40fdbd366e3a8a9dc9de5abb5fd
changes/77/249377/1
Iury Gregory Melo Ferreira 7 years ago
parent 6add4485c2
commit 6156cb49f2
  1. 24
      manifests/db.pp
  2. 222
      manifests/logging.pp
  3. 4
      spec/classes/ceilometer_agent_auth_spec.rb
  4. 4
      spec/classes/ceilometer_agent_central_spec.rb
  5. 4
      spec/classes/ceilometer_agent_compute_spec.rb
  6. 20
      spec/classes/ceilometer_agent_notification_spec.rb
  7. 4
      spec/classes/ceilometer_agent_polling_spec.rb
  8. 4
      spec/classes/ceilometer_alarm_evaluator_spec.rb
  9. 4
      spec/classes/ceilometer_alarm_notifier_spec.rb
  10. 24
      spec/classes/ceilometer_api_spec.rb
  11. 4
      spec/classes/ceilometer_client_spec.rb
  12. 4
      spec/classes/ceilometer_collector_spec.rb
  13. 10
      spec/classes/ceilometer_db_mysql_spec.rb
  14. 8
      spec/classes/ceilometer_db_postgresql_spec.rb
  15. 16
      spec/classes/ceilometer_db_spec.rb
  16. 4
      spec/classes/ceilometer_db_sync_spec.rb
  17. 4
      spec/classes/ceilometer_expirer_spec.rb
  18. 4
      spec/classes/ceilometer_init_spec.rb
  19. 4
      spec/classes/ceilometer_keystone_auth_spec.rb
  20. 16
      spec/classes/ceilometer_logging_spec.rb
  21. 4
      spec/classes/ceilometer_policy_spec.rb
  22. 8
      spec/classes/ceilometer_wsgi_apache_spec.rb
  23. 3
      spec/spec_helper.rb

@ -12,28 +12,28 @@
#
# [*database_idle_timeout*]
# Timeout when db connections should be reaped.
# (Optional) Defaults to 3600.
# (Optional) Defaults to $::os_service_default
#
# [*database_min_pool_size*]
# Minimum number of SQL connections to keep open in a pool.
# (Optional) Defaults to 1.
# (Optional) Defaults to $::os_service_default
#
# [*database_max_pool_size*]
# Maximum number of SQL connections to keep open in a pool.
# (Optional) Defaults to 10.
# (Optional) Defaults to $::os_service_default
#
# [*database_max_retries*]
# Maximum db connection retries during startup.
# Setting -1 implies an infinite retry count.
# (Optional) Defaults to 10.
# (Optional) Defaults to $::os_service_default
#
# [*database_retry_interval*]
# Interval between retries of opening a sql connection.
# (Optional) Defaults to 10.
# (Optional) Defaults to $::os_service_default
#
# [*database_max_overflow*]
# If set, use this value for max_overflow with sqlalchemy.
# (Optional) Defaults to 20.
# (Optional) Defaults to $::os_service_default
#
# [*mongodb_replica_set*]
# The name of the replica set which is used to connect to MongoDB
@ -46,12 +46,12 @@
#
class ceilometer::db (
$database_connection = 'mysql://ceilometer:ceilometer@localhost/ceilometer',
$database_idle_timeout = 3600,
$database_min_pool_size = 1,
$database_max_pool_size = 10,
$database_max_retries = 10,
$database_retry_interval = 10,
$database_max_overflow = 20,
$database_idle_timeout = $::os_service_default,
$database_min_pool_size = $::os_service_default,
$database_max_pool_size = $::os_service_default,
$database_max_retries = $::os_service_default,
$database_retry_interval = $::os_service_default,
$database_max_overflow = $::os_service_default,
$sync_db = true,
$mongodb_replica_set = undef,
) {

@ -6,23 +6,23 @@
#
# [*verbose*]
# (Optional) Should the daemons log verbose messages
# Defaults to 'false'
# Defaults to $::os_service_default
#
# [*debug*]
# (Optional) Should the daemons log debug messages
# Defaults to 'false'
# Defaults to $::os_service_default
#
# [*use_syslog*]
# (Optional) Use syslog for logging.
# Defaults to 'false'
# Defaults to $::os_service_default
#
# [*use_stderr*]
# (optional) Use stderr for logging
# Defaults to 'true'
# Defaults to $::os_service_default
#
# [*log_facility*]
# (Optional) Syslog facility to receive log lines.
# Defaults to 'LOG_USER'
# Defaults to $::os_service_default
#
# [*log_dir*]
# (optional) Directory where logs should be stored.
@ -31,34 +31,34 @@
#
# [*logging_context_format_string*]
# (optional) Format string to use for log messages with context.
# Defaults to undef.
# Defaults to $::os_service_default
# Example: '%(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s\
# [%(request_id)s %(user_identity)s] %(instance)s%(message)s'
#
# [*logging_default_format_string*]
# (optional) Format string to use for log messages without context.
# Defaults to undef.
# Defaults to $::os_service_default
# Example: '%(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s\
# [-] %(instance)s%(message)s'
#
# [*logging_debug_format_suffix*]
# (optional) Formatted data to append to log format when level is DEBUG.
# Defaults to undef.
# Defaults to $::os_service_default
# Example: '%(funcName)s %(pathname)s:%(lineno)d'
#
# [*logging_exception_prefix*]
# (optional) Prefix each line of exception output with this format.
# Defaults to undef.
# Defaults to $::os_service_default
# Example: '%(asctime)s.%(msecs)03d %(process)d TRACE %(name)s %(instance)s'
#
# [*log_config_append*]
# The name of an additional logging configuration file.
# Defaults to undef.
# Defaults to $::os_service_default
# See https://docs.python.org/2/howto/logging.html
#
# [*default_log_levels*]
# (optional) Hash of logger (keys) and level (values) pairs.
# Defaults to undef.
# Defaults to $::os_service_default
# Example:
# { 'amqp' => 'WARN', 'amqplib' => 'WARN', 'boto' => 'WARN',
# 'qpid' => 'WARN', 'sqlalchemy' => 'WARN', 'suds' => 'INFO',
@ -67,47 +67,47 @@
#
# [*publish_errors*]
# (optional) Publish error events (boolean value).
# Defaults to undef (false if unconfigured).
# Defaults to $::os_service_default
#
# [*fatal_deprecations*]
# (optional) Make deprecations fatal (boolean value)
# Defaults to undef (false if unconfigured).
# Defaults to $::os_service_default
#
# [*instance_format*]
# (optional) If an instance is passed with the log message, format it
# like this (string value).
# Defaults to undef.
# Defaults to $::os_service_default
# Example: '[instance: %(uuid)s] '
#
# [*instance_uuid_format*]
# (optional) If an instance UUID is passed with the log message, format
# it like this (string value).
# Defaults to undef.
# Defaults to $::os_service_default
# Example: instance_uuid_format='[instance: %(uuid)s] '
#
# [*log_date_format*]
# (optional) Format string for %%(asctime)s in log records.
# Defaults to undef.
# Defaults to $::os_service_default
# Example: 'Y-%m-%d %H:%M:%S'
class ceilometer::logging(
$use_syslog = false,
$use_stderr = true,
$log_facility = 'LOG_USER',
$use_syslog = $::os_service_default,
$use_stderr = $::os_service_default,
$log_facility = $::os_service_default,
$log_dir = '/var/log/ceilometer',
$verbose = false,
$debug = false,
$logging_context_format_string = undef,
$logging_default_format_string = undef,
$logging_debug_format_suffix = undef,
$logging_exception_prefix = undef,
$log_config_append = undef,
$default_log_levels = undef,
$publish_errors = undef,
$fatal_deprecations = undef,
$instance_format = undef,
$instance_uuid_format = undef,
$log_date_format = undef,
$verbose = $::os_service_default,
$debug = $::os_service_default,
$logging_context_format_string = $::os_service_default,
$logging_default_format_string = $::os_service_default,
$logging_debug_format_suffix = $::os_service_default,
$logging_exception_prefix = $::os_service_default,
$log_config_append = $::os_service_default,
$default_log_levels = $::os_service_default,
$publish_errors = $::os_service_default,
$fatal_deprecations = $::os_service_default,
$instance_format = $::os_service_default,
$instance_uuid_format = $::os_service_default,
$log_date_format = $::os_service_default,
) {
# NOTE(spredzy): In order to keep backward compatibility we rely on the pick function
@ -119,139 +119,29 @@ class ceilometer::logging(
$verbose_real = pick($::ceilometer::verbose,$verbose)
$debug_real = pick($::ceilometer::debug,$debug)
ceilometer_config {
'DEFAULT/debug' : value => $debug_real;
'DEFAULT/verbose' : value => $verbose_real;
'DEFAULT/use_stderr' : value => $use_stderr_real;
'DEFAULT/use_syslog' : value => $use_syslog_real;
'DEFAULT/log_dir' : value => $log_dir_real;
'DEFAULT/syslog_log_facility': value => $log_facility_real;
if is_service_default($default_log_levels) {
$default_log_levels_real = $default_log_levels
} else {
$default_log_levels_real = join(sort(join_keys_to_values($default_log_levels, '=')), ',')
}
if $logging_context_format_string {
ceilometer_config {
'DEFAULT/logging_context_format_string' :
value => $logging_context_format_string;
}
}
else {
ceilometer_config {
'DEFAULT/logging_context_format_string' : ensure => absent;
}
}
if $logging_default_format_string {
ceilometer_config {
'DEFAULT/logging_default_format_string' :
value => $logging_default_format_string;
}
}
else {
ceilometer_config {
'DEFAULT/logging_default_format_string' : ensure => absent;
}
}
if $logging_debug_format_suffix {
ceilometer_config {
'DEFAULT/logging_debug_format_suffix' :
value => $logging_debug_format_suffix;
}
}
else {
ceilometer_config {
'DEFAULT/logging_debug_format_suffix' : ensure => absent;
}
}
if $logging_exception_prefix {
ceilometer_config {
'DEFAULT/logging_exception_prefix' : value => $logging_exception_prefix;
}
}
else {
ceilometer_config {
'DEFAULT/logging_exception_prefix' : ensure => absent;
}
}
if $log_config_append {
ceilometer_config {
'DEFAULT/log_config_append' : value => $log_config_append;
}
}
else {
ceilometer_config {
'DEFAULT/log_config_append' : ensure => absent;
}
}
if $default_log_levels {
ceilometer_config {
'DEFAULT/default_log_levels' :
value => join(sort(join_keys_to_values($default_log_levels, '=')), ',');
}
}
else {
ceilometer_config {
'DEFAULT/default_log_levels' : ensure => absent;
}
}
if $publish_errors {
ceilometer_config {
'DEFAULT/publish_errors' : value => $publish_errors;
}
}
else {
ceilometer_config {
'DEFAULT/publish_errors' : ensure => absent;
}
}
if $fatal_deprecations {
ceilometer_config {
'DEFAULT/fatal_deprecations' : value => $fatal_deprecations;
}
}
else {
ceilometer_config {
'DEFAULT/fatal_deprecations' : ensure => absent;
}
}
if $instance_format {
ceilometer_config {
'DEFAULT/instance_format' : value => $instance_format;
}
}
else {
ceilometer_config {
'DEFAULT/instance_format' : ensure => absent;
}
}
if $instance_uuid_format {
ceilometer_config {
'DEFAULT/instance_uuid_format' : value => $instance_uuid_format;
}
}
else {
ceilometer_config {
'DEFAULT/instance_uuid_format' : ensure => absent;
}
}
if $log_date_format {
ceilometer_config {
'DEFAULT/log_date_format' : value => $log_date_format;
}
}
else {
ceilometer_config {
'DEFAULT/log_date_format' : ensure => absent;
}
}
ceilometer_config {
'DEFAULT/debug': value => $debug_real;
'DEFAULT/verbose': value => $verbose_real;
'DEFAULT/use_stderr': value => $use_stderr_real;
'DEFAULT/use_syslog': value => $use_syslog_real;
'DEFAULT/log_dir': value => $log_dir_real;
'DEFAULT/syslog_log_facility': value => $log_facility_real;
'DEFAULT/logging_context_format_string': value => $logging_context_format_string;
'DEFAULT/logging_default_format_string': value => $logging_default_format_string;
'DEFAULT/logging_debug_format_suffix': value => $logging_debug_format_suffix;
'DEFAULT/logging_exception_prefix': value => $logging_exception_prefix;
'DEFAULT/log_config_append': value => $log_config_append;
'DEFAULT/default_log_levels': value => $default_log_levels_real;
'DEFAULT/publish_errors': value => $publish_errors;
'DEFAULT/fatal_deprecations': value => $fatal_deprecations;
'DEFAULT/instance_format': value => $instance_format;
'DEFAULT/instance_uuid_format': value => $instance_uuid_format;
'DEFAULT/log_date_format': value => $log_date_format;
}
}

@ -42,7 +42,7 @@ describe 'ceilometer::agent::auth' do
context 'on Debian platforms' do
let :facts do
{ :osfamily => 'Debian' }
@default_facts.merge({ :osfamily => 'Debian' })
end
it_configures 'ceilometer-agent-auth'
@ -50,7 +50,7 @@ describe 'ceilometer::agent::auth' do
context 'on RedHat platforms' do
let :facts do
{ :osfamily => 'RedHat' }
@default_facts.merge({ :osfamily => 'RedHat' })
end
it_configures 'ceilometer-agent-auth'

@ -79,7 +79,7 @@ describe 'ceilometer::agent::central' do
context 'on Debian platforms' do
let :facts do
{ :osfamily => 'Debian' }
@default_facts.merge({ :osfamily => 'Debian' })
end
let :platform_params do
@ -92,7 +92,7 @@ describe 'ceilometer::agent::central' do
context 'on RedHat platforms' do
let :facts do
{ :osfamily => 'RedHat' }
@default_facts.merge({ :osfamily => 'RedHat' })
end
let :platform_params do

@ -90,7 +90,7 @@ describe 'ceilometer::agent::compute' do
context 'on Debian platforms' do
let :facts do
{ :osfamily => 'Debian' }
@default_facts.merge({ :osfamily => 'Debian' })
end
let :platform_params do
@ -118,7 +118,7 @@ describe 'ceilometer::agent::compute' do
context 'on RedHat platforms' do
let :facts do
{ :osfamily => 'RedHat' }
@default_facts.merge({ :osfamily => 'RedHat' })
end
let :platform_params do

@ -89,7 +89,7 @@ describe 'ceilometer::agent::notification' do
context 'on Debian platforms' do
let :facts do
{ :osfamily => 'Debian' }
@default_facts.merge({ :osfamily => 'Debian' })
end
let :platform_params do
@ -102,7 +102,7 @@ describe 'ceilometer::agent::notification' do
context 'on RedHat platforms' do
let :facts do
{ :osfamily => 'RedHat' }
@default_facts.merge({ :osfamily => 'RedHat' })
end
let :platform_params do
@ -115,10 +115,10 @@ describe 'ceilometer::agent::notification' do
context 'on RHEL 7' do
let :facts do
{ :osfamily => 'RedHat',
@default_facts.merge({ :osfamily => 'RedHat',
:operatingsystem => 'RedHat',
:operatingsystemmajrelease => 7
}
})
end
let :platform_params do
@ -131,10 +131,10 @@ describe 'ceilometer::agent::notification' do
context 'on CentOS 7' do
let :facts do
{ :osfamily => 'RedHat',
@default_facts.merge({ :osfamily => 'RedHat',
:operatingsystem => 'CentOS',
:operatingsystemmajrelease => 7
}
})
end
let :platform_params do
@ -147,10 +147,10 @@ describe 'ceilometer::agent::notification' do
context 'on Scientific 7' do
let :facts do
{ :osfamily => 'RedHat',
@default_facts.merge({ :osfamily => 'RedHat',
:operatingsystem => 'Scientific',
:operatingsystemmajrelease => 7
}
})
end
let :platform_params do
@ -163,10 +163,10 @@ describe 'ceilometer::agent::notification' do
context 'on Fedora 20' do
let :facts do
{ :osfamily => 'RedHat',
@default_facts.merge({ :osfamily => 'RedHat',
:operatingsystem => 'Fedora',
:operatingsystemrelease => 20
}
})
end
let :platform_params do

@ -104,7 +104,7 @@ describe 'ceilometer::agent::polling' do
context 'on Debian platforms' do
let :facts do
{ :osfamily => 'Debian' }
@default_facts.merge({ :osfamily => 'Debian' })
end
let :platform_params do
@ -133,7 +133,7 @@ describe 'ceilometer::agent::polling' do
context 'on RedHat platforms' do
let :facts do
{ :osfamily => 'RedHat' }
@default_facts.merge({ :osfamily => 'RedHat' })
end
let :platform_params do

@ -105,7 +105,7 @@ describe 'ceilometer::alarm::evaluator' do
context 'on Debian platforms' do
let :facts do
{ :osfamily => 'Debian' }
@default_facts.merge({ :osfamily => 'Debian' })
end
let :platform_params do
@ -118,7 +118,7 @@ describe 'ceilometer::alarm::evaluator' do
context 'on RedHat platforms' do
let :facts do
{ :osfamily => 'RedHat' }
@default_facts.merge({ :osfamily => 'RedHat' })
end
let :platform_params do

@ -95,7 +95,7 @@ describe 'ceilometer::alarm::notifier' do
context 'on Debian platforms' do
let :facts do
{ :osfamily => 'Debian' }
@default_facts.merge({ :osfamily => 'Debian' })
end
let :platform_params do
@ -108,7 +108,7 @@ describe 'ceilometer::alarm::notifier' do
context 'on RedHat platforms' do
let :facts do
{ :osfamily => 'RedHat' }
@default_facts.merge({ :osfamily => 'RedHat' })
end
let :platform_params do

@ -154,12 +154,12 @@ describe 'ceilometer::api' do
context 'on Debian platforms' do
let :facts do
{ :osfamily => 'Debian',
@default_facts.merge({ :osfamily => 'Debian',
:operatingsystem => 'Debian',
:operatingsystemrelease => '8.0',
:concat_basedir => '/var/lib/puppet/concat',
:fqdn => 'some.host.tld',
:processorcount => 2 }
:processorcount => 2 })
end
let :platform_params do
@ -172,13 +172,13 @@ describe 'ceilometer::api' do
context 'on RedHat platforms' do
let :facts do
{ :osfamily => 'RedHat',
:operatingsystem => 'RedHat',
:operatingsystemrelease => '7.1',
@default_facts.merge({ :osfamily => 'RedHat',
:operatingsystem => 'RedHat',
:operatingsystemrelease => '7.1',
:operatingsystemmajrelease => '7',
:fqdn => 'some.host.tld',
:concat_basedir => '/var/lib/puppet/concat',
:processorcount => 2 }
:fqdn => 'some.host.tld',
:concat_basedir => '/var/lib/puppet/concat',
:processorcount => 2 })
end
let :platform_params do
@ -191,7 +191,7 @@ describe 'ceilometer::api' do
describe 'with custom auth_uri' do
let :facts do
{ :osfamily => 'RedHat' }
@default_facts.merge({ :osfamily => 'RedHat' })
end
before do
params.merge!({
@ -205,10 +205,10 @@ describe 'ceilometer::api' do
describe "with custom keystone identity_uri" do
let :facts do
{ :osfamily => 'RedHat' }
@default_facts.merge({ :osfamily => 'RedHat' })
end
before do
params.merge!({
params.merge!({
:keystone_identity_uri => 'https://foo.bar:1234/',
})
end
@ -224,7 +224,7 @@ describe 'ceilometer::api' do
describe "with custom keystone identity_uri and auth_uri" do
let :facts do
{ :osfamily => 'RedHat' }
@default_facts.merge({ :osfamily => 'RedHat' })
end
before do
params.merge!({

@ -17,7 +17,7 @@ describe 'ceilometer::client' do
context 'on Debian platforms' do
let :facts do
{ :osfamily => 'Debian' }
@default_facts.merge({ :osfamily => 'Debian' })
end
let :platform_params do
@ -29,7 +29,7 @@ describe 'ceilometer::client' do
context 'on RedHat platforms' do
let :facts do
{ :osfamily => 'RedHat' }
@default_facts.merge({ :osfamily => 'RedHat' })
end
let :platform_params do

@ -111,7 +111,7 @@ describe 'ceilometer::collector' do
context 'on Debian platforms' do
let :facts do
{ :osfamily => 'Debian' }
@default_facts.merge({ :osfamily => 'Debian' })
end
let :platform_params do
@ -124,7 +124,7 @@ describe 'ceilometer::collector' do
context 'on RedHat platforms' do
let :facts do
{ :osfamily => 'RedHat' }
@default_facts.merge({ :osfamily => 'RedHat' })
end
let :platform_params do

@ -35,7 +35,7 @@ describe 'ceilometer::db::mysql' do
context 'on Debian platforms' do
let :facts do
{ :osfamily => 'Debian' }
@default_facts.merge({ :osfamily => 'Debian' })
end
it_configures 'ceilometer mysql database'
@ -43,7 +43,7 @@ describe 'ceilometer::db::mysql' do
context 'on RedHat platforms' do
let :facts do
{ :osfamily => 'RedHat' }
@default_facts.merge({ :osfamily => 'RedHat' })
end
it_configures 'ceilometer mysql database'
@ -51,7 +51,7 @@ describe 'ceilometer::db::mysql' do
describe "overriding allowed_hosts param to array" do
let :facts do
{ :osfamily => "Debian" }
@default_facts.merge({ :osfamily => "Debian" })
end
let :params do
{
@ -64,7 +64,7 @@ describe 'ceilometer::db::mysql' do
describe "overriding allowed_hosts param to string" do
let :facts do
{ :osfamily => 'RedHat' }
@default_facts.merge({ :osfamily => 'RedHat' })
end
let :params do
{
@ -77,7 +77,7 @@ describe 'ceilometer::db::mysql' do
describe "overriding allowed_hosts param equals to host param " do
let :facts do
{ :osfamily => 'RedHat' }
@default_facts.merge({ :osfamily => 'RedHat' })
end
let :params do
{

@ -12,11 +12,11 @@ describe 'ceilometer::db::postgresql' do
context 'on a RedHat osfamily' do
let :facts do
{
@default_facts.merge({
:osfamily => 'RedHat',
:operatingsystemrelease => '7.0',
:concat_basedir => '/var/lib/puppet/concat'
}
})
end
context 'with only required parameters' do
@ -34,12 +34,12 @@ describe 'ceilometer::db::postgresql' do
context 'on a Debian osfamily' do
let :facts do
{
@default_facts.merge({
:operatingsystemrelease => '7.8',
:operatingsystem => 'Debian',
:osfamily => 'Debian',
:concat_basedir => '/var/lib/puppet/concat'
}
})
end
context 'with only required parameters' do

@ -9,10 +9,10 @@ describe 'ceilometer::db' do
it { is_expected.to contain_class('ceilometer::params') }
it { is_expected.to contain_class('ceilometer::db::sync') }
it { is_expected.to contain_ceilometer_config('database/connection').with_value('mysql://ceilometer:ceilometer@localhost/ceilometer').with_secret(true) }
it { is_expected.to contain_ceilometer_config('database/idle_timeout').with_value('3600') }
it { is_expected.to contain_ceilometer_config('database/min_pool_size').with_value('1') }
it { is_expected.to contain_ceilometer_config('database/max_retries').with_value('10') }
it { is_expected.to contain_ceilometer_config('database/retry_interval').with_value('10') }
it { is_expected.to contain_ceilometer_config('database/idle_timeout').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_ceilometer_config('database/min_pool_size').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_ceilometer_config('database/max_retries').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_ceilometer_config('database/retry_interval').with_value('<SERVICE DEFAULT>') }
it { is_expected.not_to contain_ceilometer_config('database/mongodb_replica_set') }
end
@ -79,10 +79,10 @@ describe 'ceilometer::db' do
context 'on Debian platforms' do
let :facts do
{ :osfamily => 'Debian',
@default_facts.merge({ :osfamily => 'Debian',
:operatingsystem => 'Debian',
:operatingsystemrelease => 'jessie',
}
})
end
it_configures 'ceilometer::db'
@ -105,9 +105,9 @@ describe 'ceilometer::db' do
context 'on Redhat platforms' do
let :facts do
{ :osfamily => 'RedHat',
@default_facts.merge({ :osfamily => 'RedHat',
:operatingsystemrelease => '7.1',
}
})
end
it_configures 'ceilometer::db'

@ -36,11 +36,11 @@ describe 'ceilometer::db::sync' do
context 'on a RedHat osfamily' do
let :facts do
{
@default_facts.merge({
:osfamily => 'RedHat',
:operatingsystemrelease => '7.0',
:concat_basedir => '/var/lib/puppet/concat'
}
})
end
it_configures 'ceilometer-dbsync'

@ -70,7 +70,7 @@ describe 'ceilometer::expirer' do
context 'on Debian platforms' do
let :facts do
{ :osfamily => 'Debian' }
@default_facts.merge({ :osfamily => 'Debian' })
end
let :platform_params do
@ -82,7 +82,7 @@ describe 'ceilometer::expirer' do
context 'on RedHat platforms' do
let :facts do
{ :osfamily => 'RedHat' }
@default_facts.merge({ :osfamily => 'RedHat' })
end
let :platform_params do

@ -305,7 +305,7 @@ describe 'ceilometer' do
context 'on Debian platforms' do
let :facts do
{ :osfamily => 'Debian' }
@default_facts.merge({ :osfamily => 'Debian' })
end
let :platform_params do
@ -317,7 +317,7 @@ describe 'ceilometer' do
context 'on RedHat platforms' do
let :facts do
{ :osfamily => 'RedHat' }
@default_facts.merge({ :osfamily => 'RedHat' })
end
let :platform_params do

@ -198,7 +198,7 @@ describe 'ceilometer::keystone::auth' do
context 'on Debian platforms' do
let :facts do
{ :osfamily => 'Debian' }
@default_facts.merge({ :osfamily => 'Debian' })
end
it_configures 'ceilometer keystone auth'
@ -206,7 +206,7 @@ describe 'ceilometer::keystone::auth' do
context 'on RedHat platforms' do
let :facts do
{ :osfamily => 'RedHat' }
@default_facts.merge({ :osfamily => 'RedHat' })
end
it_configures 'ceilometer keystone auth'

@ -15,7 +15,7 @@ describe 'ceilometer::logging' do
:logging_exception_prefix => '%(asctime)s.%(msecs)03d %(process)d TRACE %(name)s %(instance)s',
:log_config_append => '/etc/ceilometer/logging.conf',
:publish_errors => true,
:default_log_levels => {
:default_log_levels => {
'amqp' => 'WARN', 'amqplib' => 'WARN', 'boto' => 'WARN',
'qpid' => 'WARN', 'sqlalchemy' => 'WARN', 'suds' => 'INFO',
'iso8601' => 'WARN',
@ -57,11 +57,11 @@ describe 'ceilometer::logging' do
shared_examples 'basic default logging settings' do
it 'configures ceilometer logging settins with default values' do
is_expected.to contain_ceilometer_config('DEFAULT/use_syslog').with(:value => 'false')
is_expected.to contain_ceilometer_config('DEFAULT/use_stderr').with(:value => 'true')
is_expected.to contain_ceilometer_config('DEFAULT/use_syslog').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_ceilometer_config('DEFAULT/use_stderr').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_ceilometer_config('DEFAULT/log_dir').with(:value => '/var/log/ceilometer')
is_expected.to contain_ceilometer_config('DEFAULT/verbose').with(:value => 'false')
is_expected.to contain_ceilometer_config('DEFAULT/debug').with(:value => 'false')
is_expected.to contain_ceilometer_config('DEFAULT/verbose').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_ceilometer_config('DEFAULT/debug').with(:value => '<SERVICE DEFAULT>')
end
end
@ -120,13 +120,13 @@ describe 'ceilometer::logging' do
:default_log_levels, :fatal_deprecations,
:instance_format, :instance_uuid_format,
:log_date_format, ].each { |param|
it { is_expected.to contain_ceilometer_config("DEFAULT/#{param}").with_ensure('absent') }
it { is_expected.to contain_ceilometer_config("DEFAULT/#{param}").with_value('<SERVICE DEFAULT>') }
}
end
context 'on Debian platforms' do
let :facts do
{ :osfamily => 'Debian' }
@default_facts.merge({ :osfamily => 'Debian' })
end
it_configures 'ceilometer-logging'
@ -134,7 +134,7 @@ describe 'ceilometer::logging' do
context 'on RedHat platforms' do
let :facts do
{ :osfamily => 'RedHat' }
@default_facts.merge({ :osfamily => 'RedHat' })
end
it_configures 'ceilometer-logging'

@ -25,7 +25,7 @@ describe 'ceilometer::policy' do
context 'on Debian platforms' do
let :facts do
{ :osfamily => 'Debian' }
@default_facts.merge({ :osfamily => 'Debian' })
end
it_configures 'ceilometer policies'
@ -33,7 +33,7 @@ describe 'ceilometer::policy' do
context 'on RedHat platforms' do
let :facts do
{ :osfamily => 'RedHat' }
@default_facts.merge({ :osfamily => 'RedHat' })
end
it_configures 'ceilometer policies'

@ -87,10 +87,10 @@ describe 'ceilometer::wsgi::apache' do
context 'on RedHat platforms' do
let :facts do
global_facts.merge({
@default_facts.merge(global_facts.merge({
:osfamily => 'RedHat',
:operatingsystemrelease => '7.0'
})
}))
end
let :platform_parameters do
@ -107,11 +107,11 @@ describe 'ceilometer::wsgi::apache' do
context 'on Debian platforms' do
let :facts do
global_facts.merge({
@default_facts.merge(global_facts.merge({
:osfamily => 'Debian',
:operatingsystem => 'Debian',
:operatingsystemrelease => '7.0'
})
}))
end
let :platform_parameters do

@ -5,6 +5,9 @@ require 'webmock/rspec'
RSpec.configure do |c|
c.alias_it_should_behave_like_to :it_configures, 'configures'
c.alias_it_should_behave_like_to :it_raises, 'raises'
c.before :each do
@default_facts = { :os_service_default => '<SERVICE DEFAULT>' }
end
end
at_exit { RSpec::Puppet::Coverage.report! }

Loading…
Cancel
Save