
Adds cinder::cron::db_purge for setting up cron job which runs "cinder-manage db purge". Change-Id: I677f2ef3d9ca81fff0f672c8e34b6e4278674a96
34 lines
936 B
Ruby
34 lines
936 B
Ruby
require 'spec_helper'
|
|
|
|
describe 'cinder::cron::db_purge' do
|
|
|
|
let :facts do
|
|
{ :osfamily => 'RedHat' }
|
|
end
|
|
|
|
let :params do
|
|
{ :minute => 1,
|
|
:hour => 0,
|
|
:monthday => '*',
|
|
:month => '*',
|
|
:weekday => '*',
|
|
:user => 'cinder',
|
|
:age => '30',
|
|
:destination => '/var/log/cinder/cinder-rowsflush.log' }
|
|
end
|
|
|
|
it 'configures a cron' do
|
|
is_expected.to contain_cron('cinder-manage db purge').with(
|
|
:command => "cinder-manage db purge #{params[:age]} >>#{params[:destination]} 2>&1",
|
|
:environment => 'PATH=/bin:/usr/bin:/usr/sbin SHELL=/bin/sh',
|
|
:user => params[:user],
|
|
:minute => params[:minute],
|
|
:hour => params[:hour],
|
|
:monthday => params[:monthday],
|
|
:month => params[:month],
|
|
:weekday => params[:weekday],
|
|
:require => 'Package[cinder]',
|
|
)
|
|
end
|
|
end
|