serverspec 2.0.0.beta8 → 2.0.0.beta9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (139) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +24 -2
  3. data/lib/serverspec/setup.rb +6 -8
  4. data/lib/serverspec/type/cgroup.rb +1 -0
  5. data/lib/serverspec/type/command.rb +1 -1
  6. data/lib/serverspec/type/cron.rb +1 -1
  7. data/lib/serverspec/type/default_gateway.rb +2 -2
  8. data/lib/serverspec/type/file.rb +21 -17
  9. data/lib/serverspec/type/group.rb +2 -2
  10. data/lib/serverspec/type/host.rb +3 -3
  11. data/lib/serverspec/type/iis_app_pool.rb +2 -2
  12. data/lib/serverspec/type/iis_website.rb +5 -5
  13. data/lib/serverspec/type/interface.rb +1 -1
  14. data/lib/serverspec/type/ipfilter.rb +1 -1
  15. data/lib/serverspec/type/ipnat.rb +1 -1
  16. data/lib/serverspec/type/iptables.rb +1 -1
  17. data/lib/serverspec/type/kernel_module.rb +1 -1
  18. data/lib/serverspec/type/lxc.rb +2 -2
  19. data/lib/serverspec/type/mail_alias.rb +1 -1
  20. data/lib/serverspec/type/package.rb +2 -7
  21. data/lib/serverspec/type/port.rb +1 -1
  22. data/lib/serverspec/type/ppa.rb +2 -2
  23. data/lib/serverspec/type/routing_table.rb +1 -1
  24. data/lib/serverspec/type/selinux.rb +3 -3
  25. data/lib/serverspec/type/service.rb +7 -15
  26. data/lib/serverspec/type/user.rb +12 -6
  27. data/lib/serverspec/type/windows_feature.rb +1 -1
  28. data/lib/serverspec/type/windows_hot_fix.rb +1 -1
  29. data/lib/serverspec/type/windows_registry_key.rb +4 -4
  30. data/lib/serverspec/type/windows_scheduled_task.rb +1 -1
  31. data/lib/serverspec/type/yumrepo.rb +2 -2
  32. data/lib/serverspec/type/zfs.rb +2 -2
  33. data/lib/serverspec/version.rb +1 -1
  34. data/serverspec.gemspec +1 -1
  35. data/spec/spec_helper.rb +11 -0
  36. data/spec/type/aix/file_spec.rb +35 -0
  37. data/spec/type/aix/group_spec.rb +15 -0
  38. data/spec/type/aix/package_spec.rb +15 -0
  39. data/spec/type/aix/port_spec.rb +37 -0
  40. data/spec/type/aix/service_spec.rb +23 -0
  41. data/spec/type/aix/user_spec.rb +32 -0
  42. data/spec/type/arch/file_spec.rb +32 -0
  43. data/spec/type/arch/package_spec.rb +31 -0
  44. data/spec/type/arch/service_spec.rb +13 -0
  45. data/spec/type/{command_spec.rb → base/command_spec.rb} +1 -3
  46. data/spec/type/{cron_spec.rb → base/cron_spec.rb} +5 -1
  47. data/spec/type/{default_gateway_spec.rb → base/default_gateway_spec.rb} +1 -1
  48. data/spec/type/{file_spec.rb → base/file_spec.rb} +23 -24
  49. data/spec/type/{group_spec.rb → base/group_spec.rb} +5 -1
  50. data/spec/type/{host_spec.rb → base/host_spec.rb} +5 -1
  51. data/spec/type/{mail_alias_spec.rb → base/mail_alias_spec.rb} +5 -1
  52. data/spec/type/{package_spec.rb → base/package_spec.rb} +3 -32
  53. data/spec/type/{php_config_spec.rb → base/php_config_spec.rb} +1 -1
  54. data/spec/type/{port_spec.rb → base/port_spec.rb} +5 -1
  55. data/spec/type/{process_spec.rb → base/process_spec.rb} +5 -1
  56. data/spec/type/{routing_table_spec.rb → base/routing_table_spec.rb} +5 -1
  57. data/spec/type/{service_spec.rb → base/service_spec.rb} +5 -25
  58. data/spec/type/{user_spec.rb → base/user_spec.rb} +5 -1
  59. data/spec/type/darwin/file_spec.rb +43 -0
  60. data/spec/type/darwin/package_spec.rb +24 -0
  61. data/spec/type/darwin/port_spec.rb +37 -0
  62. data/spec/type/darwin/service_spec.rb +32 -0
  63. data/spec/type/debian/package_spec.rb +39 -0
  64. data/spec/type/debian/service_spec.rb +23 -0
  65. data/spec/type/fedora/service_spec.rb +19 -0
  66. data/spec/type/fedora15/service_spec.rb +19 -0
  67. data/spec/type/fedora20/service_spec.rb +19 -0
  68. data/spec/type/freebsd/file_spec.rb +11 -0
  69. data/spec/type/freebsd/package_spec.rb +31 -0
  70. data/spec/type/freebsd/port_spec.rb +37 -0
  71. data/spec/type/freebsd/service_spec.rb +16 -0
  72. data/spec/type/freebsd10/package_spec.rb +31 -0
  73. data/spec/type/gentoo/package_spec.rb +16 -0
  74. data/spec/type/gentoo/service_spec.rb +24 -0
  75. data/spec/type/{cgroup_spec.rb → linux/cgroup_spec.rb} +1 -1
  76. data/spec/type/linux/file_spec.rb +38 -0
  77. data/spec/type/{interface_spec.rb → linux/interface_spec.rb} +5 -1
  78. data/spec/type/{iptables_spec.rb → linux/iptables_spec.rb} +6 -2
  79. data/spec/type/linux/kernel_module_spec.rb +15 -0
  80. data/spec/type/{linux_kernel_parameter_spec.rb → linux/linux_kernel_parameter_spec.rb} +1 -1
  81. data/spec/type/{lxc_spec.rb → linux/lxc_container_spec.rb} +5 -1
  82. data/spec/type/{selinux_spec.rb → linux/selinux_spec.rb} +5 -1
  83. data/spec/type/{zfs_spec.rb → linux/zfs_spec.rb} +5 -1
  84. data/spec/type/nixos/package_spec.rb +31 -0
  85. data/spec/type/nixos/service_spec.rb +13 -0
  86. data/spec/type/openbsd/file_spec.rb +174 -0
  87. data/spec/type/openbsd/interface_spec.rb +25 -0
  88. data/spec/type/openbsd/mail_alias_spec.rb +15 -0
  89. data/spec/type/openbsd/package_spec.rb +24 -0
  90. data/spec/type/openbsd/port_spec.rb +11 -0
  91. data/spec/type/openbsd/service_spec.rb +24 -0
  92. data/spec/type/openbsd/user_spec.rb +24 -0
  93. data/spec/type/opensuse/service_spec.rb +32 -0
  94. data/spec/type/plamo/package_spec.rb +16 -0
  95. data/spec/type/plamo/service_spec.rb +16 -0
  96. data/spec/type/redhat/file_spec.rb +36 -0
  97. data/spec/type/redhat/package_spec.rb +39 -0
  98. data/spec/type/redhat/service_spec.rb +23 -0
  99. data/spec/type/{yumrepo_spec.rb → redhat/yumrepo_spec.rb} +5 -1
  100. data/spec/type/redhat5/iptables_spec.rb +23 -0
  101. data/spec/type/redhat7/service_spec.rb +13 -0
  102. data/spec/type/smartos/package_spec.rb +31 -0
  103. data/spec/type/smartos/service_spec.rb +32 -0
  104. data/spec/type/solaris/cron_spec.rb +23 -0
  105. data/spec/type/solaris/file_spec.rb +33 -0
  106. data/spec/type/solaris/group_spec.rb +15 -0
  107. data/spec/type/solaris/host_spec.rb +31 -0
  108. data/spec/type/solaris/ipfilter_spec.rb +11 -0
  109. data/spec/type/solaris/ipnat_spec.rb +11 -0
  110. data/spec/type/solaris/package_spec.rb +15 -0
  111. data/spec/type/solaris/port_spec.rb +37 -0
  112. data/spec/type/solaris/service_spec.rb +32 -0
  113. data/spec/type/solaris/user_spec.rb +32 -0
  114. data/spec/type/solaris/zfs_spec.rb +19 -0
  115. data/spec/type/solaris10/file_spec.rb +391 -0
  116. data/spec/type/solaris10/group_spec.rb +16 -0
  117. data/spec/type/solaris10/host_spec.rb +24 -0
  118. data/spec/type/solaris10/package_spec.rb +15 -0
  119. data/spec/type/solaris10/user_spec.rb +16 -0
  120. data/spec/type/suse/package_spec.rb +39 -0
  121. data/spec/type/suse/service_spec.rb +23 -0
  122. data/spec/type/ubuntu/ppa_spec.rb +23 -0
  123. data/spec/type/ubuntu/service_spec.rb +15 -0
  124. data/spec/type/windows/command_spec.rb +65 -0
  125. data/spec/type/windows/feature_spec.rb +13 -0
  126. data/spec/type/windows/file_spec.rb +161 -0
  127. data/spec/type/windows/group_spec.rb +31 -0
  128. data/spec/type/windows/host_spec.rb +56 -0
  129. data/spec/type/windows/hot_fix_spec.rb +26 -0
  130. data/spec/type/windows/iis_app_pool_spec.rb +18 -0
  131. data/spec/type/windows/iis_webisite_spec.rb +30 -0
  132. data/spec/type/windows/package_spec.rb +14 -0
  133. data/spec/type/windows/port_spec.rb +33 -0
  134. data/spec/type/windows/registry_key_spec.rb +62 -0
  135. data/spec/type/windows/scheduled_task_spec.rb +13 -0
  136. data/spec/type/windows/service_spec.rb +42 -0
  137. data/spec/type/windows/user_spec.rb +45 -0
  138. metadata +208 -50
  139. data/spec/type/kernel_module_spec.rb +0 -11
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 22d2a873870ecdddc00919f06be8c80c0a3d4f41
4
- data.tar.gz: f2c1d92a9211eeda7a2f080dca4fc8a5eabf03c8
3
+ metadata.gz: 4eac2e10fe1f7646006a794380e458fa37b3c75c
4
+ data.tar.gz: dbcfb11112500d422ce06d4af91bb0b3f3e2b835
5
5
  SHA512:
