serverspec 0.9.4 → 0.9.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (133) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +4 -0
  3. data/README.md +1 -1
  4. data/lib/serverspec/backend/cmd.rb +5 -0
  5. data/lib/serverspec/backend/exec.rb +1 -0
  6. data/lib/serverspec/backend/ssh.rb +3 -2
  7. data/lib/serverspec/configuration.rb +1 -1
  8. data/lib/serverspec/version.rb +1 -1
  9. data/spec/aix/command_spec.rb +3 -1
  10. data/spec/aix/cron_spec.rb +3 -1
  11. data/spec/aix/default_gateway_spec.rb +3 -1
  12. data/spec/aix/file_spec.rb +3 -1
  13. data/spec/aix/group_spec.rb +3 -1
  14. data/spec/aix/host_spec.rb +3 -1
  15. data/spec/aix/package_spec.rb +3 -1
  16. data/spec/aix/php_config_spec.rb +3 -1
  17. data/spec/aix/port_spec.rb +3 -1
  18. data/spec/aix/routing_table_spec.rb +3 -1
  19. data/spec/aix/service_spec.rb +3 -1
  20. data/spec/aix/user_spec.rb +3 -1
  21. data/spec/darwin/command_spec.rb +3 -1
  22. data/spec/darwin/cron_spec.rb +3 -1
  23. data/spec/darwin/default_gateway_spec.rb +3 -1
  24. data/spec/darwin/file_spec.rb +3 -1
  25. data/spec/darwin/group_spec.rb +3 -1
  26. data/spec/darwin/host_spec.rb +3 -1
  27. data/spec/darwin/mail_alias_spec.rb +3 -1
  28. data/spec/darwin/package_spec.rb +3 -1
  29. data/spec/darwin/php_config_spec.rb +3 -1
  30. data/spec/darwin/port_spec.rb +3 -1
  31. data/spec/darwin/routing_table_spec.rb +3 -1
  32. data/spec/darwin/service_spec.rb +3 -1
  33. data/spec/darwin/user_spec.rb +3 -1
  34. data/spec/debian/command_spec.rb +3 -1
  35. data/spec/debian/cron_spec.rb +3 -1
  36. data/spec/debian/default_gateway_spec.rb +3 -1
  37. data/spec/debian/file_spec.rb +3 -1
  38. data/spec/debian/group_spec.rb +3 -1
  39. data/spec/debian/host_spec.rb +3 -1
  40. data/spec/debian/interface_spec.rb +3 -1
  41. data/spec/debian/iptables_spec.rb +3 -1
  42. data/spec/debian/kernel_module_spec.rb +3 -1
  43. data/spec/debian/linux_kernel_parameter_spec.rb +3 -1
  44. data/spec/debian/mail_alias_spec.rb +3 -1
  45. data/spec/debian/package_spec.rb +3 -1
  46. data/spec/debian/php_config_spec.rb +4 -1
  47. data/spec/debian/port_spec.rb +3 -1
  48. data/spec/debian/routing_table_spec.rb +3 -1
  49. data/spec/debian/selinux_spec.rb +3 -1
  50. data/spec/debian/service_spec.rb +3 -1
  51. data/spec/debian/user_spec.rb +3 -1
  52. data/spec/debian/zfs_spec.rb +3 -1
  53. data/spec/freebsd/command_spec.rb +1 -1
  54. data/spec/freebsd/cron_spec.rb +3 -1
  55. data/spec/freebsd/default_gateway_spec.rb +3 -1
  56. data/spec/freebsd/file_spec.rb +3 -1
  57. data/spec/freebsd/group_spec.rb +3 -1
  58. data/spec/freebsd/host_spec.rb +3 -1
  59. data/spec/freebsd/package_spec.rb +3 -1
  60. data/spec/freebsd/php_config_spec.rb +3 -1
  61. data/spec/freebsd/port_spec.rb +3 -1
  62. data/spec/freebsd/routing_table_spec.rb +3 -1
  63. data/spec/freebsd/service_spec.rb +3 -1
  64. data/spec/freebsd/user_spec.rb +3 -2
  65. data/spec/gentoo/command_spec.rb +3 -1
  66. data/spec/gentoo/cron_spec.rb +3 -1
  67. data/spec/gentoo/default_gateway_spec.rb +3 -1
  68. data/spec/gentoo/file_spec.rb +1 -1
  69. data/spec/gentoo/group_spec.rb +3 -1
  70. data/spec/gentoo/host_spec.rb +3 -1
  71. data/spec/gentoo/interface_spec.rb +3 -1
  72. data/spec/gentoo/iptables_spec.rb +3 -1
  73. data/spec/gentoo/kernel_module_spec.rb +3 -1
  74. data/spec/gentoo/linux_kernel_parameter_spec.rb +3 -1
  75. data/spec/gentoo/mail_alias_spec.rb +3 -1
  76. data/spec/gentoo/package_spec.rb +3 -1
  77. data/spec/gentoo/php_config_spec.rb +3 -1
  78. data/spec/gentoo/port_spec.rb +3 -1
  79. data/spec/gentoo/routing_table_spec.rb +3 -1
  80. data/spec/gentoo/selinux_spec.rb +3 -1
  81. data/spec/gentoo/service_spec.rb +3 -1
  82. data/spec/gentoo/user_spec.rb +3 -1
  83. data/spec/gentoo/zfs_spec.rb +3 -1
  84. data/spec/redhat/command_spec.rb +3 -1
  85. data/spec/redhat/commands_spec.rb +3 -1
  86. data/spec/redhat/cron_spec.rb +3 -1
  87. data/spec/redhat/default_gateway_spec.rb +3 -1
  88. data/spec/redhat/file_spec.rb +3 -1
  89. data/spec/redhat/group_spec.rb +3 -1
  90. data/spec/redhat/host_spec.rb +3 -1
  91. data/spec/redhat/interface_spec.rb +3 -1
  92. data/spec/redhat/iptables_spec.rb +3 -1
  93. data/spec/redhat/kernel_module_spec.rb +3 -1
  94. data/spec/redhat/linux_kernel_parameter_spec.rb +3 -1
  95. data/spec/redhat/mail_alias_spec.rb +3 -1
  96. data/spec/redhat/package_spec.rb +3 -1
  97. data/spec/redhat/php_config_spec.rb +3 -1
  98. data/spec/redhat/port_spec.rb +3 -1
  99. data/spec/redhat/routing_table_spec.rb +3 -1
  100. data/spec/redhat/selinux_spec.rb +3 -1
  101. data/spec/redhat/service_spec.rb +3 -1
  102. data/spec/redhat/user_spec.rb +3 -2
  103. data/spec/redhat/yumrepo_spec.rb +3 -1
  104. data/spec/redhat/zfs_spec.rb +3 -1
  105. data/spec/smartos/commands_spec.rb +3 -1
  106. data/spec/smartos/mail_alias_spec.rb +3 -1
  107. data/spec/solaris10/commands_spec.rb +3 -1
  108. data/spec/solaris10/mail_alias_spec.rb +3 -1
  109. data/spec/solaris10/php_config_spec.rb +3 -1
  110. data/spec/solaris11/command_spec.rb +3 -1
  111. data/spec/solaris11/cron_spec.rb +3 -1
  112. data/spec/solaris11/default_gateway_spec.rb +3 -1
  113. data/spec/solaris11/file_spec.rb +3 -1
  114. data/spec/solaris11/group_spec.rb +3 -1
  115. data/spec/solaris11/host_spec.rb +3 -1
  116. data/spec/solaris11/ipfilter_spec.rb +3 -1
  117. data/spec/solaris11/ipnat_spec.rb +3 -1
  118. data/spec/solaris11/mail_alias_spec.rb +3 -1
  119. data/spec/solaris11/package_spec.rb +3 -1
  120. data/spec/solaris11/php_config_spec.rb +3 -1
  121. data/spec/solaris11/port_spec.rb +3 -1
  122. data/spec/solaris11/routing_table_spec.rb +3 -1
  123. data/spec/solaris11/service_spec.rb +3 -1
  124. data/spec/solaris11/svcprop_spec.rb +3 -1
  125. data/spec/solaris11/user_spec.rb +3 -1
  126. data/spec/solaris11/zfs_spec.rb +3 -1
  127. data/spec/spec_helper.rb +4 -0
  128. data/spec/windows/file_spec.rb +0 -1
  129. data/spec/windows/group_spec.rb +0 -1
  130. data/spec/windows/port_spec.rb +0 -1
  131. data/spec/windows/user_spec.rb +0 -1
  132. metadata +2 -4
  133. data/spec/aix/linux_kernel_parameter_spec.rb +0 -36
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7db443421700dfdacefd2e30f55e0d7fa0351361
4
- data.tar.gz: a2853fb2095bb792edee67cd39bf82c920406182
3
+ metadata.gz: c455583699b9962898ac154d786fadc8cec05082
4
+ data.tar.gz: 66337a76008e11dc60380cb24fdd2730ecac98b8
5
5
  SHA512:
