specinfra 2.59.3 → 2.59.4

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: a3083cf7aa58957df086160ab4f894fdfbae0afe
4
- data.tar.gz: c2939af0a93a5332352e82210616e39976286df0
3
+ metadata.gz: b9887f235ce373dcd861206f18418c363c202465
4
+ data.tar.gz: 6c122064efb934b72cf1f0b86df97f457797cbbc
5
5
  SHA512:
6
- metadata.gz: 6ee5f7ee68a8a1937574afa5e6106091b936eebb08fab8ec4bbd6490e0aefb4aaaae5d4dedff2d601aaade7f04c93130462a84c01655884b0c5f255449ec17a1
7
- data.tar.gz: c3798838df76dcee83b0fef17a34e850fb0a806b6f99af7292e1ff70bf3d339be953675d44d4e3b7e857ffd23c6e6f71cd29cac680cc8d821c0b08e3e77d41a8
6
+ metadata.gz: aa82e2ee4e5ec0d40717539286aecd462b590821b777151c62e78d659c299ca84bc20abeb068b029966ed3e454026ad668cdba20fa8fb6e931ee14773e6a2a67
7
+ data.tar.gz: c3503491951e2de9a0df2b8b829c62e8a213a71457b77c881fcf20ef603d9910d84ee8ce61930ff361a4be2332301ed5dc4a62f315b43ff12abc4d78e6d244ec
@@ -1,8 +1,19 @@
1
1
  class Specinfra::Command::Darwin::Base::Port < Specinfra::Command::Base::Port
2
2
  class << self
3
3
  def check_is_listening(port, options={})
4
- regexp = ":#{port} "
5
- "lsof -nP -iTCP -sTCP:LISTEN | grep -- #{escape(regexp)}"
4
+ regexp = ":#{port} "
5
+ protocol = options[:protocol] || 'tcp'
6
+ protocol_options = case protocol
7
+ when 'tcp'
8
+ "-iTCP -sTCP:LISTEN"
9
+ when 'tcp6'
10
+ "-i6TCP -sTCP:LISTEN"
11
+ when 'udp'
12
+ "-iUDP"
13
+ when 'udp6'
14
+ "-i6UDP"
15
+ end
16
+ "lsof -nP #{protocol_options} | grep -- #{escape(regexp)}"
6
17
  end
7
18
  end
8
19
  end
@@ -1,3 +1,3 @@
1
1
  module Specinfra
2
- VERSION = "2.59.3"
2
+ VERSION = "2.59.4"
3
3
  end
@@ -0,0 +1,12 @@
1
+ require 'spec_helper'
2
+
3
+ property[:os] = nil
4
+ set :os, :family => 'darwin'
5
+
6
+ describe get_command(:check_port_is_listening, '80') do
7
+ it { should eq 'lsof -nP -iTCP -sTCP:LISTEN | grep -- :80\ ' }
8
+ end
9
+
10
+ describe get_command(:check_port_is_listening, '80', :protocol => 'udp') do
11
+ it { should eq 'lsof -nP -iUDP | grep -- :80\ ' }
12
+ 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.59.3
4
+ version: 2.59.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gosuke Miyashita
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-23 00:00:00.000000000 Z
11
+ date: 2016-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-scp
@@ -520,6 +520,7 @@ files:
520
520
  - spec/command/darwin/file_spec.rb
521
521
  - spec/command/darwin/host_spec.rb
522
522
  - spec/command/darwin/interface_spec.rb
523
+ - spec/command/darwin/port_spec.rb
523
524
  - spec/command/darwin/process_spec.rb
524
525
  - spec/command/darwin/user_spec.rb
525
526
  - spec/command/debian/service_spec.rb
@@ -633,6 +634,7 @@ test_files:
633
634
  - spec/command/darwin/file_spec.rb
634
635
  - spec/command/darwin/host_spec.rb
635
636
  - spec/command/darwin/interface_spec.rb
637
+ - spec/command/darwin/port_spec.rb
636
638
  - spec/command/darwin/process_spec.rb
637
639
  - spec/command/darwin/user_spec.rb
638
640
  - spec/command/debian/service_spec.rb