specinfra 2.68.1 → 2.68.2
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 +4 -4
- data/lib/specinfra/command.rb +4 -0
- data/lib/specinfra/command/freebsd/base/interface.rb +8 -0
- data/lib/specinfra/command/freebsd/base/routing_table.rb +1 -1
- data/lib/specinfra/command/freebsd/v11.rb +2 -0
- data/lib/specinfra/command/freebsd/v11/interface.rb +11 -0
- data/lib/specinfra/version.rb +1 -1
- data/spec/command/freebsd/interface_spec.rb +8 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e514d3dccccb34aa3f143aa347df698c54e2cd3
|
4
|
+
data.tar.gz: 12a6031b637634edb96301a41778849e14bcabb0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b505ccdb51eb73353fe88503c1aa000678e3a4faf2af9a33f5263f2160547262604e837ad5452bbecea93717b76d05560b37fe667051940488ecfc7b4820e8c0
|
7
|
+
data.tar.gz: 00c1e89ac104430096e2a655ff1f201f97fe1a575534efc032ea5b3f568fd9e686b1b991d3ddea10ec4eae18d3a8da3fcbbe4b4ffd1dd21ab9b1ae6518565e1f
|
data/lib/specinfra/command.rb
CHANGED
@@ -266,6 +266,10 @@ require 'specinfra/command/freebsd/v8/package'
|
|
266
266
|
require 'specinfra/command/freebsd/v9'
|
267
267
|
require 'specinfra/command/freebsd/v9/package'
|
268
268
|
|
269
|
+
# FreeBSD V11 (inherit FreeBSD)
|
270
|
+
require 'specinfra/command/freebsd/v11'
|
271
|
+
require 'specinfra/command/freebsd/v11/interface'
|
272
|
+
|
269
273
|
# OpenBSD (inherit Base)
|
270
274
|
require 'specinfra/command/openbsd'
|
271
275
|
require 'specinfra/command/openbsd/base'
|
@@ -4,6 +4,14 @@ class Specinfra::Command::Freebsd::Base::Interface < Specinfra::Command::Base::I
|
|
4
4
|
"ifconfig #{name}"
|
5
5
|
end
|
6
6
|
|
7
|
+
def get_speed_of(name)
|
8
|
+
"ifconfig #{name} | awk '/media:/{if(match($0,/[0-9]+/)){ print substr($0, RSTART, RLENGTH);}}'"
|
9
|
+
end
|
10
|
+
|
11
|
+
def get_mtu_of(name)
|
12
|
+
"ifconfig #{name} | awk '/mtu /{print $NF}'"
|
13
|
+
end
|
14
|
+
|
7
15
|
def check_has_ipv4_address(interface, ip_address)
|
8
16
|
ip_address = ip_address.dup
|
9
17
|
if ip_address =~ /\/\d+$/
|
@@ -1,7 +1,7 @@
|
|
1
1
|
class Specinfra::Command::Freebsd::Base::RoutingTable < Specinfra::Command::Base::RoutingTable
|
2
2
|
class << self
|
3
3
|
def check_has_entry(destination)
|
4
|
-
%Q{netstat -rnW | grep #{destination} | awk '{print $1, "via", $2, "dev", $
|
4
|
+
%Q{netstat -rnW | grep #{destination} | awk '{print $1, "via", $2, "dev", $6, " "}'}
|
5
5
|
end
|
6
6
|
|
7
7
|
alias :get_entry :check_has_entry
|
@@ -0,0 +1,11 @@
|
|
1
|
+
class Specinfra::Command::Freebsd::V11::Interface < Specinfra::Command::Freebsd::Base::Interface
|
2
|
+
class << self
|
3
|
+
def get_ipv4_address(interface)
|
4
|
+
"ifconfig -f inet:cidr #{interface} inet | awk '/inet /{print $2}'"
|
5
|
+
end
|
6
|
+
|
7
|
+
def get_ipv6_address(interface)
|
8
|
+
"ifconfig -f inet6:cidr #{interface} inet6 | awk '/inet6 /{print $2}' | tail -1"
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
data/lib/specinfra/version.rb
CHANGED
@@ -38,3 +38,11 @@ end
|
|
38
38
|
describe get_command(:get_interface_link_state, 'vtnet0') do
|
39
39
|
it { should eq %Q{ifconfig -u vtnet0 2>&1 | awk -v s=up '/status:/ && $2 != "active" { s="down" }; END {print s}'} }
|
40
40
|
end
|
41
|
+
|
42
|
+
describe get_command(:get_interface_speed_of, 'vtnet0') do
|
43
|
+
it { should eq "ifconfig vtnet0 | awk '/media:/{if(match($0,/[0-9]+/)){ print substr($0, RSTART, RLENGTH);}}'" }
|
44
|
+
end
|
45
|
+
|
46
|
+
describe get_command(:get_interface_mtu_of, 'vtnet0') do
|
47
|
+
it { should eq "ifconfig vtnet0 | awk '/mtu /{print $NF}'" }
|
48
|
+
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.68.
|
4
|
+
version: 2.68.2
|
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-
|
11
|
+
date: 2017-07-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-scp
|
@@ -307,6 +307,8 @@ files:
|
|
307
307
|
- lib/specinfra/command/freebsd/base/service.rb
|
308
308
|
- lib/specinfra/command/freebsd/base/user.rb
|
309
309
|
- lib/specinfra/command/freebsd/base/zfs.rb
|
310
|
+
- lib/specinfra/command/freebsd/v11.rb
|
311
|
+
- lib/specinfra/command/freebsd/v11/interface.rb
|
310
312
|
- lib/specinfra/command/freebsd/v6.rb
|
311
313
|
- lib/specinfra/command/freebsd/v6/package.rb
|
312
314
|
- lib/specinfra/command/freebsd/v6/user.rb
|