specinfra 2.83.0 → 2.83.3

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: d74b760931c73cff0e9828d546a7e63f658ec60a
4
- data.tar.gz: f945ae61dd3f169436d89903db0ad45847684f63
3
+ metadata.gz: 6705583dbf8312d537307218cb9c75cf28bbb9d6
4
+ data.tar.gz: 2fe5613db13e84c37cbce47471cb273907f9cb6c
5
5
  SHA512:
6
- metadata.gz: a5c308cdcf87bc332143697d3c6d8d5a47e221f1afef33e711ae0786958a71f3d20009d37d15591294465427e5a31b438ac7fb1494a868cc67895ceb50f1a3fe
7
- data.tar.gz: cfc67a5a753304dfa7f38573c77b0f6124c4012d63cc57c81d862671fed9bda823a597de02cffa61042c8d6cb1d1ef4b2d609eb3828937bdfa9458886a7e638a
6
+ metadata.gz: 94f87c4bbbe61fc61e69d53a81f4b63273c056a9652ad3b86615f466c33c893608a7c7c5ef4df9fdd47747d2a6a5b913bb12d45b1a6c3cab08f8359c8e5ad698
7
+ data.tar.gz: 9a28cb42d8c790052039a52b91cb13910addadb0881d8784525e1257ef8f4fe41ae17d2b03de1bbf66381fcac0cd681b3bd9ee85e5ac0cfa281d9cc272590307
@@ -8,6 +8,10 @@ class Specinfra::Command::Darwin::Base::Inventory < Specinfra::Command::Base::In
8
8
  'false'
9
9
  end
10
10
 
11
+ def get_kernel
12
+ 'false'
13
+ end
14
+
11
15
  def get_hostname
12
16
  'hostname -s'
13
17
  end
@@ -3,8 +3,8 @@ class Specinfra::Command::Freebsd::Base::Service < Specinfra::Command::Base::Ser
3
3
  def check_is_enabled(service, level=3)
4
4
  "service #{escape(service)} enabled"
5
5
  end
6
- def check_is_running_under_init(service)
7
- "service #{escape(service)} status | grep -E 'as (pid [0-9]+)'"
6
+ def check_is_running(service)
7
+ "service #{escape(service)} onestatus"
8
8
  end
9
9
  end
10
10
  end
@@ -30,7 +30,7 @@ class Specinfra::Command::Linux::Base::Inventory < Specinfra::Command::Base::Inv
30
30
 
31
31
  def get_block_device
32
32
  block_device_dirs = '/sys/block/*/{size,removable,device/{model,rev,state,timeout,vendor},queue/rotational}'
33
- "for f in $(ls #{block_device_dirs}); do echo -e \"${f}\t$(cat ${f})\"; done"
33
+ %Q[bash -c 'for f in $(ls #{block_device_dirs}); do echo -e "${f}\t$(cat ${f})"; done']
34
34
  end
35
35
 
36
36
  def get_system_product_name
@@ -1,3 +1,3 @@
1
1
  module Specinfra
2
- VERSION = "2.83.0"
2
+ VERSION = "2.83.3"
3
3
  end
@@ -5,67 +5,96 @@ describe 'command/freebsd/service works correctly' do
5
5
  property[:os] = nil
6
6
  end
7
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' }
8
+ describe 'check_service_is_enabled' do
9
+ context 'freebsd-base' do
10
+ before do
11
+ set :os, :family => 'freebsd'
12
+ end
13
+ describe 'get_command(:check_service_is_enabled, "httpd")' do
14
+ it { expect(get_command(:check_service_is_enabled, 'httpd')).to eq 'service httpd enabled' }
15
+ end
14
16
  end
15
- end
16
17
 
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$' }
18
+ context 'freebsd-6' do
19
+ before do
20
+ set :os, :family => 'freebsd', :release => '6'
21
+ end
22
+ describe 'get_command(:check_service_is_enabled, "httpd")' do
23
+ it { expect(get_command(:check_service_is_enabled, 'httpd')).to eq 'service -e | grep -- /httpd$' }
24
+ end
23
25
  end
24
- end
25
26
 
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$' }
27
+ context 'freebsd-7' do
28
+ before do
29
+ set :os, :family => 'freebsd', :release => '7'
30
+ end
31
+ describe 'get_command(:check_service_is_enabled, "httpd")' do
32
+ it { expect(get_command(:check_service_is_enabled, 'httpd')).to eq 'service -e | grep -- /httpd$' }
33
+ end
32
34
  end
33
- end
34
35
 
35
- context 'freebsd-8' do
36
- before do
37
- set :os, :family => 'freebsd', :release => '8'
36
+ context 'freebsd-8' do
37
+ before do
38
+ set :os, :family => 'freebsd', :release => '8'
39
+ end
40
+ describe 'get_command(:check_service_is_enabled, "httpd")' do
41
+ it { expect(get_command(:check_service_is_enabled, 'httpd')).to eq 'service -e | grep -- /httpd$' }
42
+ end
38
43
  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$' }