6
- metadata.gz: f4f893ae50ce59810c2f2ebde4a94f4a0d95e5d25601702b64b6d39b0511e5d85d751968a005d1f0e3c5608f1e60f0eccdee4fb744011b9ff87df36de451166c
7
- data.tar.gz: d0698d14a569d5b855b5237ae41a8c8f307b066b13b907ba1f0f74c2af25d307e49ed6966c900ffb315ccc25a4b2e74094317cdd724ed6af928d548d5fc1da6c
6
+ metadata.gz: 3d7f1c6915b8afe45a6510118df3fd2c58709fc26029f8a554b2dcae41ccdb768ce99f4e1a0c802fffb2a942e1a4235bc8cf22782077514d395ebf3a3a96ada3
7
+ data.tar.gz: c03d276562f404f43670c76ffcb91941204cbf1631a45155c475fd394f755883eeb00ae328153f4776ef28b11298e0186772fadefdd44cbee3fe556aa42e5350
data/Rakefile CHANGED
@@ -6,7 +6,29 @@ rescue LoadError
6
6
  end
7
7
 
8
8
  if defined?(RSpec)
9
- RSpec::Core::RakeTask.new('spec') do |t|
10
- t.pattern = 'spec/*/*_spec.rb'
9
+ task :spec => 'spec:all'
10
+
11
+ namespace :spec do
12
+ task :all => [ 'spec:type:all', 'spec:helper', 'spec:unit' ]
13
+
14
+ namespace :type do
15
+ oses = Dir.glob('spec/type/*').map {|d| File.basename(d)}
16
+
17
+ task :all => oses.map {|os| "spec:type:#{os}" }
18
+
19
+ oses.each do |os|
20
+ RSpec::Core::RakeTask.new(os.to_sym) do |t|
21
+ t.pattern = "spec/type/#{os}/*_spec.rb"
22
+ end
23
+ end
24
+ end
25
+
26
+ RSpec::Core::RakeTask.new(:helper) do |t|
27
+ t.pattern = "spec/helper/*_spec.rb"
28
+ end
29
+
30
+ RSpec::Core::RakeTask.new(:unit) do |t|
31
+ t.pattern = "spec/unit/*_spec.rb"
32
+ end
11
33
  end
