specinfra 2.36.17 → 2.36.18

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2d39102e5d6b60f2c4e5aa254c95e9559c4ca2f5
4
- data.tar.gz: 47387d1f254b6e5e7f96db0d2f3eaf360882c0b2
3
+ metadata.gz: 9a0f1a1d203c0d6b82d43387e8bd15de5d2f8faf
4
+ data.tar.gz: 026b90bc6edf30e076a88c01083763dfd8e5df0d
5
5
  SHA512:
6
- metadata.gz: bef2820b4f8a57c88a882286a8a93e6ccf0c2e552bfe7f7aa723be3b3474a848f0b302670c3bf45ab462dc40f3a4e0b3f4adfb24985159512470fe0b9fb23050
7
- data.tar.gz: 85444779c5f8356f8f8cc0b48e717a68c1aff79f63f60bb942ff8bdc4e9faa66fcd9f313aa342d0f9ea94ca46396f050cbe620237157dd5c39e526c2f60dd63d
6
+ metadata.gz: 8d6ae7dedcf5e5e4bed21ee2800cbc37c35e033d39c3154a8d16f2b13bf24d24d532088339d36e1ba237efa93464d1a6e98006a7a2fc2cd4db1fd3c5ab074bb6
7
+ data.tar.gz: 9042411075b227466cdf1e3053ba224869f68d6ce5117cf77f6f6d3c6c8104c6eb0053aa4046db7568ceec4195b7397b101deeaba73240dc99b75a51a98c231c
@@ -58,7 +58,7 @@ module Specinfra
58
58
  def create_and_start_container
59
59
  opts = { 'Image' => current_image.id }
60
60
 
61
- if current_image.json["Config"]["Cmd"].nil?
61
+ if current_image.json["Config"]["Cmd"].nil? && current_image.json["Config"]["Entrypoint"].nil?
62
62
  opts.merge!({'Cmd' => ['/bin/sh']})
63
63
  end
64
64
 
@@ -1,8 +1,11 @@
1
1
  class Specinfra::Helper::DetectOs::Darwin < Specinfra::Helper::DetectOs
2
2
  def detect
3
- if run_command('uname -s').stdout =~ /Darwin/i
4
- release = run_command('uname -r').stdout.strip
5
- { :family => 'darwin', :release => release }
3
+ if ( uname = run_command('uname -sr').stdout ) && uname =~ /Darwin/i
4
+ if uname =~ /([\d.]+)$/
5
+ { :family => 'darwin', :release => $1 }
6
+ else
7
+ { :family => 'darwin', :release => nil }
8
+ end
6
9
  end
7
10
  end
8
11
  end
@@ -1,3 +1,3 @@
1
1
  module Specinfra
2
- VERSION = "2.36.17"
2
+ VERSION = "2.36.18"
3
3
  end
@@ -42,12 +42,12 @@ describe Specinfra::Helper::DetectOs::Aix do
42
42
  :arch => 'powerpc'
43
43
  )
44
44
  end
45
- it 'Should return aix when AIX is installed.' do
45
+ it 'Should return aix nil nil when AIX FooBar is installed.' do
46
46
  allow(aix).to receive(:run_command).with('uname -s') {
47
47
  CommandResult.new(:stdout => 'AIX', :exit_status => 0)
48
48
  }
49
49
  allow(aix).to receive(:run_command).with('uname -rvp') {
50
- CommandResult.new(:stdout => '', :exit_status => 1)
50
+ CommandResult.new(:stdout => 'Foo Bar batz', :exit_status => 1)
51
51
  }
