serverspec 2.0.0.beta19 → 2.0.0.beta20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/WINDOWS_SUPPORT.md +9 -13
- data/lib/serverspec/helper/type.rb +7 -9
- data/lib/serverspec/helper.rb +0 -2
- data/lib/serverspec/setup.rb +11 -7
- data/lib/serverspec/type/base.rb +15 -17
- data/lib/serverspec/type/cgroup.rb +13 -16
- data/lib/serverspec/type/command.rb +14 -17
- data/lib/serverspec/type/cron.rb +8 -9
- data/lib/serverspec/type/default_gateway.rb +14 -16
- data/lib/serverspec/type/file.rb +76 -78
- data/lib/serverspec/type/group.rb +7 -9
- data/lib/serverspec/type/host.rb +10 -12
- data/lib/serverspec/type/iis_app_pool.rb +40 -42
- data/lib/serverspec/type/iis_website.rb +28 -31
- data/lib/serverspec/type/interface.rb +10 -12
- data/lib/serverspec/type/ipfilter.rb +7 -9
- data/lib/serverspec/type/ipnat.rb +7 -9
- data/lib/serverspec/type/iptables.rb +7 -9
- data/lib/serverspec/type/kernel_module.rb +4 -6
- data/lib/serverspec/type/linux_kernel_parameter.rb +7 -9
- data/lib/serverspec/type/lxc.rb +10 -12
- data/lib/serverspec/type/mail_alias.rb +4 -6
- data/lib/serverspec/type/package.rb +48 -50
- data/lib/serverspec/type/php_config.rb +7 -9
- data/lib/serverspec/type/port.rb +28 -30
- data/lib/serverspec/type/ppa.rb +7 -9
- data/lib/serverspec/type/process.rb +20 -22
- data/lib/serverspec/type/routing_table.rb +7 -9
- data/lib/serverspec/type/selinux.rb +13 -17
- data/lib/serverspec/type/service.rb +24 -26
- data/lib/serverspec/type/user.rb +22 -30
- data/lib/serverspec/type/windows_feature.rb +4 -6
- data/lib/serverspec/type/windows_hot_fix.rb +4 -6
- data/lib/serverspec/type/windows_registry_key.rb +13 -15
- data/lib/serverspec/type/windows_scheduled_task.rb +4 -6
- data/lib/serverspec/type/yumrepo.rb +7 -9
- data/lib/serverspec/type/zfs.rb +10 -12
- data/lib/serverspec/version.rb +1 -1
- data/lib/serverspec.rb +2 -1
- data/spec/spec_helper.rb +2 -3
- data/spec/type/aix/group_spec.rb +0 -4
- data/spec/type/aix/package_spec.rb +0 -4
- data/spec/type/aix/port_spec.rb +12 -25
- data/spec/type/aix/service_spec.rb +0 -7
- data/spec/type/aix/user_spec.rb +0 -12
- data/spec/type/arch/file_spec.rb +0 -13
- data/spec/type/arch/package_spec.rb +0 -10
- data/spec/type/base/cron_spec.rb +0 -8
- data/spec/type/base/file_spec.rb +0 -53
- data/spec/type/base/group_spec.rb +0 -8
- data/spec/type/base/host_spec.rb +0 -20
- data/spec/type/base/mail_alias_spec.rb +0 -4
- data/spec/type/base/package_spec.rb +10 -38
- data/spec/type/base/port_spec.rb +19 -18
- data/spec/type/base/service_spec.rb +4 -29
- data/spec/type/base/user_spec.rb +0 -24
- data/spec/type/darwin/package_spec.rb +0 -8
- data/spec/type/darwin/port_spec.rb +17 -23
- data/spec/type/darwin/service_spec.rb +0 -12
- data/spec/type/debian/package_spec.rb +0 -12
- data/spec/type/debian/service_spec.rb +0 -8
- data/spec/type/freebsd/file_spec.rb +0 -16
- data/spec/type/freebsd/package_spec.rb +0 -8
- data/spec/type/freebsd/port_spec.rb +17 -23
- data/spec/type/freebsd/service_spec.rb +0 -4
- data/spec/type/freebsd10/package_spec.rb +0 -8
- data/spec/type/gentoo/package_spec.rb +0 -5
- data/spec/type/gentoo/service_spec.rb +0 -8
- data/spec/type/linux/file_spec.rb +0 -13
- data/spec/type/linux/iptables_spec.rb +0 -8
- data/spec/type/linux/kernel_module_spec.rb +0 -4
- data/spec/type/linux/lxc_container_spec.rb +0 -8
- data/spec/type/nixos/package_spec.rb +0 -12
- data/spec/type/openbsd/file_spec.rb +0 -30
- data/spec/type/openbsd/mail_alias_spec.rb +0 -4
- data/spec/type/openbsd/package_spec.rb +0 -9
- data/spec/type/openbsd/service_spec.rb +0 -7
- data/spec/type/openbsd/user_spec.rb +0 -8
- data/spec/type/opensuse/service_spec.rb +0 -12
- data/spec/type/plamo/package_spec.rb +0 -4
- data/spec/type/plamo/service_spec.rb +0 -4
- data/spec/type/redhat/file_spec.rb +0 -13
- data/spec/type/redhat/package_spec.rb +0 -12
- data/spec/type/redhat/service_spec.rb +0 -8
- data/spec/type/redhat/yumrepo_spec.rb +5 -19
- data/spec/type/redhat5/iptables_spec.rb +0 -8
- data/spec/type/smartos/package_spec.rb +0 -8
- data/spec/type/smartos/service_spec.rb +0 -12
- data/spec/type/solaris/cron_spec.rb +0 -8
- data/spec/type/solaris/file_spec.rb +0 -14
- data/spec/type/solaris/group_spec.rb +0 -4
- data/spec/type/solaris/host_spec.rb +3 -11
- data/spec/type/solaris/package_spec.rb +0 -4
- data/spec/type/solaris/port_spec.rb +23 -22
- data/spec/type/solaris/service_spec.rb +0 -12
- data/spec/type/solaris/user_spec.rb +0 -12
- data/spec/type/solaris10/file_spec.rb +0 -58
- data/spec/type/solaris10/group_spec.rb +0 -4
- data/spec/type/solaris10/host_spec.rb +2 -6
- data/spec/type/solaris10/package_spec.rb +0 -3
- data/spec/type/solaris10/user_spec.rb +0 -4
- data/spec/type/suse/package_spec.rb +0 -12
- data/spec/type/suse/service_spec.rb +0 -8
- data/spec/type/ubuntu/ppa_spec.rb +0 -8
- data/spec/type/ubuntu/service_spec.rb +0 -4
- data/spec/type/windows/feature_spec.rb +8 -0
- data/spec/type/windows/file_spec.rb +0 -36
- data/spec/type/windows/group_spec.rb +0 -4
- data/spec/type/windows/host_spec.rb +0 -20
- data/spec/type/windows/port_spec.rb +0 -4
- data/spec/type/windows/service_spec.rb +0 -8
- data/spec/type/windows/user_spec.rb +0 -8
- metadata +2 -5
- data/lib/serverspec/helper/properties.rb +0 -9
- data/spec/helper/properties_spec.rb +0 -11
@@ -6,23 +6,11 @@ describe service('sshd') do
|
|
6
6
|
it { should be_enabled }
|
7
7
|
end
|
8
8
|
|
9
|
-
describe service('invalid-service') do
|
10
|
-
it { should_not be_enabled }
|
11
|
-
end
|
12
|
-
|
13
9
|
describe service('sshd') do
|
14
10
|
it { should be_enabled.with_level(4) }
|
15
11
|
end
|
16
12
|
|
17
|
-
describe service('invalid-service') do
|
18
|
-
it { should_not be_enabled.with_level(4) }
|
19
|
-
end
|
20
|
-
|
21
13
|
describe service('sshd') do
|
22
14
|
it { should be_running }
|
23
15
|
end
|
24
16
|
|
25
|
-
describe service('invalid-service') do
|
26
|
-
it { should_not be_running }
|
27
|
-
end
|
28
|
-
|
@@ -6,27 +6,14 @@ describe file('/tmp') do
|
|
6
6
|
it { should be_readable.by_user('mail') }
|
7
7
|
end
|
8
8
|
|
9
|
-
describe file('/tmp') do
|
10
|
-
it { should_not be_readable.by_user('invalid-user') }
|
11
|
-
end
|
12
|
-
|
13
9
|
describe file('/tmp') do
|
14
10
|
it { should be_writable.by_user('mail') }
|
15
11
|
end
|
16
12
|
|
17
|
-
describe file('/tmp') do
|
18
|
-
it { should_not be_writable.by_user('invalid-user') }
|
19
|
-
end
|
20
|
-
|
21
|
-
|
22
13
|
describe file('/tmp') do
|
23
14
|
it { should be_executable.by_user('mail') }
|
24
15
|
end
|
25
16
|
|
26
|
-
describe file('/tmp') do
|
27
|
-
it { should_not be_executable.by_user('invalid-user') }
|
28
|
-
end
|
29
|
-
|
30
17
|
describe file('/tmp') do
|
31
18
|
it { should be_immutable }
|
32
19
|
end
|
@@ -6,14 +6,6 @@ describe package('httpd') do
|
|
6
6
|
it { should be_installed }
|
7
7
|
end
|
8
8
|
|
9
|
-
describe package('invalid-package') do
|
10
|
-
it { should_not be_installed }
|
11
|
-
end
|
12
|
-
|
13
|
-
describe package('invalid-package') do
|
14
|
-
it { should_not be_installed.by('rpm') }
|
15
|
-
end
|
16
|
-
|
17
9
|
describe package('httpd') do
|
18
10
|
it { should be_installed.with_version('2.2.15-28.el6') }
|
19
11
|
end
|
@@ -22,10 +14,6 @@ describe package('httpd') do
|
|
22
14
|
it { should be_installed.by('rpm').with_version('2.2.15-28.el6') }
|
23
15
|
end
|
24
16
|
|
25
|
-
describe package('httpd') do
|
26
|
-
it { should_not be_installed.with_version('invalid-version') }
|
27
|
-
end
|
28
|
-
|
29
17
|
describe package('httpd') do
|
30
18
|
let(:stdout) { "2.2.15\n" }
|
31
19
|
its(:version) { should eq '2.2.15' }
|
@@ -6,14 +6,6 @@ describe service('sshd') do
|
|
6
6
|
it { should be_enabled }
|
7
7
|
end
|
8
8
|
|
9
|
-
describe service('invalid-service') do
|
10
|
-
it { should_not be_enabled }
|
11
|
-
end
|
12
|
-
|
13
9
|
describe service('sshd') do
|
14
10
|
it { should be_enabled.with_level(4) }
|
15
11
|
end
|
16
|
-
|
17
|
-
describe service('invalid-service') do
|
18
|
-
it { should_not be_enabled.with_level(4) }
|
19
|
-
end
|
@@ -2,24 +2,10 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
set :os, :family => 'redhat'
|
4
4
|
|
5
|
-
describe
|
6
|
-
|
7
|
-
|
8
|
-
it { should exist }
|
9
|
-
end
|
10
|
-
|
11
|
-
describe yumrepo('invalid-repository') do
|
12
|
-
it { should_not exist }
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
describe 'be_enabled' do
|
17
|
-
describe yumrepo('epel') do
|
18
|
-
it { should be_enabled }
|
19
|
-
end
|
5
|
+
describe yumrepo('epel') do
|
6
|
+
it { should exist }
|
7
|
+
end
|
20
8
|
|
21
|
-
|
22
|
-
|
23
|
-
end
|
24
|
-
end
|
9
|
+
describe yumrepo('epel') do
|
10
|
+
it { should be_enabled }
|
25
11
|
end
|
@@ -6,14 +6,6 @@ describe iptables do
|
|
6
6
|
it { should have_rule '-P INPUT ACCEPT' }
|
7
7
|
end
|
8
8
|
|
9
|
-
describe iptables do
|
10
|
-
it { should_not have_rule 'invalid-rule' }
|
11
|
-
end
|
12
|
-
|
13
9
|
describe iptables do
|
14
10
|
it { should have_rule('-P INPUT ACCEPT').with_table('mangle').with_chain('INPUT') }
|
15
11
|
end
|
16
|
-
|
17
|
-
describe iptables do
|
18
|
-
it { should_not have_rule('invalid-rule').with_table('mangle').with_chain('INPUT') }
|
19
|
-
end
|
@@ -6,18 +6,10 @@ describe package('httpd') do
|
|
6
6
|
it { should be_installed }
|
7
7
|
end
|
8
8
|
|
9
|
-
describe package('invalid-package') do
|
10
|
-
it { should_not be_installed }
|
11
|
-
end
|
12
|
-
|
13
9
|
describe package('httpd') do
|
14
10
|
it { should be_installed.with_version('2.2.15-28.el6') }
|
15
11
|
end
|
16
12
|
|
17
|
-
describe package('httpd') do
|
18
|
-
it { should_not be_installed.with_version('invalid-version') }
|
19
|
-
end
|
20
|
-
|
21
13
|
describe package('httpd') do
|
22
14
|
let(:stdout) { "2.2.15\n" }
|
23
15
|
its(:version) { should eq '2.2.15' }
|
@@ -6,23 +6,11 @@ describe service('sshd') do
|
|
6
6
|
it { should be_enabled }
|
7
7
|
end
|
8
8
|
|
9
|
-
describe service('invalid-service') do
|
10
|
-
it { should_not be_enabled }
|
11
|
-
end
|
12
|
-
|
13
9
|
describe service('sshd') do
|
14
10
|
it { should be_running }
|
15
11
|
end
|
16
12
|
|
17
|
-
describe service('invalid-service') do
|
18
|
-
it { should_not be_running }
|
19
|
-
end
|
20
|
-
|
21
13
|
describe service('sshd') do
|
22
14
|
it { should have_property :foo => 'bar' }
|
23
15
|
end
|
24
16
|
|
25
|
-
describe service('invalid-service') do
|
26
|
-
it { should_not have_property :foo => 'bar' }
|
27
|
-
end
|
28
|
-
|
@@ -6,14 +6,6 @@ describe cron do
|
|
6
6
|
it { should have_entry '* * * * * /usr/local/bin/batch.sh' }
|
7
7
|
end
|
8
8
|
|
9
|
-
describe cron do
|
10
|
-
it { should_not have_entry 'invalid entry' }
|
11
|
-
end
|
12
|
-
|
13
9
|
describe cron do
|
14
10
|
it { should have_entry('* * * * * /usr/local/bin/batch.sh').with_user('root') }
|
15
11
|
end
|
16
|
-
|
17
|
-
describe cron do
|
18
|
-
it { should_not have_entry('* * * * * /usr/local/bin/batch.sh').with_user('invalid-user') }
|
19
|
-
end
|
@@ -6,24 +6,10 @@ describe file('/tmp') do
|
|
6
6
|
it { should be_readable.by_user('mail') }
|
7
7
|
end
|
8
8
|
|
9
|
-
describe file('/tmp') do
|
10
|
-
it { should_not be_readable.by_user('invalid-user') }
|
11
|
-
end
|
12
|
-
|
13
9
|
describe file('/tmp') do
|
14
10
|
it { should be_writable.by_user('mail') }
|
15
11
|
end
|
16
12
|
|
17
|
-
describe file('/tmp') do
|
18
|
-
it { should_not be_writable.by_user('invalid-user') }
|
19
|
-
end
|
20
|
-
|
21
|
-
|
22
13
|
describe file('/tmp') do
|
23
14
|
it { should be_executable.by_user('mail') }
|
24
15
|
end
|
25
|
-
|
26
|
-
describe file('/tmp') do
|
27
|
-
it { should_not be_executable.by_user('invalid-user') }
|
28
|
-
end
|
29
|
-
|
@@ -6,22 +6,14 @@ describe host('127.0.0.1') do
|
|
6
6
|
it { should be_reachable }
|
7
7
|
end
|
8
8
|
|
9
|
-
describe host('invalid-host') do
|
10
|
-
it { should_not be_reachable }
|
11
|
-
end
|
12
|
-
|
13
9
|
describe host('127.0.0.1') do
|
14
|
-
it { should be_reachable.with(:proto =>
|
10
|
+
it { should be_reachable.with(:proto => 'icmp', :timeout=> 1) }
|
15
11
|
end
|
16
12
|
|
17
13
|
describe host('127.0.0.1') do
|
18
|
-
it { should be_reachable.with(:proto =>
|
14
|
+
it { should be_reachable.with(:proto => 'tcp', :port => 22, :timeout=> 1) }
|
19
15
|
end
|
20
16
|
|
21
17
|
describe host('127.0.0.1') do
|
22
|
-
it { should be_reachable.with(:proto =>
|
23
|
-
end
|
24
|
-
|
25
|
-
describe host('invalid-host') do
|
26
|
-
it { should_not be_reachable.with(:proto => "udp", :port => 53, :timeout=> 1) }
|
18
|
+
it { should be_reachable.with(:proto => 'udp', :port => 53, :timeout=> 1) }
|
27
19
|
end
|
@@ -2,32 +2,33 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
set :os, :family => 'solaris'
|
4
4
|
|
5
|
-
describe
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
it('protocol: tcp') { should be_listening.with('tcp') }
|
10
|
-
|
11
|
-
it 'invalid protocol raises error' do
|
12
|
-
expect {
|
13
|
-
should be_listening.with('not implemented')
|
14
|
-
}.to raise_error(ArgumentError, %r/\A`be_listening` matcher doesn\'t support/)
|
15
|
-
end
|
5
|
+
describe port(80) do
|
6
|
+
it { should be_listening }
|
7
|
+
end
|
16
8
|
|
17
|
-
|
18
|
-
|
19
|
-
|
9
|
+
describe port(80) do
|
10
|
+
it { should be_listening.with('tcp') }
|
11
|
+
end
|
20
12
|
|
21
|
-
|
22
|
-
|
23
|
-
|
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/)
|
24
18
|
end
|
19
|
+
end
|
25
20
|
|
26
|
-
|
27
|
-
|
28
|
-
|
21
|
+
describe port(80) do
|
22
|
+
it { should be_listening.on('127.0.0.1') }
|
23
|
+
end
|
29
24
|
|
30
|
-
|
31
|
-
|
25
|
+
describe port(80) do
|
26
|
+
it do
|
27
|
+
expect{ should be_listening.on('') }.to raise_error(ArgumentError)
|
32
28
|
end
|
33
29
|
end
|
30
|
+
|
31
|
+
describe port(123) do
|
32
|
+
it { should be_listening.with('udp') }
|
33
|
+
end
|
34
|
+
|
@@ -6,23 +6,11 @@ describe service('sshd') do
|
|
6
6
|
it { should be_enabled }
|
7
7
|
end
|
8
8
|
|
9
|
-
describe service('invalid-service') do
|
10
|
-
it { should_not be_enabled }
|
11
|
-
end
|
12
|
-
|
13
9
|
describe service('sshd') do
|
14
10
|
it { should be_running }
|
15
11
|
end
|
16
12
|
|
17
|
-
describe service('invalid-service') do
|
18
|
-
it { should_not be_running }
|
19
|
-
end
|
20
|
-
|
21
13
|
describe service('sshd') do
|
22
14
|
it { should have_property :foo => 'bar' }
|
23
15
|
end
|
24
16
|
|
25
|
-
describe service('invalid-service') do
|
26
|
-
it { should_not have_property :foo => 'bar' }
|
27
|
-
end
|
28
|
-
|
@@ -6,23 +6,11 @@ describe user('root') do
|
|
6
6
|
it { should belong_to_group 'root' }
|
7
7
|
end
|
8
8
|
|
9
|
-
describe user('root') do
|
10
|
-
it { should_not belong_to_group 'invalid-group' }
|
11
|
-
end
|
12
|
-
|
13
9
|
describe user('root') do
|
14
10
|
it { should have_login_shell '/bin/bash' }
|
15
11
|
end
|
16
12
|
|
17
|
-
describe user('root') do
|
18
|
-
it { should_not have_login_shell 'invalid-login-shell' }
|
19
|
-
end
|
20
|
-
|
21
13
|
describe user('root') do
|
22
14
|
it { should have_home_directory '/root' }
|
23
15
|
end
|
24
16
|
|
25
|
-
describe user('root') do
|
26
|
-
it { should_not have_home_directory 'invalid-home-directory' }
|
27
|
-
end
|
28
|
-
|
@@ -6,26 +6,14 @@ describe file('/etc/ssh/sshd_config') do
|
|
6
6
|
it { should be_file }
|
7
7
|
end
|
8
8
|
|
9
|
-
describe file('/etc/invalid_file') do
|
10
|
-
it { should_not be_file }
|
11
|
-
end
|
12
|
-
|
13
9
|
describe file('/etc/ssh') do
|
14
10
|
it { should be_directory }
|
15
11
|
end
|
16
12
|
|
17
|
-
describe file('/etc/invalid_directory') do
|
18
|
-
it { should_not be_directory }
|
19
|
-
end
|
20
|
-
|
21
13
|
describe file('/var/run/unicorn.sock') do
|
22
14
|
it { should be_socket }
|
23
15
|
end
|
24
16
|
|
25
|
-
describe file('/etc/invalid_socket') do
|
26
|
-
it { should_not be_socket }
|
27
|
-
end
|
28
|
-
|
29
17
|
describe file('/etc/ssh/sshd_config') do
|
30
18
|
it { should contain 'This is the sshd server system-wide configuration file' }
|
31
19
|
end
|
@@ -34,66 +22,34 @@ describe file('/etc/ssh/sshd_config') do
|
|
34
22
|
it { should contain /^This is the sshd server system-wide configuration file/ }
|
35
23
|
end
|
36
24
|
|
37
|
-
describe file('/etc/ssh/sshd_config') do
|
38
|
-
it { should_not contain 'This is invalid text!!' }
|
39
|
-
end
|
40
|
-
|
41
25
|
describe file('Gemfile') do
|
42
26
|
it { should contain('rspec').from(/^group :test do/).to(/^end/) }
|
43
27
|
end
|
44
28
|
|
45
|
-
describe file('/etc/ssh/sshd_config') do
|
46
|
-
it { should_not contain('This is invalid text!!').from(/^group :test do/).to(/^end/) }
|
47
|
-
end
|
48
|
-
|
49
29
|
describe file('Gemfile') do
|
50
30
|
it { should contain('rspec').after(/^group :test do/) }
|
51
31
|
end
|
52
32
|
|
53
|
-
describe file('/etc/ssh/sshd_config') do
|
54
|
-
it { should_not contain('This is invalid text!!').after(/^group :test do/) }
|
55
|
-
end
|
56
|
-
|
57
33
|
describe file('Gemfile') do
|
58
34
|
it { should contain('rspec').before(/^end/) }
|
59
35
|
end
|
60
36
|
|
61
|
-
describe file('/etc/ssh/sshd_config') do
|
62
|
-
it { should_not contain('This is invalid text!!').before(/^end/) }
|
63
|
-
end
|
64
|
-
|
65
37
|
describe file('/etc/passwd') do
|
66
38
|
it { should be_mode 644 }
|
67
39
|
end
|
68
40
|
|
69
|
-
describe file('/etc/passwd') do
|
70
|
-
it { should_not be_mode 'invalid' }
|
71
|
-
end
|
72
|
-
|
73
41
|
describe file('/etc/passwd') do
|
74
42
|
it { should be_owned_by 'root' }
|
75
43
|
end
|
76
44
|
|
77
|
-
describe file('/etc/passwd') do
|
78
|
-
it { should_not be_owned_by 'invalid-owner' }
|
79
|
-
end
|
80
|
-
|
81
45
|
describe file('/etc/passwd') do
|
82
46
|
it { should be_grouped_into 'root' }
|
83
47
|
end
|
84
48
|
|
85
|
-
describe file('/etc/passwd') do
|
86
|
-
it { should_not be_grouped_into 'invalid-group' }
|
87
|
-
end
|
88
|
-
|
89
49
|
describe file('/etc/pam.d/system-auth') do
|
90
50
|
it { should be_linked_to '/etc/pam.d/system-auth-ac' }
|
91
51
|
end
|
92
52
|
|
93
|
-
describe file('dummy-link') do
|
94
|
-
it { should_not be_linked_to '/invalid/target' }
|
95
|
-
end
|
96
|
-
|
97
53
|
describe file('/dev') do
|
98
54
|
let(:stdout) { "755\r\n" }
|
99
55
|
it { should be_readable }
|
@@ -219,10 +175,6 @@ describe file('/') do
|
|
219
175
|
it { should be_mounted }
|
220
176
|
end
|
221
177
|
|
222
|
-
describe file('/etc/invalid-mount') do
|
223
|
-
it { should_not be_mounted }
|
224
|
-
end
|
225
|
-
|
226
178
|
describe file('/') do
|
227
179
|
let(:stdout) { "/dev/mapper/VolGroup-lv_root on / type ext4 (rw,mode=620)\r\n" }
|
228
180
|
it { should be_mounted.with( :type => 'ext4' ) }
|
@@ -268,11 +220,6 @@ describe file('/') do
|
|
268
220
|
it { should_not be_mounted.with( :type => 'ext4', :device => '/dev/mapper/VolGroup-lv_r00t' ) }
|
269
221
|
end
|
270
222
|
|
271
|
-
describe file('/etc/invalid-mount') do
|
272
|
-
let(:stdout) { "/dev/mapper/VolGroup-lv_root on / type ext4 (rw,mode=620)\r\n" }
|
273
|
-
it { should_not be_mounted.with( :type => 'ext4' ) }
|
274
|
-
end
|
275
|
-
|
276
223
|
describe file('/') do
|
277
224
|
let(:stdout) { "/dev/mapper/VolGroup-lv_root on / type ext4 (rw,mode=620)\r\n" }
|
278
225
|
it do
|
@@ -329,11 +276,6 @@ describe file('/') do
|
|
329
276
|
end
|
330
277
|
end
|
331
278
|
|
332
|
-
describe file('/etc/invalid-mount') do
|
333
|
-
let(:stdout) { "/dev/mapper/VolGroup-lv_root on / type ext4 (rw,mode=620)\r\n" }
|
334
|
-
it { should_not be_mounted.only_with( :type => 'ext4' ) }
|
335
|
-
end
|
336
|
-
|
337
279
|
describe file('/etc/services') do
|
338
280
|
let(:stdout) { "35435ea447c19f0ea5ef971837ab9ced\n" }
|
339
281
|
its(:md5sum) { should eq '35435ea447c19f0ea5ef971837ab9ced' }
|
@@ -6,15 +6,11 @@ describe host('127.0.0.1') do
|
|
6
6
|
it { should be_reachable }
|
7
7
|
end
|
8
8
|
|
9
|
-
describe host('invalid-host') do
|
10
|
-
it { should_not be_reachable }
|
11
|
-
end
|
12
|
-
|
13
9
|
describe host('127.0.0.1') do
|
14
|
-
it { should be_reachable.with(:proto =>
|
10
|
+
it { should be_reachable.with(:proto => 'icmp', :timeout=> 1) }
|
15
11
|
end
|
16
12
|
|
17
13
|
describe host('127.0.0.1') do
|
18
|
-
it { should be_reachable.with(:proto =>
|
14
|
+
it { should be_reachable.with(:proto => 'tcp', :port => 22, :timeout=> 1) }
|
19
15
|
end
|
20
16
|
|
@@ -6,14 +6,6 @@ describe package('httpd') do
|
|
6
6
|
it { should be_installed }
|
7
7
|
end
|
8
8
|
|
9
|
-
describe package('invalid-package') do
|
10
|
-
it { should_not be_installed }
|
11
|
-
end
|
12
|
-
|
13
|
-
describe package('invalid-package') do
|
14
|
-
it { should_not be_installed.by('rpm') }
|
15
|
-
end
|
16
|
-
|
17
9
|
describe package('httpd') do
|
18
10
|
it { should be_installed.with_version('2.2.15-28.el6') }
|
19
11
|
end
|
@@ -22,10 +14,6 @@ describe package('httpd') do
|
|
22
14
|
it { should be_installed.by('rpm').with_version('2.2.15-28.el6') }
|
23
15
|
end
|
24
16
|
|
25
|
-
describe package('httpd') do
|
26
|
-
it { should_not be_installed.with_version('invalid-version') }
|
27
|
-
end
|
28
|
-
|
29
17
|
describe package('httpd') do
|
30
18
|
let(:stdout) { "2.2.15\n" }
|
31
19
|
its(:version) { should eq '2.2.15' }
|
@@ -6,14 +6,6 @@ describe service('sshd') do
|
|
6
6
|
it { should be_enabled }
|
7
7
|
end
|
8
8
|
|
9
|
-
describe service('invalid-service') do
|
10
|
-
it { should_not be_enabled }
|
11
|
-
end
|
12
|
-
|
13
9
|
describe service('sshd') do
|
14
10
|
it { should be_enabled.with_level(4) }
|
15
11
|
end
|
16
|
-
|
17
|
-
describe service('invalid-service') do
|
18
|
-
it { should_not be_enabled.with_level(4) }
|
19
|
-
end
|
@@ -6,14 +6,6 @@ describe ppa('username/ppa-name') do
|
|
6
6
|
it { should exist }
|
7
7
|
end
|
8
8
|
|
9
|
-
describe ppa('invalid-ppa') do
|
10
|
-
it { should_not exist }
|
11
|
-
end
|
12
|
-
|
13
9
|
describe ppa('username/ppa-name') do
|
14
10
|
it { should be_enabled }
|
15
11
|
end
|
16
|
-
|
17
|
-
describe ppa('invalid-ppa') do
|
18
|
-
it { should_not be_enabled }
|
19
|
-
end
|
@@ -7,3 +7,11 @@ set :os, :family => 'windows'
|
|
7
7
|
describe windows_feature('Minesweeper') do
|
8
8
|
it{ should be_installed }
|
9
9
|
end
|
10
|
+
|
11
|
+
describe windows_feature('IIS-Webserver') do
|
12
|
+
it{ should be_installed.by(:dism) }
|
13
|
+
end
|
14
|
+
|
15
|
+
describe windows_feature('Web-Webserver') do
|
16
|
+
it{ should be_installed.by(:powershell) }
|
17
|
+
end
|