serverspec 0.14.4 → 0.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/serverspec/type/cgroup.rb +1 -1
- data/lib/serverspec/type/command.rb +6 -6
- data/lib/serverspec/type/default_gateway.rb +2 -2
- data/lib/serverspec/type/file.rb +1 -1
- data/lib/serverspec/type/interface.rb +1 -1
- data/lib/serverspec/type/linux_kernel_parameter.rb +1 -1
- data/lib/serverspec/type/package.rb +1 -1
- data/lib/serverspec/type/php_config.rb +1 -1
- data/lib/serverspec/type/process.rb +2 -2
- data/lib/serverspec/version.rb +1 -1
- data/serverspec.gemspec +1 -1
- data/spec/spec_helper.rb +7 -15
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3cc50787ae240d064c0e341a21d4cf65c2b2b3e4
|
4
|
+
data.tar.gz: c32f7dcc3513b788bc938f192626d950420aad4b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26aa8da0bf28a3cbc26b7bf1a9ca727649d6c40e8d460fbd0e1538ed827cbc067c3b0e444d5a71093ef0f5b40d92272251c9b1a76868803928e4708b5f658c21
|
7
|
+
data.tar.gz: f3505fc995a4856f1ef838cac007c2668d3b960f00e17fb07d3df2a5ebdac3d5c5748efc76a48f2e441bd271272c53c57efc894320b5399fed98fbac4765a1e2
|
@@ -6,9 +6,9 @@ module Serverspec
|
|
6
6
|
def return_stdout?(content)
|
7
7
|
ret = backend.run_command(@name)
|
8
8
|
if content.instance_of?(Regexp)
|
9
|
-
ret
|
9
|
+
ret.stdout =~ content
|
10
10
|
else
|
11
|
-
ret
|
11
|
+
ret.stdout.strip == content
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
@@ -18,20 +18,20 @@ module Serverspec
|
|
18
18
|
# See http://stackoverflow.com/questions/7937651/receiving-extended-data-with-ssh-using-twisted-conch-as-client
|
19
19
|
# So I use stdout instead of stderr
|
20
20
|
if content.instance_of?(Regexp)
|
21
|
-
ret
|
21
|
+
ret.stdout =~ content
|
22
22
|
else
|
23
|
-
ret
|
23
|
+
ret.stdout.strip == content
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
27
|
def return_exit_status?(status)
|
28
28
|
ret = backend.run_command(@name)
|
29
|
-
ret
|
29
|
+
ret.exit_status.to_i == status
|
30
30
|
end
|
31
31
|
|
32
32
|
def stdout
|
33
33
|
if @result.nil?
|
34
|
-
@result = backend.run_command(@name)
|
34
|
+
@result = backend.run_command(@name).stdout
|
35
35
|
end
|
36
36
|
@result
|
37
37
|
end
|
@@ -3,13 +3,13 @@ module Serverspec
|
|
3
3
|
class DefaultGateway < Base
|
4
4
|
def ipaddress
|
5
5
|
ret = backend.run_command(commands.check_routing_table('default'))
|
6
|
-
ret
|
6
|
+
ret.stdout =~ /^(\S+)(?: via (\S+))? dev (\S+).+(?:\r)?\n(?:default via (\S+))?/
|
7
7
|
$2 ? $2 : $4
|
8
8
|
end
|
9
9
|
|
10
10
|
def interface
|
11
11
|
ret = backend.run_command(commands.check_routing_table('default'))
|
12
|
-
ret
|
12
|
+
ret.stdout =~ /^(\S+)(?: via (\S+))? dev (\S+).+(?:\r)?\n(?:default via (\S+))?/
|
13
13
|
$3
|
14
14
|
end
|
15
15
|
|
data/lib/serverspec/type/file.rb
CHANGED
@@ -3,7 +3,7 @@ module Serverspec
|
|
3
3
|
class Process < Base
|
4
4
|
|
5
5
|
def running?
|
6
|
-
pid = backend.run_command(commands.get_process(@name, :format => "pid="))
|
6
|
+
pid = backend.run_command(commands.get_process(@name, :format => "pid=")).stdout
|
7
7
|
not pid.empty?
|
8
8
|
end
|
9
9
|
|
@@ -21,7 +21,7 @@ module Serverspec
|
|
21
21
|
|
22
22
|
def get_column(keyword)
|
23
23
|
ret = backend.run_command(commands.get_process(@name, :format => "#{keyword}="))
|
24
|
-
val = ret
|
24
|
+
val = ret.stdout.strip
|
25
25
|
val = val.to_i if val.match(/^\d+$/)
|
26
26
|
val
|
27
27
|
end
|
data/lib/serverspec/version.rb
CHANGED
data/serverspec.gemspec
CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.add_runtime_dependency "net-ssh"
|
22
22
|
spec.add_runtime_dependency "rspec", ">= 2.13.0"
|
23
23
|
spec.add_runtime_dependency "highline"
|
24
|
-
spec.add_runtime_dependency "specinfra", ">= 0.
|
24
|
+
spec.add_runtime_dependency "specinfra", ">= 0.5.0"
|
25
25
|
spec.add_development_dependency "bundler", "~> 1.3"
|
26
26
|
spec.add_development_dependency "rake"
|
27
27
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -17,21 +17,13 @@ module SpecInfra
|
|
17
17
|
@example.metadata[:subject].set_command(cmd)
|
18
18
|
end
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
else
|
28
|
-
{
|
29
|
-
:stdout => ::SpecInfra.configuration.stdout,
|
30
|
-
:stderr => ::SpecInfra.configuration.stderr,
|
31
|
-
:exit_status => 0,
|
32
|
-
:exit_signal => nil
|
33
|
-
}
|
34
|
-
end
|
20
|
+
CommandResult.new({
|
21
|
+
:stdout => ::SpecInfra.configuration.stdout,
|
22
|
+
:stderr => ::SpecInfra.configuration.stderr,
|
23
|
+
:exit_status => cmd =~ /invalid/ ? 1 : 0,
|
24
|
+
:exit_signal => nil,
|
25
|
+
})
|
26
|
+
|
35
27
|
end
|
36
28
|
end
|
37
29
|
[Exec, Ssh, Cmd, WinRM].each do |clz|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: serverspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.15.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gosuke Miyashita
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-01-
|
11
|
+
date: 2014-01-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-ssh
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.
|
61
|
+
version: 0.5.0
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - '>='
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 0.
|
68
|
+
version: 0.5.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: bundler
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|