serverspec 0.11.1 → 0.11.2

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 (157) hide show
  1. checksums.yaml +4 -4
  2. data/lib/serverspec/backend/exec.rb +17 -13
  3. data/lib/serverspec/helper/detect_os.rb +4 -5
  4. data/lib/serverspec/version.rb +1 -1
  5. data/spec/aix/command_spec.rb +1 -3
  6. data/spec/aix/cron_spec.rb +1 -3
  7. data/spec/aix/default_gateway_spec.rb +1 -3
  8. data/spec/aix/file_spec.rb +1 -3
  9. data/spec/aix/group_spec.rb +1 -3
  10. data/spec/aix/host_spec.rb +1 -3
  11. data/spec/aix/package_spec.rb +1 -3
  12. data/spec/aix/php_config_spec.rb +1 -3
  13. data/spec/aix/port_spec.rb +1 -3
  14. data/spec/aix/routing_table_spec.rb +1 -3
  15. data/spec/aix/service_spec.rb +1 -3
  16. data/spec/aix/user_spec.rb +1 -3
  17. data/spec/backend/cmd/configuration_spec.rb +0 -4
  18. data/spec/backend/winrm/configuration_spec.rb +0 -4
  19. data/spec/darwin/command_spec.rb +1 -3
  20. data/spec/darwin/cron_spec.rb +1 -3
  21. data/spec/darwin/default_gateway_spec.rb +1 -3
  22. data/spec/darwin/file_spec.rb +1 -3
  23. data/spec/darwin/group_spec.rb +1 -3
  24. data/spec/darwin/host_spec.rb +1 -3
  25. data/spec/darwin/mail_alias_spec.rb +1 -3
  26. data/spec/darwin/package_spec.rb +1 -3
  27. data/spec/darwin/php_config_spec.rb +1 -3
  28. data/spec/darwin/port_spec.rb +1 -3
  29. data/spec/darwin/routing_table_spec.rb +1 -3
  30. data/spec/darwin/service_spec.rb +1 -3
  31. data/spec/darwin/user_spec.rb +1 -3
  32. data/spec/debian/cgroup_spec.rb +1 -3
  33. data/spec/debian/command_spec.rb +1 -3
  34. data/spec/debian/cron_spec.rb +1 -3
  35. data/spec/debian/default_gateway_spec.rb +1 -3
  36. data/spec/debian/file_spec.rb +1 -3
  37. data/spec/debian/group_spec.rb +1 -3
  38. data/spec/debian/host_spec.rb +1 -3
  39. data/spec/debian/interface_spec.rb +1 -3
  40. data/spec/debian/iptables_spec.rb +1 -3
  41. data/spec/debian/kernel_module_spec.rb +1 -3
  42. data/spec/debian/linux_kernel_parameter_spec.rb +1 -3
  43. data/spec/debian/lxc_spec.rb +1 -3
  44. data/spec/debian/mail_alias_spec.rb +1 -3
  45. data/spec/debian/package_spec.rb +1 -3
  46. data/spec/debian/php_config_spec.rb +1 -3
  47. data/spec/debian/port_spec.rb +1 -3
  48. data/spec/debian/routing_table_spec.rb +1 -3
  49. data/spec/debian/selinux_spec.rb +1 -3
  50. data/spec/debian/service_spec.rb +1 -3
  51. data/spec/debian/user_spec.rb +1 -3
  52. data/spec/debian/zfs_spec.rb +1 -3
  53. data/spec/freebsd/command_spec.rb +1 -1
  54. data/spec/freebsd/cron_spec.rb +1 -3
  55. data/spec/freebsd/default_gateway_spec.rb +1 -3
  56. data/spec/freebsd/file_spec.rb +1 -3
  57. data/spec/freebsd/group_spec.rb +1 -3
  58. data/spec/freebsd/host_spec.rb +1 -3
  59. data/spec/freebsd/package_spec.rb +1 -3
  60. data/spec/freebsd/php_config_spec.rb +1 -3
  61. data/spec/freebsd/port_spec.rb +1 -3
  62. data/spec/freebsd/routing_table_spec.rb +1 -3
  63. data/spec/freebsd/service_spec.rb +1 -3
  64. data/spec/freebsd/user_spec.rb +1 -3
  65. data/spec/gentoo/cgroup_spec.rb +1 -3
  66. data/spec/gentoo/command_spec.rb +1 -3
  67. data/spec/gentoo/cron_spec.rb +1 -3
  68. data/spec/gentoo/default_gateway_spec.rb +1 -3
  69. data/spec/gentoo/file_spec.rb +1 -1
  70. data/spec/gentoo/group_spec.rb +1 -3
  71. data/spec/gentoo/host_spec.rb +1 -3
  72. data/spec/gentoo/interface_spec.rb +1 -3
  73. data/spec/gentoo/iptables_spec.rb +1 -3
  74. data/spec/gentoo/kernel_module_spec.rb +1 -3
  75. data/spec/gentoo/linux_kernel_parameter_spec.rb +1 -3
  76. data/spec/gentoo/lxc_spec.rb +1 -3
  77. data/spec/gentoo/mail_alias_spec.rb +1 -3
  78. data/spec/gentoo/package_spec.rb +1 -3
  79. data/spec/gentoo/php_config_spec.rb +1 -3
  80. data/spec/gentoo/port_spec.rb +1 -3
  81. data/spec/gentoo/routing_table_spec.rb +1 -3
  82. data/spec/gentoo/selinux_spec.rb +1 -3
  83. data/spec/gentoo/service_spec.rb +1 -3
  84. data/spec/gentoo/user_spec.rb +1 -3
  85. data/spec/gentoo/zfs_spec.rb +1 -3
  86. data/spec/plamo/cgroup_spec.rb +1 -3
  87. data/spec/plamo/command_spec.rb +1 -3
  88. data/spec/plamo/cron_spec.rb +1 -3
  89. data/spec/plamo/default_gateway_spec.rb +1 -3
  90. data/spec/plamo/file_spec.rb +1 -3
  91. data/spec/plamo/group_spec.rb +1 -3
  92. data/spec/plamo/host_spec.rb +1 -3
  93. data/spec/plamo/interface_spec.rb +1 -3
  94. data/spec/plamo/iptables_spec.rb +1 -3
  95. data/spec/plamo/kernel_module_spec.rb +1 -3
  96. data/spec/plamo/linux_kernel_parameter_spec.rb +1 -3
  97. data/spec/plamo/lxc_spec.rb +1 -3
  98. data/spec/plamo/mail_alias_spec.rb +1 -3
  99. data/spec/plamo/package_spec.rb +1 -3
  100. data/spec/plamo/php_config_spec.rb +1 -3
  101. data/spec/plamo/port_spec.rb +1 -3
  102. data/spec/plamo/routing_table_spec.rb +1 -3
  103. data/spec/plamo/selinux_spec.rb +1 -3
  104. data/spec/plamo/service_spec.rb +1 -3
  105. data/spec/plamo/user_spec.rb +1 -3
  106. data/spec/plamo/zfs_spec.rb +1 -3
  107. data/spec/redhat/cgroup_spec.rb +1 -3
  108. data/spec/redhat/command_spec.rb +1 -3
  109. data/spec/redhat/cron_spec.rb +1 -3
  110. data/spec/redhat/default_gateway_spec.rb +1 -3
  111. data/spec/redhat/file_spec.rb +1 -3
  112. data/spec/redhat/group_spec.rb +1 -3
  113. data/spec/redhat/host_spec.rb +1 -3
  114. data/spec/redhat/interface_spec.rb +1 -3
  115. data/spec/redhat/iptables_spec.rb +1 -3
  116. data/spec/redhat/kernel_module_spec.rb +1 -3
  117. data/spec/redhat/linux_kernel_parameter_spec.rb +1 -3
  118. data/spec/redhat/lxc_spec.rb +1 -3
  119. data/spec/redhat/mail_alias_spec.rb +1 -3
  120. data/spec/redhat/package_spec.rb +1 -3
  121. data/spec/redhat/php_config_spec.rb +1 -3
  122. data/spec/redhat/port_spec.rb +1 -3
  123. data/spec/redhat/routing_table_spec.rb +1 -3
  124. data/spec/redhat/selinux_spec.rb +1 -3
  125. data/spec/redhat/service_spec.rb +1 -3
  126. data/spec/redhat/user_spec.rb +1 -3
  127. data/spec/redhat/yumrepo_spec.rb +1 -3
  128. data/spec/redhat/zfs_spec.rb +1 -3
  129. data/spec/smartos/mail_alias_spec.rb +1 -3
  130. data/spec/solaris10/mail_alias_spec.rb +1 -3
  131. data/spec/solaris10/php_config_spec.rb +1 -3
  132. data/spec/solaris11/command_spec.rb +1 -3
  133. data/spec/solaris11/cron_spec.rb +1 -3
  134. data/spec/solaris11/default_gateway_spec.rb +1 -3
  135. data/spec/solaris11/file_spec.rb +1 -3
  136. data/spec/solaris11/group_spec.rb +1 -3
  137. data/spec/solaris11/host_spec.rb +1 -3
  138. data/spec/solaris11/ipfilter_spec.rb +1 -3
  139. data/spec/solaris11/ipnat_spec.rb +1 -3
  140. data/spec/solaris11/mail_alias_spec.rb +1 -3
  141. data/spec/solaris11/package_spec.rb +1 -3
  142. data/spec/solaris11/php_config_spec.rb +1 -3
  143. data/spec/solaris11/port_spec.rb +1 -3
  144. data/spec/solaris11/routing_table_spec.rb +1 -3
  145. data/spec/solaris11/service_spec.rb +1 -3
  146. data/spec/solaris11/svcprop_spec.rb +1 -3
  147. data/spec/solaris11/user_spec.rb +1 -3
  148. data/spec/solaris11/zfs_spec.rb +1 -3
  149. data/spec/spec_helper.rb +0 -1
  150. data/spec/windows/command_spec.rb +1 -3
  151. data/spec/windows/file_spec.rb +1 -3
  152. data/spec/windows/group_spec.rb +1 -3
  153. data/spec/windows/port_spec.rb +1 -3
  154. data/spec/windows/service_spec.rb +2 -4
  155. data/spec/windows/user_spec.rb +1 -3
  156. data/spec/windows/windows_registry_key_spec.rb +1 -3
  157. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 023526d17b8618754baa4934056510262885ae34
