serverspec 2.29.2 → 2.30.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/appveyor.yml +0 -4
- data/lib/serverspec/matcher.rb +1 -0
- data/lib/serverspec/matcher/be_enabled.rb +6 -0
- data/lib/serverspec/matcher/be_listening.rb +7 -0
- data/lib/serverspec/matcher/be_monitored_by.rb +17 -0
- data/lib/serverspec/matcher/be_running.rb +6 -0
- data/lib/serverspec/matcher/have_rule.rb +8 -0
- data/lib/serverspec/type/service.rb +4 -2
- data/lib/serverspec/version.rb +1 -1
- data/spec/type/base/service_spec.rb +5 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 805aa103f31a41ff32676fa36c1f6e54801ee299
|
4
|
+
data.tar.gz: 7feea0c4b60f88ed26264b530db7e194807f1806
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc4cc36245e7a9d9ba25ebc82ec428ffa4b9086595b3db43374b81056d37ef91c652ab24305baee7f7bf6d25f45fd751f5ab4d2763b5ac7ea1d10685f2ddc8cf
|
7
|
+
data.tar.gz: e74039e4443f224733b816790d7b9521ea8e0cbab9dbdfe7b4707e7c2b232d2f54ab504f9be0152958503ca89d3d13cf29e840db90c2d369d86163bffa547adf
|
data/appveyor.yml
CHANGED
data/lib/serverspec/matcher.rb
CHANGED
@@ -3,6 +3,13 @@ RSpec::Matchers.define :be_listening do
|
|
3
3
|
port.listening? @with, @local_address
|
4
4
|
end
|
5
5
|
|
6
|
+
description do
|
7
|
+
message = 'be listening'
|
8
|
+
message << " on #{@local_address}" if @local_address
|
9
|
+
message << " with #{@with}" if @with
|
10
|
+
message
|
11
|
+
end
|
12
|
+
|
6
13
|
chain :with do |with|
|
7
14
|
@with = with
|
8
15
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
RSpec::Matchers.define :be_monitored_by do |monitor|
|
2
|
+
match do |service|
|
3
|
+
service.monitored_by?(monitor, @monitor_name)
|
4
|
+
end
|
5
|
+
description do
|
6
|
+
if @monitor_name
|
7
|
+
"be monitored by #{monitor} with name #{@monitor_name}"
|
8
|
+
else
|
9
|
+
"be monitored by #{monitor}"
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
chain :with_name do |name|
|
14
|
+
@monitor_name = (name ? name : nil)
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
@@ -7,6 +7,14 @@ RSpec::Matchers.define :have_rule do |rule|
|
|
7
7
|
end
|
8
8
|
end
|
9
9
|
|
10
|
+
description do
|
11
|
+
message = %Q{have rule "#{rule}"}
|
12
|
+
message << " with table #{@table}" if @table
|
13
|
+
message << ' and' if @table && @chain
|
14
|
+
message << " with chain #{@chain}" if @chain
|
15
|
+
message
|
16
|
+
end
|
17
|
+
|
10
18
|
chain :with_table do |table|
|
11
19
|
@table = table
|
12
20
|
end
|
@@ -25,9 +25,11 @@ module Serverspec::Type
|
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
-
def monitored_by?(monitor)
|
28
|
+
def monitored_by?(monitor, monitor_name)
|
29
29
|
check_method = "check_service_is_monitored_by_#{monitor}".to_sym
|
30
|
-
|
30
|
+
# use the with_name value if set instead of the service name
|
31
|
+
monitor_name = (monitor_name ? monitor_name : @name)
|
32
|
+
res = @runner.send(check_method, monitor_name)
|
31
33
|
end
|
32
34
|
|
33
35
|
def has_property?(property)
|
data/lib/serverspec/version.rb
CHANGED
@@ -36,6 +36,11 @@ describe service('sshd') do
|
|
36
36
|
it { should be_monitored_by(:monit) }
|
37
37
|
end
|
38
38
|
|
39
|
+
describe service('tinc') do
|
40
|
+
let(:stdout) { "Process 'tinc-myvpn'\r\n status running\r\n monitoring status monitored" }
|
41
|
+
it { should be_monitored_by(:monit).with_name('tinc-myvpn') }
|
42
|
+
end
|
43
|
+
|
39
44
|
describe service('unicorn') do
|
40
45
|
it { should be_monitored_by(:god) }
|
41
46
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: serverspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.30.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gosuke Miyashita
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -124,6 +124,7 @@ files:
|
|
124
124
|
- lib/serverspec/matcher/be_executable.rb
|
125
125
|
- lib/serverspec/matcher/be_installed.rb
|
126
126
|
- lib/serverspec/matcher/be_listening.rb
|
127
|
+
- lib/serverspec/matcher/be_monitored_by.rb
|
127
128
|
- lib/serverspec/matcher/be_mounted.rb
|
128
129
|
- lib/serverspec/matcher/be_permissive.rb
|
129
130
|
- lib/serverspec/matcher/be_reachable.rb
|