12
34
  end
@@ -94,25 +94,25 @@ EOF
94
94
  content = <<-EOF
95
95
  require 'spec_helper'
96
96
 
97
- describe package('httpd'), :if => os[:family] == 'RedHat' do
97
+ describe package('httpd'), :if => os[:family] == 'redhat' do
98
98
  it { should be_installed }
99
99
  end
100
100
 
101
- describe package('apache2'), :if => os[:family] == 'Ubuntu' do
101
+ describe package('apache2'), :if => os[:family] == 'ubuntu' do
102
102
  it { should be_installed }
103
103
  end
104
104
 
105
- describe service('httpd'), :if => os[:family] == 'RedHat' do
105
+ describe service('httpd'), :if => os[:family] == 'redhat' do
106
106
  it { should be_enabled }
107
107
  it { should be_running }
108
108
  end
109
109
 
110
- describe service('apache2'), :if => os[:family] == 'Ubuntu' do
110
+ describe service('apache2'), :if => os[:family] == 'ubuntu' do
111
111
  it { should be_enabled }
112
112
  it { should be_running }
113
113
  end
114
114
 
115
- describe service('org.apache.httpd'), :if => os[:family] == 'Darwin' do
115
+ describe service('org.apache.httpd'), :if => os[:family] == 'darwin' do
116
116
  it { should be_enabled }