4
- data.tar.gz: f93f6e2ba37634eec4d5891f725f6ab4cc1c1a39
3
+ metadata.gz: fa5c70430c2fb240182165631842fc28cbad2da9
4
+ data.tar.gz: 1608f99186882f77029ffdff9fe0469104c17724
5
5
  SHA512:
6
- metadata.gz: 68647589cb070900e3d4ad44d03423c064249619e4367993c00ea7f58a3437906d391a4f0e135e73c0c3a2c56e0169c18e59f2fe43942e89b47cc6b0b722d29d
7
- data.tar.gz: a5048fa1b0a72b2bb4a869b089d8e7207424a821686c7a930e67d596a0a4e6f3f3b7b37aa5167ccc393d14e8d4503459e3a4046e5d9c3f7de951f845e222db80
6
+ metadata.gz: 3ab1545b9d6a79b56a875a7b2e712dbd531d125c047303f5788564a419dc49a8ce48a7f6aa7686e490f9051b832bb5e80d9d5693b756ee007313fb21691149d2
7
+ data.tar.gz: 5dd5332793bc57e35adc31d439df50c4b263a42868ec5515f6c435afa4da8ea5ee8ff4fe4e14597f9be4e5fe8cd669a14bb77fd461f7e3dba6f5e1905cb66e70
@@ -168,33 +168,37 @@ module Serverspec
168
168
  def check_os
