serverspec 1.9.1 → 1.10.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f4ca52869f2dbc6844fcf25e2b8da41d0e8222c0
4
- data.tar.gz: 6d3246e665018ec15dedd4af1a02e3f3c44160b2
3
+ metadata.gz: 0c2a6d1a4ea5ce4ba9ae35e54181e56e43c7a5ec
4
+ data.tar.gz: 42f594c7e7cf668945965ae8341d70a4d45db68e
5
5
  SHA512:
6
- metadata.gz: 11a40531de1b48b20cf721585eb1f84be4b0e64d20ce88eda609e7525a04707da816040f579e845d3578dbe2ef2faf16ee723437220f93b6310c3b19ef70207d
7
- data.tar.gz: 59233246cfcf4d87be4601b914a9cb15390f64afe2488d177146fdb98239328a65c16ca251a24b58b4c7a1a22ab85513058756449c273c43f4d1e3e506a5fbab
6
+ metadata.gz: 7beeca0c2daf0bb94a2d3fd8f8a408df17ac1da5a6a0e57b802d46c2c8d8e6255a25b4d14974c1644492fb591af3c40eb0375fe247511c37c7b0e1869a37f90d
7
+ data.tar.gz: d62cab3be110a3582e5441b0babef53533f53d6d254609002b8e78055b9d10817950676d2b6592a127afee919a149272b6df0f8ac5c3fd836f0426409ccf594b
@@ -73,6 +73,10 @@ module Serverspec
73
73
  backend.check_mounted(@name, attr, only_with)
74
74
  end
75
75
 
76
+ def immutable?
77
+ backend.check_immutable(@name)
78
+ end
79
+
76
80
  def match_checksum(checksum)
77
81
  backend.check_file_checksum(@name, checksum)
78
82
  end
@@ -1,3 +1,3 @@
1
1
  module Serverspec
2
- VERSION = "1.9.1"
2
+ VERSION = "1.10.0"
3
3
  end
data/serverspec.gemspec CHANGED
@@ -19,10 +19,10 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.add_runtime_dependency "net-ssh"
22
- spec.add_runtime_dependency "rspec", "~> 2.13"
22
+ spec.add_runtime_dependency "rspec", "~> 2.99"
23
23
  spec.add_runtime_dependency "rspec-its"
24
24
  spec.add_runtime_dependency "highline"
25
- spec.add_runtime_dependency "specinfra", "~> 1.18"
25
+ spec.add_runtime_dependency "specinfra", "~> 1.20"
26
26
  spec.add_development_dependency "bundler", "~> 1.3"
27
27
  spec.add_development_dependency "rake", "~> 10.1.1"
28
28
  end
@@ -265,6 +265,11 @@ describe file('/etc/invalid-mount') do
265
265
  it { should_not be_mounted }
266
266
  end
267
267
 
268
+ describe file('/etc/immutable-file') do
269
+ it { should be_immutable }
270
+ its(:command) { should eq "lsattr -d /etc/immutable-file 2>&1 | awk '$1~/^-*i-*$/ {exit 0} {exit 1}'" }
271
+ end
272
+
268
273
  describe file('/') do
269
274
  let(:stdout) { "/dev/mapper/VolGroup-lv_root on / type ext4 (rw,mode=620)\r\n" }
270
275
  it { should be_mounted.with( :type => 'ext4' ) }
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: 1.9.1
4
+ version: 1.10.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: 2014-06-30 00:00:00.000000000 Z
11
+ date: 2014-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-ssh
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '2.13'
33
+ version: '2.99'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '2.13'
40
+ version: '2.99'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec-its
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '1.18'
75
+ version: '1.20'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '1.18'
82
+ version: '1.20'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: bundler
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -266,7 +266,6 @@ files:
266
266
  - spec/fedora/process_spec.rb
267
267
  - spec/fedora/routing_table_spec.rb
268
268
  - spec/fedora/selinux_spec.rb
269
- - spec/fedora/service_spec.rb
270
269
  - spec/fedora/user_spec.rb
271
270
  - spec/fedora/yumrepo_spec.rb
272
271
  - spec/fedora/zfs_spec.rb
@@ -513,7 +512,6 @@ test_files:
513
512
  - spec/fedora/process_spec.rb
514
513
  - spec/fedora/routing_table_spec.rb
515
514
  - spec/fedora/selinux_spec.rb
516
- - spec/fedora/service_spec.rb
517
515
  - spec/fedora/user_spec.rb
518
516
  - spec/fedora/yumrepo_spec.rb
519
517
  - spec/fedora/zfs_spec.rb
