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 +4 -4
- data/lib/serverspec/type/interface.rb +15 -3
- data/lib/serverspec/version.rb +1 -1
- data/serverspec.gemspec +1 -1
- data/spec/type/linux/interface_spec.rb +11 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1db17cecc7c750c354f720930fa66610cb9d0568
|
4
|
+
data.tar.gz: b348abe2ecda5705cf5ed9ccdc5e02cf18f4297a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
10
|
-
|
11
|
-
|
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
|
data/lib/serverspec/version.rb
CHANGED
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.
|
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.
|
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:
|
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.
|
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.
|
68
|
+
version: '2.48'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: bundler
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|