169
169
  return RSpec.configuration.os if RSpec.configuration.os
170
170
  if run_command('ls /etc/redhat-release')[:exit_status] == 0
171
- 'RedHat'
171
+ line = run_command('cat /etc/redhat-release')[:stdout]
172
+ if line =~ /release (\d[\d.]*)/
173
+ release = $1
174
+ end
175
+ { :family => 'RedHat', :release => release }
172
176
  elsif run_command('ls /etc/system-release')[:exit_status] == 0
173
- 'RedHat' # Amazon Linux
177
+ { :family => 'RedHat', :release => nil } # Amazon Linux
174
178
  elsif run_command('ls /etc/debian_version')[:exit_status] == 0
175
- 'Debian'
179
+ { :family => 'Debian', :release => nil }
176
180
  elsif run_command('ls /etc/gentoo-release')[:exit_status] == 0
177
- 'Gentoo'
181
+ { :family => 'Gentoo', :release => nil }
178
182
  elsif run_command('ls /usr/lib/setup/Plamo-*')[:exit_status] == 0
179
- 'Plamo'
183
+ { :family => 'Plamo', :release => nil }
180
184
  elsif run_command('uname -s')[:stdout] =~ /AIX/i
181
- 'AIX'
185
+ { :family => 'AIX', :release => nil }
182
186
  elsif (os = run_command('uname -sr')[:stdout]) && os =~ /SunOS/i
