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 +4 -4
- data/lib/specinfra/command/darwin/base/port.rb +13 -2
- data/lib/specinfra/version.rb +1 -1
- data/spec/command/darwin/port_spec.rb +12 -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: b9887f235ce373dcd861206f18418c363c202465
|
4
|
+
data.tar.gz: 6c122064efb934b72cf1f0b86df97f457797cbbc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
5
|
-
|
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
|
data/lib/specinfra/version.rb
CHANGED
@@ -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.
|
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-
|
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
|