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.
Files changed (116) hide show
  1. checksums.yaml +4 -4
  2. data/WINDOWS_SUPPORT.md +9 -13
  3. data/lib/serverspec/helper/type.rb +7 -9
  4. data/lib/serverspec/helper.rb +0 -2
  5. data/lib/serverspec/setup.rb +11 -7
  6. data/lib/serverspec/type/base.rb +15 -17
  7. data/lib/serverspec/type/cgroup.rb +13 -16
  8. data/lib/serverspec/type/command.rb +14 -17
  9. data/lib/serverspec/type/cron.rb +8 -9
  10. data/lib/serverspec/type/default_gateway.rb +14 -16
  11. data/lib/serverspec/type/file.rb +76 -78
  12. data/lib/serverspec/type/group.rb +7 -9
  13. data/lib/serverspec/type/host.rb +10 -12
  14. data/lib/serverspec/type/iis_app_pool.rb +40 -42
  15. data/lib/serverspec/type/iis_website.rb +28 -31
  16. data/lib/serverspec/type/interface.rb +10 -12
  17. data/lib/serverspec/type/ipfilter.rb +7 -9
  18. data/lib/serverspec/type/ipnat.rb +7 -9
  19. data/lib/serverspec/type/iptables.rb +7 -9
  20. data/lib/serverspec/type/kernel_module.rb +4 -6
  21. data/lib/serverspec/type/linux_kernel_parameter.rb +7 -9
  22. data/lib/serverspec/type/lxc.rb +10 -12
  23. data/lib/serverspec/type/mail_alias.rb +4 -6
  24. data/lib/serverspec/type/package.rb +48 -50
  25. data/lib/serverspec/type/php_config.rb +7 -9
  26. data/lib/serverspec/type/port.rb +28 -30
  27. data/lib/serverspec/type/ppa.rb +7 -9
  28. data/lib/serverspec/type/process.rb +20 -22
  29. data/lib/serverspec/type/routing_table.rb +7 -9
  30. data/lib/serverspec/type/selinux.rb +13 -17
  31. data/lib/serverspec/type/service.rb +24 -26
  32. data/lib/serverspec/type/user.rb +22 -30
  33. data/lib/serverspec/type/windows_feature.rb +4 -6
  34. data/lib/serverspec/type/windows_hot_fix.rb +4 -6
  35. data/lib/serverspec/type/windows_registry_key.rb +13 -15
  36. data/lib/serverspec/type/windows_scheduled_task.rb +4 -6
  37. data/lib/serverspec/type/yumrepo.rb +7 -9
  38. data/lib/serverspec/type/zfs.rb +10 -12
  39. data/lib/serverspec/version.rb +1 -1
  40. data/lib/serverspec.rb +2 -1
  41. data/spec/spec_helper.rb +2 -3
  42. data/spec/type/aix/group_spec.rb +0 -4
  43. data/spec/type/aix/package_spec.rb +0 -4
  44. data/spec/type/aix/port_spec.rb +12 -25
  45. data/spec/type/aix/service_spec.rb +0 -7
  46. data/spec/type/aix/user_spec.rb +0 -12
  47. data/spec/type/arch/file_spec.rb +0 -13
  48. data/spec/type/arch/package_spec.rb +0 -10
  49. data/spec/type/base/cron_spec.rb +0 -8
  50. data/spec/type/base/file_spec.rb +0 -53
  51. data/spec/type/base/group_spec.rb +0 -8
  52. data/spec/type/base/host_spec.rb +0 -20
  53. data/spec/type/base/mail_alias_spec.rb +0 -4
  54. data/spec/type/base/package_spec.rb +10 -38
  55. data/spec/type/base/port_spec.rb +19 -18
  56. data/spec/type/base/service_spec.rb +4 -29
  57. data/spec/type/base/user_spec.rb +0 -24
  58. data/spec/type/darwin/package_spec.rb +0 -8
  59. data/spec/type/darwin/port_spec.rb +17 -23
  60. data/spec/type/darwin/service_spec.rb +0 -12
  61. data/spec/type/debian/package_spec.rb +0 -12
  62. data/spec/type/debian/service_spec.rb +0 -8
  63. data/spec/type/freebsd/file_spec.rb +0 -16
  64. data/spec/type/freebsd/package_spec.rb +0 -8
  65. data/spec/type/freebsd/port_spec.rb +17 -23
  66. data/spec/type/freebsd/service_spec.rb +0 -4
  67. data/spec/type/freebsd10/package_spec.rb +0 -8
  68. data/spec/type/gentoo/package_spec.rb +0 -5
  69. data/spec/type/gentoo/service_spec.rb +0 -8
  70. data/spec/type/linux/file_spec.rb +0 -13
  71. data/spec/type/linux/iptables_spec.rb +0 -8
  72. data/spec/type/linux/kernel_module_spec.rb +0 -4
  73. data/spec/type/linux/lxc_container_spec.rb +0 -8
  74. data/spec/type/nixos/package_spec.rb +0 -12
  75. data/spec/type/openbsd/file_spec.rb +0 -30
  76. data/spec/type/openbsd/mail_alias_spec.rb +0 -4
  77. data/spec/type/openbsd/package_spec.rb +0 -9
  78. data/spec/type/openbsd/service_spec.rb +0 -7
  79. data/spec/type/openbsd/user_spec.rb +0 -8
  80. data/spec/type/opensuse/service_spec.rb +0 -12
  81. data/spec/type/plamo/package_spec.rb +0 -4
  82. data/spec/type/plamo/service_spec.rb +0 -4
  83. data/spec/type/redhat/file_spec.rb +0 -13
  84. data/spec/type/redhat/package_spec.rb +0 -12
  85. data/spec/type/redhat/service_spec.rb +0 -8
  86. data/spec/type/redhat/yumrepo_spec.rb +5 -19
  87. data/spec/type/redhat5/iptables_spec.rb +0 -8
  88. data/spec/type/smartos/package_spec.rb +0 -8
  89. data/spec/type/smartos/service_spec.rb +0 -12
  90. data/spec/type/solaris/cron_spec.rb +0 -8
  91. data/spec/type/solaris/file_spec.rb +0 -14
  92. data/spec/type/solaris/group_spec.rb +0 -4
  93. data/spec/type/solaris/host_spec.rb +3 -11
  94. data/spec/type/solaris/package_spec.rb +0 -4
  95. data/spec/type/solaris/port_spec.rb +23 -22
  96. data/spec/type/solaris/service_spec.rb +0 -12
  97. data/spec/type/solaris/user_spec.rb +0 -12
  98. data/spec/type/solaris10/file_spec.rb +0 -58
  99. data/spec/type/solaris10/group_spec.rb +0 -4
  100. data/spec/type/solaris10/host_spec.rb +2 -6
  101. data/spec/type/solaris10/package_spec.rb +0 -3
  102. data/spec/type/solaris10/user_spec.rb +0 -4
  103. data/spec/type/suse/package_spec.rb +0 -12
  104. data/spec/type/suse/service_spec.rb +0 -8
  105. data/spec/type/ubuntu/ppa_spec.rb +0 -8
  106. data/spec/type/ubuntu/service_spec.rb +0 -4
  107. data/spec/type/windows/feature_spec.rb +8 -0
  108. data/spec/type/windows/file_spec.rb +0 -36
  109. data/spec/type/windows/group_spec.rb +0 -4
  110. data/spec/type/windows/host_spec.rb +0 -20
  111. data/spec/type/windows/port_spec.rb +0 -4
  112. data/spec/type/windows/service_spec.rb +0 -8
  113. data/spec/type/windows/user_spec.rb +0 -8
  114. metadata +2 -5
  115. data/lib/serverspec/helper/properties.rb +0 -9
  116. data/spec/helper/properties_spec.rb +0 -11