183
187
  if os =~ /5.10/
184
- 'Solaris10'
188
+ { :family => 'Solaris10', :release => nil }
185
189
  elsif run_command('grep -q "Oracle Solaris 11" /etc/release')[:exit_status] == 0
186
- 'Solaris11'
190
+ { :family => 'Solaris11', :release => nil }
187
191
  elsif run_command('grep -q SmartOS /etc/release')[:exit_status] == 0
188
- 'SmartOS'
192
+ { :family => 'SmartOS', :release => nil }
189
193
  else
190
- 'Solaris'
194
+ { :family => 'Solaris', :release => nil }
191
195
  end
192
196
  elsif run_command('uname -s')[:stdout] =~ /Darwin/i
193
- 'Darwin'
197
+ { :family => 'Darwin', :release => nil }
194
198
  elsif run_command('uname -s')[:stdout] =~ /FreeBSD/i
195
- 'FreeBSD'
199
+ { :family => 'FreeBSD', :release => nil }
196
200
  else
197
- 'Base'
201
+ { :family => 'Base', :release => nil }
198
202
  end
199
203
  end
200
204
  end
@@ -2,17 +2,16 @@ module Serverspec
2
2
  module Helper
3
3
  module DetectOS
4
4
  def commands
5
- property[:os_type] = {} if ! property[:os_type]
5
+ property[:os_by_host] = {} if ! property[:os_by_host]
6
6
  host = RSpec.configuration.ssh ? RSpec.configuration.ssh.host : 'localhost'
7
7
 
8
- if property[:os_type][host]
9
- os = property[:os_type][host]
8
+ if property[:os_by_host][host]
9
+ os = property[:os_by_host][host]
10
10
  else
11
11
  os = backend(Serverspec::Commands::Base).check_os
12
- property[:os_type][host] = os
13
12
  end
14
13
 
15
- self.class.const_get('Serverspec').const_get('Commands').const_get(os).new
14
+ self.class.const_get('Serverspec').const_get('Commands').const_get(os[:family]).new
16
15
  end
17
16
  end
18
17
  end
@@ -1,3 +1,3 @@
1
1
  module Serverspec
2
- VERSION = "0.11.1"
2
+ VERSION = "0.11.2"
3
3
  end
@@ -1,8 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.configure do |c|
4
- c.os = 'AIX'
5
- end
3
+ include Serverspec::Helper::AIX
6
4
 
7
5
  describe command('cat /etc/resolv.conf') do
8
6
  let(:stdout) { "nameserver 127.0.0.1\r\n" }
@@ -1,8 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.configure do |c|
4
- c.os = 'AIX'
5
- end
3
+ include Serverspec::Helper::AIX
6
4
 
7
5
  describe cron do