44
+
45
+ context 'freebsd-9' do
46
+ before do
47
+ set :os, :family => 'freebsd', :release => '9'
48
+ end
49
+ describe 'get_command(:check_service_is_enabled, "httpd")' do
50
+ it { expect(get_command(:check_service_is_enabled, 'httpd')).to eq 'service -e | grep -- /httpd$' }
51
+ end
41
52
  end
42
- end
43
53
 
44
- context 'freebsd-9' do
45
- before do
46
- set :os, :family => 'freebsd', :release => '9'
54
+ context 'freebsd-10' do
55
+ before do
56
+ set :os, :family => 'freebsd', :release => '10'
57
+ end
58
+ describe 'get_command(:check_service_is_enabled, "httpd")' do
59
+ it { expect(get_command(:check_service_is_enabled, 'httpd')).to eq 'service httpd enabled' }
60
+ end
47
61
  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$' }
62
+
63
+ context 'freebsd-11' do
64
+ before do
65
+ set :os, :family => 'freebsd', :release => '11'
66
+ end
67
+ describe 'get_command(:check_service_is_enabled, "httpd")' do
68
+ it { expect(get_command(:check_service_is_enabled, 'httpd')).to eq 'service httpd enabled' }
69
+ end
50
70
  end
51
- end
52
71
 
53
- context 'freebsd-10' do
54
- before do
55
- set :os, :family => 'freebsd', :release => '10'
72
+ context 'freebsd-12' do
73
+ before do
74
+ set :os, :family => 'freebsd', :release => '12'
75
+ end
76
+ describe 'get_command(:check_service_is_enabled, "httpd")' do
77
+ it { expect(get_command(:check_service_is_enabled, 'httpd')).to eq 'service httpd enabled' }
78
+ end
56
79
  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' }
80
+
81
+ context 'freebsd-13' do
82
+ before do
83
+ set :os, :family => 'freebsd', :release => '13'
84
+ end
85
+ describe 'get_command(:check_service_is_enabled, "httpd")' do
86
+ it { expect(get_command(:check_service_is_enabled, 'httpd')).to eq 'service httpd enabled' }
87
+ end
59
88
  end
60
89
  end
61
90
 
62
- context 'freebsd-11' do
91
+ describe 'check_service_is_running' do
63
92
  before do
64
- set :os, :family => 'freebsd', :release => '11'
93
+ set :os, :family => 'freebsd'
65
94
  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' }
95
+
96
+ describe 'get_command(:check_service_is_running, "foobar")' do
97
+ it { expect(get_command(:check_service_is_running, 'foobar')).to eq 'service foobar onestatus' }
68
98
  end
69
99
  end
70
100
  end
71
-
@@ -16,5 +16,5 @@ end
16
16
 
17
17
  describe get_command(:get_inventory_block_device) do
18
18
  block_device_dirs = '/sys/block/*/{size,removable,device/{model,rev,state,timeout,vendor},queue/rotational}'
19
- it { should eq "for f in $(ls #{block_device_dirs}); do echo -e \"${f}\t$(cat ${f})\"; done" }
19
+ it { should eq %Q[bash -c 'for f in $(ls #{block_device_dirs}); do echo -e "${f}\t$(cat ${f})"; done'] }
20
20
  end
@@ -0,0 +1,16 @@
1
+ require 'spec_helper'
2
+
3
+ describe Specinfra::HostInventory::Kernel do
4
+ describe "get" do
5
+ let(:host_inventory) { Specinfra::HostInventory.instance }
6
+ let(:command_class) { Specinfra::Command::Darwin::Base }
7
+ let(:error_message) { "get_kernel is not implemented in #{command_class}" }
8
+ let(:kernel_inventory) { Specinfra::HostInventory::Kernel.new(host_inventory) }
9
+ let(:result) { kernel_inventory.get }
10
+ example "it includes the value of os_info[:arch] in the key 'machine'" do
11
+ expect(result).to include(
12
+ "machine" => host_inventory.backend.os_info[:arch]
13
+ )
14
+ end
15
+ end
16
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: specinfra
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.83.0
4
+ version: 2.83.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gosuke Miyashita
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-21 00:00:00.000000000 Z
11
+ date: 2022-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-scp
@@ -600,6 +600,7 @@ files:
600
600
  - spec/host_inventory/base/group_spec.rb
601
601
  - spec/host_inventory/base/user_spec.rb
602
602
  - spec/host_inventory/darwin/filesystem_spec.rb
603
+ - spec/host_inventory/darwin/kernel_spec.rb
603
604
  - spec/host_inventory/freebsd/filesystem_spec.rb
604
605
  - spec/host_inventory/linux/block_device_spec.rb
605
606
  - spec/host_inventory/linux/cpu_spec.rb
@@ -742,6 +743,7 @@ test_files:
742
743
  - spec/host_inventory/base/group_spec.rb
743
744
  - spec/host_inventory/base/user_spec.rb
744
745
  - spec/host_inventory/darwin/filesystem_spec.rb
746
+ - spec/host_inventory/darwin/kernel_spec.rb
745
747
  - spec/host_inventory/freebsd/filesystem_spec.rb
746
748
  - spec/host_inventory/linux/block_device_spec.rb
747
749
  - spec/host_inventory/linux/cpu_spec.rb