@@ -1,43 +1,40 @@
1
- module Serverspec
2
- module Type
3
- class IisWebsite < Base
1
+ module Serverspec::Type
2
+ class IisWebsite < Base
4
3
 
5
- def exists?()
6
- @runner.check_iis_website_is_installed(@name)
7
- end
4
+ def exists?()
5
+ @runner.check_iis_website_is_installed(@name)
6
+ end
8
7
 
9
- def enabled?()
10
- @runner.check_iis_website_is_enabled(@name)
11
- end
8
+ def enabled?()
9
+ @runner.check_iis_website_is_enabled(@name)
10
+ end
12
11
 
13
- def running?()
14
- @runner.check_iis_website_is_running(@name)
15
- end
12
+ def running?()
13
+ @runner.check_iis_website_is_running(@name)
14
+ end
16
15
 
17
- def in_app_pool?(app_pool)
18
- @runner.check_iis_website_is_in_app_pool(@name, app_pool)
19
- end
16
+ def in_app_pool?(app_pool)
17
+ @runner.check_iis_website_is_in_app_pool(@name, app_pool)
18
+ end
20
19
 
21
- def has_physical_path?(path)
22
- @runner.check_iis_website_has_physical_path(@name, path)
23
- end
20
+ def has_physical_path?(path)
21
+ @runner.check_iis_website_has_physical_path(@name, path)
22
+ end
24
23
 
