specinfra 2.67.6 → 2.67.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Rakefile +1 -1
- data/lib/specinfra/helper/detect_os/suse.rb +4 -4
- data/lib/specinfra/version.rb +1 -1
- data/spec/helper/detect_os/debian_spec.rb +53 -2
- data/spec/helper/detect_os/suse_spec.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3277900939ebf01c5ac42247f8274e4ba198e585
|
4
|
+
data.tar.gz: 760acb4646c250057493ed45a752371070a516a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e990b6514c5f0cd223da0520b77a9c4e0ab402a70a926f6b459eeb7ef2212d137ae66de89fc02d4ccbcc5b8995e43a65f6b5c7b2eab02b4a851a59ee7a5dd020
|
7
|
+
data.tar.gz: a96423b03de2ad4903ea3362c06ea20bf20b705574329e102685087623916d3a1161555f73fd55432ef9fb2fc3d9af184623258a324643baa51f46948d292994
|
data/Rakefile
CHANGED
@@ -13,7 +13,7 @@ if defined?(RSpec)
|
|
13
13
|
task :all => [ :helper, :backend, :configuration, :processor, :command, :host_inventory ]
|
14
14
|
|
15
15
|
RSpec::Core::RakeTask.new(:helper) do |t|
|
16
|
-
t.pattern = "spec/helper
|
16
|
+
t.pattern = "spec/helper/**/*_spec.rb"
|
17
17
|
end
|
18
18
|
|
19
19
|
task :backend => 'backend:all'
|
@@ -1,14 +1,14 @@
|
|
1
1
|
class Specinfra::Helper::DetectOs::Suse < Specinfra::Helper::DetectOs
|
2
2
|
def detect
|
3
|
-
if run_command('ls /etc/os-release').success? and run_command('
|
3
|
+
if run_command('ls /etc/os-release').success? and run_command('zypper -V').success?
|
4
4
|
line = run_command('cat /etc/os-release').stdout
|
5
|
-
if line =~ /
|
5
|
+
if line =~ /ID=opensuse/
|
6
6
|
family = 'opensuse'
|
7
7
|
elsif line =~ /NAME=\"SLES"/
|
8
8
|
family = 'sles'
|
9
|
-
|
9
|
+
end
|
10
|
+
if line =~ /VERSION_ID=\"(\d+\.\d+|\d+)\"/
|
10
11
|
release = $1
|
11
|
-
family = 'opensuse'
|
12
12
|
end
|
13
13
|
{ :family => family, :release => release }
|
14
14
|
end
|
data/lib/specinfra/version.rb
CHANGED
@@ -2,16 +2,67 @@ require 'spec_helper'
|
|
2
2
|
require 'specinfra/helper/detect_os/debian'
|
3
3
|
|
4
4
|
describe Specinfra::Helper::DetectOs::Debian do
|
5
|
-
|
5
|
+
debian = Specinfra::Helper::DetectOs::Debian.new(Specinfra.backend)
|
6
6
|
|
7
7
|
it 'Should return debian 8.5 when jessie is installed.' do
|
8
8
|
allow(debian).to receive(:run_command).with('cat /etc/debian_version') {
|
9
9
|
CommandResult.new(:stdout => "8.5\n", :exit_status => 0)
|
10
10
|
}
|
11
|
-
|
11
|
+
allow(debian).to receive(:run_command).with('lsb_release -ir') {
|
12
|
+
CommandResult.new(:stdout => "8.5\n", :exit_status => 1)
|
13
|
+
}
|
14
|
+
allow(debian).to receive(:run_command).with('cat /etc/lsb-release') {
|
15
|
+
CommandResult.new(:stdout => "8.5\n", :exit_status => 1)
|
16
|
+
}
|
17
|
+
expect(debian.detect).to include(
|
12
18
|
:family => 'debian',
|
13
19
|
:release => '8.5'
|
14
20
|
)
|
15
21
|
end
|
22
|
+
it 'Should return ubuntu 16.10 when yakkety is installed.' do
|
23
|
+
allow(debian).to receive(:run_command).with('cat /etc/debian_version') {
|
24
|
+
CommandResult.new(:stdout => "stretch/sid", :exit_status => 0)
|
25
|
+
}
|
26
|
+
allow(debian).to receive(:run_command).with('lsb_release -ir') {
|
27
|
+
CommandResult.new(:stdout => "Distributor ID:Ubuntu\nRelease:16.10\n", :exit_status => 0)
|
28
|
+
}
|
29
|
+
allow(debian).to receive(:run_command).with('cat /etc/lsb-release') {
|
30
|
+
CommandResult.new(:stdout => "DISTRIB_ID=Ubuntu\nDISTRIB_RELEASE=16.10\nDISTRIB_CODENAME=yakkety\nDISTRIB_DESCRIPTION=\"Ubuntu 16.10\"", :exit_status => 0)
|
31
|
+
}
|
32
|
+
expect(debian.detect).to include(
|
33
|
+
:family => 'ubuntu',
|
34
|
+
:release => '16.10'
|
35
|
+
)
|
36
|
+
end
|
37
|
+
it 'Should return ubuntu 16.04 when xenial is installed.' do
|
38
|
+
allow(debian).to receive(:run_command).with('cat /etc/debian_version') {
|
39
|
+
CommandResult.new(:stdout => "stretch/sid", :exit_status => 0)
|
40
|
+
}
|
41
|
+
allow(debian).to receive(:run_command).with('lsb_release -ir') {
|
42
|
+
CommandResult.new(:stdout => "Distributor ID:Ubuntu\nRelease:16.04\n", :exit_status => 0)
|
43
|
+
}
|
44
|
+
allow(debian).to receive(:run_command).with('cat /etc/lsb-release') {
|
45
|
+
CommandResult.new(:stdout => "DISTRIB_ID=Ubuntu\nDISTRIB_RELEASE=16.04\nDISTRIB_CODENAME=xenial\nDISTRIB_DESCRIPTION=\"Ubuntu 16.04.2 LTS\"", :exit_status => 0)
|
46
|
+
}
|
47
|
+
expect(debian.detect).to include(
|
48
|
+
:family => 'ubuntu',
|
49
|
+
:release => '16.04'
|
50
|
+
)
|
51
|
+
end
|
52
|
+
it 'Should return ubuntu 16.04 when xenial is installed in docker.' do
|
53
|
+
allow(debian).to receive(:run_command).with('cat /etc/debian_version') {
|
54
|
+
CommandResult.new(:stdout => "stretch/sid", :exit_status => 0)
|
55
|
+
}
|
56
|
+
allow(debian).to receive(:run_command).with('lsb_release -ir') {
|
57
|
+
CommandResult.new(:stdout => 'lsb-release is not installed in docker image by default', :exit_status => 1)
|
58
|
+
}
|
59
|
+
allow(debian).to receive(:run_command).with('cat /etc/lsb-release') {
|
60
|
+
CommandResult.new(:stdout => "DISTRIB_ID=Ubuntu\nDISTRIB_RELEASE=16.04\nDISTRIB_CODENAME=xenial\nDISTRIB_DESCRIPTION=\"Ubuntu 16.04.2 LTS\"", :exit_status => 0)
|
61
|
+
}
|
62
|
+
expect(debian.detect).to include(
|
63
|
+
:family => 'ubuntu',
|
64
|
+
:release => '16.04'
|
65
|
+
)
|
66
|
+
end
|
16
67
|
end
|
17
68
|
|
@@ -5,7 +5,7 @@ describe Specinfra::Helper::DetectOs::Suse do
|
|
5
5
|
suse = Specinfra::Helper::DetectOs::Suse.new(:exec)
|
6
6
|
it 'Should return opensuse 42 when openSUSE 42.2 is installed.' do
|
7
7
|
allow(suse).to receive(:run_command) {
|
8
|
-
CommandResult.new(:stdout =>
|
8
|
+
CommandResult.new(:stdout => "NAME=\"openSUSE Leap\"\nVERSION=\"42.2\"\nID=opensuse\nID_LIKE=\"suse\"\nVERSION_ID=\"42.2\"\nPRETTY_NAME=\"openSUSE Leap 42.2\"\nANSI_COLOR=\"0;32\"\nCPE_NAME=\"cpe:/o:opensuse:leap:42.2\"\nBUG_REPORT_URL=\"https://bugs.opensuse.org\"\nHOME_URL=\"https://www.opensuse.org/\"\n", :exit_status => 0)
|
9
9
|
}
|
10
10
|
expect(suse.detect).to include(
|
11
11
|
:family => 'opensuse',
|
@@ -14,7 +14,7 @@ describe Specinfra::Helper::DetectOs::Suse do
|
|
14
14
|
end
|
15
15
|
it 'Should return opensuse 13.2 when openSUSE 13.2 is installed.' do
|
16
16
|
allow(suse).to receive(:run_command) {
|
17
|
-
CommandResult.new(:stdout =>
|
17
|
+
CommandResult.new(:stdout => "NAME=openSUSE\nVERSION=\"13.2 (Harlequin)\"\nVERSION_ID=\"13.2\"\nPRETTY_NAME=\"openSUSE 13.2 (Harlequin) (x86_64)\"\nID=opensuse\nANSI_COLOR=\"0;32\"\nCPE_NAME=\"cpe:/o:opensuse:opensuse:13.2\"\nBUG_REPORT_URL=\"https://bugs.opensuse.org\"\nHOME_URL=\"https://opensuse.org/\"\nID_LIKE=\"suse\"\n", :exit_status => 0)
|
18
18
|
}
|
19
19
|
expect(suse.detect).to include(
|
20
20
|
:family => 'opensuse',
|
@@ -23,7 +23,7 @@ describe Specinfra::Helper::DetectOs::Suse do
|
|
23
23
|
end
|
24
24
|
it 'Should return sles 12 when SUSE Linux Enterprise Server 12 is installed.' do
|
25
25
|
allow(suse).to receive(:run_command) {
|
26
|
-
CommandResult.new(:stdout =>
|
26
|
+
CommandResult.new(:stdout => "NAME=\"SLES\"\nVERSION=\"12\"\nVERSION_ID=\"12\"\nPRETTY_NAME=\"SUSE Linux Enterprise Server 12\"\nID=\"sles\"\nANSI_COLOR=\"0;32\"\nCPE_NAME=\"cpe:/o:suse:sles:12\"\n", :exit_status => 0)
|
27
27
|
}
|
28
28
|
expect(suse.detect).to include(
|
29
29
|
:family => 'sles',
|
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.67.
|
4
|
+
version: 2.67.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gosuke Miyashita
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-scp
|