Table of Contents

Serverspec

Serverspec : Middleware Spec Files

apache-httpd_spec.rb

describe package('httpd') do
  it { should be_installed }
end

describe service('htpd') do
  it { should be_enabled } #auto start
  it { should be_running } #
end

describe port(80) do
  it { should be_listening }
end

describe file('/var/log/httpd') do
  it { should be_directory }
end

mariadb_spec.rb

require 'spec_helper'

# install check
describe package('mariadb-server') do
#  it { should be_installed }
  it { should be_installed.with_version '5.5' }
end

# service check
describe service('mariadb') do
  it { should be_enabled }
  it { should be_running }
end

# Listen port check
describe port(3306) do
  it { should be_listening }
end

zabbix-agent_spec.rb

require 'spec_helper'
properties = property['zabbix-agent']

describe package('zabbix-agent') do
  it { should be_installed }
end

describe service('zabbix-agent') do
  it { should be_enabled }
  it { should be_running }
end

describe command('zabbix_agentd -V') do
  it { should return_stdout /#{properties[:version]}/ }
end