25
- def has_site_bindings?(port, protocol, ipaddress, host_header)
26
- @runner.check_iis_website_has_site_bindings(@name, port, protocol, ipaddress, host_header)
27
- end
24
+ def has_site_bindings?(port, protocol, ipaddress, host_header)
25
+ @runner.check_iis_website_has_site_bindings(@name, port, protocol, ipaddress, host_header)
26
+ end
28
27
 
29
- def has_virtual_dir?(vdir, path)
30
- @runner.check_iis_website_has_virtual_dir(@name, vdir, path)
31
- end
28
+ def has_virtual_dir?(vdir, path)
29
+ @runner.check_iis_website_has_virtual_dir(@name, vdir, path)
30
+ end
32
31
 
33
- def has_site_application?(app, pool, physical_path)
34
- @runner.check_iis_website_has_site_application(@name, app, pool, physical_path)
35
- end
32
+ def has_site_application?(app, pool, physical_path)
33
+ @runner.check_iis_website_has_site_application(@name, app, pool, physical_path)
34
+ end
36
35
 
37
- def to_s
38
- %Q[IIS Website "#{@name}"]
39
- end
36
+ def to_s
37
+ %Q[IIS Website "#{@name}"]
40
38
  end
41
39
  end
42
40
  end
43
-
@@ -1,16 +1,14 @@
1
- module Serverspec
2
- module Type
3
- class Interface < Base
4
- def speed
5
- ret = @runner.get_interface_speed_of(@name)
6
- val = ret.stdout.strip
7
- val = val.to_i if val.match(/^\d+$/)
8
- val
9
- end
1
+ module Serverspec::Type
2
+ class Interface < Base
3
+ def speed
4
+ ret = @runner.get_interface_speed_of(@name)
5
+ val = ret.stdout.strip
6
+ val = val.to_i if val.match(/^\d+$/)
7
+ val
8
+ end
10
9
 
11
- def has_ipv4_address?(ip_address)
12
- @runner.check_interface_has_ipv4_address(@name, ip_address)
13
- end
10
+ def has_ipv4_address?(ip_address)
11
+ @runner.check_interface_has_ipv4_address(@name, ip_address)
14
12
  end
15
13
  end
16
14
  end
@@ -1,13 +1,11 @@
1
- module Serverspec
2
- module Type
3
- class Ipfilter < Base
4
- def has_rule?(rule)
5
- @runner.check_ipfilter_has_rule(rule)
6
- end
1
+ module Serverspec::Type
2
+ class Ipfilter < Base
3
+ def has_rule?(rule)
4
+ @runner.check_ipfilter_has_rule(rule)
5
+ end
7
6
 
8
- def to_s
9
- 'ipfilter'
10
- end
7
+ def to_s
8
+ 'ipfilter'
11
9
  end
12
10
  end
13
11
  end