117
117
  it { should be_running }
118
118
  end
@@ -251,9 +251,7 @@ require 'winrm'
251
251
  <% end -%>
252
252
 
253
253
  include Specinfra::Helper::<%= @backend_type %>
254
- <% if @os_type == 'UN*X' -%>
255
- include Specinfra::Helper::DetectOS
256
- <% else -%>
254
+ <% if @os_type != 'UN*X' -%>
257
255
  include Specinfra::Helper::Windows
258
256
  <% end -%>
259
257
 
@@ -1,3 +1,4 @@
1
+ :q
1
2
  module Serverspec
2
3
  module Type
3
4
  class Cgroup < Base
@@ -36,7 +36,7 @@ module Serverspec
36
36
  private
37
37
 
38
38
  def command_result()
39
- @command_result ||= @runner.run_command(@name)
39
+ @command_result ||= @runner.run_command(@name)
40
40
  end
41
41
  end
42
42
  end
@@ -2,7 +2,7 @@ module Serverspec
2
2
  module Type
3
3
  class Cron < Base
4
4
  def has_entry?(user, entry)
5
- @runner.check_cron_entry(user, entry)
5
+ @runner.check_cron_has_entry(user, entry)
6
6
  end
7
7
  def to_s
8
8
  'Cron'
@@ -2,13 +2,13 @@ module Serverspec
2
2
  module Type
3
3
  class DefaultGateway < Base
4
4
  def ipaddress
5
- ret = @runner.run_command(commands.check_routing_table('default'))
5
+ ret = @runner.run_command(commands.check_routing_table_has_entry('default'))
6
6
  ret.stdout =~ /^(\S+)(?: via (\S+))? dev (\S+).+(?:\r)?\n(?:default via (\S+))?/
7
7
  $2 ? $2 : $4
8
8
  end
9
9
 
10
10
  def interface
11
- ret = @runner.run_command(commands.check_routing_table('default'))
11
+ ret = @runner.run_command(commands.check_routing_table_has_entry('default'))
12
12
  ret.stdout =~ /^(\S+)(?: via (\S+))? dev (\S+).+(?:\r)?\n(?:default via (\S+))?/
13
13
  $3
14
14
  end
@@ -6,15 +6,15 @@ module Serverspec
6
6
  attr_accessor :content
7
7
 
8
8
  def file?
9
- @runner.check_file(@name)
9
+ @runner.check_file_is_file(@name)
10
10
  end
11
11
 
12
12
  def socket?
13
- @runner.check_socket(@name)
13
+ @runner.check_file_is_socket(@name)
14
14
  end
15
15
 
16
16
  def directory?
17
- @runner.check_directory(@name)
17
+ @runner.check_file_is_directory(@name)
18
18
  end
19
19
 
20
20
  def contain(pattern, from, to)
@@ -30,59 +30,63 @@ module Serverspec
30
30
  end
31
31
 
32
32
  def mode?(mode)
33
- @runner.check_mode(@name, mode)
33
+ @runner.check_file_mode(@name, mode)
34
34
  end
35
35
 
36
36
  def owned_by?(owner)
37
- @runner.check_owner(@name, owner)
37
+ @runner.check_file_is_owned_by(@name, owner)
38
38
  end
39
39
 
40
40
  def grouped_into?(group)