@@ -1,188 +0,0 @@
1
- require 'spec_helper'
2
-
3
- include SpecInfra::Helper::Fedora
4
-
5
- # Fedora 15+
6
-
7
- describe service('sshd') do
8
- it { should be_enabled }
9
- # TODO Find a way to make this default to multiuser.target instead
10
- its(:command) { should eq "systemctl --plain list-dependencies runlevel3.target | grep '^sshd.service$'" }
11
- end
12
-
13
- describe service('invalid-service') do
14
- it { should_not be_enabled }
15
- end
16
-
17
- describe service('sshd') do
18
- it { should be_enabled.with_level(4) }
19
- its(:command) { should eq "systemctl --plain list-dependencies runlevel4.target | grep '^sshd.service$'" }
20
- end
21
-
22
- describe service('sshd') do
23
- it { should be_enabled.with_level("graphical.target") }
24
- its(:command) { should eq "systemctl --plain list-dependencies graphical.target | grep '^sshd.service$'" }
25
- end
26
-
27
- describe service('invalid-service') do
28
- it { should_not be_enabled.with_level(4) }
29
- end
30
-
31
- describe service('sshd') do
32
- it { should be_running }
33
- its(:command) { should eq "systemctl is-active sshd.service" }
34
- end
35
-
36
- describe service('invalid-daemon') do
37
- it { should_not be_running }
38
- end
39
-
40
- describe service('sshd') do
41
- let(:stdout) { "sshd is stopped\r\n" }
42
- it { should be_running }
43
- end
44
-
45
- # Fedora 14-
46
-
47
- host = SpecInfra.configuration.ssh ? SpecInfra.configuration.ssh.host : 'localhost'
48
-
49
- describe service('sshd') do
50
- before :each do
51
- set_property :os_by_host => { host => { :family => 'fedora', :release => '14' } }
52
- end
53
- after :each do
54
- property.delete :os_by_host
55
- end
56
-
57
- it { should be_enabled }
58
- its(:command) { should eq "chkconfig --list sshd | grep 3:on" }
59
- end
60
-
61
- describe service('invalid-service') do
62
- before :each do
63
- set_property :os_by_host => { host => { :family => 'fedora', :release => '14' } }
64
- end
65
- after :each do
66
- property.delete :os_by_host
67
- end
68
-
69
- it { should_not be_enabled }
70
- end
71
-
72
- describe service('sshd') do
73
- before :each do
74
- set_property :os_by_host => { host => { :family => 'fedora', :release => '14' } }
75
- end
76
- after :each do
77
- property.delete :os_by_host
78
- end
79
-
80
- it { should be_enabled.with_level(4) }
81
- its(:command) { should eq "chkconfig --list sshd | grep 4:on" }
82
- end
83
-
84
- describe service('invalid-service') do
85
- before :each do
86
- set_property :os_by_host => { host => { :family => 'fedora', :release => '14' } }
87
- end
88
- after :each do
89
- property.delete :os_by_host
90
- end
91
-
92
- it { should_not be_enabled.with_level(4) }
93
- end
94
-
95
- describe service('sshd') do
96
- before :each do
97
- set_property :os_by_host => { host => { :family => 'fedora', :release => '14' } }
98
- end
99
- after :each do
100
- property.delete :os_by_host
101
- end
102
-
103
- it { should be_running }
104
- its(:command) { should eq "service sshd status" }
105
- end
106
-
107
- describe service('invalid-daemon') do
108
- before :each do
109
- set_property :os_by_host => { host => { :family => 'fedora', :release => '14' } }
110
- end
111
- after :each do
112
- property.delete :os_by_host
113
- end
114
-
115
- it { should_not be_running }
116
- end
117
-
118
- describe service('sshd') do
119
- before :each do
120
- set_property :os_by_host => { host => { :family => 'fedora', :release => '14' } }
121
- end
122
- after :each do
123
- property.delete :os_by_host
124
- end
125
-
126
- let(:stdout) { "sshd is stopped\r\n" }
127
- it { should be_running }
128
- end
129
-
130
- # All versions of Fedora
131
-
132
- describe service('sshd') do
133
- it { should be_running.under('supervisor') }
134
- its(:command) { should eq "supervisorctl status sshd | grep RUNNING" }
135
- end
136
-
137
- describe service('invalid-daemon') do
138
- it { should_not be_running.under('supervisor') }
139
- end
140
-
141
- describe service('sshd') do
142
- it { should be_running.under('upstart') }
143
- its(:command) { should eq "initctl status sshd | grep running" }
144
- end
145
-
146
- describe service('invalid-daemon') do
147
- it { should_not be_running.under('upstart') }
148
- end
149
-
150
- describe service('sshd') do
151
- it {
152
- expect {
153
- should be_running.under('not implemented')
154
- }.to raise_error(ArgumentError, %r/\A`be_running` matcher doesn\'t support/)
155
- }
156
- end
157
-
158
- describe service('sshd') do
159
- let(:stdout) { "Process 'sshd'\r\n status running\r\n monitoring status monitored" }
160
- it { should be_monitored_by('monit') }
161
- its(:command) { should eq "monit status" }
162
- end
163
-
164
- describe service('sshd') do
165
- let(:stdout) { "Process 'sshd'\r\n status not monitored\r\n monitoring status not monitored" }
166
- it { should_not be_monitored_by('monit') }
167
- end
168
-
169
- describe service('invalid-daemon') do
170
- it { should_not be_monitored_by('monit') }
171
- end
172
-
173
- describe service('unicorn') do
174
- it { should be_monitored_by('god') }
175
- its(:command) { should eq "god status unicorn" }
176
- end
177
-
178
- describe service('invalid-daemon') do
179
- it { should_not be_monitored_by('god') }
180
- end
181
-
182
- describe service('sshd') do
183
- it {
184
- expect {
185
- should be_monitored_by('not implemented')
186
- }.to raise_error(ArgumentError, %r/\A`be_monitored_by` matcher doesn\'t support/)
187
- }
188
- end