52
52
  expect(aix.detect).to include(
53
53
  :family => 'aix',
@@ -4,11 +4,8 @@ require 'specinfra/helper/detect_os/darwin'
4
4
  describe Specinfra::Helper::DetectOs::Darwin do
5
5
  darwin = Specinfra::Helper::DetectOs::Darwin.new(:exec)
6
6
  it 'Should return darwin 13.4.0 when Mac OS X 10.9.5 (Mavericks) is installed.' do
7
- allow(darwin).to receive(:run_command).with('uname -s') {
8
- CommandResult.new(:stdout => 'Darwin', :exit_status => 0)
9
- }
10
- allow(darwin).to receive(:run_command).with('uname -r') {
11
- CommandResult.new(:stdout => '13.4.0', :exit_status => 0)
7
+ allow(darwin).to receive(:run_command) {
8
+ CommandResult.new(:stdout => 'Darwin 13.4.0', :exit_status => 0)
12
9
  }
13
10
  expect(darwin.detect).to include(
14
11
  :family => 'darwin',
@@ -16,11 +13,8 @@ describe Specinfra::Helper::DetectOs::Darwin do
16
13
  )
17
14
  end
18
15
  it 'Should return darwin 12.6.0 when Mac OS X 10.8.5 (Mountain Lion) is installed.' do
19
- allow(darwin).to receive(:run_command).with('uname -s') {
20
- CommandResult.new(:stdout => 'Darwin', :exit_status => 0)
21
- }
22
- allow(darwin).to receive(:run_command).with('uname -r') {
23
- CommandResult.new(:stdout => '12.6.0', :exit_status => 0)
16
+ allow(darwin).to receive(:run_command) {
17
+ CommandResult.new(:stdout => 'Darwin 12.6.0', :exit_status => 0)
24
18
  }
25
19
  expect(darwin.detect).to include(
26
20
  :family => 'darwin',
@@ -28,15 +22,21 @@ describe Specinfra::Helper::DetectOs::Darwin do
28
22
  )
29
23
  end
30
24
  it 'Should return darwin 11.4.2 when Mac OS X 10.7.5 (Lion) is installed.' do
31
- allow(darwin).to receive(:run_command).with('uname -s') {
32
- CommandResult.new(:stdout => 'Darwin', :exit_status => 0)
33
- }
34
- allow(darwin).to receive(:run_command).with('uname -r') {
35
- CommandResult.new(:stdout => '11.4.2', :exit_status => 0)
25
+ allow(darwin).to receive(:run_command) {
26
+ CommandResult.new(:stdout => 'Darwin 11.4.2', :exit_status => 0)
36
27
  }
37
28
  expect(darwin.detect).to include(
38
29
  :family => 'darwin',
39
30
  :release => '11.4.2'
40
31
  )
41
32
  end
33
+ it 'Should return darwin nil when Darwin FooBar is installed.' do
34
+ allow(darwin).to receive(:run_command) {
35
+ CommandResult.new(:stdout => 'Darwin FooBar', :exit_status => 0)
36
+ }
37
+ expect(darwin.detect).to include(
38
+ :family => 'darwin',
39
+ :release => nil
40
+ )
41
+ end
42
42
  end
@@ -2,13 +2,21 @@ require 'spec_helper'
2
2
  require 'specinfra/helper/detect_os/esxi'
3
3
 
4
4
  describe Specinfra::Helper::DetectOs::Esxi do
5
+ esxi = Specinfra::Helper::DetectOs::Esxi.new(:exec)
5
6
  it 'Should return esxi when esxi is installed.' do
6
- allow(Specinfra::Helper::DetectOs::Esxi).to receive(:run_command) { CommandResult.new(:stdout => 'VMware ESXi 5.0.0 build-123445', :exit_status => 0) }
7
- expect(Specinfra::Helper::DetectOs::Esxi.detect).to include(:family => 'esxi', :release => '5.0.0 build-123445')
7
+ allow(esxi).to receive(:run_command) {
8
+ CommandResult.new(:stdout => 'VMware ESXi 5.0.0 build-123445', :exit_status => 0)
9
+ }
10
+ expect(esxi.detect).to include(
11
+ :family => 'esxi',
12
+ :release => '5.0.0 build-123445'
13
+ )
8
14
  end
9
15
 
10
16
  it 'Should not return esxi when VMware Workstation is installed.' do
11
- allow(Specinfra::Helper::DetectOs::Esxi).to receive(:run_command) { CommandResult.new(:stdout => 'VMware Workstation', :exit_status => 0) }
12
- expect(Specinfra::Helper::DetectOs::Esxi.detect).to be_nil
17
+ allow(esxi).to receive(:run_command) {
18
+ CommandResult.new(:stdout => 'VMware Workstation', :exit_status => 0)
19
+ }
20
+ expect(esxi.detect).to be_nil
13
21
  end
14
- end
22
+ end
@@ -3,13 +3,13 @@ require 'specinfra/helper/detect_os/freebsd'
3
3
 
4
4
  describe Specinfra::Helper::DetectOs::Freebsd do
5
5
  freebsd = Specinfra::Helper::DetectOs::Freebsd.new(:exec)
6
- it 'Should return freebsd 8 when FreeBSD 8.2-RELEASE-p3 is installed.' do
6
+ it 'Should return freebsd 10 when FreeBSD 10.1-RELEASE is installed.' do
7
7
  allow(freebsd).to receive(:run_command) {
8
- CommandResult.new(:stdout => 'FreeBSD 8.2-RELEASE-p3', :exit_status => 0)
8
+ CommandResult.new(:stdout => 'FreeBSD 10.1--RELEASE', :exit_status => 0)
9
9
  }
10
10
  expect(freebsd.detect).to include(
11
11
  :family => 'freebsd',
12
- :release => '8'
12
+ :release => '10'
13
13
  )
14
14
  end
15
15
  it 'Should return freebsd 9 when FreeBSD 9.3-RELEASE is installed.' do
@@ -21,13 +21,22 @@ describe Specinfra::Helper::DetectOs::Freebsd do
21
21
  :release => '9'
22
22
  )
23
23
  end
24
- it 'Should return freebsd 10 when FreeBSD 10.1-RELEASE is installed.' do
24
+ it 'Should return freebsd 8 when FreeBSD 8.2-RELEASE-p3 is installed.' do
25
25
  allow(freebsd).to receive(:run_command) {
26
- CommandResult.new(:stdout => 'FreeBSD 10.1--RELEASE', :exit_status => 0)
26
+ CommandResult.new(:stdout => 'FreeBSD 8.2-RELEASE-p3', :exit_status => 0)
27
27
  }
28
28
  expect(freebsd.detect).to include(
29
29
  :family => 'freebsd',
30
- :release => '10'
30
+ :release => '8'
31
+ )
32
+ end
33
+ it 'Should return freebsd nil when FreeBSD FooBar is installed.' do
34
+ allow(freebsd).to receive(:run_command) {
35
+ CommandResult.new(:stdout => 'FreeBSD FooBar', :exit_status => 0)
36
+ }
37
+ expect(freebsd.detect).to include(
38
+ :family => 'freebsd',
39
+ :release => nil
31
40
  )
32
41
  end
33
42
  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.36.17
4
+ version: 2.36.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gosuke Miyashita
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-07 00:00:00.000000000 Z
11
+ date: 2015-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-scp