41
- @runner.check_grouped(@name, group)
41
+ @runner.check_file_is_grouped(@name, group)
42
42
  end
43
43
 
44
44
  def linked_to?(target)
45
- @runner.check_link(@name, target)
45
+ @runner.check_file_is_linked_to(@name, target)
46
46
  end
47
47
 
48
48
  def readable?(by_whom, by_user)
49
49
  if by_user != nil
50
- @runner.check_access_by_user(@name, by_user, 'r')
50
+ @runner.check_file_access_by_user(@name, by_user, 'r')
51
51
  else
52
- @runner.check_readable(@name, by_whom)
52
+ @runner.check_file_is_readable(@name, by_whom)
53
53
  end
54
54
  end
55
55
 
56
56
  def writable?(by_whom, by_user)
57
57
  if by_user != nil
58
- @runner.check_access_by_user(@name, by_user, 'w')
58
+ @runner.check_file_access_by_user(@name, by_user, 'w')
59
59
  else
60
- @runner.check_writable(@name, by_whom)
60
+ @runner.check_file_is_writable(@name, by_whom)
61
61
  end
62
62
  end
63
63
 
64
64
  def executable?(by_whom, by_user)
65
65
  if by_user != nil
66
- @runner.check_access_by_user(@name, by_user, 'x')
66
+ @runner.check_file_access_by_user(@name, by_user, 'x')
67
67
  else
68
- @runner.check_executable(@name, by_whom)
68
+ @runner.check_file_is_executable(@name, by_whom)
69
69
  end
70
70
  end
71
71
 
72
72
  def mounted?(attr, only_with)
73
- @runner.check_mounted(@name, attr, only_with)
73
+ @runner.check_file_is_mounted(@name, attr, only_with)
74
+ end
75
+
76
+ def immutable?
77
+ backend.check_file_is_immutable(@name)
74
78
  end
75
79
 
76
80
  def match_checksum(checksum)
77
- @runner.check_file_checksum(@name, checksum)
81
+ @runner.check_file_has_checksum(@name, checksum)
78
82
  end
79
83
 
80
84
  def match_md5checksum(md5sum)
81
- @runner.check_file_md5checksum(@name, md5sum)
85
+ @runner.check_file_has_md5checksum(@name, md5sum)
82
86
  end
83
87
 
84
88
  def match_sha256checksum(sha256sum)
85
- @runner.check_file_sha256checksum(@name, sha256sum)
89
+ @runner.check_file_has_sha256checksum(@name, sha256sum)
86
90
  end
87
91
 
88
92
  def content
@@ -2,11 +2,11 @@ module Serverspec
2
2
  module Type
3
3
  class Group < Base
4
4
  def exists?
5
- @runner.check_group(@name)
5
+ @runner.check_group_exists(@name)
6
6
  end
7
7
 
8
8
  def has_gid?(gid)
9
- @runner.check_gid(@name, gid)
9
+ @runner.check_group_has_gid(@name, gid)
10
10
  end
11
11
  end
12
12
  end
@@ -2,15 +2,15 @@ module Serverspec
2
2
  module Type
3
3
  class Host < Base
4
4
  def resolvable?(type)
5
- @runner.check_resolvable(@name, type)
5
+ @runner.check_host_is_resolvable(@name, type)
6
6
  end
7
7
 
8
8
  def reachable?(port, proto, timeout)
9
- @runner.check_reachable(@name, port, proto, timeout)
9
+ @runner.check_host_is_reachable(@name, port, proto, timeout)
10
10
  end
11
11
 
12
12
  def ipaddress
13
- @runner.get_ipaddress_of_host(@name).stdout.strip
13
+ @runner.get_host_ipaddress(@name).stdout.strip
14
14
  end
15
15
  end
16
16
  end
@@ -2,11 +2,11 @@ module Serverspec
2
2
  module Type
3
3
  class IisAppPool < Base
4
4
  def exists?()
5
- @runner.check_iis_app_pool(@name)
5
+ @runner.check_iis_app_pool_exists(@name)
6
6
  end
7
7
 
8
8
  def has_dotnet_version?(dotnet)
9
- @runner.check_iis_app_pool_dotnet(@name, dotnet)
9
+ @runner.check_iis_app_pool_has_dotnet_version(@name, dotnet)
10
10
  end
11
11
 
12
12
  def to_s
