serverspec 0.11.5 → 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (230) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +1 -5
  3. data/lib/serverspec.rb +2 -36
  4. data/lib/serverspec/helper.rb +2 -32
  5. data/lib/serverspec/helper/backend.rb +11 -0
  6. data/lib/serverspec/helper/os.rb +25 -0
  7. data/lib/serverspec/setup.rb +3 -3
  8. data/lib/serverspec/version.rb +1 -1
  9. data/serverspec.gemspec +1 -0
  10. data/spec/aix/command_spec.rb +1 -1
  11. data/spec/aix/cron_spec.rb +1 -1
  12. data/spec/aix/default_gateway_spec.rb +1 -1
  13. data/spec/aix/file_spec.rb +1 -1
  14. data/spec/aix/group_spec.rb +1 -1
  15. data/spec/aix/host_spec.rb +1 -1
  16. data/spec/aix/package_spec.rb +1 -1
  17. data/spec/aix/php_config_spec.rb +1 -1
  18. data/spec/aix/port_spec.rb +1 -1
  19. data/spec/aix/routing_table_spec.rb +1 -1
  20. data/spec/aix/service_spec.rb +1 -1
  21. data/spec/aix/user_spec.rb +1 -1
  22. data/spec/backend/cmd/configuration_spec.rb +2 -2
  23. data/spec/backend/exec/build_command_spec.rb +1 -1
  24. data/spec/backend/exec/configuration_spec.rb +2 -3
  25. data/spec/backend/powershell/script_helper_spec.rb +4 -4
  26. data/spec/backend/ssh/build_command_spec.rb +1 -1
  27. data/spec/backend/ssh/configuration_spec.rb +2 -3
  28. data/spec/backend/winrm/configuration_spec.rb +2 -2
  29. data/spec/darwin/command_spec.rb +1 -1
  30. data/spec/darwin/cron_spec.rb +1 -1
  31. data/spec/darwin/default_gateway_spec.rb +1 -1
  32. data/spec/darwin/file_spec.rb +1 -1
  33. data/spec/darwin/group_spec.rb +1 -1
  34. data/spec/darwin/host_spec.rb +1 -1
  35. data/spec/darwin/mail_alias_spec.rb +1 -1
  36. data/spec/darwin/package_spec.rb +1 -1
  37. data/spec/darwin/php_config_spec.rb +1 -1
  38. data/spec/darwin/port_spec.rb +1 -1
  39. data/spec/darwin/routing_table_spec.rb +1 -1
  40. data/spec/darwin/service_spec.rb +1 -1
  41. data/spec/darwin/user_spec.rb +1 -1
  42. data/spec/debian/cgroup_spec.rb +1 -1
  43. data/spec/debian/command_spec.rb +1 -1
  44. data/spec/debian/cron_spec.rb +1 -1
  45. data/spec/debian/default_gateway_spec.rb +1 -1
  46. data/spec/debian/file_spec.rb +1 -1
  47. data/spec/debian/group_spec.rb +1 -1
  48. data/spec/debian/host_spec.rb +1 -1
  49. data/spec/debian/interface_spec.rb +1 -1
  50. data/spec/debian/iptables_spec.rb +1 -1
  51. data/spec/debian/kernel_module_spec.rb +1 -1
  52. data/spec/debian/linux_kernel_parameter_spec.rb +1 -1
  53. data/spec/debian/lxc_spec.rb +1 -1
  54. data/spec/debian/mail_alias_spec.rb +1 -1
  55. data/spec/debian/package_spec.rb +1 -1
  56. data/spec/debian/php_config_spec.rb +1 -1
  57. data/spec/debian/port_spec.rb +1 -1
  58. data/spec/debian/routing_table_spec.rb +1 -1
  59. data/spec/debian/selinux_spec.rb +1 -1
  60. data/spec/debian/service_spec.rb +1 -1
  61. data/spec/debian/user_spec.rb +1 -1
  62. data/spec/debian/zfs_spec.rb +1 -1
  63. data/spec/freebsd/command_spec.rb +1 -1
  64. data/spec/freebsd/cron_spec.rb +1 -1
  65. data/spec/freebsd/default_gateway_spec.rb +1 -1
  66. data/spec/freebsd/file_spec.rb +1 -1
  67. data/spec/freebsd/group_spec.rb +1 -1
  68. data/spec/freebsd/host_spec.rb +1 -1
  69. data/spec/freebsd/package_spec.rb +1 -1
  70. data/spec/freebsd/php_config_spec.rb +1 -1
  71. data/spec/freebsd/port_spec.rb +1 -1
  72. data/spec/freebsd/routing_table_spec.rb +1 -1
  73. data/spec/freebsd/service_spec.rb +1 -1
  74. data/spec/freebsd/user_spec.rb +1 -1
  75. data/spec/gentoo/cgroup_spec.rb +1 -1
  76. data/spec/gentoo/command_spec.rb +1 -1
  77. data/spec/gentoo/cron_spec.rb +1 -1
  78. data/spec/gentoo/default_gateway_spec.rb +1 -1
  79. data/spec/gentoo/file_spec.rb +1 -1
  80. data/spec/gentoo/group_spec.rb +1 -1
  81. data/spec/gentoo/host_spec.rb +1 -1
  82. data/spec/gentoo/interface_spec.rb +1 -1
  83. data/spec/gentoo/iptables_spec.rb +1 -1
  84. data/spec/gentoo/kernel_module_spec.rb +1 -1
  85. data/spec/gentoo/linux_kernel_parameter_spec.rb +1 -1
  86. data/spec/gentoo/lxc_spec.rb +1 -1
  87. data/spec/gentoo/mail_alias_spec.rb +1 -1
  88. data/spec/gentoo/package_spec.rb +1 -1
  89. data/spec/gentoo/php_config_spec.rb +1 -1
  90. data/spec/gentoo/port_spec.rb +1 -1
  91. data/spec/gentoo/routing_table_spec.rb +1 -1
  92. data/spec/gentoo/selinux_spec.rb +1 -1
  93. data/spec/gentoo/service_spec.rb +1 -1
  94. data/spec/gentoo/user_spec.rb +1 -1
  95. data/spec/gentoo/zfs_spec.rb +1 -1
  96. data/spec/plamo/cgroup_spec.rb +1 -1
  97. data/spec/plamo/command_spec.rb +1 -1
  98. data/spec/plamo/cron_spec.rb +1 -1
  99. data/spec/plamo/default_gateway_spec.rb +1 -1
  100. data/spec/plamo/file_spec.rb +1 -1
  101. data/spec/plamo/group_spec.rb +1 -1
  102. data/spec/plamo/host_spec.rb +1 -1
  103. data/spec/plamo/interface_spec.rb +1 -1
  104. data/spec/plamo/iptables_spec.rb +1 -1
  105. data/spec/plamo/kernel_module_spec.rb +1 -1
  106. data/spec/plamo/linux_kernel_parameter_spec.rb +1 -1
  107. data/spec/plamo/lxc_spec.rb +1 -1
  108. data/spec/plamo/mail_alias_spec.rb +1 -1
  109. data/spec/plamo/package_spec.rb +1 -1
  110. data/spec/plamo/php_config_spec.rb +1 -1
  111. data/spec/plamo/port_spec.rb +1 -1
  112. data/spec/plamo/routing_table_spec.rb +1 -1
  113. data/spec/plamo/selinux_spec.rb +1 -1
  114. data/spec/plamo/service_spec.rb +1 -1
  115. data/spec/plamo/user_spec.rb +1 -1
  116. data/spec/plamo/zfs_spec.rb +1 -1
  117. data/spec/redhat/cgroup_spec.rb +1 -1
  118. data/spec/redhat/command_spec.rb +1 -1
  119. data/spec/redhat/cron_spec.rb +1 -1
  120. data/spec/redhat/default_gateway_spec.rb +1 -1
  121. data/spec/redhat/file_spec.rb +1 -1
  122. data/spec/redhat/group_spec.rb +1 -1
  123. data/spec/redhat/host_spec.rb +1 -1
  124. data/spec/redhat/interface_spec.rb +1 -1
  125. data/spec/redhat/iptables_spec.rb +1 -1
  126. data/spec/redhat/kernel_module_spec.rb +1 -1
  127. data/spec/redhat/linux_kernel_parameter_spec.rb +1 -1
  128. data/spec/redhat/lxc_spec.rb +1 -1
  129. data/spec/redhat/mail_alias_spec.rb +1 -1
  130. data/spec/redhat/package_spec.rb +1 -1
  131. data/spec/redhat/php_config_spec.rb +1 -1
  132. data/spec/redhat/port_spec.rb +1 -1
  133. data/spec/redhat/routing_table_spec.rb +1 -1
  134. data/spec/redhat/selinux_spec.rb +1 -1
  135. data/spec/redhat/service_spec.rb +1 -1
  136. data/spec/redhat/user_spec.rb +1 -1
  137. data/spec/redhat/yumrepo_spec.rb +1 -1
  138. data/spec/redhat/zfs_spec.rb +1 -1
  139. data/spec/smartos/mail_alias_spec.rb +1 -1
  140. data/spec/solaris/command_spec.rb +1 -1
  141. data/spec/solaris/cron_spec.rb +1 -1
  142. data/spec/solaris/default_gateway_spec.rb +1 -1
  143. data/spec/solaris/file_spec.rb +1 -1
  144. data/spec/solaris/group_spec.rb +1 -1
  145. data/spec/solaris/host_spec.rb +1 -1
  146. data/spec/solaris/ipfilter_spec.rb +1 -1
  147. data/spec/solaris/ipnat_spec.rb +1 -1
  148. data/spec/solaris/mail_alias_spec.rb +1 -1
  149. data/spec/solaris/package_spec.rb +1 -1
  150. data/spec/solaris/php_config_spec.rb +1 -1
  151. data/spec/solaris/port_spec.rb +1 -1
  152. data/spec/solaris/routing_table_spec.rb +1 -1
  153. data/spec/solaris/service_spec.rb +1 -1
  154. data/spec/solaris/svcprop_spec.rb +1 -1
  155. data/spec/solaris/user_spec.rb +1 -1
  156. data/spec/solaris/zfs_spec.rb +1 -1
  157. data/spec/solaris10/file_spec.rb +1 -1
  158. data/spec/solaris10/group_spec.rb +1 -1
  159. data/spec/solaris10/mail_alias_spec.rb +1 -1
  160. data/spec/solaris10/package_spec.rb +1 -1
  161. data/spec/solaris10/php_config_spec.rb +1 -1
  162. data/spec/solaris10/user_spec.rb +1 -1
  163. data/spec/solaris11/command_spec.rb +1 -1
  164. data/spec/solaris11/cron_spec.rb +1 -1
  165. data/spec/solaris11/default_gateway_spec.rb +1 -1
  166. data/spec/solaris11/file_spec.rb +1 -1
  167. data/spec/solaris11/group_spec.rb +1 -1
  168. data/spec/solaris11/host_spec.rb +1 -1
  169. data/spec/solaris11/ipfilter_spec.rb +1 -1
  170. data/spec/solaris11/ipnat_spec.rb +1 -1
  171. data/spec/solaris11/mail_alias_spec.rb +1 -1
  172. data/spec/solaris11/package_spec.rb +1 -1
  173. data/spec/solaris11/php_config_spec.rb +1 -1
  174. data/spec/solaris11/port_spec.rb +1 -1
  175. data/spec/solaris11/routing_table_spec.rb +1 -1
  176. data/spec/solaris11/service_spec.rb +1 -1
  177. data/spec/solaris11/svcprop_spec.rb +1 -1
  178. data/spec/solaris11/user_spec.rb +1 -1
  179. data/spec/solaris11/zfs_spec.rb +1 -1
  180. data/spec/spec_helper.rb +8 -6
  181. data/spec/windows/command_spec.rb +2 -2
  182. data/spec/windows/file_spec.rb +2 -2
  183. data/spec/windows/group_spec.rb +2 -2
  184. data/spec/windows/port_spec.rb +2 -2
  185. data/spec/windows/service_spec.rb +2 -2
  186. data/spec/windows/user_spec.rb +2 -2
  187. data/spec/windows/windows_registry_key_spec.rb +2 -2
  188. metadata +18 -45
  189. data/lib/serverspec/attributes.rb +0 -17
  190. data/lib/serverspec/backend.rb +0 -7
  191. data/lib/serverspec/backend/base.rb +0 -31
  192. data/lib/serverspec/backend/cmd.rb +0 -39
  193. data/lib/serverspec/backend/exec.rb +0 -218
  194. data/lib/serverspec/backend/powershell/command.rb +0 -40
  195. data/lib/serverspec/backend/powershell/script_helper.rb +0 -85
  196. data/lib/serverspec/backend/powershell/support/check_file_access_rules.ps1 +0 -8
  197. data/lib/serverspec/backend/powershell/support/crop_text.ps1 +0 -11
  198. data/lib/serverspec/backend/powershell/support/find_group.ps1 +0 -8
  199. data/lib/serverspec/backend/powershell/support/find_installed_application.ps1 +0 -7
  200. data/lib/serverspec/backend/powershell/support/find_service.ps1 +0 -5
  201. data/lib/serverspec/backend/powershell/support/find_user.ps1 +0 -8
  202. data/lib/serverspec/backend/powershell/support/find_usergroup.ps1 +0 -9
  203. data/lib/serverspec/backend/powershell/support/is_port_listening.ps1 +0 -13
  204. data/lib/serverspec/backend/ssh.rb +0 -93
  205. data/lib/serverspec/backend/winrm.rb +0 -26
  206. data/lib/serverspec/configuration.rb +0 -12
  207. data/lib/serverspec/helper/aix.rb +0 -9
  208. data/lib/serverspec/helper/attributes.rb +0 -16
  209. data/lib/serverspec/helper/base.rb +0 -9
  210. data/lib/serverspec/helper/cmd.rb +0 -15
  211. data/lib/serverspec/helper/configuration.rb +0 -37
  212. data/lib/serverspec/helper/darwin.rb +0 -9
  213. data/lib/serverspec/helper/debian.rb +0 -9
  214. data/lib/serverspec/helper/detect_os.rb +0 -19
  215. data/lib/serverspec/helper/exec.rb +0 -14
  216. data/lib/serverspec/helper/freebsd.rb +0 -9
  217. data/lib/serverspec/helper/gentoo.rb +0 -9
  218. data/lib/serverspec/helper/plamo.rb +0 -9
  219. data/lib/serverspec/helper/properties.rb +0 -14
  220. data/lib/serverspec/helper/puppet.rb +0 -9
  221. data/lib/serverspec/helper/redhat.rb +0 -9
  222. data/lib/serverspec/helper/smartos.rb +0 -10
  223. data/lib/serverspec/helper/solaris.rb +0 -9
  224. data/lib/serverspec/helper/solaris10.rb +0 -9
  225. data/lib/serverspec/helper/solaris11.rb +0 -9
  226. data/lib/serverspec/helper/ssh.rb +0 -15
  227. data/lib/serverspec/helper/windows.rb +0 -9
  228. data/lib/serverspec/helper/winrm.rb +0 -15
  229. data/lib/serverspec/properties.rb +0 -17
  230. data/spec/helpers/properties_spec.rb +0 -11
