serverspec-ruby19 2.24.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (205) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +26 -0
  3. data/.gitmodules +3 -0
  4. data/.travis.yml +19 -0
  5. data/Gemfile +8 -0
  6. data/Guardfile +4 -0
  7. data/LICENSE.txt +22 -0
  8. data/README.md +26 -0
  9. data/Rakefile +30 -0
  10. data/WINDOWS_SUPPORT.md +118 -0
  11. data/appveyor.yml +56 -0
  12. data/bin/serverspec-init +7 -0
  13. data/lib/serverspec.rb +63 -0
  14. data/lib/serverspec/commands/base.rb +7 -0
  15. data/lib/serverspec/helper.rb +8 -0
  16. data/lib/serverspec/helper/type.rb +26 -0
  17. data/lib/serverspec/matcher.rb +39 -0
  18. data/lib/serverspec/matcher/be_enabled.rb +13 -0
  19. data/lib/serverspec/matcher/be_enforcing.rb +10 -0
  20. data/lib/serverspec/matcher/be_executable.rb +13 -0
  21. data/lib/serverspec/matcher/be_installed.rb +13 -0
  22. data/lib/serverspec/matcher/be_listening.rb +13 -0
  23. data/lib/serverspec/matcher/be_mounted.rb +15 -0
  24. data/lib/serverspec/matcher/be_permissive.rb +10 -0
  25. data/lib/serverspec/matcher/be_reachable.rb +17 -0
  26. data/lib/serverspec/matcher/be_readable.rb +13 -0
  27. data/lib/serverspec/matcher/be_resolvable.rb +9 -0
  28. data/lib/serverspec/matcher/be_running.rb +13 -0
  29. data/lib/serverspec/matcher/be_writable.rb +13 -0
  30. data/lib/serverspec/matcher/belong_to_group.rb +5 -0
  31. data/lib/serverspec/matcher/belong_to_primary_group.rb +5 -0
  32. data/lib/serverspec/matcher/contain.rb +28 -0
  33. data/lib/serverspec/matcher/have_entry.rb +14 -0
  34. data/lib/serverspec/matcher/have_rule.rb +17 -0
  35. data/lib/serverspec/matcher/have_site_application.rb +18 -0
  36. data/lib/serverspec/matcher/have_site_bindings.rb +22 -0
  37. data/lib/serverspec/matcher/have_virtual_dir.rb +14 -0
  38. data/lib/serverspec/power_assert.rb +14 -0
  39. data/lib/serverspec/setup.rb +338 -0
  40. data/lib/serverspec/subject.rb +12 -0
  41. data/lib/serverspec/type/base.rb +30 -0
  42. data/lib/serverspec/type/bond.rb +11 -0
  43. data/lib/serverspec/type/bridge.rb +11 -0
  44. data/lib/serverspec/type/cgroup.rb +17 -0
  45. data/lib/serverspec/type/command.rb +20 -0
  46. data/lib/serverspec/type/cron.rb +15 -0
  47. data/lib/serverspec/type/default_gateway.rb +15 -0
  48. data/lib/serverspec/type/docker_base.rb +29 -0
  49. data/lib/serverspec/type/docker_container.rb +27 -0
  50. data/lib/serverspec/type/docker_image.rb +4 -0
  51. data/lib/serverspec/type/file.rb +133 -0
  52. data/lib/serverspec/type/fstab.rb +11 -0
  53. data/lib/serverspec/type/group.rb +11 -0
  54. data/lib/serverspec/type/host.rb +21 -0
  55. data/lib/serverspec/type/iis_app_pool.rb +43 -0
  56. data/lib/serverspec/type/iis_website.rb +40 -0
  57. data/lib/serverspec/type/interface.rb +27 -0
  58. data/lib/serverspec/type/ip6tables.rb +13 -0
  59. data/lib/serverspec/type/ipfilter.rb +11 -0
  60. data/lib/serverspec/type/ipnat.rb +11 -0
  61. data/lib/serverspec/type/iptables.rb +11 -0
  62. data/lib/serverspec/type/kernel_module.rb +7 -0
  63. data/lib/serverspec/type/linux_audit_system.rb +45 -0
  64. data/lib/serverspec/type/linux_kernel_parameter.rb +10 -0
  65. data/lib/serverspec/type/lxc.rb +15 -0
  66. data/lib/serverspec/type/mail_alias.rb +7 -0
  67. data/lib/serverspec/type/mysql_config.rb +10 -0
  68. data/lib/serverspec/type/package.rb +66 -0
  69. data/lib/serverspec/type/php_config.rb +10 -0
  70. data/lib/serverspec/type/port.rb +40 -0
  71. data/lib/serverspec/type/ppa.rb +11 -0
  72. data/lib/serverspec/type/process.rb +27 -0
  73. data/lib/serverspec/type/routing_table.rb +11 -0
  74. data/lib/serverspec/type/selinux.rb +19 -0
  75. data/lib/serverspec/type/selinux_module.rb +11 -0
  76. data/lib/serverspec/type/service.rb +52 -0
  77. data/lib/serverspec/type/user.rb +43 -0
  78. data/lib/serverspec/type/windows_feature.rb +7 -0
  79. data/lib/serverspec/type/windows_hot_fix.rb +7 -0
  80. data/lib/serverspec/type/windows_registry_key.rb +19 -0
  81. data/lib/serverspec/type/windows_scheduled_task.rb +7 -0
  82. data/lib/serverspec/type/x509_certificate.rb +76 -0
  83. data/lib/serverspec/type/x509_private_key.rb +21 -0
  84. data/lib/serverspec/type/yumrepo.rb +11 -0
  85. data/lib/serverspec/type/zfs.rb +29 -0
  86. data/lib/serverspec/version.rb +3 -0
  87. data/serverspec.gemspec +28 -0
  88. data/spec/helper/type_spec.rb +6 -0
  89. data/spec/spec_helper.rb +28 -0
  90. data/spec/type/aix/file_spec.rb +31 -0
  91. data/spec/type/aix/group_spec.rb +7 -0
  92. data/spec/type/aix/package_spec.rb +7 -0
  93. data/spec/type/aix/port_spec.rb +20 -0
  94. data/spec/type/aix/service_spec.rb +12 -0
  95. data/spec/type/aix/user_spec.rb +16 -0
  96. data/spec/type/arch/file_spec.rb +15 -0
  97. data/spec/type/arch/package_spec.rb +19 -0
  98. data/spec/type/arch/service_spec.rb +9 -0
  99. data/spec/type/base/command_spec.rb +67 -0
  100. data/spec/type/base/cron_spec.rb +11 -0
  101. data/spec/type/base/default_gateway_spec.rb +11 -0
  102. data/spec/type/base/file_spec.rb +356 -0
  103. data/spec/type/base/group_spec.rb +11 -0
  104. data/spec/type/base/host_spec.rb +47 -0
  105. data/spec/type/base/mail_alias_spec.rb +7 -0
  106. data/spec/type/base/mysql_config_spec.rb +13 -0
  107. data/spec/type/base/package_spec.rb +51 -0
  108. data/spec/type/base/php_config_spec.rb +33 -0
  109. data/spec/type/base/port_spec.rb +34 -0
  110. data/spec/type/base/process_spec.rb +35 -0
  111. data/spec/type/base/routing_table_spec.rb +63 -0
  112. data/spec/type/base/service_spec.rb +49 -0
  113. data/spec/type/base/user_spec.rb +44 -0
  114. data/spec/type/darwin/file_spec.rb +41 -0
  115. data/spec/type/darwin/package_spec.rb +19 -0
  116. data/spec/type/darwin/port_spec.rb +27 -0
  117. data/spec/type/darwin/service_spec.rb +16 -0
  118. data/spec/type/debian/package_spec.rb +23 -0
  119. data/spec/type/debian/service_spec.rb +11 -0
  120. data/spec/type/fedora/service_spec.rb +15 -0
  121. data/spec/type/fedora15/service_spec.rb +15 -0
  122. data/spec/type/fedora20/service_spec.rb +15 -0
  123. data/spec/type/freebsd/file_spec.rb +29 -0
  124. data/spec/type/freebsd/package_spec.rb +19 -0
  125. data/spec/type/freebsd/port_spec.rb +27 -0
  126. data/spec/type/freebsd/service_spec.rb +8 -0
  127. data/spec/type/freebsd10/package_spec.rb +19 -0
  128. data/spec/type/gentoo/package_spec.rb +7 -0
  129. data/spec/type/gentoo/service_spec.rb +12 -0
  130. data/spec/type/linux/bond_spec.rb +12 -0
  131. data/spec/type/linux/bridge_spec.rb +12 -0
  132. data/spec/type/linux/cgroup_spec.rb +13 -0
  133. data/spec/type/linux/docker_container_pre_1_8_spec.rb +124 -0
  134. data/spec/type/linux/docker_container_spec.rb +126 -0
  135. data/spec/type/linux/docker_image_spec.rb +94 -0
  136. data/spec/type/linux/file_spec.rb +27 -0
  137. data/spec/type/linux/fstab_spec.rb +31 -0
  138. data/spec/type/linux/interface_spec.rb +30 -0
  139. data/spec/type/linux/ip6tables_spec.rb +19 -0
  140. data/spec/type/linux/iptables_spec.rb +11 -0
  141. data/spec/type/linux/kernel_module_spec.rb +7 -0
  142. data/spec/type/linux/linux_audit_system_spec.rb +139 -0
  143. data/spec/type/linux/linux_kernel_parameter_spec.rb +33 -0
  144. data/spec/type/linux/lxc_container_spec.rb +12 -0
  145. data/spec/type/linux/selinux_module_spec.rb +11 -0
  146. data/spec/type/linux/selinux_spec.rb +23 -0
  147. data/spec/type/linux/x509_certificate_spec.rb +62 -0
  148. data/spec/type/linux/x509_private_key_spec.rb +31 -0
  149. data/spec/type/linux/zfs_spec.rb +15 -0
  150. data/spec/type/nixos/package_spec.rb +15 -0
  151. data/spec/type/nixos/service_spec.rb +9 -0
  152. data/spec/type/openbsd/file_spec.rb +134 -0
  153. data/spec/type/openbsd/interface_spec.rb +21 -0
  154. data/spec/type/openbsd/mail_alias_spec.rb +7 -0
  155. data/spec/type/openbsd/package_spec.rb +11 -0
  156. data/spec/type/openbsd/port_spec.rb +7 -0
  157. data/spec/type/openbsd/service_spec.rb +13 -0
  158. data/spec/type/openbsd/user_spec.rb +12 -0
  159. data/spec/type/opensuse/service_spec.rb +16 -0
  160. data/spec/type/plamo/package_spec.rb +8 -0
  161. data/spec/type/plamo/service_spec.rb +8 -0
  162. data/spec/type/redhat/file_spec.rb +19 -0
  163. data/spec/type/redhat/package_spec.rb +23 -0
  164. data/spec/type/redhat/service_spec.rb +11 -0
  165. data/spec/type/redhat/yumrepo_spec.rb +11 -0
  166. data/spec/type/redhat5/iptables_spec.rb +11 -0
  167. data/spec/type/redhat7/service_spec.rb +9 -0
  168. data/spec/type/smartos/package_spec.rb +19 -0
  169. data/spec/type/smartos/service_spec.rb +16 -0
  170. data/spec/type/solaris/cron_spec.rb +11 -0
  171. data/spec/type/solaris/file_spec.rb +15 -0
  172. data/spec/type/solaris/group_spec.rb +7 -0
  173. data/spec/type/solaris/host_spec.rb +19 -0
  174. data/spec/type/solaris/ipfilter_spec.rb +7 -0
  175. data/spec/type/solaris/ipnat_spec.rb +7 -0
  176. data/spec/type/solaris/package_spec.rb +7 -0
  177. data/spec/type/solaris/port_spec.rb +34 -0
  178. data/spec/type/solaris/service_spec.rb +16 -0
  179. data/spec/type/solaris/user_spec.rb +16 -0
  180. data/spec/type/solaris/zfs_spec.rb +15 -0
  181. data/spec/type/solaris10/file_spec.rb +313 -0
  182. data/spec/type/solaris10/group_spec.rb +8 -0
  183. data/spec/type/solaris10/host_spec.rb +16 -0
  184. data/spec/type/solaris10/package_spec.rb +8 -0
  185. data/spec/type/solaris10/user_spec.rb +8 -0
  186. data/spec/type/suse/package_spec.rb +23 -0
  187. data/spec/type/suse/service_spec.rb +11 -0
  188. data/spec/type/ubuntu/ppa_spec.rb +11 -0
  189. data/spec/type/ubuntu/service_spec.rb +7 -0
  190. data/spec/type/windows/command_spec.rb +64 -0
  191. data/spec/type/windows/feature_spec.rb +17 -0
  192. data/spec/type/windows/file_spec.rb +120 -0
  193. data/spec/type/windows/group_spec.rb +23 -0
  194. data/spec/type/windows/host_spec.rb +32 -0
  195. data/spec/type/windows/hot_fix_spec.rb +22 -0
  196. data/spec/type/windows/iis_app_pool_spec.rb +17 -0
  197. data/spec/type/windows/iis_webisite_spec.rb +16 -0
  198. data/spec/type/windows/package_spec.rb +10 -0
  199. data/spec/type/windows/port_spec.rb +25 -0
  200. data/spec/type/windows/registry_key_spec.rb +58 -0
  201. data/spec/type/windows/scheduled_task_spec.rb +9 -0
  202. data/spec/type/windows/service_spec.rb +30 -0
  203. data/spec/type/windows/user_spec.rb +33 -0
  204. data/wercker.yml +1 -0
  205. metadata +450 -0
