serverspec-clc 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +26 -0
- data/.gitmodules +3 -0
- data/.travis.yml +14 -0
- data/Gemfile +8 -0
- data/Guardfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +15 -0
- data/Rakefile +30 -0
- data/WINDOWS_SUPPORT.md +116 -0
- data/bin/serverspec-init +7 -0
- data/lib/serverspec.rb +33 -0
- data/lib/serverspec/commands/base.rb +7 -0
- data/lib/serverspec/helper.rb +8 -0
- data/lib/serverspec/helper/type.rb +23 -0
- data/lib/serverspec/matcher.rb +35 -0
- data/lib/serverspec/matcher/be_enabled.rb +13 -0
- data/lib/serverspec/matcher/be_executable.rb +13 -0
- data/lib/serverspec/matcher/be_installed.rb +13 -0
- data/lib/serverspec/matcher/be_listening.rb +13 -0
- data/lib/serverspec/matcher/be_mounted.rb +15 -0
- data/lib/serverspec/matcher/be_reachable.rb +17 -0
- data/lib/serverspec/matcher/be_readable.rb +13 -0
- data/lib/serverspec/matcher/be_resolvable.rb +9 -0
- data/lib/serverspec/matcher/be_running.rb +13 -0
- data/lib/serverspec/matcher/be_writable.rb +13 -0
- data/lib/serverspec/matcher/belong_to_group.rb +5 -0
- data/lib/serverspec/matcher/belong_to_primary_group.rb +5 -0
- data/lib/serverspec/matcher/contain.rb +24 -0
- data/lib/serverspec/matcher/have_entry.rb +14 -0
- data/lib/serverspec/matcher/have_rule.rb +17 -0
- data/lib/serverspec/matcher/have_site_application.rb +18 -0
- data/lib/serverspec/matcher/have_site_bindings.rb +22 -0
- data/lib/serverspec/matcher/have_virtual_dir.rb +14 -0
- data/lib/serverspec/setup.rb +333 -0
- data/lib/serverspec/subject.rb +12 -0
- data/lib/serverspec/type/base.rb +21 -0
- data/lib/serverspec/type/cgroup.rb +17 -0
- data/lib/serverspec/type/command.rb +20 -0
- data/lib/serverspec/type/cron.rb +11 -0
- data/lib/serverspec/type/default_gateway.rb +15 -0
- data/lib/serverspec/type/file.rb +113 -0
- data/lib/serverspec/type/group.rb +11 -0
- data/lib/serverspec/type/host.rb +15 -0
- data/lib/serverspec/type/iis_app_pool.rb +43 -0
- data/lib/serverspec/type/iis_website.rb +40 -0
- data/lib/serverspec/type/interface.rb +18 -0
- data/lib/serverspec/type/ip6tables.rb +13 -0
- data/lib/serverspec/type/ipfilter.rb +11 -0
- data/lib/serverspec/type/ipnat.rb +11 -0
- data/lib/serverspec/type/iptables.rb +11 -0
- data/lib/serverspec/type/kernel_module.rb +7 -0
- data/lib/serverspec/type/linux_kernel_parameter.rb +10 -0
- data/lib/serverspec/type/lxc.rb +15 -0
- data/lib/serverspec/type/mail_alias.rb +7 -0
- data/lib/serverspec/type/package.rb +65 -0
- data/lib/serverspec/type/php_config.rb +10 -0
- data/lib/serverspec/type/port.rb +40 -0
- data/lib/serverspec/type/ppa.rb +11 -0
- data/lib/serverspec/type/process.rb +27 -0
- data/lib/serverspec/type/routing_table.rb +11 -0
- data/lib/serverspec/type/selinux.rb +19 -0
- data/lib/serverspec/type/selinux_module.rb +11 -0
- data/lib/serverspec/type/service.rb +33 -0
- data/lib/serverspec/type/user.rb +31 -0
- data/lib/serverspec/type/windows_feature.rb +7 -0
- data/lib/serverspec/type/windows_hot_fix.rb +7 -0
- data/lib/serverspec/type/windows_registry_key.rb +19 -0
- data/lib/serverspec/type/windows_scheduled_task.rb +7 -0
- data/lib/serverspec/type/yumrepo.rb +11 -0
- data/lib/serverspec/type/zfs.rb +15 -0
- data/lib/serverspec/version.rb +3 -0
- data/serverspec.gemspec +26 -0
- data/spec/helper/type_spec.rb +6 -0
- data/spec/spec_helper.rb +28 -0
- data/spec/type/aix/file_spec.rb +31 -0
- data/spec/type/aix/group_spec.rb +7 -0
- data/spec/type/aix/package_spec.rb +7 -0
- data/spec/type/aix/port_spec.rb +20 -0
- data/spec/type/aix/service_spec.rb +12 -0
- data/spec/type/aix/user_spec.rb +16 -0
- data/spec/type/arch/file_spec.rb +15 -0
- data/spec/type/arch/package_spec.rb +19 -0
- data/spec/type/arch/service_spec.rb +9 -0
- data/spec/type/base/command_spec.rb +62 -0
- data/spec/type/base/cron_spec.rb +11 -0
- data/spec/type/base/default_gateway_spec.rb +11 -0
- data/spec/type/base/file_spec.rb +336 -0
- data/spec/type/base/group_spec.rb +11 -0
- data/spec/type/base/host_spec.rb +36 -0
- data/spec/type/base/mail_alias_spec.rb +7 -0
- data/spec/type/base/package_spec.rb +43 -0
- data/spec/type/base/php_config_spec.rb +33 -0
- data/spec/type/base/port_spec.rb +34 -0
- data/spec/type/base/process_spec.rb +35 -0
- data/spec/type/base/routing_table_spec.rb +118 -0
- data/spec/type/base/service_spec.rb +45 -0
- data/spec/type/base/user_spec.rb +31 -0
- data/spec/type/darwin/file_spec.rb +41 -0
- data/spec/type/darwin/package_spec.rb +19 -0
- data/spec/type/darwin/port_spec.rb +27 -0
- data/spec/type/darwin/service_spec.rb +16 -0
- data/spec/type/debian/package_spec.rb +23 -0
- data/spec/type/debian/service_spec.rb +11 -0
- data/spec/type/fedora/service_spec.rb +15 -0
- data/spec/type/fedora15/service_spec.rb +15 -0
- data/spec/type/fedora20/service_spec.rb +15 -0
- data/spec/type/freebsd/file_spec.rb +29 -0
- data/spec/type/freebsd/package_spec.rb +19 -0
- data/spec/type/freebsd/port_spec.rb +27 -0
- data/spec/type/freebsd/service_spec.rb +8 -0
- data/spec/type/freebsd10/package_spec.rb +19 -0
- data/spec/type/gentoo/package_spec.rb +7 -0
- data/spec/type/gentoo/service_spec.rb +12 -0
- data/spec/type/linux/cgroup_spec.rb +13 -0
- data/spec/type/linux/file_spec.rb +21 -0
- data/spec/type/linux/interface_spec.rb +25 -0
- data/spec/type/linux/ip6tables_spec.rb +19 -0
- data/spec/type/linux/iptables_spec.rb +11 -0
- data/spec/type/linux/kernel_module_spec.rb +7 -0
- data/spec/type/linux/linux_kernel_parameter_spec.rb +33 -0
- data/spec/type/linux/lxc_container_spec.rb +12 -0
- data/spec/type/linux/selinux_module_spec.rb +11 -0
- data/spec/type/linux/selinux_spec.rb +15 -0
- data/spec/type/linux/zfs_spec.rb +15 -0
- data/spec/type/nixos/package_spec.rb +15 -0
- data/spec/type/nixos/service_spec.rb +9 -0
- data/spec/type/openbsd/file_spec.rb +134 -0
- data/spec/type/openbsd/interface_spec.rb +21 -0
- data/spec/type/openbsd/mail_alias_spec.rb +7 -0
- data/spec/type/openbsd/package_spec.rb +11 -0
- data/spec/type/openbsd/port_spec.rb +7 -0
- data/spec/type/openbsd/service_spec.rb +13 -0
- data/spec/type/openbsd/user_spec.rb +12 -0
- data/spec/type/opensuse/service_spec.rb +16 -0
- data/spec/type/plamo/package_spec.rb +8 -0
- data/spec/type/plamo/service_spec.rb +8 -0
- data/spec/type/redhat/file_spec.rb +19 -0
- data/spec/type/redhat/package_spec.rb +23 -0
- data/spec/type/redhat/service_spec.rb +11 -0
- data/spec/type/redhat/yumrepo_spec.rb +11 -0
- data/spec/type/redhat5/iptables_spec.rb +11 -0
- data/spec/type/redhat7/service_spec.rb +9 -0
- data/spec/type/smartos/package_spec.rb +19 -0
- data/spec/type/smartos/service_spec.rb +16 -0
- data/spec/type/solaris/cron_spec.rb +11 -0
- data/spec/type/solaris/file_spec.rb +15 -0
- data/spec/type/solaris/group_spec.rb +7 -0
- data/spec/type/solaris/host_spec.rb +19 -0
- data/spec/type/solaris/ipfilter_spec.rb +7 -0
- data/spec/type/solaris/ipnat_spec.rb +7 -0
- data/spec/type/solaris/package_spec.rb +7 -0
- data/spec/type/solaris/port_spec.rb +34 -0
- data/spec/type/solaris/service_spec.rb +16 -0
- data/spec/type/solaris/user_spec.rb +16 -0
- data/spec/type/solaris/zfs_spec.rb +15 -0
- data/spec/type/solaris10/file_spec.rb +313 -0
- data/spec/type/solaris10/group_spec.rb +8 -0
- data/spec/type/solaris10/host_spec.rb +16 -0
- data/spec/type/solaris10/package_spec.rb +8 -0
- data/spec/type/solaris10/user_spec.rb +8 -0
- data/spec/type/suse/package_spec.rb +23 -0
- data/spec/type/suse/service_spec.rb +11 -0
- data/spec/type/ubuntu/ppa_spec.rb +11 -0
- data/spec/type/ubuntu/service_spec.rb +7 -0
- data/spec/type/windows/command_spec.rb +64 -0
- data/spec/type/windows/feature_spec.rb +17 -0
- data/spec/type/windows/file_spec.rb +121 -0
- data/spec/type/windows/group_spec.rb +23 -0
- data/spec/type/windows/host_spec.rb +32 -0
- data/spec/type/windows/hot_fix_spec.rb +22 -0
- data/spec/type/windows/iis_app_pool_spec.rb +17 -0
- data/spec/type/windows/iis_webisite_spec.rb +16 -0
- data/spec/type/windows/package_spec.rb +10 -0
- data/spec/type/windows/port_spec.rb +25 -0
- data/spec/type/windows/registry_key_spec.rb +58 -0
- data/spec/type/windows/scheduled_task_spec.rb +9 -0
- data/spec/type/windows/service_spec.rb +30 -0
- data/spec/type/windows/user_spec.rb +33 -0
- metadata +400 -0
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
set :os, :family => 'base'
|
4
|
+
|
5
|
+
describe host('127.0.0.1') do
|
6
|
+
it { should be_resolvable }
|
7
|
+
end
|
8
|
+
|
9
|
+
describe host('127.0.0.1') do
|
10
|
+
it { should be_resolvable.by('hosts') }
|
11
|
+
end
|
12
|
+
|
13
|
+
describe host('127.0.0.1') do
|
14
|
+
it { should be_resolvable.by('dns') }
|
15
|
+
end
|
16
|
+
|
17
|
+
describe host('127.0.0.1') do
|
18
|
+
it { should be_reachable }
|
19
|
+
end
|
20
|
+
|
21
|
+
describe host('127.0.0.1') do
|
22
|
+
it { should be_reachable.with(:proto => "icmp", :timeout=> 1) }
|
23
|
+
end
|
24
|
+
|
25
|
+
describe host('127.0.0.1') do
|
26
|
+
it { should be_reachable.with(:proto => "tcp", :port => 22, :timeout=> 1) }
|
27
|
+
end
|
28
|
+
|
29
|
+
describe host('127.0.0.1') do
|
30
|
+
it { should be_reachable.with(:proto => "udp", :port => 53, :timeout=> 1) }
|
31
|
+
end
|
32
|
+
|
33
|
+
describe host('example.jp') do
|
34
|
+
let(:stdout) { "1.2.3.4\r\n" }
|
35
|
+
its(:ipaddress) { should eq '1.2.3.4' }
|
36
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
set :os, :family => 'base'
|
4
|
+
|
5
|
+
describe package('jekyll') do
|
6
|
+
it { should be_installed.by(:gem) }
|
7
|
+
end
|
8
|
+
|
9
|
+
describe package('jekyll') do
|
10
|
+
it { should be_installed.by(:gem).with_version('1.1.1') }
|
11
|
+
end
|
12
|
+
|
13
|
+
describe package('bower') do
|
14
|
+
it { should be_installed.by(:npm) }
|
15
|
+
end
|
16
|
+
|
17
|
+
describe package('bower') do
|
18
|
+
it { should be_installed.by(:npm).with_version('0.9.2') }
|
19
|
+
end
|
20
|
+
|
21
|
+
describe package('mongo') do
|
22
|
+
it { should be_installed.by(:pecl) }
|
23
|
+
end
|
24
|
+
|
25
|
+
describe package('mongo') do
|
26
|
+
it { should be_installed.by(:pecl).with_version('1.4.1') }
|
27
|
+
end
|
28
|
+
|
29
|
+
describe package('XML_Util') do
|
30
|
+
it { should be_installed.by(:pear).with_version('1.2.1') }
|
31
|
+
end
|
32
|
+
|
33
|
+
describe package('supervisor') do
|
34
|
+
it { should be_installed.by(:pip).with_version('3.0') }
|
35
|
+
end
|
36
|
+
|
37
|
+
describe package('App::Ack') do
|
38
|
+
it { should be_installed.by(:cpan) }
|
39
|
+
end
|
40
|
+
|
41
|
+
describe package('App::Ack') do
|
42
|
+
it { should be_installed.by(:cpan).with_version('2.04') }
|
43
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
set :os, :family => 'base'
|
4
|
+
|
5
|
+
describe php_config('default_mimetype') do
|
6
|
+
let(:stdout) { 'text/html' }
|
7
|
+
its(:value) { should eq 'text/html' }
|
8
|
+
end
|
9
|
+
|
10
|
+
describe php_config('default_mimetype') do
|
11
|
+
let(:stdout) { 'text/html' }
|
12
|
+
its(:value) { should_not eq 'text/plain' }
|
13
|
+
end
|
14
|
+
|
15
|
+
describe php_config('session.cache_expire') do
|
16
|
+
let(:stdout) { '180' }
|
17
|
+
its(:value) { should eq 180 }
|
18
|
+
end
|
19
|
+
|
20
|
+
describe php_config('session.cache_expire') do
|
21
|
+
let(:stdout) { '180' }
|
22
|
+
its(:value) { should_not eq 360 }
|
23
|
+
end
|
24
|
+
|
25
|
+
describe php_config('mbstring.http_output_conv_mimetypes') do
|
26
|
+
let(:stdout) { 'application' }
|
27
|
+
its(:value) { should match /application/ }
|
28
|
+
end
|
29
|
+
|
30
|
+
describe php_config('mbstring.http_output_conv_mimetypes') do
|
31
|
+
let(:stdout) { 'application' }
|
32
|
+
its(:value) { should_not match /html/ }
|
33
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
set :os, :family => 'base'
|
4
|
+
|
5
|
+
describe port(80) do
|
6
|
+
it { should be_listening }
|
7
|
+
end
|
8
|
+
|
9
|
+
describe port(80) do
|
10
|
+
it { should be_listening.with('tcp') }
|
11
|
+
end
|
12
|
+
|
13
|
+
describe port(80) do
|
14
|
+
it do
|
15
|
+
expect {
|
16
|
+
should be_listening.with('not implemented')
|
17
|
+
}.to raise_error(ArgumentError, %r/\A`be_listening` matcher doesn\'t support/)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
describe port(80) do
|
22
|
+
it { should be_listening.on('127.0.0.1') }
|
23
|
+
end
|
24
|
+
|
25
|
+
describe port(80) do
|
26
|
+
it do
|
27
|
+
expect{ should be_listening.on('') }.to raise_error(ArgumentError)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
describe port(53) do
|
32
|
+
it { should be_listening.with('udp') }
|
33
|
+
end
|
34
|
+
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
set :os, :family => 'base'
|
4
|
+
|
5
|
+
describe process("memcached") do
|
6
|
+
let(:stdout) { " 1407\n" }
|
7
|
+
its(:pid) { should eq 1407 }
|
8
|
+
end
|
9
|
+
|
10
|
+
describe process("memcached") do
|
11
|
+
let(:stdout) { "/usr/bin/memcached -m 14386 -p 11211 -u nobody -l 10.11.1.53 -c 30000\n" }
|
12
|
+
its(:args) { should match /-c 30000\b/ }
|
13
|
+
end
|
14
|
+
|
15
|
+
describe process("memcached") do
|
16
|
+
let(:stdout) { "nobody\n" }
|
17
|
+
its(:user) { should eq "nobody" }
|
18
|
+
end
|
19
|
+
|
20
|
+
describe process("memcached") do
|
21
|
+
let(:stdout) { "nobody\n" }
|
22
|
+
its(:group) { should eq "nobody" }
|
23
|
+
end
|
24
|
+
|
25
|
+
describe process("memcached") do
|
26
|
+
context "when running" do
|
27
|
+
let(:stdout) { " 1407\n" }
|
28
|
+
it { should be_running }
|
29
|
+
end
|
30
|
+
|
31
|
+
context "when not running" do
|
32
|
+
let(:stdout) { " 1407\n" }
|
33
|
+
it { should be_running }
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,118 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
set :os, :family => 'base'
|
4
|
+
|
5
|
+
describe routing_table do
|
6
|
+
let(:stdout) { "192.168.100.0/24 dev eth1 proto kernel scope link src 192.168.100.10 \r\ndefault via 192.168.100.1 dev eth0 \r\n" }
|
7
|
+
it { should have_entry( :destination => '192.168.100.0/24' ) }
|
8
|
+
end
|
9
|
+
|
10
|
+
describe routing_table do
|
11
|
+
let(:stdout) { "192.168.100.0/24 dev eth1 proto kernel scope link src 192.168.100.10 \r\ndefault via 192.168.100.1 dev eth0 \r\n" }
|
12
|
+
it { should_not have_entry( :destination => '192.168.100.100/24' ) }
|
13
|
+
end
|
14
|
+
|
15
|
+
describe routing_table do
|
16
|
+
let(:stdout) { "192.168.100.0/24 dev eth1 proto kernel scope link src 192.168.100.10 \r\ndefault via 192.168.100.1 dev eth0 \r\n" }
|
17
|
+
it do
|
18
|
+
should have_entry(
|
19
|
+
:destination => '192.168.100.0/24',
|
20
|
+
:gateway => '192.168.100.1'
|
21
|
+
)
|
22
|
+
end
|
23
|
+
|
24
|
+
it do
|
25
|
+
should have_entry(
|
26
|
+
:destination => '192.168.100.0/24',
|
27
|
+
:gateway => '192.168.100.1',
|
28
|
+
:interface => 'eth1'
|
29
|
+
)
|
30
|
+
end
|
31
|
+
|
32
|
+
it do
|
33
|
+
should_not have_entry(
|
34
|
+
:gateway => '192.168.100.1',
|
35
|
+
:interface => 'eth1'
|
36
|
+
)
|
37
|
+
end
|
38
|
+
|
39
|
+
it do
|
40
|
+
should_not have_entry(
|
41
|
+
:destination => '192.168.100.0/32',
|
42
|
+
:gateway => '192.168.100.1',
|
43
|
+
:interface => 'eth1'
|
44
|
+
)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
describe routing_table do
|
49
|
+
let(:stdout) { "192.168.200.0/24 via 192.168.200.1 dev eth0 \r\ndefault via 192.168.100.1 dev eth0 \r\n" }
|
50
|
+
it { should have_entry( :destination => '192.168.200.0/24' ) }
|
51
|
+
it { should_not have_entry( :destination => '192.168.200.200/24' ) }
|
52
|
+
|
53
|
+
it do
|
54
|
+
should have_entry(
|
55
|
+
:destination => '192.168.200.0/24',
|
56
|
+
:gateway => '192.168.200.1'
|
57
|
+
)
|
58
|
+
end
|
59
|
+
|
60
|
+
it do
|
61
|
+
should have_entry(
|
62
|
+
:destination => '192.168.200.0/24',
|
63
|
+
:gateway => '192.168.200.1',
|
64
|
+
:interface => 'eth0'
|
65
|
+
)
|
66
|
+
end
|
67
|
+
|
68
|
+
it do
|
69
|
+
should_not have_entry(
|
70
|
+
:gateway => '192.168.200.1',
|
71
|
+
:interface => 'eth0'
|
72
|
+
)
|
73
|
+
end
|
74
|
+
|
75
|
+
it do
|
76
|
+
should_not have_entry(
|
77
|
+
:destination => '192.168.200.0/32',
|
78
|
+
:gateway => '192.168.200.1',
|
79
|
+
:interface => 'eth0'
|
80
|
+
)
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
describe routing_table do
|
85
|
+
let(:stdout) { "default via 10.0.2.2 dev eth0 \r\n" }
|
86
|
+
it { should have_entry( :destination => 'default' ) }
|
87
|
+
it { should_not have_entry( :destination => 'defaulth' ) }
|
88
|
+
|
89
|
+
it do
|
90
|
+
should have_entry(
|
91
|
+
:destination => 'default',
|
92
|
+
:gateway => '10.0.2.2'
|
93
|
+
)
|
94
|
+
end
|
95
|
+
|
96
|
+
it do
|
97
|
+
should have_entry(
|
98
|
+
:destination => 'default',
|
99
|
+
:gateway => '10.0.2.2',
|
100
|
+
:interface => 'eth0'
|
101
|
+
)
|
102
|
+
end
|
103
|
+
|
104
|
+
it do
|
105
|
+
should_not have_entry(
|
106
|
+
:gateway => '10.0.2.2',
|
107
|
+
:interface => 'eth0'
|
108
|
+
)
|
109
|
+
end
|
110
|
+
|
111
|
+
it do
|
112
|
+
should_not have_entry(
|
113
|
+
:destination => 'default',
|
114
|
+
:gateway => '10.0.2.1',
|
115
|
+
:interface => 'eth0'
|
116
|
+
)
|
117
|
+
end
|
118
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
set :os, :family => 'base'
|
4
|
+
|
5
|
+
describe service('sshd') do
|
6
|
+
it { should be_running }
|
7
|
+
end
|
8
|
+
|
9
|
+
describe service('sshd') do
|
10
|
+
let(:stdout) { "sshd is stopped\r\n" }
|
11
|
+
it { should be_running }
|
12
|
+
end
|
13
|
+
|
14
|
+
describe service('sshd') do
|
15
|
+
it { should be_running.under(:supervisor) }
|
16
|
+
end
|
17
|
+
|
18
|
+
describe service('sshd') do
|
19
|
+
it { should be_running.under(:upstart) }
|
20
|
+
end
|
21
|
+
|
22
|
+
describe service('sshd') do
|
23
|
+
it {
|
24
|
+
expect {
|
25
|
+
should be_running.under('not implemented')
|
26
|
+
}.to raise_exception
|
27
|
+
}
|
28
|
+
end
|
29
|
+
|
30
|
+
describe service('sshd') do
|
31
|
+
let(:stdout) { "Process 'sshd'\r\n status running\r\n monitoring status monitored" }
|
32
|
+
it { should be_monitored_by(:monit) }
|
33
|
+
end
|
34
|
+
|
35
|
+
describe service('unicorn') do
|
36
|
+
it { should be_monitored_by(:god) }
|
37
|
+
end
|
38
|
+
|
39
|
+
describe service('sshd') do
|
40
|
+
it {
|
41
|
+
expect {
|
42
|
+
should be_monitored_by('not implemented')
|
43
|
+
}.to raise_exception
|
44
|
+
}
|
45
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
set :os, :family => 'base'
|
4
|
+
|
5
|
+
describe user('root') do
|
6
|
+
it { should exist }
|
7
|
+
end
|
8
|
+
|
9
|
+
describe user('root') do
|
10
|
+
it { should belong_to_group 'root' }
|
11
|
+
end
|
12
|
+
|
13
|
+
describe user('root') do
|
14
|
+
it { should belong_to_primary_group 'root' }
|
15
|
+
end
|
16
|
+
|
17
|
+
describe user('root') do
|
18
|
+
it { should have_uid 0 }
|
19
|
+
end
|
20
|
+
|
21
|
+
describe user('root') do
|
22
|
+
it { should have_login_shell '/bin/bash' }
|
23
|
+
end
|
24
|
+
|
25
|
+
describe user('root') do
|
26
|
+
it { should have_home_directory '/root' }
|
27
|
+
end
|
28
|
+
|
29
|
+
describe user('root') do
|
30
|
+
it { should have_authorized_key 'ssh-rsa ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGH foo@bar.local' }
|
31
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
set :os, :family => 'darwin'
|
4
|
+
|
5
|
+
describe file('/tmp') do
|
6
|
+
it { should be_readable.by_user('mail') }
|
7
|
+
end
|
8
|
+
|
9
|
+
describe file('/tmp') do
|
10
|
+
it { should be_writable.by_user('mail') }
|
11
|
+
end
|
12
|
+
|
13
|
+
describe file('/tmp') do
|
14
|
+
it { should be_executable.by_user('mail') }
|
15
|
+
end
|
16
|
+
|
17
|
+
describe file('/etc/services') do
|
18
|
+
let(:stdout) { "35435ea447c19f0ea5ef971837ab9ced\n" }
|
19
|
+
its(:md5sum) { should eq '35435ea447c19f0ea5ef971837ab9ced' }
|
20
|
+
end
|
21
|
+
|
22
|
+
describe file('/etc/services') do
|
23
|
+
let(:stdout) {"0c3feee1353a8459f8c7d84885e6bc602ef853751ffdbce3e3b6dfa1d345fc7a" }
|
24
|
+
its(:sha256sum) { should eq '0c3feee1353a8459f8c7d84885e6bc602ef853751ffdbce3e3b6dfa1d345fc7a' }
|
25
|
+
end
|
26
|
+
|
27
|
+
describe file('/etc/pam.d/system-auth') do
|
28
|
+
it { should be_linked_to '/etc/pam.d/system-auth-ac' }
|
29
|
+
end
|
30
|
+
|
31
|
+
describe file('/etc/passwd') do
|
32
|
+
it { should be_mode 644 }
|
33
|
+
end
|
34
|
+
|
35
|
+
describe file('/etc/passwd') do
|
36
|
+
it { should be_owned_by 'root' }
|
37
|
+
end
|
38
|
+
|
39
|
+
describe file('/etc/passwd') do
|
40
|
+
it { should be_grouped_into 'root' }
|
41
|
+
end
|