serverspec-runner 1.1.8 → 1.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -11
- data/Rakefile +2 -4
- data/lib/serverspec-runner/util/hash.rb +13 -0
- data/lib/serverspec-runner/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26cbd7ddb81935a654b0bd87ac49a2d91ca4e199
|
4
|
+
data.tar.gz: c10302a87857547e9d122a581a6fae66067a8502
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5467ca5d527762709dbef2903765487e0d2232724275814ccc909cd665f05064af885a751be33915a27a07f19d9f5938edb18bdd8e9c3c55ea070151fc77c8cf
|
7
|
+
data.tar.gz: da79a445f3ffafd13143e36c46baa64f0a03891eb6ecaa0026712bea22079c077aa4f65ddd970d84543fec415f22abf0d43776e011816dc5790582054f6d1f7b
|
data/README.md
CHANGED
@@ -24,21 +24,22 @@ Edit your [spec-files](http://serverspec.org/resource_types.html).
|
|
24
24
|
Edit your infrastructure or middleware tests scenario to "scenario.yml".
|
25
25
|
|
26
26
|
```
|
27
|
-
test_top_dir:
|
28
|
-
:
|
29
|
-
test_bottom_dir:
|
30
|
-
- servername
|
27
|
+
test_top_dir: # test directory top
|
28
|
+
: # test hierarchy directories
|
29
|
+
test_bottom_dir: # test directory bottom
|
30
|
+
- servername # ssh-accessible ip address or fqdn. or alias
|
31
31
|
- :
|
32
32
|
- :
|
33
33
|
:
|
34
34
|
---
|
35
|
-
servername:
|
36
|
-
host: 192.168.0.11
|
37
|
-
ssh_opts:
|
38
|
-
port: 22
|
39
|
-
user: "anyone"
|
40
|
-
|
41
|
-
|
35
|
+
servername: # alias name(not required)
|
36
|
+
host: 192.168.0.11 # ssh-accessible ip address or fqdn(required if alias exist)
|
37
|
+
ssh_opts: # ssh options(not required)
|
38
|
+
port: 22 # ssh port option(not required)
|
39
|
+
user: "anyone" # ssh user option(not required)
|
40
|
+
keys: ["~/.ssh/id_rsa"] # ssh private keys option(not required)
|
41
|
+
: # any other Net::SSH Options(not required)
|
42
|
+
any_attribute: "aaa" # host attributes. this example available to get "property[:any_attribute]" from your codes(not required)
|
42
43
|
:
|
43
44
|
:
|
44
45
|
```
|
data/Rakefile
CHANGED
@@ -6,6 +6,7 @@ require 'fileutils'
|
|
6
6
|
require 'net/ssh'
|
7
7
|
require 'open-uri'
|
8
8
|
require 'serverspec-runner'
|
9
|
+
require 'serverspec-runner/util/hash'
|
9
10
|
|
10
11
|
desc "Run serverspec to all scenario"
|
11
12
|
task :spec => 'spec:all'
|
@@ -159,10 +160,7 @@ namespace :spec do
|
|
159
160
|
scenarios = data
|
160
161
|
else
|
161
162
|
data.each do |k, v|
|
162
|
-
platform[k.to_sym] =
|
163
|
-
v.each do |kk, vv|
|
164
|
-
platform[k.to_sym][kk.to_sym] = vv
|
165
|
-
end
|
163
|
+
platform[k.to_sym] = v.deep_symbolize_keys
|
166
164
|
end
|
167
165
|
end
|
168
166
|
end
|
@@ -2,4 +2,17 @@ class Hash
|
|
2
2
|
def depth
|
3
3
|
1 + (values.map{|v| Hash === v ? v.depth : 1}.max)
|
4
4
|
end
|
5
|
+
|
6
|
+
def deep_symbolize_keys
|
7
|
+
self.each_with_object({}) do |(k, v), h|
|
8
|
+
|
9
|
+
if v.is_a?(Array)
|
10
|
+
v = v.map{|vv| vv.deep_symbolize_keys}
|
11
|
+
elsif v.is_a?(Hash)
|
12
|
+
v = v.deep_symbolize_keys
|
13
|
+
end
|
14
|
+
|
15
|
+
h[k.to_s.to_sym] = v
|
16
|
+
end
|
17
|
+
end
|
5
18
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: serverspec-runner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- hiracy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-04-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: serverspec
|