@@ -1,13 +1,11 @@
1
- module Serverspec
2
- module Type
3
- class Ipnat < Base
4
- def has_rule?(rule)
5
- @runner.check_ipnat_has_rule(rule)
6
- end
1
+ module Serverspec::Type
2
+ class Ipnat < Base
3
+ def has_rule?(rule)
4
+ @runner.check_ipnat_has_rule(rule)
5
+ end
7
6
 
8
- def to_s
9
- 'ipnat'
10
- end
7
+ def to_s
8
+ 'ipnat'
11
9
  end
12
10
  end
13
11
  end
@@ -1,13 +1,11 @@
1
- module Serverspec
2
- module Type
3
- class Iptables < Base
4
- def has_rule?(rule, table, chain)
5
- @runner.check_iptables_has_rule(rule, table, chain)
6
- end
1
+ module Serverspec::Type
2
+ class Iptables < Base
3
+ def has_rule?(rule, table, chain)
4
+ @runner.check_iptables_has_rule(rule, table, chain)
5
+ end
7
6
 
8
- def to_s
9
- 'iptables'
10
- end
7
+ def to_s
8
+ 'iptables'
11
9
  end
12
10
  end
13
11
  end
@@ -1,9 +1,7 @@
1
- module Serverspec
2
- module Type
3
- class KernelModule < Base
4
- def loaded?
5
- @runner.check_kernel_module_is_loaded(@name)
6
- end
1
+ module Serverspec::Type
2
+ class KernelModule < Base
3
+ def loaded?
4
+ @runner.check_kernel_module_is_loaded(@name)
7
5
  end
8
6
  end
9
7
  end
@@ -1,12 +1,10 @@
1
- module Serverspec
2
- module Type
3
- class LinuxKernelParameter < Base
4
- def value
5
- ret = @runner.run_command("/sbin/sysctl -q -n #{@name}")
6
- val = ret.stdout.strip
7
- val = val.to_i if val.match(/^\d+$/)
8
- val
9
- end
1
+ module Serverspec::Type
2
+ class LinuxKernelParameter < Base
3
+ def value
4
+ ret = @runner.run_command("/sbin/sysctl -q -n #{@name}")
5
+ val = ret.stdout.strip
6
+ val = val.to_i if val.match(/^\d+$/)
7
+ val
10
8
  end
11
9
  end
12
10
  end
@@ -1,17 +1,15 @@
1
- module Serverspec
2
- module Type
3
- class Lxc < Base
4
- def exists?
5
- @runner.check_lxc_container_exists(@name)
6
- end
1
+ module Serverspec::Type
2
+ class Lxc < Base
3
+ def exists?
4
+ @runner.check_lxc_container_exists(@name)
5
+ end
7
6
 
8
- def running?
9
- @runner.check_lxc_container_is_running(@name)
10
- end
7
+ def running?
8
+ @runner.check_lxc_container_is_running(@name)
9
+ end
11
10
 
12
- def to_s
13
- 'LXC'
14
- end
11
+ def to_s
12
+ 'LXC'
15
13
  end
16
14
  end
17
15
  end
@@ -1,9 +1,7 @@
1
- module Serverspec
2
- module Type
3
- class MailAlias < Base
4
- def aliased_to?(target)
5
- @runner.check_mail_alias_is_aliased_to(@name, target)
6
- end
1
+ module Serverspec::Type
2
+ class MailAlias < Base
3
+ def aliased_to?(target)
4
+ @runner.check_mail_alias_is_aliased_to(@name, target)
7
5
  end
8
6
  end
9
7
  end
@@ -1,66 +1,64 @@
1
- module Serverspec
2
- module Type
3
- class Package < Base
4
- def installed?(provider, version)
5
- if provider.nil?
6
- @runner.check_package_is_installed(@name, version)
7
- else
8
- check_method = "check_package_is_installed_by_#{provider}".to_sym
9
- @runner.send(check_method, @name, version)
10
- end
1
+ module Serverspec::Type
2
+ class Package < Base
3
+ def installed?(provider, version)
4
+ if provider.nil?
5
+ @runner.check_package_is_installed(@name, version)
6
+ else
7
+ check_method = "check_package_is_installed_by_#{provider}".to_sym
8
+ @runner.send(check_method, @name, version)
11
9
  end