@@ -3,23 +3,23 @@ module Serverspec
3
3
  class IisWebsite < Base
4
4
 
5
5
  def exists?()
6
- @runner.check_iis_website_installed(@name)
6
+ @runner.check_iis_website_is_installed(@name)
7
7
  end
8
8
 
9
9
  def enabled?()
10
- @runner.check_iis_website_enabled(@name)
10
+ @runner.check_iis_website_is_enabled(@name)
11
11
  end
12
12
 
13
13
  def running?()
14
- @runner.check_iis_website_running(@name)
14
+ @runner.check_iis_website_is_running(@name)
15
15
  end
16
16
 
17
17
  def in_app_pool?(app_pool)
18
- @runner.check_iis_website_app_pool(@name, app_pool)
18
+ @runner.check_iis_website_is_in_app_pool(@name, app_pool)
19
19
  end
20
20
 
21
21
  def has_physical_path?(path)
22
- @runner.check_iis_website_path(@name, path)
22
+ @runner.check_iis_website_has_physical_path(@name, path)
23
23
  end
24
24
 
25
25
  def to_s
@@ -9,7 +9,7 @@ module Serverspec
9
9
  end
10
10
 
11
11
  def has_ipv4_address?(ip_address)
12
- @runner.check_ipv4_address(@name, ip_address)
12
+ @runner.check_interface_ipv4_address(@name, ip_address)
13
13
  end
14
14
  end
15
15
  end
@@ -2,7 +2,7 @@ module Serverspec
2
2
  module Type
3
3
  class Ipfilter < Base
4
4
  def has_rule?(rule)
5
- @runner.check_ipfilter_rule(rule)
5
+ @runner.check_ipfilter_has_rule(rule)
6
6
  end
7
7
 
8
8
  def to_s
@@ -2,7 +2,7 @@ module Serverspec
2
2
  module Type
3
3
  class Ipnat < Base
4
4
  def has_rule?(rule)
5
- @runner.check_ipnat_rule(rule)
5
+ @runner.check_ipnat_has_rule(rule)
6
6
  end
7
7
 
8
8
  def to_s
@@ -2,7 +2,7 @@ module Serverspec
2
2
  module Type
3
3
  class Iptables < Base
4
4
  def has_rule?(rule, table, chain)
5
- @runner.check_iptables_rule(rule, table, chain)
5
+ @runner.check_iptables_has_rule(rule, table, chain)
6
6
  end
7
7
 
8
8
  def to_s
@@ -2,7 +2,7 @@ module Serverspec
2
2
  module Type
3
3
  class KernelModule < Base
4
4
  def loaded?
5
- @runner.check_kernel_module_loaded(@name)
5
+ @runner.check_kernel_module_is_loaded(@name)
6
6
  end
7
7
  end
8
8
  end
@@ -2,11 +2,11 @@ module Serverspec
2
2
  module Type
3
3
  class Lxc < Base
4
4
  def exists?
5
- @runner.check_container(@name)
5
+ @runner.check_lxc_container_exists(@name)
6
6
  end
7
7
 
8
8
  def running?
9
- @runner.check_container_running(@name)
9
+ @runner.check_lxc_container_is_running(@name)
10
10
  end
11
11
 
12
12
  def to_s
@@ -2,7 +2,7 @@ module Serverspec
2
2
  module Type
3
3
  class MailAlias < Base
4
4
  def aliased_to?(target)
5
- @runner.check_mail_alias(@name, target)
5
+ @runner.check_mail_alias_is_aliased_to(@name, target)
6
6
  end
7
7
  end
8
8
  end
@@ -3,14 +3,9 @@ module Serverspec
3
3
  class Package < Base
4
4
  def installed?(provider, version)
5
5
  if provider.nil?
6
- @runner.check_installed(@name, version)
6
+ @runner.check_package_is_installed(@name, version)
7
7
  else
8
- check_method = "check_installed_by_#{provider}".to_sym
9
-
10
- unless @runner.respond_to?(check_method) || commands.respond_to?(check_method)
11
- raise ArgumentError.new("`be_installed` matcher doesn't support #{provider}")
12
- end
13
-
8
+ check_method = "check_package_is_installed_by_#{provider}".to_sym
14
9
  @runner.send(check_method, @name, version)
15
10
  end
16
11
  end
@@ -31,7 +31,7 @@ module Serverspec
31
31
  def listening?(protocol, local_address)
