-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(default): replace Serverspec with InSpec testing
- Loading branch information
Showing
4 changed files
with
66 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# frozen_string_literal: true | ||
|
||
control 'snmp.config.file' do | ||
title 'Verify the configuration file' | ||
|
||
# Overide by platform family | ||
config_file, root_group = | ||
case platform[:family] | ||
when 'bsd' | ||
%w[/usr/local/etc/snmp/snmpd.conf wheel] | ||
else | ||
%w[/etc/snmp/snmpd.conf root] | ||
end | ||
|
||
describe file(config_file) do | ||
it { should be_file } | ||
it { should be_owned_by 'root' } | ||
it { should be_grouped_into root_group } | ||
its('mode') { should cmp '0644' } | ||
its('content') { should include 'syslocation Right Here' } | ||
its('content') { should include 'syscontact System Admin' } | ||
its('content') { should include 'dontLogTCPWrappersConnects yes' } | ||
its('content') { should include 'view all included .1 80' } | ||
its('content') { should include 'rocommunity public localhost' } | ||
its('content') { should include 'rocommunity public 192.168.0.0/24' } | ||
its('content') { should include 'rocommunity public 192.168.1.0/24' } | ||
its('content') { should include 'rwcommunity private 192.168.1.0/24' } | ||
its('content') { should include 'rouser myv3user auth -V all' } | ||
its('content') do | ||
should include 'createUser myv3user SHA myv3password AES v3privpass' | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# frozen_string_literal: true | ||
|
||
control 'snmp.package.install' do | ||
title 'The required package should be installed' | ||
|
||
# Overide by platform family | ||
package_name = | ||
case system.platform[:family] | ||
when 'debian' | ||
'snmpd' | ||
when 'gentoo' | ||
'net-analyzer/net-snmp' | ||
else | ||
'net-snmp' | ||
end | ||
|
||
describe package(package_name) do | ||
it { should be_installed } | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# frozen_string_literal: true | ||
|
||
control 'snmp.service.running' do | ||
title 'The service should be installed, enabled and running' | ||
|
||
service_name = 'snmpd' | ||
|
||
describe service(service_name) do | ||
it { should be_installed } | ||
it { should be_enabled } | ||
it { should be_running } | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.