10
+ end
12
11
 
13
- def version
14
- ret = @runner.get_package_version(@name).stdout.strip
15
- if ret.empty?
16
- nil
17
- else
18
- Version.new(ret)
19
- end
12
+ def version
13
+ ret = @runner.get_package_version(@name).stdout.strip
14
+ if ret.empty?
15
+ nil
16
+ else
17
+ Version.new(ret)
20
18
  end
19
+ end
21
20
 
22
- class Version
23
- include Comparable
21
+ class Version
22
+ include Comparable
24
23
 
25
- attr_reader :epoch, :version
24
+ attr_reader :epoch, :version
26
25
 
27
- def initialize(val)
28
- matches = val.match(/^(?:(\d+):)?(\d[0-9a-zA-Z.+:~-]*)$/)
29
- if matches.nil?
30
- raise ArgumentError, "Malformed version number string #{val}"
31
- end
32
- @epoch = matches[1].to_i
33
- @version = matches[2].to_s
26
+ def initialize(val)
27
+ matches = val.match(/^(?:(\d+):)?(\d[0-9a-zA-Z.+:~-]*)$/)
28
+ if matches.nil?
29
+ raise ArgumentError, "Malformed version number string #{val}"
34
30
  end
31
+ @epoch = matches[1].to_i
32
+ @version = matches[2].to_s
33
+ end
35
34
 
36
- def <=>(other)
37
- other = Version.new(other) if other.is_a?(String)
38
- rv = @epoch <=> other.epoch
39
- return rv if rv != 0
35
+ def <=>(other)
36
+ other = Version.new(other) if other.is_a?(String)
37
+ rv = @epoch <=> other.epoch
38
+ return rv if rv != 0
40
39
 
41
- self.ver_array <=> other.ver_array
42
- end
40
+ self.ver_array <=> other.ver_array
41
+ end
43
42
 
44
- def ver_array
45
- val = @version
46
- re = /^(?:(\d+)|(\D+))(.*)$/
47
- res = []
48
- until val.empty?
49
- matches = val.match(re)
50
- if matches[1].nil?
51
- # String
52
- matches[2].to_s.each_byte do |b|
53
- code_point = defined?("~".ord) ? "~".ord : ?~
54
- res << ((b == code_point) ? -2 : b)
55
- end
56
- else
57
- # Digits
58
- res << matches[1].to_i
43
+ def ver_array
44
+ val = @version
45
+ re = /^(?:(\d+)|(\D+))(.*)$/
46
+ res = []
47
+ until val.empty?
48
+ matches = val.match(re)
49
+ if matches[1].nil?
50
+ # String
51
+ matches[2].to_s.each_byte do |b|
52
+ code_point = defined?("~".ord) ? "~".ord : ?~
53
+ res << ((b == code_point) ? -2 : b)
59
54
  end
60
- val = matches[3].to_s
55
+ else
56
+ # Digits
57
+ res << matches[1].to_i
61
58
  end
62
- res << -1
59
+ val = matches[3].to_s
63
60
  end
61
+ res << -1
64
62
  end
65
63
  end
66
64
  end
@@ -1,12 +1,10 @@
1
- module Serverspec
2
- module Type
3
- class PhpConfig < Base
4
- def value
5
- ret = @runner.run_command("php -r 'echo get_cfg_var( \"#{@name}\" );'")
6
- val = ret.stdout
7
- val = val.to_i if val.match(/^\d+$/)
8
- val
9
- end
1
+ module Serverspec::Type
2
+ class PhpConfig < Base
3
+ def value
4
+ ret = @runner.run_command("php -r 'echo get_cfg_var( \"#{@name}\" );'")
5
+ val = ret.stdout
6
+ val = val.to_i if val.match(/^\d+$/)
7
+ val
10
8
  end
11
9
  end
12
10
  end
@@ -1,42 +1,40 @@
1
1
  require 'resolv'
2
2
 