8
6
  it { should have_entry '* * * * * /usr/local/bin/batch.sh' }
@@ -1,8 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.configure do |c|
4
- c.os = 'AIX'
5
- end
3
+ include Serverspec::Helper::AIX
6
4
 
7
5
  describe default_gateway do
8
6
  let(:stdout) { "default via 192.168.1.1 dev eth1 \r\n" }
@@ -1,8 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.configure do |c|
4
- c.os = 'AIX'
5
- end
3
+ include Serverspec::Helper::AIX
6
4
 
7
5
  describe file('/etc/ssh/sshd_config') do
8
6
  it { should be_file }
@@ -1,8 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.configure do |c|
4
- c.os = 'AIX'
5
- end
3
+ include Serverspec::Helper::AIX
6
4
 
7
5
  describe group('root') do
8
6
  it { should exist }
@@ -1,8 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.configure do |c|
4
- c.os = 'AIX'
5
- end
3
+ include Serverspec::Helper::AIX
6
4
 
7
5
  describe host('127.0.0.1') do
8
6
  it { should be_resolvable }
@@ -1,8 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.configure do |c|
4
- c.os = 'AIX'
5
- end
3
+ include Serverspec::Helper::AIX
6
4
 
7
5
  describe package('httpd') do
8
6
  it { should be_installed }
@@ -1,8 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.configure do |c|
4
- c.os = 'AIX'
5
- end
3
+ include Serverspec::Helper::AIX
6
4
 
7
5
  describe php_config('default_mimetype') do
8
6
  let(:stdout) { 'text/html' }
@@ -1,8 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.configure do |c|
4
- c.os = 'AIX'
5
- end
3
+ include Serverspec::Helper::AIX
6
4
 
7
5
  describe port(80) do
8
6
  it { should be_listening }
@@ -1,8 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.configure do |c|
4
- c.os = 'AIX'
5
- end
3
+ include Serverspec::Helper::AIX
6
4
 
7
5
  describe routing_table do
8
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" }
@@ -1,8 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.configure do |c|
4
- c.os = 'AIX'
5
- end
3
+ include Serverspec::Helper::AIX
6
4
 
7
5
  describe service('sshd') do
8
6
  it { should be_enabled }
@@ -1,8 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.configure do |c|
4
- c.os = 'AIX'
5
- end
3
+ include Serverspec::Helper::AIX
6
4
 
7
5
  describe user('root') do
8
6
  it { should exist }
@@ -4,10 +4,6 @@ require 'support/powershell_command_runner'
4
4
  include Serverspec::Helper::Cmd
5
5
  include Serverspec::Helper::Windows
6
6
 
7
- RSpec.configure do |c|
8
- c.os = 'Windows'
9
- end
10
-
11
7
  describe "Cmd" do
12
8
  it_behaves_like "a powershell command runner"
13
9
  end
@@ -4,10 +4,6 @@ require 'support/powershell_command_runner'
4
4
  include Serverspec::Helper::WinRM
5
5
  include Serverspec::Helper::Windows
6
6
 
7
- RSpec.configure do |c|
8
- c.os = 'Windows'
9
- end
10
-
11
7
  describe "WinRM" do
12
8
  it_behaves_like "a powershell command runner"
13
9
  end
@@ -1,8 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.configure do |c|
4
- c.os = 'Darwin'
5
- end
3
+ include Serverspec::Helper::Darwin
6
4
 
7
5
  describe command('cat /etc/resolv.conf') do
8
6
  let(:stdout) { "nameserver 127.0.0.1\r\n" }
@@ -1,8 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.configure do |c|
4
- c.os = 'Darwin'
5
- end
3
+ include Serverspec::Helper::Darwin
6
4
 
7
5
  describe cron do
8
6
  it { should have_entry '* * * * * /usr/local/bin/batch.sh' }
@@ -1,8 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.configure do |c|
4
- c.os = 'Darwin'
5
- end
3
+ include Serverspec::Helper::Darwin
6
4
 
7
5
  describe default_gateway do
8
6
  let(:stdout) { "default via 192.168.1.1 dev eth1 \r\n" }