@@ -1,9 +0,0 @@
1
- module Serverspec
2
- module Helper
3
- module Darwin
4
- def commands
5
- Serverspec::Commands::Darwin.new
6
- end
7
- end
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- module Serverspec
2
- module Helper
3
- module Debian
4
- def commands
5
- Serverspec::Commands::Debian.new
6
- end
7
- end
8
- end
9
- end
@@ -1,19 +0,0 @@
1
- module Serverspec
2
- module Helper
3
- module DetectOS
4
- def commands
5
- property[:os_by_host] = {} if ! property[:os_by_host]
6
- host = RSpec.configuration.ssh ? RSpec.configuration.ssh.host : 'localhost'
7
-
8
- if property[:os_by_host][host]
9
- os = property[:os_by_host][host]
10
- else
11
- os = backend(Serverspec::Commands::Base).check_os
12
- property[:os_by_host][host] = os
13
- end
14
-
15
- self.class.const_get('Serverspec').const_get('Commands').const_get(os[:family]).new
16
- end
17
- end
18
- end
19
- end
@@ -1,14 +0,0 @@
1
- module Serverspec
2
- module Helper
3
- module Exec
4
- def backend(commands_object=nil)
5
- if commands_object.nil? && ! respond_to?(:commands)
6
- commands_object = Serverspec::Commands::Base.new
7
- end
8
- instance = Serverspec::Backend::Exec.instance
9
- instance.set_commands(commands_object || commands)
10
- instance
11
- end
12
- end
13
- end
14
- end
@@ -1,9 +0,0 @@
1
- module Serverspec
2
- module Helper
3
- module FreeBSD
4
- def commands
5
- Serverspec::Commands::FreeBSD.new
6
- end
7
- end
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- module Serverspec
2
- module Helper
3
- module Gentoo
4
- def commands
5
- Serverspec::Commands::Gentoo.new
6
- end
7
- end
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- module Serverspec
2
- module Helper
3
- module Plamo
4
- def commands
5
- Serverspec::Commands::Plamo.new
6
- end
7
- end
8
- end
9
- end
@@ -1,14 +0,0 @@
1
- require 'serverspec/properties'
2
-
3
- module Serverspec
4
- module Helper
5
- module Properties
6
- def property
7
- Serverspec::Properties.instance.properties
8
- end
9
- def set_property(prop)
10
- Serverspec::Properties.instance.properties(prop)
11
- end
12
- end
13
- end
14
- end
@@ -1,9 +0,0 @@
1
- module Serverspec
2
- module Helper
3
- module Puppet
4
- def backend
5
- Serverspec::Backend::Puppet.new(commands)
6
- end
7
- end
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- module Serverspec
2
- module Helper
3
- module RedHat
4
- def commands
5
- Serverspec::Commands::RedHat.new
6
- end
7
- end
8
- end
9
- end
@@ -1,10 +0,0 @@
1
- module Serverspec
2
- module Helper
3
- module SmartOS
4
- def commands
5
- Serverspec::Commands::SmartOS.new
6
- end
7
- end
8
- end
9
- end
10
-
@@ -1,9 +0,0 @@
1
- module Serverspec
2
- module Helper
3
- module Solaris
4
- def commands
5
- Serverspec::Commands::Solaris.new
6
- end
7
- end
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- module Serverspec
2
- module Helper
3
- module Solaris10
4
- def commands
5
- Serverspec::Commands::Solaris10.new
6
- end
7
- end
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- module Serverspec
2
- module Helper
3
- module Solaris11
4
- def commands
5
- Serverspec::Commands::Solaris11.new
6
- end
7
- end
8
- end
9
- end
@@ -1,15 +0,0 @@
1
- module Serverspec
2
- module Helper
3
- module Ssh
4
- def backend(commands_object=nil)
5
- if ! respond_to?(:commands)
6
- commands_object = Serverspec::Commands::Base.new
7
- end
8
- instance = Serverspec::Backend::Ssh.instance
9
- instance.set_commands(commands_object || commands)
10
- instance
11
- end
12
- end
13
- end
14
- end
15
-
@@ -1,9 +0,0 @@
1
- module Serverspec
2
- module Helper
3
- module Windows
4
- def commands
5
- Serverspec::Commands::Windows.new
6
- end
7
- end
8
- end
9
- end
@@ -1,15 +0,0 @@
1
- module Serverspec
2
- module Helper
3
- module WinRM
4
- def backend(commands_object=nil)
5
- if ! respond_to?(:commands)
6
- commands_object = Serverspec::Commands::Windows.new
7
- end
8
- instance = Serverspec::Backend::WinRM.instance
9
- instance.set_commands(commands_object || commands)
10
- instance
11
- end
12
- end
13
- end
14
- end
15
-
@@ -1,17 +0,0 @@
1
- require 'singleton'
2
-
3
- module Serverspec
4
- class Properties
5
- include Singleton
6
- def initialize
7
- @prop = {}
8
- end
9
- def properties(prop=nil)
10
- if ! prop.nil?
11
- @prop = prop
12
- end
13
- @prop
14
- end
15
- end
16
- end
17
-
@@ -1,11 +0,0 @@
1
- require 'spec_helper'
2
-
3
- include Serverspec::Helper::Properties
4
-
5
- describe 'Properties Helper' do
6
- before :all do
7
- set_property :role => 'proxy'
8
- end
9
- subject { property }
10
- it { should include :role => 'proxy' }
11
- end