specinfra 2.67.5 → 2.67.6
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/lib/specinfra/helper/detect_os/suse.rb +5 -4
- data/lib/specinfra/version.rb +1 -1
- data/spec/helper/detect_os/suse_spec.rb +12 -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: ab31c496f0f4b694ca5ca17e0d222dbfed9526d7
|
4
|
+
data.tar.gz: 4101eb155a5672c62d1db388322b1000c8ca4461
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c569a210e20dbe05951f4290719f1ae2c057d1427e52e98eafc74166f6ff2a614980e46fa92203d9755b18438c2600928f001c085248cfb1b671281702e740c4
|
7
|
+
data.tar.gz: bcdc124ecd28ea1472a1ffd8e4ba9a03c5de836aad46d8a0d3edf359d408f75f87b521f51d02617f1353593932fb35f76ba064bb61e2d5617b88b1099e266ad2
|
@@ -1,9 +1,10 @@
|
|
1
1
|
class Specinfra::Helper::DetectOs::Suse < Specinfra::Helper::DetectOs
|
2
2
|
def detect
|
3
|
-
if run_command('ls /etc/
|
4
|
-
line = run_command('cat /etc/
|
5
|
-
if line =~ /
|
6
|
-
|
3
|
+
if run_command('ls /etc/os-release').success? and run_command('ls /etc/SuSe-release').success?
|
4
|
+
line = run_command('cat /etc/os-release').stdout
|
5
|
+
if line =~ /NAME=\"OpenSUSE"/
|
6
|
+
family = 'opensuse'
|
7
|
+
elsif line =~ /NAME=\"SLES"/
|
7
8
|
family = 'sles'
|
8
9
|
elsif line =~ /openSUSE (\d+\.\d+|\d+)/
|
9
10
|
release = $1
|
data/lib/specinfra/version.rb
CHANGED
@@ -3,9 +3,18 @@ require 'specinfra/helper/detect_os/suse'
|
|
3
3
|
|
4
4
|
describe Specinfra::Helper::DetectOs::Suse do
|
5
5
|
suse = Specinfra::Helper::DetectOs::Suse.new(:exec)
|
6
|
-
it 'Should return opensuse
|
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 => 'openSUSE
|
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
|
+
}
|
10
|
+
expect(suse.detect).to include(
|
11
|
+
:family => 'opensuse',
|
12
|
+
:release => '42.2'
|
13
|
+
)
|
14
|
+
end
|
15
|
+
it 'Should return opensuse 13.2 when openSUSE 13.2 is installed.' do
|
16
|
+
allow(suse).to receive(:run_command) {
|
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)
|
9
18
|
}
|
10
19
|
expect(suse.detect).to include(
|
11
20
|
:family => 'opensuse',
|
@@ -14,7 +23,7 @@ describe Specinfra::Helper::DetectOs::Suse do
|
|
14
23
|
end
|
15
24
|
it 'Should return sles 12 when SUSE Linux Enterprise Server 12 is installed.' do
|
16
25
|
allow(suse).to receive(:run_command) {
|
17
|
-
CommandResult.new(:stdout => 'SUSE Linux Enterprise Server 12', :exit_status => 0)
|
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)
|
18
27
|
}
|
19
28
|
expect(suse.detect).to include(
|
20
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.6
|
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-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-scp
|