6
- metadata.gz: 7a577e8153713fee9665b849583edf38eb74bad7759947ac73d1f4e0886a1028b7e0fb2d16cd36602f25f95de83220971be524e1d6a97e78cf441185b254e6d7
7
- data.tar.gz: eae422a0ad172a6f68bb2974f219a688b03c28714b27fe451ecc104163cd350ee817e07420bba86c3c3922fe797d1297cc9228ca272e3e53d3fcf077f8cc8e64
6
+ metadata.gz: 4f95c10a464f2a548804e4a65fa30431ca4b0350de6da6e1085161f74f18a8e305724a937bd7d4e6bb6e82e71e108472e2b49f9f3bf8a980e70deca782c11b58
7
+ data.tar.gz: c43fb7bd5b7231f104b7567ad1fd6974938224d0c2b288bee043b59f44f14c2bc90e4c2e891af3fab6635cf370e37a00a95c1188d2bf65c3d7450511c3aadce6
data/Gemfile CHANGED
@@ -1,4 +1,8 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
+ group :test do
4
+ gem 'coveralls', :require => false
5
+ end
6
+
3
7
  # Specify your gem's dependencies in serverspec.gemspec
4
8
  gemspec
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Serverspec [![Gem Version](https://badge.fury.io/rb/serverspec.png)](http://badge.fury.io/rb/serverspec) [![BuildStatus](https://secure.travis-ci.org/serverspec/serverspec.png)](http://travis-ci.org/serverspec/serverspec)
1
+ # Serverspec [![Gem Version](https://badge.fury.io/rb/serverspec.png)](http://badge.fury.io/rb/serverspec) [![BuildStatus](https://secure.travis-ci.org/serverspec/serverspec.png)](http://travis-ci.org/serverspec/serverspec) [![Coverage Status](https://coveralls.io/repos/serverspec/serverspec/badge.png)](https://coveralls.io/r/serverspec/serverspec)
2
2
 
3
3
  RSpec tests for your servers configured by Puppet, Chef or anything else
4
4
 
@@ -30,6 +30,11 @@ module Serverspec
30
30
  { :stdout => stdout, :stderr => nil, :status => $? }
31
31
  end
32
32
  end
33
+
34
+ def check_os
35
+ # Dirty hack for specs
36
+ 'Windows'
37
+ end
33
38
  end
34
39
  end
35
40
  end
@@ -158,6 +158,7 @@ module Serverspec
158
158
  end
159
159
 
160
160
  def check_os
161
+ return RSpec.configuration.os if RSpec.configuration.os
161
162
  if run_command('ls /etc/redhat-release')[:exit_status] == 0
162
163
  'RedHat'
163
164
  elsif run_command('ls /etc/system-release')[:exit_status] == 0
@@ -40,8 +40,9 @@ module Serverspec
40
40
  def ssh_exec!(command)
41
41
  stdout_data = ''
42
42
  stderr_data = ''
43
- exit_status = nil
43
+ exit_status = nil
44
44
  exit_signal = nil
45
+ pass_prompt = RSpec.configuration.pass_prompt || /^\[sudo\] password for/
45
46
 
46
47
  ssh = RSpec.configuration.ssh
47
48
  ssh.open_channel do |channel|
@@ -51,7 +52,7 @@ module Serverspec
51
52
  channel.exec("#{command}") do |ch, success|
52
53
  abort "FAILED: couldn't execute command (ssh.channel.exec)" if !success
53
54
  channel.on_data do |ch, data|
54
- if data =~ /^\[sudo\] password for/
55
+ if data.match pass_prompt
55
56
  abort "Please set sudo password by using SUDO_PASSWORD or ASK_SUDO_PASSWORD environment variable" if RSpec.configuration.sudo_password.nil?
56
57
  channel.send_data "#{RSpec.configuration.sudo_password}\n"
57
58
  else
@@ -1,7 +1,7 @@
1
1
  module Serverspec
2
2
  module Configuration
3
3
  class << self
4
- VALID_OPTIONS_KEYS = [:path, :pre_command, :stdout, :stderr, :sudo_path].freeze
4
+ VALID_OPTIONS_KEYS = [:path, :pre_command, :stdout, :stderr, :sudo_path, :passprompt].freeze
5
5
  attr_accessor(*VALID_OPTIONS_KEYS)
6
6
 
7
7
  def defaults
@@ -1,3 +1,3 @@
1
1
  module Serverspec
2
- VERSION = "0.9.4"
2
+ VERSION = "0.9.5"
3
3
  end
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::AIX
3
+ RSpec.configure do |c|
4
+ c.os = 'AIX'
5
+ end
4
6
 
5
7
  describe command('cat /etc/resolv.conf') do
6
8
  let(:stdout) { "nameserver 127.0.0.1\r\n" }
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::AIX
3
+ RSpec.configure do |c|
4
+ c.os = 'AIX'
5
+ end
4
6
 
5
7
  describe cron do
6
8
  it { should have_entry '* * * * * /usr/local/bin/batch.sh' }
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::AIX
3
+ RSpec.configure do |c|
4
+ c.os = 'AIX'
5
+ end
4
6
 
5
7
  describe default_gateway do
6
8
  let(:stdout) { "default via 192.168.1.1 dev eth1 \r\n" }
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::AIX
3
+ RSpec.configure do |c|
4
+ c.os = 'AIX'
5
+ end
4
6
 
5
7
  describe file('/etc/ssh/sshd_config') do
6
8
  it { should be_file }
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::AIX
3
+ RSpec.configure do |c|
4
+ c.os = 'AIX'
5
+ end
4
6
 
5
7
  describe group('root') do
6
8
  it { should exist }
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::AIX
3
+ RSpec.configure do |c|
4
+ c.os = 'AIX'
5
+ end
4
6
 
5
7
  describe host('127.0.0.1') do
6
8
  it { should be_resolvable }
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::AIX
3
+ RSpec.configure do |c|
4
+ c.os = 'AIX'
5
+ end
4
6
 
5
7
  describe package('httpd') do
6
8
  it { should be_installed }
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::AIX
3
+ RSpec.configure do |c|
4
+ c.os = 'AIX'
5
+ end
4
6
 
5
7
  describe php_config('default_mimetype') do
6
8
  let(:stdout) { 'text/html' }
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::AIX
3
+ RSpec.configure do |c|
4
+ c.os = 'AIX'
5
+ end
4
6
 
5
7
  describe port(80) do
6
8
  it { should be_listening }
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::AIX
3
+ RSpec.configure do |c|
4
+ c.os = 'AIX'
5
+ end
4
6
 
5
7
  describe routing_table do
6
8
  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,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::AIX
3
+ RSpec.configure do |c|
4
+ c.os = 'AIX'
5
+ end
4
6
 
5
7
  describe service('sshd') do
6
8
  it { should be_enabled }
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::AIX
3
+ RSpec.configure do |c|
4
+ c.os = 'AIX'
5
+ end
4
6
 
5
7
  describe user('root') do
6
8
  it { should exist }
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::Darwin
3
+ RSpec.configure do |c|
4
+ c.os = 'Darwin'
5
+ end
4
6
 
5
7
  describe command('cat /etc/resolv.conf') do
6
8
  let(:stdout) { "nameserver 127.0.0.1\r\n" }
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::Darwin
3
+ RSpec.configure do |c|
4
+ c.os = 'Darwin'
5
+ end
4
6
 
5
7
  describe cron do
6
8
  it { should have_entry '* * * * * /usr/local/bin/batch.sh' }
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::Darwin
3
+ RSpec.configure do |c|
4
+ c.os = 'Darwin'
5
+ end
4
6
 
5
7
  describe default_gateway do
6
8
  let(:stdout) { "default via 192.168.1.1 dev eth1 \r\n" }
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::Darwin
3
+ RSpec.configure do |c|
4
+ c.os = 'Darwin'
5
+ end
4
6
 
5
7
  describe file('/etc/ssh/sshd_config') do
6
8
  it { should be_file }
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::Darwin
3
+ RSpec.configure do |c|
4
+ c.os = 'Darwin'
5
+ end
4
6
 
5
7
  describe group('root') do
6
8
  it { should exist }
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::Darwin
3
+ RSpec.configure do |c|
4
+ c.os = 'Darwin'
5
+ end
4
6
 
5
7
  describe host('127.0.0.1') do
6
8
  it { should be_resolvable }
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::Darwin
3
+ RSpec.configure do |c|
4
+ c.os = 'Darwin'
5
+ end
4
6
 
5
7
  describe mail_alias('daemon') do
6
8
  it { should be_aliased_to "root" }
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::Darwin
3
+ RSpec.configure do |c|
4
+ c.os = 'Darwin'
5
+ end
4
6
 
5
7
  describe package('jekyll') do
6
8
  it { should be_installed.by('gem') }
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::Darwin
3
+ RSpec.configure do |c|
4
+ c.os = 'Darwin'
5
+ end
4
6
 
5
7
  describe php_config('default_mimetype') do
6
8
  let(:stdout) { 'text/html' }
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::Darwin
3
+ RSpec.configure do |c|
4
+ c.os = 'Darwin'
5
+ end
4
6
 
5
7
  describe port(80) do
6
8
  it { should be_listening }
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::Darwin
3
+ RSpec.configure do |c|
4
+ c.os = 'Darwin'
5
+ end
4
6
 
5
7
  describe routing_table do
6
8
  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,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::Darwin
3
+ RSpec.configure do |c|
4
+ c.os = 'Darwin'
5
+ end
4
6
 
5
7
  #describe service('sshd') do
6
8
  # it { should be_enabled }
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::Darwin
3
+ RSpec.configure do |c|
4
+ c.os = 'Darwin'
5
+ end
4
6
 
5
7
  describe user('root') do
6
8
  it { should exist }
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::Debian
3
+ RSpec.configure do |c|
4
+ c.os = 'Debian'
5
+ end
4
6
 
5
7
  describe command('cat /etc/resolv.conf') do
6
8
  let(:stdout) { "nameserver 127.0.0.1\r\n" }
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::Debian
3
+ RSpec.configure do |c|
4
+ c.os = 'Debian'
5
+ end
4
6
 
5
7
  describe cron do
6
8
  it { should have_entry '* * * * * /usr/local/bin/batch.sh' }
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::Debian
3
+ RSpec.configure do |c|
4
+ c.os = 'Debian'
5
+ end
4
6
 
5
7
  describe default_gateway do
6
8
  let(:stdout) { "default via 192.168.1.1 dev eth1 \r\n" }
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::Debian
3
+ RSpec.configure do |c|
4
+ c.os = 'Debian'
5
+ end
4
6
 
5
7
  describe file('/etc/ssh/sshd_config') do
6
8
  it { should be_file }
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::Debian
3
+ RSpec.configure do |c|
4
+ c.os = 'Debian'
5
+ end
4
6
 
5
7
  describe group('root') do
6
8
  it { should exist }
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::Debian
3
+ RSpec.configure do |c|
4
+ c.os = 'Debian'
5
+ end
4
6
 
5
7
  describe host('127.0.0.1') do
6
8
  it { should be_resolvable }
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::Debian
3
+ RSpec.configure do |c|
4
+ c.os = 'Debian'
5
+ end
4
6
 
5
7
  describe interface('eth0') do
6
8
  let(:stdout) { '1000' }
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::Debian
3
+ RSpec.configure do |c|
4
+ c.os = 'Debian'
5
+ end
4
6
 
5
7
  describe iptables do
6
8
  it { should have_rule '-P INPUT ACCEPT' }
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::Debian
3
+ RSpec.configure do |c|
4
+ c.os = 'Debian'
5
+ end
4
6
 
5
7
  describe kernel_module('lp') do
6
8
  it { should be_loaded }
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::Debian
3
+ RSpec.configure do |c|
4
+ c.os = 'Debian'
5
+ end
4
6
 
5
7
  describe linux_kernel_parameter('net.ipv4.tcp_syncookies') do
6
8
  let(:stdout) { "1\n" }
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::Debian
3
+ RSpec.configure do |c|
4
+ c.os = 'Debian'
5
+ end
4
6
 
5
7
  describe mail_alias('daemon') do
6
8
  it { should be_aliased_to "root" }
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::Debian
3
+ RSpec.configure do |c|
4
+ c.os = 'Debian'
5
+ end
4
6
 
5
7
  describe package('apache2') do
6
8
  it { should be_installed }
@@ -1,6 +1,9 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::Debian
3
+ RSpec.configure do |c|
4
+ c.os = 'Debian'
5
+ end
6
+
4
7
  describe php_config('default_mimetype') do
5
8
  let(:stdout) { 'text/html' }
6
9
  its(:value) { should eq 'text/html' }
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::Debian
3
+ RSpec.configure do |c|
4
+ c.os = 'Debian'
5
+ end
4
6
 
5
7
  describe port(80) do
6
8
  it { should be_listening }
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::Debian
3
+ RSpec.configure do |c|
4
+ c.os = 'Debian'
5
+ end
4
6
 
5
7
  describe routing_table do
6
8
  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,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::Debian
3
+ RSpec.configure do |c|
4
+ c.os = 'Debian'
5
+ end
4
6
 
5
7
  describe selinux do
6
8
  it { should be_enforcing }
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::Debian
3
+ RSpec.configure do |c|
4
+ c.os = 'Debian'
5
+ end
4
6
 
5
7
  describe service('sshd') do
6
8
  it { should be_enabled }
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::Debian
3
+ RSpec.configure do |c|
4
+ c.os = 'Debian'
5
+ end
4
6
 
5
7
  describe user('root') do
6
8
  it { should exist }
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::Debian
3
+ RSpec.configure do |c|
4
+ c.os = 'Debian'
5
+ end
4
6
 
5
7
  describe zfs('rpool') do
6
8
  it { should exist }
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::FreeBSD
3
+ include Serverspec::Helper::DetectOS
4
4
 
5
5
  describe command('cat /etc/resolv.conf') do
6
6
  let(:stdout) { "nameserver 127.0.0.1\r\n" }
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::FreeBSD
3
+ RSpec.configure do |c|
4
+ c.os = 'FreeBSD'
5
+ end
4
6
 
5
7
  describe cron do
6
8
  it { should have_entry '* * * * * /usr/local/bin/batch.sh' }
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::FreeBSD
3
+ RSpec.configure do |c|
4
+ c.os = 'FreeBSD'
5
+ end
4
6
 
5
7
  describe default_gateway do
6
8
  let(:stdout) { "default via 192.168.1.1 dev eth1 \r\n" }
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::FreeBSD
3
+ RSpec.configure do |c|
4
+ c.os = 'FreeBSD'
5
+ end
4
6
 
5
7
  describe file('/etc/ssh/sshd_config') do
6
8
  it { should be_file }
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::FreeBSD
3
+ RSpec.configure do |c|
4
+ c.os = 'FreeBSD'
5
+ end
4
6
 
5
7
  describe group('root') do
6
8
  it { should exist }
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- include Serverspec::Helper::FreeBSD
3
+ RSpec.configure do |c|
4
+ c.os = 'FreeBSD'
5
+ end
4
6
 
5
7
  describe host('127.0.0.1') do
6
8
  it { should be_resolvable }