@@ -1,8 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.configure do |c|
4
- c.os = 'Darwin'
5
- end
3
+ include Serverspec::Helper::Darwin
6
4
 
7
5
  describe file('/etc/ssh/sshd_config') do
8
6
  it { should be_file }
@@ -1,8 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.configure do |c|
4
- c.os = 'Darwin'
5
- end
3
+ include Serverspec::Helper::Darwin
6
4
 
7
5
  describe group('root') do
8
6
  it { should exist }
@@ -1,8 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.configure do |c|
4
- c.os = 'Darwin'
5
- end
3
+ include Serverspec::Helper::Darwin
6
4
 
7
5
  describe host('127.0.0.1') do
8
6
  it { should be_resolvable }
@@ -1,8 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.configure do |c|
4
- c.os = 'Darwin'
5
- end
3
+ include Serverspec::Helper::Darwin
6
4
 
7
5
  describe mail_alias('daemon') do
8
6
  it { should be_aliased_to "root" }
@@ -1,8 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.configure do |c|
4
- c.os = 'Darwin'
5
- end
3
+ include Serverspec::Helper::Darwin
6
4
 
7
5
  describe package('jekyll') do
8
6
  it { should be_installed.by('gem') }
@@ -1,8 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.configure do |c|
4
- c.os = 'Darwin'
5
- end
3
+ include Serverspec::Helper::Darwin
6
4
 
7
5
  describe php_config('default_mimetype') do
8
6
  let(:stdout) { 'text/html' }
@@ -1,8 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.configure do |c|
4
- c.os = 'Darwin'
5
- end
3
+ include Serverspec::Helper::Darwin
6
4
 
7
5
  describe port(80) do
8
6
  it { should be_listening }
@@ -1,8 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.configure do |c|
4
- c.os = 'Darwin'
5
- end
3
+ include Serverspec::Helper::Darwin
6
4
 
7
5
  describe routing_table do
8
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" }
@@ -1,8 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.configure do |c|
4
- c.os = 'Darwin'
5
- end
3
+ include Serverspec::Helper::Darwin
6
4
 
7
5
  #describe service('sshd') do
8
6
  # it { should be_enabled }
@@ -1,8 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.configure do |c|
4
- c.os = 'Darwin'
5
- end
3
+ include Serverspec::Helper::Darwin
6
4
 
7
5
  describe user('root') do
8
6
  it { should exist }
@@ -1,8 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.configure do |c|
4
- c.os = 'Debian'
5
- end
3
+ include Serverspec::Helper::Debian
6
4
 
7
5
  describe cgroup('group1') do
8
6
  let(:stdout) { "1\r\n" }
@@ -1,8 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.configure do |c|
4
- c.os = 'Debian'
5
- end
3
+ include Serverspec::Helper::Debian
6
4
 
7
5
  describe command('cat /etc/resolv.conf') do
8
6
  let(:stdout) { "nameserver 127.0.0.1\r\n" }
@@ -1,8 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.configure do |c|
4
- c.os = 'Debian'
5
- end
3
+ include Serverspec::Helper::Debian
6
4
 
7
5
  describe cron do
8
6
  it { should have_entry '* * * * * /usr/local/bin/batch.sh' }
@@ -1,8 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.configure do |c|
4
- c.os = 'Debian'
5
- end
3
+ include Serverspec::Helper::Debian
6
4
 
7
5
  describe default_gateway do
8
6
  let(:stdout) { "default via 192.168.1.1 dev eth1 \r\n" }
@@ -1,8 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.configure do |c|
4
- c.os = 'Debian'
5
- end
3
+ include Serverspec::Helper::Debian
6
4
 
7
5
  describe file('/etc/ssh/sshd_config') do
8
6
  it { should be_file }
@@ -1,8 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.configure do |c|
4
- c.os = 'Debian'
5
- end
3
+ include Serverspec::Helper::Debian
6
4
 
7
5
  describe group('root') do
8
6
  it { should exist }
