specinfra 2.82.12 → 2.82.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/specinfra/backend/powershell/support/is_port_listening.ps1 +2 -1
- data/lib/specinfra/backend/ssh.rb +8 -2
- data/lib/specinfra/command/darwin/base/file.rb +4 -0
- data/lib/specinfra/command/darwin/base/host.rb +1 -1
- data/lib/specinfra/version.rb +1 -1
- data/spec/command/darwin/host_spec.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4140ff67c6bbcbf8a39f69318942ebaa596d1e86
|
4
|
+
data.tar.gz: 728c324fd0b36d219c2d1d51af5daa74f6901db9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26c567c8c1a184ef52addfe2fd0d1b62e266445ce03ad5509a7539de359cc5229f56b2cf1e44235976e2eecc02fecc18068e72c5a885387dd9479e25b8fa9306
|
7
|
+
data.tar.gz: b85480d49c615c2a5bf66774d83adb6d5ecfd6f3383dda435a093908627f29a210ea51ff2e394ab4ff4927de8fe7851a4177febd5c13a3ec043acf9752a280e3
|
@@ -5,9 +5,10 @@ function IsPortListening
|
|
5
5
|
$networkIPs = (Get-WmiObject Win32_NetworkAdapterConfiguration | ? {$_.IPEnabled}) | %{ $_.IPAddress[0] }
|
6
6
|
[array] $networkIPs += "0.0.0.0"
|
7
7
|
[array] $networkIPs += "127.0.0.1"
|
8
|
+
[array] $networkIPs += "[::1]"
|
8
9
|
foreach ($ipaddress in $networkIPs)
|
9
10
|
{
|
10
|
-
$matchExpression = ("$ipaddress" + ":" + $portNumber)
|
11
|
+
$matchExpression = ("$ipaddress" + ":" + $portNumber + ".*LISTENING")
|
11
12
|
if ($protocol) { $matchExpression = ($protocol.toUpper() + "\s+$matchExpression") }
|
12
13
|
if ($netstatOutput -match $matchExpression) { return $true }
|
13
14
|
}
|
@@ -73,10 +73,16 @@ module Specinfra
|
|
73
73
|
end
|
74
74
|
|
75
75
|
def create_ssh
|
76
|
+
options = get_config(:ssh_options)
|
77
|
+
|
78
|
+
if !Net::SSH::VALID_OPTIONS.include?(:strict_host_key_checking)
|
79
|
+
options.delete(:strict_host_key_checking)
|
80
|
+
end
|
81
|
+
|
76
82
|
Net::SSH.start(
|
77
83
|
get_config(:host),
|
78
|
-
|
79
|
-
|
84
|
+
options[:user],
|
85
|
+
options
|
80
86
|
)
|
81
87
|
end
|
82
88
|
|
@@ -34,6 +34,10 @@ class Specinfra::Command::Darwin::Base::File < Specinfra::Command::Base::File
|
|
34
34
|
def get_mode(file)
|
35
35
|
"stat -f%Lp #{escape(file)}"
|
36
36
|
end
|
37
|
+
|
38
|
+
def get_size(file)
|
39
|
+
"stat -f %z #{escape(file)}"
|
40
|
+
end
|
37
41
|
|
38
42
|
def get_owner_user(file)
|
39
43
|
"stat -f %Su #{escape(file)}"
|
@@ -16,7 +16,7 @@ class Specinfra::Command::Darwin::Base::Host < Specinfra::Command::Base::Host
|
|
16
16
|
if port.nil?
|
17
17
|
"ping -t #{escape(timeout)} -c 2 -n #{escape(host)}"
|
18
18
|
else
|
19
|
-
"nc -vvvvz#{escape(proto[0].chr)} #{escape(host)} #{escape(port)} -w #{escape(timeout)}"
|
19
|
+
"nc -vvvvz#{escape(proto[0].chr)} #{escape(host)} #{escape(port)} -w #{escape(timeout)} -G #{escape(timeout)}"
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
data/lib/specinfra/version.rb
CHANGED
@@ -19,8 +19,8 @@ describe get_command(:check_host_is_reachable, 'pink.unicorn.com', nil, 'tcp', 1
|
|
19
19
|
it { should eq "ping -t 10 -c 2 -n pink.unicorn.com"}
|
20
20
|
end
|
21
21
|
|
22
|
-
describe get_command(:check_host_is_reachable, 'pink.unicorn.com', 53, 'udp', 66) do
|
23
|
-
it { should eq "nc -vvvvzu pink.unicorn.com 53 -w 66" }
|
22
|
+
describe get_command(:check_host_is_reachable, 'pink.unicorn.com', 53, 'udp', 66) do
|
23
|
+
it { should eq "nc -vvvvzu pink.unicorn.com 53 -w 66 -G 66" }
|
24
24
|
end
|
25
25
|
|
26
26
|
describe get_command(:get_host_ipaddress, 'pink.unicorn.com') do
|
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.82.
|
4
|
+
version: 2.82.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gosuke Miyashita
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-06-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-scp
|
@@ -629,7 +629,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
629
629
|
version: '0'
|
630
630
|
requirements: []
|
631
631
|
rubyforge_project:
|
632
|
-
rubygems_version: 2.
|
632
|
+
rubygems_version: 2.5.1
|
633
633
|
signing_key:
|
634
634
|
specification_version: 4
|
635
635
|
summary: Common layer for serverspec and itamae
|