Skip to content

Instantly share code, notes, and snippets.

@slyness
Created June 24, 2014 20:01
Show Gist options
  • Select an option

  • Save slyness/92148f9906cb8e4d793d to your computer and use it in GitHub Desktop.

Select an option

Save slyness/92148f9906cb8e4d793d to your computer and use it in GitHub Desktop.
require "serverspec"
require "net/http"
require "uri"
include Serverspec::Helper::Exec
include Serverspec::Helper::DetectOS
RSpec.configure do |c|
c.before :all do
c.path = "/sbin:/usr/sbin"
end
end
%w[
check-http.rb
check-haproxy.rb
check-banner.rb
check-socket.rb
check-dns.rb
].each do |plugin|
describe file(File.join("/etc/sensu/plugins", plugin)) do
it { should be_file }
it { should be_mode 755 }
it { should be_owned_by "root" }
it { should be_grouped_into "sensu" }
end
end
describe file("/etc/sensu/handlers/pagerduty.rb") do
it { should be_file }
it { should be_mode 755 }
it { should be_owned_by "root" }
it { should be_grouped_into "sensu" }
end
describe file("/etc/sensu/extensions/system_profile.rb") do
it { should be_file }
it { should be_mode 755 }
it { should be_owned_by "root" }
it { should be_grouped_into "sensu" }
end
@slyness
Copy link
Author

slyness commented Jun 27, 2014

This is a server spec test file called assest which includes spec_helper and tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment