specinfra 2.43.0 → 2.43.1

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: 1fe07b3ec871ed35a8bfbf4d77a056c3c3a8c0a4
4
- data.tar.gz: 4137b8fd9588bdd4d9c6b82c4495fbc5329c35b1
3
+ metadata.gz: 0f8ffc7591179d5e0341e7b56676dc0d68de2665
4
+ data.tar.gz: f8aaf49bd3eeaa8d6d0018e4573d15dc5f62cca6
5
5
  SHA512:
6
- metadata.gz: 2eb1e11b60d1fbab945161326d5659f1247d150185d4174ce3426a2de58a4d25fdcb1b9349f424f7cec163dbcb0366f48f9a4ad689b5d691a119c7a9ab0d61b1
7
- data.tar.gz: e09f478345dc4ec163342774f115dc6afcb6b19a1208b2b0965ac4b9c5612f0218b4b71296e6fc02db1fe6113f11fa1703c7d261196fa0d95f6c17cabe6d4413
6
+ metadata.gz: b45903b1ceb05f87cba69c61dc1720bd76596621ac7e94a4f918aa2c39fc4ceeca2e0bb01834a6a05460eb63992c6dcd509fd3544cb19c0c6b1dc88c6374b7b5
7
+ data.tar.gz: b5cf648975ec41fd7352586a762ffac9bb6506725579251ed1a81e9274f71d20bd8f4ee4c227869a9db21d4396dfdf0e8cfd849bf71b37ffb1d9864af784c2fa
@@ -36,5 +36,12 @@ class Specinfra::Command::Openbsd::Base::Interface < Specinfra::Command::Base::I
36
36
  "ifconfig #{interface} inet6 | grep 'inet6 #{ip_address}'"
37
37
  end
38
38
 
39
+ def get_link_state(interface)
40
+ # Checks if interfaces is administratively up by parsing the options.
41
+ # L1 check via status. Virtual interfaces like tapX missing the status will report up.
42
+ # Emulates operstate in linux with exception of the unknown status.
43
+ %Q{ifconfig #{interface} 2>&1 | awk -v s=down -F '[:<>,]' } +
44
+ %Q{'NR == 1 && $3 == "UP" { s="up" }; /status:/ && $2 != " active" { s="down" }; END{ print s }'}
45
+ end
39
46
  end
40
47
  end
@@ -1,3 +1,3 @@
1
1
  module Specinfra
2
- VERSION = "2.43.0"
2
+ VERSION = "2.43.1"
3
3
  end
@@ -3,6 +3,10 @@ require 'spec_helper'
3
3
  property[:os] = nil
4
4
  set :os, :family => 'openbsd'
5
5
 
6
+ describe get_command(:get_interface_speed_of, 'vio0') do
7
+ it { should eq "ifconfig vio0 | grep 'media\:' | perl -pe 's|.*media\:.*\\((.*?)\\)|\\1|'" }
8
+ end
9
+
6
10
  describe get_command(:check_interface_has_ipv6_address, 'vio0', '2001:0db8:bd05:01d2:288a:1fc0:0001:10ee') do
7
11
  it { should eq "ifconfig vio0 inet6 | grep 'inet6 2001:0db8:bd05:01d2:288a:1fc0:0001:10ee '" }
8
12
  end
@@ -26,3 +30,9 @@ end
26
30
  describe get_command(:check_interface_has_ipv4_address, 'vio0', '192.168.0.123/24') do
27
31
  it { should eq "ifconfig vio0 inet | grep 'inet 192\\.168\\.0\\.123 '" }
28
32
  end
33
+
34
+ describe get_command(:get_interface_link_state, 'vio0') do
35
+ it do should eq %Q{ifconfig vio0 2>&1 | awk -v s=down -F '[:<>,]' } +
36
+ %Q{'NR == 1 && $3 == "UP" { s="up" }; /status:/ && $2 != " active" { s="down" }; END{ print s }'}
37
+ end
38
+ 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.43.0
4
+ version: 2.43.1
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-08-29 00:00:00.000000000 Z
11
+ date: 2015-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-scp
@@ -626,3 +626,4 @@ test_files:
626
626
  - spec/host_inventory/openbsd/filesystem_spec.rb
627
627
  - spec/host_inventory/solaris/filesystem_spec.rb
628
628
  - spec/spec_helper.rb
629
+ has_rdoc: