Fix beaker tests

Now that we install logstash 2.0, and its package manages service files
and user creation, update our beaker tests to reflect these changes.

Also, the logstash deb depends on the logrotate package, so make sure that's
installed.

Depends-On: Id50f98459b677460c28772c406c86482dcd0e9e4
Change-Id: I4c062c82d8d0aae5dd27036021a9464d788244d1
This commit is contained in:
Jonathan Harker 2016-04-29 12:16:56 -07:00
parent ced76655f7
commit b91deb2b0c
3 changed files with 12 additions and 70 deletions

View File

@ -17,6 +17,8 @@
# Class to install common logstash items.
#
class logstash {
include ::logrotate
archive { '/tmp/logstash_2.0.0-1_all.deb':
source => 'https://download.elastic.co/logstash/logstash/packages/debian/logstash_2.0.0-1_all.deb',
extract => false,
@ -35,6 +37,7 @@ class logstash {
source => '/tmp/logstash_2.0.0-1_all.deb',
provider => 'dpkg',
require => [
Package['logrotate'],
Package['openjdk-7-jre-headless'],
Archive['/tmp/logstash_2.0.0-1_all.deb'],
]

View File

@ -20,45 +20,6 @@ describe 'puppet-logstash module', :if => ['debian', 'ubuntu'].include?(os[:fami
end
describe 'require files' do
describe 'module logstash' do
describe file('/opt/logstash/logstash-1.3.3-flatjar.jar') do
it { should be_file }
it { should be_owned_by 'logstash' }
it { should be_grouped_into 'logstash' }
end
describe file('/opt/logstash/logstash.jar') do
it { should be_linked_to '/opt/logstash/logstash-1.3.3-flatjar.jar' }
end
describe file('/var/log/logstash') do
it { should be_directory }
it { should be_owned_by 'logstash' }
it { should be_grouped_into 'logstash' }
end
describe file('/etc/logstash') do
it { should be_directory }
it { should be_owned_by 'logstash' }
it { should be_grouped_into 'logstash' }
end
end
describe 'module logstash::agent' do
describe file('/etc/init/logstash-agent.conf') do
it { should be_file }
it { should be_owned_by 'root' }
its(:content) { should include 'description "logstash agent instance"' }
end
describe file('/etc/logstash/agent.conf') do
it { should be_file }
it { should be_owned_by 'logstash' }
it { should be_grouped_into 'logstash' }
its(:content) { should include 'redis { host => "127.0.0.1" data_type => "list" key => "logstash" }' }
end
end
describe 'module logstash::elasticsearch' do
describe file('/etc/elasticsearch/templates/logstash_settings.json') do
it { should be_file }
@ -69,21 +30,16 @@ describe 'puppet-logstash module', :if => ['debian', 'ubuntu'].include?(os[:fami
end
describe 'module logstash::indexer' do
describe file('/etc/init/logstash-indexer.conf') do
it { should be_file }
it { should be_owned_by 'root' }
its(:content) { should include 'description "logstash indexer instance"' }
end
describe file('/etc/logstash/indexer.conf') do
describe file('/etc/logstash/conf.d/indexer.conf') do
it { should be_file }
it { should be_owned_by 'logstash' }
it { should be_grouped_into 'logstash' }
its(:content) { should include 'type => "redis-input"' }
its(:content) { should include 'host => "127.0.0.1"' }
end
describe file('/etc/logrotate.d/indexer.log') do
its(:content) { should include '/var/log/logstash/indexer.log' }
describe file('/etc/default/logstash') do
its(:content) { should include 'LS_OPTS="-w 1"' }
end
end
end
@ -92,29 +48,16 @@ describe 'puppet-logstash module', :if => ['debian', 'ubuntu'].include?(os[:fami
describe package('openjdk-7-jre-headless') do
it { should be_installed }
end
describe package('logstash') do
it { should be_installed }
end
end
describe 'required services' do
describe service('logstash-agent') do
describe service('logstash') do
it { should be_enabled }
it { should be_running }
end
describe service('logstash-indexer') do
it { should be_enabled }
it { should be_running }
end
end
describe 'required user' do
describe user('logstash') do
it { should exist }
it { should belong_to_group 'logstash' }
it { should have_home_directory '/opt/logstash' }
end
describe group('logstash') do
it { should exist }
end
end
end

View File

@ -15,10 +15,6 @@ file { '/etc/elasticsearch/templates':
class { '::logstash': }
class { '::logstash::agent':
require => Class['::logstash'],
}
class { '::logstash::elasticsearch':
require => Class['::logstash'],
}