@@ -0,0 +1,62 @@
1
+ require 'spec_helper'
2
+
3
+ set :os, :family => 'linux'
4
+
5
+ describe x509_certificate('test.pem') do
6
+ let(:exit_status) { 0 }
7
+ it { should be_certificate }
8
+ end
9
+
10
+ describe x509_certificate('test.pem') do
11
+ let(:exit_status) { 1 }
12
+ it { should_not be_certificate }
13
+ end
14
+
15
+ describe x509_certificate('test.pem') do
16
+ let(:stdout) { sample_subj }
17
+ its(:subject) { should eq '/O=some/OU=thing' }
18
+ end
19
+
20
+ describe x509_certificate('test.pem') do
21
+ let(:stdout) { sample_issuer }
22
+ its(:issuer) { should eq '/O=some/OU=issuer' }
23
+ end
24
+
25
+ describe x509_certificate('test.pem') do
26
+ let(:stdout) { sample_validity }
27
+ it { should be_valid }
28
+ its(:validity_in_days) { should be >= 1000 }
29
+ end
30
+
31
+ describe x509_certificate('test.pem') do
32
+ let(:stdout) { sample_validity2 }
33
+ it { should_not be_valid }
34
+ end
35
+
36
+
37
+ def sample_subj
38
+ <<'EOS'
39
+ subject= /O=some/OU=thing
40
+ EOS
41
+ end
42
+
43
+ def sample_issuer
44
+ <<'EOS'
45
+ issuer= /O=some/OU=issuer
46
+ EOS
47
+ end
48
+
49
+ def sample_validity
50
+ <<'EOS'
51
+ notBefore=Jul 1 11:11:00 2000 GMT
52
+ notAfter=Jul 1 11:11:00 2050 GMT
53
+ EOS
54
+ end
55
+
56
+ def sample_validity2
57
+ <<'EOS'
58
+ notBefore=Jul 1 11:11:00 2000 GMT
59
+ notAfter=Jul 1 11:11:00 2010 GMT
60
+ EOS
61
+ end
62
+
@@ -0,0 +1,31 @@
1
+ require 'spec_helper'
2
+
3
+ set :os, :family => 'linux'
4
+
5
+ describe x509_private_key('key.pem') do
6
+ let(:exit_status) { 0 }
7
+ let(:stdout) { 'RSA key ok' }
8
+ it { should be_valid }
9
+ end
10
+
11
+ describe x509_private_key('key.pem') do
12
+ let(:exit_status) { 1 }
13
+ let(:stdout) { 'RSA key ok' }
14
+ it { should_not be_valid }
15
+ end
16
+
17
+ describe x509_private_key('key.pem') do
18
+ let(:exit_status) { 0 }
19
+ it { should be_encrypted }
20
+ end
21
+
22
+ describe x509_private_key('key.pem') do
23
+ let(:exit_status) { 1 }
24
+ it { should_not be_encrypted }
25
+ end
26
+
27
+ describe x509_private_key('key.pem') do
28
+ let(:exit_status) { 0 }
29
+ let(:stdout) { 'SHA1SUM' }
30
+ it { should have_matching_certificate('cert.pem') }
31
+ end
@@ -0,0 +1,15 @@
1
+ require 'spec_helper'
2
+
3
+ set :os, :family => 'linux'
4
+
5
+ describe zfs('rpool') do
6
+ it { should exist }
7
+ end
8
+
9
+ describe zfs('rpool') do
10
+ it { should have_property 'mountpoint' => '/rpool' }
11
+ end
12
+
13
+ describe zfs('rpool') do
14
+ it { should have_property 'mountpoint' => '/rpool', 'compression' => 'off' }
15
+ end
@@ -0,0 +1,15 @@
1
+ require 'spec_helper'
2
+
3
+ set :os, :family => 'nixos'
4
+
5
+ describe package('httpd') do
6
+ it { should be_installed }
7
+ end
8
+
9
+ describe package('httpd') do
10
+ it { should be_installed.with_version('2.2.15-28.el6') }
11
+ end
12
+
13
+ describe package('httpd') do
14
+ it { should be_installed.by('nix').with_version('2.2.15-28.el6') }
15
+ end
@@ -0,0 +1,9 @@
1
+ require 'spec_helper'
2
+
3
+ set :os, :family => 'nixos'
4
+
5
+ describe service('sshd') do
6
+ it { should be_enabled }
7
+ it { should be_running }
8
+ end
9
+
@@ -0,0 +1,134 @@
1
+ require 'spec_helper'
2
+
3
+ set :os, {:family => 'openbsd'}
4
+
5
+ describe file('/etc/passwd') do
6
+ it { should be_mode 644 }
7
+ end
8
+
9
+ describe file('/etc/passwd') do
10
+ it { should be_owned_by 'root' }
11
+ end
12
+
13
+ describe file('/etc/passwd') do
14
+ it { should be_grouped_into 'root' }
15
+ end
16
+
17
+ describe file('/etc/pam.d/system-auth') do
18
+ it { should be_linked_to '/etc/pam.d/system-auth-ac' }
19
+ end
20
+
21
+ describe file('/') do
22
+ it { should be_mounted }
23
+ end
24
+
25
+ describe file('/') do
26
+ let(:stdout) { "/dev/mapper/VolGroup-lv_root on / type ext4 (rw,mode=620)\r\n" }
27
+ it { should be_mounted.with( :type => 'ext4' ) }
28
+ end
29
+
30
+ describe file('/') do
31
+ let(:stdout) { "/dev/mapper/VolGroup-lv_root on / type ext4 (rw,mode=620)\r\n" }
32
+ it { should be_mounted.with( :type => 'ext4', :options => { :rw => true } ) }
33
+ end
34
+
35
+ describe file('/') do
36
+ let(:stdout) { "/dev/mapper/VolGroup-lv_root on / type ext4 (rw,mode=620)\r\n" }
37
+ it { should be_mounted.with( :type => 'ext4', :options => { :mode => 620 } ) }
38
+ end
39
+
40
+ describe file('/') do
41
+ let(:stdout) { "/dev/mapper/VolGroup-lv_root on / type ext4 (rw,mode=620)\r\n" }
42
+ it { should be_mounted.with( :type => 'ext4', :device => '/dev/mapper/VolGroup-lv_root' ) }
43
+ end
44
+
45
+ describe file('/') do
46
+ let(:stdout) { "/dev/mapper/VolGroup-lv_root on / type ext4 (rw,mode=620)\r\n" }
47
+ it { should_not be_mounted.with( :type => 'xfs' ) }
48
+ end
49
+
50
+ describe file('/') do
51
+ let(:stdout) { "/dev/mapper/VolGroup-lv_root on / type ext4 (rw,mode=620)\r\n" }
52
+ it { should_not be_mounted.with( :type => 'ext4', :options => { :rw => false } ) }
53
+ end
54
+
55
+ describe file('/') do
56
+ let(:stdout) { "/dev/mapper/VolGroup-lv_root on / type ext4 (rw,mode=620)\r\n" }
57
+ it { should_not be_mounted.with( :type => 'ext4', :options => { :mode => 600 } ) }
58
+ end
59
+
60
+ describe file('/') do
61
+ let(:stdout) { "/dev/mapper/VolGroup-lv_root on / type ext4 (rw,mode=620)\r\n" }
62
+ it { should_not be_mounted.with( :type => 'xfs', :device => '/dev/mapper/VolGroup-lv_root' ) }
63
+ end
64
+
65
+ describe file('/') do
66
+ let(:stdout) { "/dev/mapper/VolGroup-lv_root on / type ext4 (rw,mode=620)\r\n" }
67
+ it { should_not be_mounted.with( :type => 'ext4', :device => '/dev/mapper/VolGroup-lv_r00t' ) }
68
+ end
69
+
70
+ describe file('/') do
71
+ let(:stdout) { "/dev/mapper/VolGroup-lv_root on / type ext4 (rw,mode=620)\r\n" }
72
+ it do
73
+ should be_mounted.only_with(
74
+ :device => '/dev/mapper/VolGroup-lv_root',
75
+ :type => 'ext4',
76
+ :options => {
77
+ :rw => true,
78
+ :mode => 620,
79
+ }
80
+ )
81
+ end
82
+ end
83
+
84
+ describe file('/') do
85
+ let(:stdout) { "/dev/mapper/VolGroup-lv_root on / type ext4 (rw,mode=620)\r\n" }
86
+ it do
87
+ should_not be_mounted.only_with(
88
+ :device => '/dev/mapper/VolGroup-lv_root',
89
+ :type => 'ext4',
90
+ :options => {
91
+ :rw => true,
92
+ :mode => 620,
93
+ :bind => true,
94
+ }
95
+ )
96
+ end
97
+ end
98
+
99
+ describe file('/') do
100
+ let(:stdout) { "/dev/mapper/VolGroup-lv_root on / type ext4 (rw,mode=620)\r\n" }
101
+ it do
102
+ should_not be_mounted.only_with(
103
+ :device => '/dev/mapper/VolGroup-lv_root',
104
+ :type => 'ext4',
105
+ :options => {
106
+ :rw => true,
107
+ }
108
+ )
109
+ end
110
+ end
111
+
112
+ describe file('/') do
113
+ let(:stdout) { "/dev/mapper/VolGroup-lv_root on / type ext4 (rw,mode=620)\r\n" }
114
+ it do
115
+ should_not be_mounted.only_with(
116
+ :device => '/dev/mapper/VolGroup-lv_roooooooooot',
117
+ :type => 'ext4',
118
+ :options => {
119
+ :rw => true,
120
+ :mode => 620,
121
+ }
122
+ )
123
+ end
124
+ end
125
+
126
+ describe file('/etc/services') do
127
+ let(:stdout) { "35435ea447c19f0ea5ef971837ab9ced\n" }
128
+ its(:md5sum) { should eq '35435ea447c19f0ea5ef971837ab9ced' }
129
+ end
130
+
131
+ describe file('/etc/services') do
132
+ let(:stdout) {"0c3feee1353a8459f8c7d84885e6bc602ef853751ffdbce3e3b6dfa1d345fc7a" }
133
+ its(:sha256sum) { should eq '0c3feee1353a8459f8c7d84885e6bc602ef853751ffdbce3e3b6dfa1d345fc7a' }
134
+ end
@@ -0,0 +1,21 @@
1
+ require 'spec_helper'
2
+
3
+ set :os, :family => 'openbsd'
4
+
5
+ describe interface('eth0') do
6
+ let(:stdout) { '1000' }
7
+ its(:speed) { should eq 1000 }
8
+ end
9
+
10
+ describe interface('eth0') do
11
+ it { should have_ipv4_address("192.168.10.10") }
12
+ end
13
+
14
+ describe interface('eth0') do
15
+ it { should have_ipv4_address("192.168.10.10/24") }
16
+ end
17
+
18
+ describe interface('invalid-interface') do
19
+ let(:stdout) { '1000' }
20
+ its(:speed) { should_not eq 100 }
21
+ end
@@ -0,0 +1,7 @@
1
+ require 'spec_helper'
2
+
3
+ set :os, :family => 'openbsd'
4
+
5
+ describe mail_alias('daemon') do
6
+ it { should be_aliased_to "root" }
7
+ end
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+
3
+ set :os, :family => 'openbsd'
4
+
5
+ describe package('httpd') do
6
+ it { should be_installed }
7
+ end
8
+
9
+ describe package('httpd') do
10
+ it { should be_installed.with_version('2.2.15-28.el6') }
11
+ end
@@ -0,0 +1,7 @@
1
+ require 'spec_helper'
2
+
3
+ set :os, :family => 'openbsd'
4
+
5
+ describe port(80) do
6
+ it { should be_listening }
7
+ end
@@ -0,0 +1,13 @@
1
+ require 'spec_helper'
2
+
3
+ set :os, :family => 'openbsd'
4
+
5
+ describe service('sshd') do
6
+ it { should be_enabled }
7
+ end
8
+
9
+ describe service('sshd') do
10
+ it { should be_running }
11
+ end
12
+
13
+
@@ -0,0 +1,12 @@
1
+ require 'spec_helper'
2
+
3
+ set :os, :family => 'openbsd'
4
+
5
+ describe user('root') do
6
+ it { should have_login_shell '/bin/bash' }
7
+ end
8
+
9
+ describe user('root') do
10
+ it { should have_home_directory '/root' }
11
+ end
12
+
@@ -0,0 +1,16 @@
1
+ require 'spec_helper'
2
+
3
+ set :os, :family => 'opensuse'
4
+
5
+ describe service('sshd') do
6
+ it { should be_enabled }
7
+ end
8
+
9
+ describe service('sshd') do
10
+ it { should be_enabled.with_level(4) }
11
+ end
12
+
13
+ describe service('sshd') do
14
+ it { should be_running }
15
+ end
16
+
@@ -0,0 +1,8 @@
1
+ require 'spec_helper'
2
+
3
+ set :os, :family => 'plamo'
4
+
5
+ describe package('httpd') do
6
+ it { should be_installed }
7
+ end
8
+
@@ -0,0 +1,8 @@
1
+ require 'spec_helper'
2
+
3
+ set :os, :family => 'plamo'
4
+
5
+ describe service('sshd') do
6
+ it { should be_enabled }
7
+ end
8
+
@@ -0,0 +1,19 @@
1
+ require 'spec_helper'
2
+
3
+ set :os, :family => 'redhat'
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('/tmp') do
18
+ it { should be_immutable }
19
+ end
@@ -0,0 +1,23 @@
1
+ require 'spec_helper'
2
+
3
+ set :os, :family => 'redhat'
4
+
5
+ describe package('httpd') do
6
+ it { should be_installed }
7
+ end
8
+
9
+ describe package('httpd') do
10
+ it { should be_installed.with_version('2.2.15-28.el6') }
11
+ end
12
+
13
+ describe package('httpd') do
14
+ it { should be_installed.by('rpm').with_version('2.2.15-28.el6') }
15
+ end
16
+
17
+ describe package('httpd') do
18
+ let(:stdout) { "2.2.15\n" }
19
+ its(:version) { should eq '2.2.15' }
20
+ its(:version) { should > '2.2.14' }
21
+ its(:version) { should < '2.2.16' }
22
+ its(:version) { should > '2.2.9' }
23
+ end
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+
3
+ set :os, :family => 'redhat'
4
+
5
+ describe service('sshd') do
6
+ it { should be_enabled }
7
+ end
8
+
9
+ describe service('sshd') do
10
+ it { should be_enabled.with_level(4) }
11
+ end