32
32
  protocol_matcher(protocol) if protocol
33
33
  local_address_matcher(local_address) if local_address
34
- @runner.check_listening(@name, options)
34
+ @runner.check_port_is_listening(@name, options)
35
35
  end
36
36
 
37
37
  def valid_ip_address?(ip_address)
@@ -2,11 +2,11 @@ module Serverspec
2
2
  module Type
3
3
  class Ppa < Base
4
4
  def exists?
5
- backend.check_ppa(@name)
5
+ backend.check_ppa_exists(@name)
6
6
  end
7
7
 
8
8
  def enabled?
9
- backend.check_ppa_enabled(@name)
9
+ backend.check_ppa_is_enabled(@name)
10
10
  end
11
11
  end
12
12
  end
@@ -2,7 +2,7 @@ module Serverspec
2
2
  module Type
3
3
  class RoutingTable < Base
4
4
  def has_entry?(entry)
5
- @runner.check_routing_table(entry)
5
+ @runner.check_routing_table_has_entry(entry)
6
6
  end
7
7
 
8
8
  def to_s
@@ -2,15 +2,15 @@ module Serverspec
2
2
  module Type
3
3
  class Selinux < Base
4
4
  def disabled?
5
- @runner.check_selinux('disabled')
5
+ @runner.check_selinux_mode('disabled')
6
6
  end
7
7
 
8
8
  def enforcing?
9
- @runner.check_selinux('enforcing')
9
+ @runner.check_selinux_mode('enforcing')
10
10
  end
11
11
 
12
12
  def permissive?
13
- @runner.check_selinux('permissive')
13
+ @runner.check_selinux_mode('permissive')
14
14
  end
15
15
 
16
16
  def to_s
@@ -2,41 +2,33 @@ module Serverspec
2
2
  module Type
3
3
  class Service < Base
4
4
  def enabled?(level=3)
5
- @runner.check_enabled(@name, level)
5
+ @runner.check_service_is_enabled(@name, level)
6
6
  end
7
7
 
8
8
  def installed?(name, version)
9
- @runner.check_service_installed(@name)
9
+ @runner.check_service_is_installed(@name)
10
10
  end
11
11
 
12
12
  def has_start_mode?(mode)
13
- @runner.check_service_start_mode(@name, mode)
13
+ @runner.check_service_has_start_mode(@name, mode)
14
14
  end
15
15
 
16
16
  def running?(under)
17
17
  if under
18
- check_method = "check_running_under_#{under}".to_sym
19
-
20
- unless commands.respond_to?(check_method)
21
- raise ArgumentError.new("`be_running` matcher doesn't support #{under}")
22
- end
23
-
18
+ check_method = "check_service_is_running_under_#{under}".to_sym
24
19
  @runner.send(check_method, @name)
25
20
  else
26
- @runner.check_running(@name)
21
+ @runner.check_service_is_running(@name)
27
22
  end
28
23
  end
29
24
 
30
25
  def monitored_by?(monitor)
31
- check_method = "check_monitored_by_#{monitor}".to_sym
32
- unless monitor && commands.respond_to?(check_method)
33
- raise ArgumentError.new("`be_monitored_by` matcher doesn't support #{monitor}")
34
- end
26
+ check_method = "check_service_is_monitored_by_#{monitor}".to_sym
35
27
  res = @runner.send(check_method, @name)
36
28
  end
37
29
 
38
30
  def has_property?(property)
39
- @runner.check_svcprops(@name, property)
31
+ @runner.check_service_has_property(@name, property)
40
32
  end
41
33
  end
42
34
  end
@@ -2,28 +2,34 @@ module Serverspec
2
2
  module Type
3
3
  class User < Base
4
4
  def exists?
5
- @runner.check_user(@name)
5
+ @runner.check_user_exists(@name)
6
6
  end
7
7
 
8
8
  def belongs_to_group?(group)
9
- @runner.check_belonging_group(@name, group)
9
+ @runner.check_user_is_belonging_to_group(@name, group)
10
10
  end
11
11
 
12
12
  def has_uid?(uid)
13
- @runner.check_uid(@name, uid)
13
+ @runner.check_user_has_uid(@name, uid)
14
14
  end
15
15
 
16
16
  def has_home_directory?(path)
17
- @runner.check_home_directory(@name, path)
17
+ @runner.check_user_has_home_directory(@name, path)
18
18
  end
