serverspec 2.27.0 → 2.28.0

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: 24ae6971b1873b798e371b2d25b1f9a7928595a6
4
- data.tar.gz: 1643e2cfa19d128d89c7715f59d5ba2e2ccbc7f8
3
+ metadata.gz: 1db17cecc7c750c354f720930fa66610cb9d0568
4
+ data.tar.gz: b348abe2ecda5705cf5ed9ccdc5e02cf18f4297a
5
5
  SHA512:
6
- metadata.gz: c7d0b8684112e5cbb3e5ecc0b888350fd1b821810ac8178a504de4b43d0b0b46d07fd16979c07c60daa8c050f709cb602ec22ea3762f2c3cb4540963fd5281d5
7
- data.tar.gz: ef5ce36e32e086b52ca9fd3dc15f4c7b1b7c44bdd734dfcdce322f03e315b74b92fde85fe32b1d49f6336085e5acce98ea458279d253d59775d4ad123c2cbbfa
6
+ metadata.gz: 032c4a130bb9663420fcc22511a39db94942d89c023aa002a28c5a8e8b2df6517cc69fc5924aef563371bea15032b9fec7e6ae6e4e97335a183179b046408170
7
+ data.tar.gz: 07ff02c9b6e6e410c2bb8125880c5f4a21b8efe8117948c13f0ea6774d36c0cecd40c84f2f3db03e76505f48bd4e3ae134ec67411bde173486499550aab1f55d
@@ -6,9 +6,12 @@ module Serverspec::Type
6
6
 
7
7
  def speed
8
8
  ret = @runner.get_interface_speed_of(@name)
9
- val = ret.stdout.strip
10
- val = val.to_i if val.match(/^\d+$/)
11
- val
9
+ val_to_integer(ret)
10
+ end
11
+
12
+ def mtu
13
+ ret = @runner.get_interface_mtu_of(@name)
14
+ val_to_integer(ret)
12
15
  end
13
16
 
14
17
  def has_ipv4_address?(ip_address)
@@ -23,5 +26,14 @@ module Serverspec::Type
23
26
  ret = @runner.get_interface_link_state(@name)
24
27
  ret.stdout.strip == 'up'
25
28
  end
29
+
30
+ private
31
+
32
+ def val_to_integer(ret)
33
+ val = ret.stdout.strip
34
+ val = val.to_i if val.match(/^\d+$/)
35
+ val
36
+ end
37
+
26
38
  end
27
39
  end
@@ -1,3 +1,3 @@
1
1
  module Serverspec
2
- VERSION = "2.27.0"
2
+ VERSION = "2.28.0"
3
3
  end
data/serverspec.gemspec CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
21
21
  spec.add_runtime_dependency "rspec", "~> 3.0"
22
22
  spec.add_runtime_dependency "rspec-its"
23
23
  spec.add_runtime_dependency "multi_json"
24
- spec.add_runtime_dependency "specinfra", "~> 2.46"
24
+ spec.add_runtime_dependency "specinfra", "~> 2.48"
25
25
  spec.add_development_dependency "bundler", "~> 1.3"
26
26
  spec.add_development_dependency("json", "~> 1.8") if RUBY_VERSION < "1.9"
27
27
  spec.add_development_dependency "rake", "~> 10.1.1"
@@ -7,6 +7,11 @@ describe interface('eth0') do
7
7
  its(:speed) { should eq 1000 }
8
8
  end
9
9
 
10
+ describe interface('eth0') do
11
+ let(:stdout) { '1500' }
12
+ its(:mtu) { should eq 1500 }
13
+ end
14
+
10
15
  describe interface('eth0') do
11
16
  it { should have_ipv4_address('192.168.10.10') }
12
17
  end
@@ -28,3 +33,9 @@ describe interface('invalid-interface') do
28
33
  let(:stdout) { '1000' }
29
34
  its(:speed) { should_not eq 100 }
30
35
  end
36
+
37
+ describe interface('invalid-interface') do
38
+ let(:stdout) { '9001' }
39
+ its(:mtu) { should_not eq 1500 }
40
+ end
41
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: serverspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.27.0
4
+ version: 2.28.0
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-12-29 00:00:00.000000000 Z
11
+ date: 2016-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '2.46'
61
+ version: '2.48'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '2.46'
68
+ version: '2.48'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: bundler
71
71
  requirement: !ruby/object:Gem::Requirement