specinfra 2.43.2 → 2.43.3

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: 3ba5e509312bc453ede783a0444e76483d5e8e93
4
- data.tar.gz: 3502f86d6b5127387d4eb8003a5723436d1b7194
3
+ metadata.gz: 95b470a3c79b70d4ad58ea8f7e7fc91b39479a7b
4
+ data.tar.gz: 13898b2f4af620e05d1377fab1c1c65f0ab7945c
5
5
  SHA512:
6
- metadata.gz: 53e34b71036e7d22cbb24bdd7255670191017198c55e239f61e0a00d1c9cc603bf8f1ba6f8ae468e2fac18df397933937d3eb8d1175b11e59aa123baaafa4e5d
7
- data.tar.gz: 9aaeb553165501eab0953caeab9bae0af6571e07feb2705d758c2ce54bf92a85f5942fcd5de1778d20fc739993db81a1ef09c850f4249dfe4d314a98aad11e3e
6
+ metadata.gz: e7a5dffb749f8d90fb700c3b01fb350b3baf07af22b51705758fe3b277884fa3107ac004541579176e8fcf97cded126934ba9f1d1643ef2cfdfacc2c006661f3
7
+ data.tar.gz: 81ed9e06277284cacc36ab274c2fd8ceb20a18756b2027ed9549db5cd719c9373575535bcbbfde04e064c566bf8d560431e176b7367e0447abdec0674b520301
@@ -33,19 +33,10 @@ class Specinfra::Command::Freebsd::Base::Interface < Specinfra::Command::Base::I
33
33
  end
34
34
 
35
35
  def get_link_state(interface)
36
- str = %Q{ ifconfig #{interface} link | \
37
- awk '/flags/{ \
38
- split($0,line,/ /) ; \
39
- split(line[2],flags,/[,<>]/); \
40
- for (idx in flags) { \
41
- if (flags[idx] == "UP"){ \
42
- print "up"; \
43
- exit 0 ; \
44
- } \
45
- }; \
46
- print "down"; \
47
- }'}
48
- str
36
+ # Checks if interfaces is administratively up with the -u arg.
37
+ # L1 check via status. Virtual interfaces like tapX missing the status will report up.
38
+ # Emulates operstate in linux with exception of the unknown status.
39
+ %Q{ifconfig -u #{interface} 2>&1 | awk -v s=up '/status:/ && $2 != "active" { s="down" }; END {print s}'}
49
40
  end
50
41
  end
51
42
  end
@@ -1,3 +1,3 @@
1
1
  module Specinfra
2
- VERSION = "2.43.2"
2
+ VERSION = "2.43.3"
3
3
  end
@@ -26,3 +26,7 @@ end
26
26
  describe get_command(:check_interface_has_ipv4_address, 'vtnet0', '192.168.0.123/24') do
27
27
  it { should eq "ifconfig vtnet0 inet | grep 'inet 192\\.168\\.0\\.123 '" }
28
28
  end
29
+
30
+ describe get_command(:get_interface_link_state, 'vtnet0') do
31
+ it { should eq %Q{ifconfig -u vtnet0 2>&1 | awk -v s=up '/status:/ && $2 != "active" { s="down" }; END {print s}'} }
32
+ 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.2
4
+ version: 2.43.3
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-09-07 00:00:00.000000000 Z
11
+ date: 2015-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-scp
@@ -626,4 +626,3 @@ 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: