specinfra 2.67.6 → 2.67.7

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: ab31c496f0f4b694ca5ca17e0d222dbfed9526d7
4
- data.tar.gz: 4101eb155a5672c62d1db388322b1000c8ca4461
3
+ metadata.gz: 3277900939ebf01c5ac42247f8274e4ba198e585
4
+ data.tar.gz: 760acb4646c250057493ed45a752371070a516a8
5
5
  SHA512:
6
- metadata.gz: c569a210e20dbe05951f4290719f1ae2c057d1427e52e98eafc74166f6ff2a614980e46fa92203d9755b18438c2600928f001c085248cfb1b671281702e740c4
7
- data.tar.gz: bcdc124ecd28ea1472a1ffd8e4ba9a03c5de836aad46d8a0d3edf359d408f75f87b521f51d02617f1353593932fb35f76ba064bb61e2d5617b88b1099e266ad2
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/*_spec.rb"
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('ls /etc/SuSe-release').success?
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 =~ /NAME=\"OpenSUSE"/
5
+ if line =~ /ID=opensuse/
6
6
  family = 'opensuse'
7
7
  elsif line =~ /NAME=\"SLES"/
8
8
  family = 'sles'
9
- elsif line =~ /openSUSE (\d+\.\d+|\d+)/
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
@@ -1,3 +1,3 @@
1
1
  module Specinfra
2
- VERSION = "2.67.6"
2
+ VERSION = "2.67.7"
3
3
  end
@@ -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
- darwin = Specinfra::Helper::DetectOs::Debian.new(Specinfra.backend)
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
- expect(darwin.detect).to include(
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 => '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)
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 => '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)
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 => '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)
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.6
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-25 00:00:00.000000000 Z
11
+ date: 2017-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-scp