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.
- checksums.yaml +4 -4
- data/Rakefile +24 -2
- data/lib/serverspec/setup.rb +6 -8
- data/lib/serverspec/type/cgroup.rb +1 -0
- data/lib/serverspec/type/command.rb +1 -1
- data/lib/serverspec/type/cron.rb +1 -1
- data/lib/serverspec/type/default_gateway.rb +2 -2
- data/lib/serverspec/type/file.rb +21 -17
- data/lib/serverspec/type/group.rb +2 -2
- data/lib/serverspec/type/host.rb +3 -3
- data/lib/serverspec/type/iis_app_pool.rb +2 -2
- data/lib/serverspec/type/iis_website.rb +5 -5
- data/lib/serverspec/type/interface.rb +1 -1
- data/lib/serverspec/type/ipfilter.rb +1 -1
- data/lib/serverspec/type/ipnat.rb +1 -1
- data/lib/serverspec/type/iptables.rb +1 -1
- data/lib/serverspec/type/kernel_module.rb +1 -1
- data/lib/serverspec/type/lxc.rb +2 -2
- data/lib/serverspec/type/mail_alias.rb +1 -1
- data/lib/serverspec/type/package.rb +2 -7
- data/lib/serverspec/type/port.rb +1 -1
- data/lib/serverspec/type/ppa.rb +2 -2
- data/lib/serverspec/type/routing_table.rb +1 -1
- data/lib/serverspec/type/selinux.rb +3 -3
- data/lib/serverspec/type/service.rb +7 -15
- data/lib/serverspec/type/user.rb +12 -6
- data/lib/serverspec/type/windows_feature.rb +1 -1
- data/lib/serverspec/type/windows_hot_fix.rb +1 -1
- data/lib/serverspec/type/windows_registry_key.rb +4 -4
- data/lib/serverspec/type/windows_scheduled_task.rb +1 -1
- data/lib/serverspec/type/yumrepo.rb +2 -2
- data/lib/serverspec/type/zfs.rb +2 -2
- data/lib/serverspec/version.rb +1 -1
- data/serverspec.gemspec +1 -1
- data/spec/spec_helper.rb +11 -0
- data/spec/type/aix/file_spec.rb +35 -0
- data/spec/type/aix/group_spec.rb +15 -0
- data/spec/type/aix/package_spec.rb +15 -0
- data/spec/type/aix/port_spec.rb +37 -0
- data/spec/type/aix/service_spec.rb +23 -0
- data/spec/type/aix/user_spec.rb +32 -0
- data/spec/type/arch/file_spec.rb +32 -0
- data/spec/type/arch/package_spec.rb +31 -0
- data/spec/type/arch/service_spec.rb +13 -0
- data/spec/type/{command_spec.rb → base/command_spec.rb} +1 -3
- data/spec/type/{cron_spec.rb → base/cron_spec.rb} +5 -1
- data/spec/type/{default_gateway_spec.rb → base/default_gateway_spec.rb} +1 -1
- data/spec/type/{file_spec.rb → base/file_spec.rb} +23 -24
- data/spec/type/{group_spec.rb → base/group_spec.rb} +5 -1
- data/spec/type/{host_spec.rb → base/host_spec.rb} +5 -1
- data/spec/type/{mail_alias_spec.rb → base/mail_alias_spec.rb} +5 -1
- data/spec/type/{package_spec.rb → base/package_spec.rb} +3 -32
- data/spec/type/{php_config_spec.rb → base/php_config_spec.rb} +1 -1
- data/spec/type/{port_spec.rb → base/port_spec.rb} +5 -1
- data/spec/type/{process_spec.rb → base/process_spec.rb} +5 -1
- data/spec/type/{routing_table_spec.rb → base/routing_table_spec.rb} +5 -1
- data/spec/type/{service_spec.rb → base/service_spec.rb} +5 -25
- data/spec/type/{user_spec.rb → base/user_spec.rb} +5 -1
- data/spec/type/darwin/file_spec.rb +43 -0
- data/spec/type/darwin/package_spec.rb +24 -0
- data/spec/type/darwin/port_spec.rb +37 -0
- data/spec/type/darwin/service_spec.rb +32 -0
- data/spec/type/debian/package_spec.rb +39 -0
- data/spec/type/debian/service_spec.rb +23 -0
- data/spec/type/fedora/service_spec.rb +19 -0
- data/spec/type/fedora15/service_spec.rb +19 -0
- data/spec/type/fedora20/service_spec.rb +19 -0
- data/spec/type/freebsd/file_spec.rb +11 -0
- data/spec/type/freebsd/package_spec.rb +31 -0
- data/spec/type/freebsd/port_spec.rb +37 -0
- data/spec/type/freebsd/service_spec.rb +16 -0
- data/spec/type/freebsd10/package_spec.rb +31 -0
- data/spec/type/gentoo/package_spec.rb +16 -0
- data/spec/type/gentoo/service_spec.rb +24 -0
- data/spec/type/{cgroup_spec.rb → linux/cgroup_spec.rb} +1 -1
- data/spec/type/linux/file_spec.rb +38 -0
- data/spec/type/{interface_spec.rb → linux/interface_spec.rb} +5 -1
- data/spec/type/{iptables_spec.rb → linux/iptables_spec.rb} +6 -2
- data/spec/type/linux/kernel_module_spec.rb +15 -0
- data/spec/type/{linux_kernel_parameter_spec.rb → linux/linux_kernel_parameter_spec.rb} +1 -1
- data/spec/type/{lxc_spec.rb → linux/lxc_container_spec.rb} +5 -1
- data/spec/type/{selinux_spec.rb → linux/selinux_spec.rb} +5 -1
- data/spec/type/{zfs_spec.rb → linux/zfs_spec.rb} +5 -1
- data/spec/type/nixos/package_spec.rb +31 -0
- data/spec/type/nixos/service_spec.rb +13 -0
- data/spec/type/openbsd/file_spec.rb +174 -0
- data/spec/type/openbsd/interface_spec.rb +25 -0
- data/spec/type/openbsd/mail_alias_spec.rb +15 -0
- data/spec/type/openbsd/package_spec.rb +24 -0
- data/spec/type/openbsd/port_spec.rb +11 -0
- data/spec/type/openbsd/service_spec.rb +24 -0
- data/spec/type/openbsd/user_spec.rb +24 -0
- data/spec/type/opensuse/service_spec.rb +32 -0
- data/spec/type/plamo/package_spec.rb +16 -0
- data/spec/type/plamo/service_spec.rb +16 -0
- data/spec/type/redhat/file_spec.rb +36 -0
- data/spec/type/redhat/package_spec.rb +39 -0
- data/spec/type/redhat/service_spec.rb +23 -0
- data/spec/type/{yumrepo_spec.rb → redhat/yumrepo_spec.rb} +5 -1
- data/spec/type/redhat5/iptables_spec.rb +23 -0
- data/spec/type/redhat7/service_spec.rb +13 -0
- data/spec/type/smartos/package_spec.rb +31 -0
- data/spec/type/smartos/service_spec.rb +32 -0
- data/spec/type/solaris/cron_spec.rb +23 -0
- data/spec/type/solaris/file_spec.rb +33 -0
- data/spec/type/solaris/group_spec.rb +15 -0
- data/spec/type/solaris/host_spec.rb +31 -0
- data/spec/type/solaris/ipfilter_spec.rb +11 -0
- data/spec/type/solaris/ipnat_spec.rb +11 -0
- data/spec/type/solaris/package_spec.rb +15 -0
- data/spec/type/solaris/port_spec.rb +37 -0
- data/spec/type/solaris/service_spec.rb +32 -0
- data/spec/type/solaris/user_spec.rb +32 -0
- data/spec/type/solaris/zfs_spec.rb +19 -0
- data/spec/type/solaris10/file_spec.rb +391 -0
- data/spec/type/solaris10/group_spec.rb +16 -0
- data/spec/type/solaris10/host_spec.rb +24 -0
- data/spec/type/solaris10/package_spec.rb +15 -0
- data/spec/type/solaris10/user_spec.rb +16 -0
- data/spec/type/suse/package_spec.rb +39 -0
- data/spec/type/suse/service_spec.rb +23 -0
- data/spec/type/ubuntu/ppa_spec.rb +23 -0
- data/spec/type/ubuntu/service_spec.rb +15 -0
- data/spec/type/windows/command_spec.rb +65 -0
- data/spec/type/windows/feature_spec.rb +13 -0
- data/spec/type/windows/file_spec.rb +161 -0
- data/spec/type/windows/group_spec.rb +31 -0
- data/spec/type/windows/host_spec.rb +56 -0
- data/spec/type/windows/hot_fix_spec.rb +26 -0
- data/spec/type/windows/iis_app_pool_spec.rb +18 -0
- data/spec/type/windows/iis_webisite_spec.rb +30 -0
- data/spec/type/windows/package_spec.rb +14 -0
- data/spec/type/windows/port_spec.rb +33 -0
- data/spec/type/windows/registry_key_spec.rb +62 -0
- data/spec/type/windows/scheduled_task_spec.rb +13 -0
- data/spec/type/windows/service_spec.rb +42 -0
- data/spec/type/windows/user_spec.rb +45 -0
- metadata +208 -50
- data/spec/type/kernel_module_spec.rb +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4eac2e10fe1f7646006a794380e458fa37b3c75c
|
4
|
+
data.tar.gz: dbcfb11112500d422ce06d4af91bb0b3f3e2b835
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
10
|
-
|
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
|
data/lib/serverspec/setup.rb
CHANGED
@@ -94,25 +94,25 @@ EOF
|
|
94
94
|
content = <<-EOF
|
95
95
|
require 'spec_helper'
|
96
96
|
|
97
|
-
describe package('httpd'), :if => os[:family] == '
|
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] == '
|
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] == '
|
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] == '
|
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] == '
|
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
|
255
|
-
include Specinfra::Helper::DetectOS
|
256
|
-
<% else -%>
|
254
|
+
<% if @os_type != 'UN*X' -%>
|
257
255
|
include Specinfra::Helper::Windows
|
258
256
|
<% end -%>
|
259
257
|
|
data/lib/serverspec/type/cron.rb
CHANGED
@@ -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.
|
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.
|
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
|
data/lib/serverspec/type/file.rb
CHANGED
@@ -6,15 +6,15 @@ module Serverspec
|
|
6
6
|
attr_accessor :content
|
7
7
|
|
8
8
|
def file?
|
9
|
-
@runner.
|
9
|
+
@runner.check_file_is_file(@name)
|
10
10
|
end
|
11
11
|
|
12
12
|
def socket?
|
13
|
-
@runner.
|
13
|
+
@runner.check_file_is_socket(@name)
|
14
14
|
end
|
15
15
|
|
16
16
|
def directory?
|
17
|
-
@runner.
|
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.
|
33
|
+
@runner.check_file_mode(@name, mode)
|
34
34
|
end
|
35
35
|
|
36
36
|
def owned_by?(owner)
|
37
|
-
@runner.
|
37
|
+
@runner.check_file_is_owned_by(@name, owner)
|
38
38
|
end
|
39
39
|
|
40
40
|
def grouped_into?(group)
|
41
|
-
@runner.
|
41
|
+
@runner.check_file_is_grouped(@name, group)
|
42
42
|
end
|
43
43
|
|
44
44
|
def linked_to?(target)
|
45
|
-
@runner.
|
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.
|
50
|
+
@runner.check_file_access_by_user(@name, by_user, 'r')
|
51
51
|
else
|
52
|
-
@runner.
|
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.
|
58
|
+
@runner.check_file_access_by_user(@name, by_user, 'w')
|
59
59
|
else
|
60
|
-
@runner.
|
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.
|
66
|
+
@runner.check_file_access_by_user(@name, by_user, 'x')
|
67
67
|
else
|
68
|
-
@runner.
|
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.
|
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.
|
81
|
+
@runner.check_file_has_checksum(@name, checksum)
|
78
82
|
end
|
79
83
|
|
80
84
|
def match_md5checksum(md5sum)
|
81
|
-
@runner.
|
85
|
+
@runner.check_file_has_md5checksum(@name, md5sum)
|
82
86
|
end
|
83
87
|
|
84
88
|
def match_sha256checksum(sha256sum)
|
85
|
-
@runner.
|
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.
|
5
|
+
@runner.check_group_exists(@name)
|
6
6
|
end
|
7
7
|
|
8
8
|
def has_gid?(gid)
|
9
|
-
@runner.
|
9
|
+
@runner.check_group_has_gid(@name, gid)
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
data/lib/serverspec/type/host.rb
CHANGED
@@ -2,15 +2,15 @@ module Serverspec
|
|
2
2
|
module Type
|
3
3
|
class Host < Base
|
4
4
|
def resolvable?(type)
|
5
|
-
@runner.
|
5
|
+
@runner.check_host_is_resolvable(@name, type)
|
6
6
|
end
|
7
7
|
|
8
8
|
def reachable?(port, proto, timeout)
|
9
|
-
@runner.
|
9
|
+
@runner.check_host_is_reachable(@name, port, proto, timeout)
|
10
10
|
end
|
11
11
|
|
12
12
|
def ipaddress
|
13
|
-
@runner.
|
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.
|
5
|
+
@runner.check_iis_app_pool_exists(@name)
|
6
6
|
end
|
7
7
|
|
8
8
|
def has_dotnet_version?(dotnet)
|
9
|
-
@runner.
|
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.
|
6
|
+
@runner.check_iis_website_is_installed(@name)
|
7
7
|
end
|
8
8
|
|
9
9
|
def enabled?()
|
10
|
-
@runner.
|
10
|
+
@runner.check_iis_website_is_enabled(@name)
|
11
11
|
end
|
12
12
|
|
13
13
|
def running?()
|
14
|
-
@runner.
|
14
|
+
@runner.check_iis_website_is_running(@name)
|
15
15
|
end
|
16
16
|
|
17
17
|
def in_app_pool?(app_pool)
|
18
|
-
@runner.
|
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.
|
22
|
+
@runner.check_iis_website_has_physical_path(@name, path)
|
23
23
|
end
|
24
24
|
|
25
25
|
def to_s
|
data/lib/serverspec/type/lxc.rb
CHANGED
@@ -2,11 +2,11 @@ module Serverspec
|
|
2
2
|
module Type
|
3
3
|
class Lxc < Base
|
4
4
|
def exists?
|
5
|
-
@runner.
|
5
|
+
@runner.check_lxc_container_exists(@name)
|
6
6
|
end
|
7
7
|
|
8
8
|
def running?
|
9
|
-
@runner.
|
9
|
+
@runner.check_lxc_container_is_running(@name)
|
10
10
|
end
|
11
11
|
|
12
12
|
def to_s
|
@@ -3,14 +3,9 @@ module Serverspec
|
|
3
3
|
class Package < Base
|
4
4
|
def installed?(provider, version)
|
5
5
|
if provider.nil?
|
6
|
-
@runner.
|
6
|
+
@runner.check_package_is_installed(@name, version)
|
7
7
|
else
|
8
|
-
check_method = "
|
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
|
data/lib/serverspec/type/port.rb
CHANGED
@@ -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.
|
34
|
+
@runner.check_port_is_listening(@name, options)
|
35
35
|
end
|
36
36
|
|
37
37
|
def valid_ip_address?(ip_address)
|
data/lib/serverspec/type/ppa.rb
CHANGED
@@ -2,15 +2,15 @@ module Serverspec
|
|
2
2
|
module Type
|
3
3
|
class Selinux < Base
|
4
4
|
def disabled?
|
5
|
-
@runner.
|
5
|
+
@runner.check_selinux_mode('disabled')
|
6
6
|
end
|
7
7
|
|
8
8
|
def enforcing?
|
9
|
-
@runner.
|
9
|
+
@runner.check_selinux_mode('enforcing')
|
10
10
|
end
|
11
11
|
|
12
12
|
def permissive?
|
13
|
-
@runner.
|
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.
|
5
|
+
@runner.check_service_is_enabled(@name, level)
|
6
6
|
end
|
7
7
|
|
8
8
|
def installed?(name, version)
|
9
|
-
@runner.
|
9
|
+
@runner.check_service_is_installed(@name)
|
10
10
|
end
|
11
11
|
|
12
12
|
def has_start_mode?(mode)
|
13
|
-
@runner.
|
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 = "
|
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.
|
21
|
+
@runner.check_service_is_running(@name)
|
27
22
|
end
|
28
23
|
end
|
29
24
|
|
30
25
|
def monitored_by?(monitor)
|
31
|
-
check_method = "
|
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.
|
31
|
+
@runner.check_service_has_property(@name, property)
|
40
32
|
end
|
41
33
|
end
|
42
34
|
end
|
data/lib/serverspec/type/user.rb
CHANGED
@@ -2,28 +2,34 @@ module Serverspec
|
|
2
2
|
module Type
|
3
3
|
class User < Base
|
4
4
|
def exists?
|
5
|
-
@runner.
|
5
|
+
@runner.check_user_exists(@name)
|
6
6
|
end
|
7
7
|
|
8
8
|
def belongs_to_group?(group)
|
9
|
-
@runner.
|
9
|
+
@runner.check_user_is_belonging_to_group(@name, group)
|
10
10
|
end
|
11
11
|
|
12
12
|
def has_uid?(uid)
|
13
|
-
@runner.
|
13
|
+
@runner.check_user_has_uid(@name, uid)
|
14
14
|
end
|
15
15
|
|
16
16
|
def has_home_directory?(path)
|
17
|
-
@runner.
|
17
|
+
@runner.check_user_has_home_directory(@name, path)
|
18
18
|
end
|
19
19
|
|
20
20
|
def has_login_shell?(shell)
|
21
|
-
@runner.
|
21
|
+
@runner.check_user_has_login_shell(@name, shell)
|
22
22
|
end
|
23
23
|
|
24
24
|
def has_authorized_key?(key)
|
25
|
-
@runner.
|
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,19 +2,19 @@ module Serverspec
|
|
2
2
|
module Type
|
3
3
|
class WindowsRegistryKey < Base
|
4
4
|
def exists?
|
5
|
-
@runner.
|
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.
|
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.
|
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.
|
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,11 +2,11 @@ module Serverspec
|
|
2
2
|
module Type
|
3
3
|
class Yumrepo < Base
|
4
4
|
def exists?
|
5
|
-
@runner.
|
5
|
+
@runner.check_yumrepo_exists(@name)
|
6
6
|
end
|
7
7
|
|
8
8
|
def enabled?
|
9
|
-
@runner.
|
9
|
+
@runner.check_yumrepo_is_enabled(@name)
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
data/lib/serverspec/type/zfs.rb
CHANGED
@@ -2,11 +2,11 @@ module Serverspec
|
|
2
2
|
module Type
|
3
3
|
class Zfs < Base
|
4
4
|
def exists?
|
5
|
-
@runner.
|
5
|
+
@runner.check_zfs_exists(@name)
|
6
6
|
end
|
7
7
|
|
8
8
|
def has_property?(property)
|
9
|
-
@runner.
|
9
|
+
@runner.check_zfs_has_property(@name, property)
|
10
10
|
end
|
11
11
|
|
12
12
|
def to_s
|
data/lib/serverspec/version.rb
CHANGED
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.
|
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
|