specinfra 2.76.4 → 2.76.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/specinfra/command.rb +4 -0
- data/lib/specinfra/command/freebsd/base/service.rb +1 -1
- data/lib/specinfra/command/freebsd/v6/service.rb +7 -0
- data/lib/specinfra/command/freebsd/v7/service.rb +2 -0
- data/lib/specinfra/command/freebsd/v8/service.rb +2 -0
- data/lib/specinfra/command/freebsd/v9/service.rb +2 -0
- data/lib/specinfra/version.rb +1 -1
- data/spec/command/freebsd/service_spec.rb +71 -0
- metadata +7 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c49976eb31350bb425c6f05ebf906b826953148
|
4
|
+
data.tar.gz: e37241d192b8e6046b8d2e7a535fd974c3ceb650
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ae6d72220adcf21de7e46745775f72215ef4451c88c287548db6741545853a92587207eb74c6cd36782bc66e67b8f72bb7d2b738a45a0993d66f39fa0d8e964
|
7
|
+
data.tar.gz: 2202d642ca425553c8870ff483c16d968f2b31e5eddd86a31816bf6f7a91dd7b19a63682ca431bb132b968dc48c4f18759602567af1aede354520673286954d2
|
data/lib/specinfra/command.rb
CHANGED
@@ -264,18 +264,22 @@ require 'specinfra/command/freebsd/base/zfs'
|
|
264
264
|
require 'specinfra/command/freebsd/v6'
|
265
265
|
require 'specinfra/command/freebsd/v6/user'
|
266
266
|
require 'specinfra/command/freebsd/v6/package'
|
267
|
+
require 'specinfra/command/freebsd/v6/service'
|
267
268
|
|
268
269
|
# FreeBSD V7 (inherit FreeBSD)
|
269
270
|
require 'specinfra/command/freebsd/v7'
|
270
271
|
require 'specinfra/command/freebsd/v7/package'
|
272
|
+
require 'specinfra/command/freebsd/v7/service'
|
271
273
|
|
272
274
|
# FreeBSD V8 (inherit FreeBSD)
|
273
275
|
require 'specinfra/command/freebsd/v8'
|
274
276
|
require 'specinfra/command/freebsd/v8/package'
|
277
|
+
require 'specinfra/command/freebsd/v8/service'
|
275
278
|
|
276
279
|
# FreeBSD V9 (inherit FreeBSD)
|
277
280
|
require 'specinfra/command/freebsd/v9'
|
278
281
|
require 'specinfra/command/freebsd/v9/package'
|
282
|
+
require 'specinfra/command/freebsd/v9/service'
|
279
283
|
|
280
284
|
# FreeBSD V11 (inherit FreeBSD)
|
281
285
|
require 'specinfra/command/freebsd/v11'
|
@@ -1,7 +1,7 @@
|
|
1
1
|
class Specinfra::Command::Freebsd::Base::Service < Specinfra::Command::Base::Service
|
2
2
|
class << self
|
3
3
|
def check_is_enabled(service, level=3)
|
4
|
-
"service
|
4
|
+
"service #{escape(service)} enabled"
|
5
5
|
end
|
6
6
|
def check_is_running_under_init(service)
|
7
7
|
"service #{escape(service)} status | grep -E 'as (pid [0-9]+)'"
|
data/lib/specinfra/version.rb
CHANGED
@@ -0,0 +1,71 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'command/freebsd/service works correctly' do
|
4
|
+
before do
|
5
|
+
property[:os] = nil
|
6
|
+
end
|
7
|
+
|
8
|
+
context 'freebsd-base' do
|
9
|
+
before do
|
10
|
+
set :os, :family => 'freebsd'
|
11
|
+
end
|
12
|
+
describe 'get_command(:check_service_is_enabled, "httpd")' do
|
13
|
+
it { expect(get_command(:check_service_is_enabled, 'httpd')).to eq 'service httpd enabled' }
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
context 'freebsd-6' do
|
18
|
+
before do
|
19
|
+
set :os, :family => 'freebsd', :release => '6'
|
20
|
+
end
|
21
|
+
describe 'get_command(:check_service_is_enabled, "httpd")' do
|
22
|
+
it { expect(get_command(:check_service_is_enabled, 'httpd')).to eq 'service -e | grep -- /httpd$' }
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
context 'freebsd-7' do
|
27
|
+
before do
|
28
|
+
set :os, :family => 'freebsd', :release => '7'
|
29
|
+
end
|
30
|
+
describe 'get_command(:check_service_is_enabled, "httpd")' do
|
31
|
+
it { expect(get_command(:check_service_is_enabled, 'httpd')).to eq 'service -e | grep -- /httpd$' }
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
context 'freebsd-8' do
|
36
|
+
before do
|
37
|
+
set :os, :family => 'freebsd', :release => '8'
|
38
|
+
end
|
39
|
+
describe 'get_command(:check_service_is_enabled, "httpd")' do
|
40
|
+
it { expect(get_command(:check_service_is_enabled, 'httpd')).to eq 'service -e | grep -- /httpd$' }
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
context 'freebsd-9' do
|
45
|
+
before do
|
46
|
+
set :os, :family => 'freebsd', :release => '9'
|
47
|
+
end
|
48
|
+
describe 'get_command(:check_service_is_enabled, "httpd")' do
|
49
|
+
it { expect(get_command(:check_service_is_enabled, 'httpd')).to eq 'service -e | grep -- /httpd$' }
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
context 'freebsd-10' do
|
54
|
+
before do
|
55
|
+
set :os, :family => 'freebsd', :release => '10'
|
56
|
+
end
|
57
|
+
describe 'get_command(:check_service_is_enabled, "httpd")' do
|
58
|
+
it { expect(get_command(:check_service_is_enabled, 'httpd')).to eq 'service httpd enabled' }
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
context 'freebsd-11' do
|
63
|
+
before do
|
64
|
+
set :os, :family => 'freebsd', :release => '11'
|
65
|
+
end
|
66
|
+
describe 'get_command(:check_service_is_enabled, "httpd")' do
|
67
|
+
it { expect(get_command(:check_service_is_enabled, 'httpd')).to eq 'service httpd enabled' }
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: specinfra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.76.
|
4
|
+
version: 2.76.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gosuke Miyashita
|
@@ -307,13 +307,17 @@ files:
|
|
307
307
|
- lib/specinfra/command/freebsd/v11/interface.rb
|
308
308
|
- lib/specinfra/command/freebsd/v6.rb
|
309
309
|
- lib/specinfra/command/freebsd/v6/package.rb
|
310
|
+
- lib/specinfra/command/freebsd/v6/service.rb
|
310
311
|
- lib/specinfra/command/freebsd/v6/user.rb
|
311
312
|
- lib/specinfra/command/freebsd/v7.rb
|
312
313
|
- lib/specinfra/command/freebsd/v7/package.rb
|
314
|
+
- lib/specinfra/command/freebsd/v7/service.rb
|
313
315
|
- lib/specinfra/command/freebsd/v8.rb
|
314
316
|
- lib/specinfra/command/freebsd/v8/package.rb
|
317
|
+
- lib/specinfra/command/freebsd/v8/service.rb
|
315
318
|
- lib/specinfra/command/freebsd/v9.rb
|
316
319
|
- lib/specinfra/command/freebsd/v9/package.rb
|
320
|
+
- lib/specinfra/command/freebsd/v9/service.rb
|
317
321
|
- lib/specinfra/command/gentoo.rb
|
318
322
|
- lib/specinfra/command/gentoo/base.rb
|
319
323
|
- lib/specinfra/command/gentoo/base/package.rb
|
@@ -562,6 +566,7 @@ files:
|
|
562
566
|
- spec/command/freebsd/host_spec.rb
|
563
567
|
- spec/command/freebsd/interface_spec.rb
|
564
568
|
- spec/command/freebsd/package_spec.rb
|
569
|
+
- spec/command/freebsd/service_spec.rb
|
565
570
|
- spec/command/linux/bond_spec.rb
|
566
571
|
- spec/command/linux/bridge_spec.rb
|
567
572
|
- spec/command/linux/file_spec.rb
|
@@ -691,6 +696,7 @@ test_files:
|
|
691
696
|
- spec/command/freebsd/host_spec.rb
|
692
697
|
- spec/command/freebsd/interface_spec.rb
|
693
698
|
- spec/command/freebsd/package_spec.rb
|
699
|
+
- spec/command/freebsd/service_spec.rb
|
694
700
|
- spec/command/linux/bond_spec.rb
|
695
701
|
- spec/command/linux/bridge_spec.rb
|
696
702
|
- spec/command/linux/file_spec.rb
|