specinfra 2.67.5 → 2.67.6

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: bdc01368ef4596af153ff9a88d9616ffc67d4227
4
- data.tar.gz: 267ad5f540834de598b5ddf9a312a558049ac277
3
+ metadata.gz: ab31c496f0f4b694ca5ca17e0d222dbfed9526d7
4
+ data.tar.gz: 4101eb155a5672c62d1db388322b1000c8ca4461
5
5
  SHA512:
6
- metadata.gz: 7538babea1df2a390dcee9a35865d8c7f85357630363acae79f3af90a3dff79734cab10836188664d5d50ea2f05a07ff6641a9fef9543b93d90cecc2b0709765
7
- data.tar.gz: 6a70a3a06f1a2d52430548092b911870420f10a9e5c88c7c7dcdad317d8f1d5d6217b70994df94cd767ec64118389725684bfaabe71f6429b64770db961cc4c4
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/SuSE-release').success?
4
- line = run_command('cat /etc/SuSE-release').stdout
5
- if line =~ /SUSE Linux Enterprise Server (\d+)/
6
- release = $1
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
@@ -1,3 +1,3 @@
1
1
  module Specinfra
2
- VERSION = "2.67.5"
2
+ VERSION = "2.67.6"
3
3
  end
@@ -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 13 when openSUSE 13.2 is installed.' do
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 13.2 (x86_64)', :exit_status => 0)
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.5
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-24 00:00:00.000000000 Z
11
+ date: 2017-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-scp