@@ -1,8 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.configure do |c|
4
- c.os = 'Debian'
5
- end
3
+ include Serverspec::Helper::Debian
6
4
 
7
5
  describe host('127.0.0.1') do
8
6
  it { should be_resolvable }
@@ -1,8 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.configure do |c|
4
- c.os = 'Debian'
5
- end
3
+ include Serverspec::Helper::Debian
6
4
 
7
5
  describe interface('eth0') do
8
6
  let(:stdout) { '1000' }
@@ -1,8 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.configure do |c|
4
- c.os = 'Debian'
5
- end
3
+ include Serverspec::Helper::Debian
6
4
 
7
5
  describe iptables do
8
6
  it { should have_rule '-P INPUT ACCEPT' }
@@ -1,8 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.configure do |c|
4
- c.os = 'Debian'
5
- end
3
+ include Serverspec::Helper::Debian
6
4
 
7
5
  describe kernel_module('lp') do
8
6
  it { should be_loaded }
@@ -1,8 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.configure do |c|
4
- c.os = 'Debian'
5
- end
3
+ include Serverspec::Helper::Debian
6
4
 
7
5
  describe linux_kernel_parameter('net.ipv4.tcp_syncookies') do
8
6
  let(:stdout) { "1\n" }
@@ -1,8 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.configure do |c|
4
- c.os = 'Debian'
5
- end
3
+ include Serverspec::Helper::Debian
6
4
 
7
5
  describe lxc('ct01') do
8
6
  it { should exist }
@@ -1,8 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.configure do |c|
4
- c.os = 'Debian'
5
- end
3
+ include Serverspec::Helper::Debian
6
4
 
7
5
  describe mail_alias('daemon') do
8
6
  it { should be_aliased_to "root" }
@@ -1,8 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.configure do |c|
4
- c.os = 'Debian'
5
- end
3
+ include Serverspec::Helper::Debian
6
4
 
7
5
  describe package('apache2') do
8
6
  it { should be_installed }
@@ -1,8 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.configure do |c|
4
- c.os = 'Debian'
5
- end
3
+ include Serverspec::Helper::Debian
6
4
 
7
5
  describe php_config('default_mimetype') do
8
6
  let(:stdout) { 'text/html' }
@@ -1,8 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.configure do |c|
4
- c.os = 'Debian'
5
- end
3
+ include Serverspec::Helper::Debian
6
4
 
7
5
  describe port(80) do
8
6
  it { should be_listening }
@@ -1,8 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.configure do |c|
4
- c.os = 'Debian'
5
- end
3
+ include Serverspec::Helper::Debian
6
4
 
7
5
  describe routing_table do
8
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" }
@@ -1,8 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.configure do |c|
4
- c.os = 'Debian'
5
- end
3
+ include Serverspec::Helper::Debian
6
4
 
7
5
  describe selinux do
8
6
  it { should be_enforcing }
@@ -1,8 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.configure do |c|
4
- c.os = 'Debian'
5
- end
3
+ include Serverspec::Helper::Debian
6
4
 
7
5
  describe service('sshd') do
8
6
  it { should be_enabled }
@@ -1,8 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.configure do |c|
4
- c.os = 'Debian'
5
- end
3
+ include Serverspec::Helper::Debian
6
4
 
7
5
  describe user('root') do
8
6
  it { should exist }
@@ -1,8 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.configure do |c|
4
- c.os = 'Debian'
5
- end
3
+ include Serverspec::Helper::Debian
6
4
 
7
5
  describe zfs('rpool') do
8
6
  it { should exist }
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::DetectOS
3
+ include Serverspec::Helper::FreeBSD
4
4
 
5
5
  describe command('cat /etc/resolv.conf') do
6
6
  let(:stdout) { "nameserver 127.0.0.1\r\n" }
@@ -1,8 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.configure do |c|
4
- c.os = 'FreeBSD'
5
- end
3
+ include Serverspec::Helper::FreeBSD
6
4
 
7
5
  describe cron do
8
6
  it { should have_entry '* * * * * /usr/local/bin/batch.sh' }