3
- module Serverspec
4
- module Type
5
- class Port < Base
6
- def protocols
7
- %w(udp tcp tcp6 udp6)
8
- end
3
+ module Serverspec::Type
4
+ class Port < Base
5
+ def protocols
6
+ %w(udp tcp tcp6 udp6)
7
+ end
9
8
 
10
- def options
11
- @options ||= {}
12
- end
9
+ def options
10
+ @options ||= {}
11
+ end
13
12
 
14
- def protocol_matcher(protocol)
15
- protocol = protocol.to_s.downcase
16
- if protocols.include?(protocol)
17
- options[:protocol] = protocol
18
- else
19
- raise ArgumentError.new("`be_listening` matcher doesn't support #{protocol}")
20
- end
13
+ def protocol_matcher(protocol)
14
+ protocol = protocol.to_s.downcase
15
+ if protocols.include?(protocol)
16
+ options[:protocol] = protocol
17
+ else
18
+ raise ArgumentError.new("`be_listening` matcher doesn't support #{protocol}")
21
19
  end
20
+ end
22
21
 
23
- def local_address_matcher(local_address)
24
- if valid_ip_address?(local_address)
25
- options[:local_address] = local_address
26
- else
27
- raise ArgumentError.new("`be_listening` matcher requires valid IPv4 or IPv6 address")
28
- end
22
+ def local_address_matcher(local_address)
23
+ if valid_ip_address?(local_address)
24
+ options[:local_address] = local_address
25
+ else
26
+ raise ArgumentError.new("`be_listening` matcher requires valid IPv4 or IPv6 address")
29
27
  end
28
+ end
30
29
 
31
- def listening?(protocol, local_address)
32
- protocol_matcher(protocol) if protocol
33
- local_address_matcher(local_address) if local_address
34
- @runner.check_port_is_listening(@name, options)
35
- end
30
+ def listening?(protocol, local_address)
31
+ protocol_matcher(protocol) if protocol
32
+ local_address_matcher(local_address) if local_address
33
+ @runner.check_port_is_listening(@name, options)
34
+ end
36
35
 
37
- def valid_ip_address?(ip_address)
38
- !!(ip_address =~ Resolv::IPv4::Regex) || !!(ip_address =~ Resolv::IPv6::Regex)
39
- end
36
+ def valid_ip_address?(ip_address)
37
+ !!(ip_address =~ Resolv::IPv4::Regex) || !!(ip_address =~ Resolv::IPv6::Regex)
40
38
  end
41
39
  end
42
40
  end
@@ -1,13 +1,11 @@
1
- module Serverspec
2
- module Type
3
- class Ppa < Base
4
- def exists?
5
- @runner.check_ppa_exists(@name)
6
- end
1
+ module Serverspec::Type
2
+ class Ppa < Base
3
+ def exists?
4
+ @runner.check_ppa_exists(@name)
5
+ end
7
6
 
8
- def enabled?
9
- @runner.check_ppa_is_enabled(@name)
10
- end
7
+ def enabled?
8
+ @runner.check_ppa_is_enabled(@name)
11
9
  end
12
10
  end
13
11
  end
@@ -1,29 +1,27 @@
1
- module Serverspec
2
- module Type
3
- class Process < Base
4
- def running?
5
- pid = @runner.get_process(@name, :format => "pid=").stdout
6
- not pid.empty?
7
- end
1
+ module Serverspec::Type
2
+ class Process < Base
3
+ def running?
4
+ pid = @runner.get_process(@name, :format => "pid=").stdout
5
+ not pid.empty?
6
+ end
8
7
 
9
- def user
10
- get_column("user")
11
- end
8
+ def user
9
+ get_column("user")
10
+ end
12
11
 
13
- def group
14
- get_column("group")
15
- end
12
+ def group
13
+ get_column("group")
14
+ end
16
15
 
17
- def method_missing(meth)
18
- get_column(meth.to_s)
19
- end
16
+ def method_missing(meth)
17
+ get_column(meth.to_s)
18
+ end
20
19
 