19
19
 
20
20
  def has_login_shell?(shell)
21
- @runner.check_login_shell(@name, shell)
21
+ @runner.check_user_has_login_shell(@name, shell)
22
22
  end
23
23
 
24
24
  def has_authorized_key?(key)
25
- @runner.check_authorized_key(@name, key)
25
+ @runner.check_user_has_authorized_key(@name, key)
26
26
  end
27
27
  end
28
28
  end
29
29
  end
30
+
31
+
32
+
33
+
34
+
35
+
@@ -2,7 +2,7 @@ module Serverspec
2
2
  module Type
3
3
  class WindowsFeature < Base
4
4
  def installed?(provider, version)
5
- @runner.check_windows_feature_enabled(@name, provider)
5
+ @runner.check_feature_is_enabled(@name, provider)
6
6
  end
7
7
  end
8
8
  end
@@ -2,7 +2,7 @@ module Serverspec
2
2
  module Type
3
3
  class WindowsHotFix < Base
4
4
  def installed?(provider, version)
5
- @runner.check_windows_hot_fix_installed(@name, version)
5
+ @runner.check_hot_fix_is_installed(@name, version)
6
6
  end
7
7
  end
8
8
  end
@@ -2,19 +2,19 @@ module Serverspec
2
2
  module Type
3
3
  class WindowsRegistryKey < Base
4
4
  def exists?
5
- @runner.check_registry_key(@name)
5
+ @runner.check_registry_key_exists(@name)
6
6
  end
7
7
 
8
8
  def has_property?(property_name, property_type = :type_string)
9
- @runner.check_registry_key(@name, {:name => property_name, :type => property_type})
9
+ @runner.check_registry_key_has_property(@name, {:name => property_name, :type => property_type})
10
10
  end
11
11
 
12
12
  def has_value?(value)
13
- @runner.check_registry_key(@name, {:name => '', :type => :type_string, :value => value})
13
+ @runner.check_registry_key_has_value(@name, {:name => '', :type => :type_string, :value => value})
14
14
  end
15
15
 
16
16
  def has_property_value?(property_name, property_type, value)
17
- @runner.check_registry_key(@name, {:name => property_name, :type => property_type, :value => value})
17
+ @runner.check_registry_key_has_value(@name, {:name => property_name, :type => property_type, :value => value})
18
18
  end
19
19
  end
20
20
  end
@@ -2,7 +2,7 @@ module Serverspec
2
2
  module Type
3
3
  class WindowsScheduledTask < Base
4
4
  def exists?
5
- @runner.check_scheduled_task(@name)
5
+ @runner.check_scheduled_task_exists(@name)
6
6
  end
7
7
  end
8
8
  end
@@ -2,11 +2,11 @@ module Serverspec
2
2
  module Type
3
3
  class Yumrepo < Base
4
4
  def exists?
5
- @runner.check_yumrepo(@name)
5
+ @runner.check_yumrepo_exists(@name)
6
6
  end
7
7
 
8
8
  def enabled?
9
- @runner.check_yumrepo_enabled(@name)
9
+ @runner.check_yumrepo_is_enabled(@name)
10
10
  end
11
11
  end
12
12
  end
@@ -2,11 +2,11 @@ module Serverspec
2
2
  module Type
3
3
  class Zfs < Base
4
4
  def exists?
5
- @runner.check_zfs(@name)
5
+ @runner.check_zfs_exists(@name)
6
6
  end
7
7
 
8
8
  def has_property?(property)
9
- @runner.check_zfs(@name, property)
9
+ @runner.check_zfs_has_property(@name, property)
10
10
  end
11
11
 
12
12
  def to_s
@@ -1,3 +1,3 @@
1
1
  module Serverspec
2
- VERSION = "2.0.0.beta8"
2
+ VERSION = "2.0.0.beta9"
3
3
  end
data/serverspec.gemspec CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.add_runtime_dependency "rspec", "~> 3.0.0"
22
22
  spec.add_runtime_dependency "rspec-its"
23
- spec.add_runtime_dependency "specinfra", "~> 2.0.0.beta6"
23
+ spec.add_runtime_dependency "specinfra", "~> 2.0.0.beta7"
24
24
  spec.add_development_dependency "bundler", "~> 1.3"
25
25
  spec.add_development_dependency "rake", "~> 10.1.1"
26
26
  end