specinfra 2.68.1 → 2.68.2

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: d1f0b60920db70d274d23dfc93c811b4634f8c31
4
- data.tar.gz: fa138de8df8ed9b15724763b7850a3c360b80eb4
3
+ metadata.gz: 1e514d3dccccb34aa3f143aa347df698c54e2cd3
4
+ data.tar.gz: 12a6031b637634edb96301a41778849e14bcabb0
5
5
  SHA512:
6
- metadata.gz: 9ea055c9995281b54f52eecb8bc2e72b2eecfb26f8ce9f9b88f275d6c55880fd1df5ef7095e23cabffbb661a3f5a9e9a42cb2d5f907f79ce6476806e4e805c2e
7
- data.tar.gz: e437959c39a62e2a9f06f2d118f55c1e1f35cf151decb9e973fa0b50399bde688dc6074a4c3332cbadff4286cb9431ab8f0b4bc678e9bacc47958be3f2c95ea5
6
+ metadata.gz: b505ccdb51eb73353fe88503c1aa000678e3a4faf2af9a33f5263f2160547262604e837ad5452bbecea93717b76d05560b37fe667051940488ecfc7b4820e8c0
7
+ data.tar.gz: 00c1e89ac104430096e2a655ff1f201f97fe1a575534efc032ea5b3f568fd9e686b1b991d3ddea10ec4eae18d3a8da3fcbbe4b4ffd1dd21ab9b1ae6518565e1f
@@ -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", $7, " "}'}
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,2 @@
1
+ class Specinfra::Command::Freebsd::V11 < Specinfra::Command::Freebsd::Base
2
+ end
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Specinfra
2
- VERSION = "2.68.1"
2
+ VERSION = "2.68.2"
3
3
  end
@@ -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.1
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-06-26 00:00:00.000000000 Z
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