21
- def get_column(keyword)
22
- ret = @runner.get_process(@name, :format => "#{keyword}=")
23
- val = ret.stdout.strip
24
- val = val.to_i if val.match(/^\d+$/)
25
- val
26
- end
20
+ def get_column(keyword)
21
+ ret = @runner.get_process(@name, :format => "#{keyword}=")
22
+ val = ret.stdout.strip
23
+ val = val.to_i if val.match(/^\d+$/)
24
+ val
27
25
  end
28
26
  end
29
27
  end
@@ -1,13 +1,11 @@
1
- module Serverspec
2
- module Type
3
- class RoutingTable < Base
4
- def has_entry?(entry)
5
- @runner.check_routing_table_has_entry(entry)
6
- end
1
+ module Serverspec::Type
2
+ class RoutingTable < Base
3
+ def has_entry?(entry)
4
+ @runner.check_routing_table_has_entry(entry)
5
+ end
7
6
 
8
- def to_s
9
- 'Routing Table'
10
- end
7
+ def to_s
8
+ 'Routing Table'
11
9
  end
12
10
  end
13
11
  end
@@ -1,23 +1,19 @@
1
- module Serverspec
2
- module Type
3
- class Selinux < Base
4
- def disabled?
5
- @runner.check_selinux_has_mode('disabled')
6
- end
1
+ module Serverspec::Type
2
+ class Selinux < Base
3
+ def disabled?
4
+ @runner.check_selinux_has_mode('disabled')
5
+ end
7
6
 
8
- def enforcing?
9
- @runner.check_selinux_has_mode('enforcing')
10
- end
7
+ def enforcing?
8
+ @runner.check_selinux_has_mode('enforcing')
9
+ end
11
10
 
12
- def permissive?
13
- @runner.check_selinux_has_mode('permissive')
14
- end
11
+ def permissive?
12
+ @runner.check_selinux_has_mode('permissive')
13
+ end
15
14
 
16
- def to_s
17
- 'SELinux'
18
- end
15
+ def to_s
16
+ 'SELinux'
19
17
  end
20
18
  end
21
19
  end
22
-
23
-
@@ -1,35 +1,33 @@
1
- module Serverspec
2
- module Type
3
- class Service < Base
4
- def enabled?(level=3)
5
- @runner.check_service_is_enabled(@name, level)
6
- end
1
+ module Serverspec::Type
2
+ class Service < Base
3
+ def enabled?(level=3)
4
+ @runner.check_service_is_enabled(@name, level)
5
+ end
7
6
 
8
- def installed?(name, version)
9
- @runner.check_service_is_installed(@name)
10
- end
7
+ def installed?(name, version)
8
+ @runner.check_service_is_installed(@name)
9
+ end
11
10
 
12
- def has_start_mode?(mode)
13
- @runner.check_service_has_start_mode(@name, mode)
14
- end
11
+ def has_start_mode?(mode)
12
+ @runner.check_service_has_start_mode(@name, mode)
13
+ end
15
14
 
16
- def running?(under)
17
- if under
18
- check_method = "check_service_is_running_under_#{under}".to_sym
19
- @runner.send(check_method, @name)
20
- else
21
- @runner.check_service_is_running(@name)
22
- end
15
+ def running?(under)
16
+ if under
17
+ check_method = "check_service_is_running_under_#{under}".to_sym
18
+ @runner.send(check_method, @name)
19
+ else
20
+ @runner.check_service_is_running(@name)
23
21
  end
22
+ end
24
23
 
25
- def monitored_by?(monitor)
26
- check_method = "check_service_is_monitored_by_#{monitor}".to_sym
27
- res = @runner.send(check_method, @name)
28
- end
24
+ def monitored_by?(monitor)
25
+ check_method = "check_service_is_monitored_by_#{monitor}".to_sym
26
+ res = @runner.send(check_method, @name)
27
+ end
29
28
 
30
- def has_property?(property)
31
- @runner.check_service_has_property(@name, property)
32
- end
29
+ def has_property?(property)
30
+ @runner.check_service_has_property(@name, property)
33
31
  end
34
32
  end
35
33
  end