serverspec-runner 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -5
- data/Rakefile +0 -1
- data/lib/serverspec-runner/version.rb +1 -1
- data/serverspec-runner.gemspec +2 -2
- data/spec/example/default.rb +1 -1
- data/spec/spec_helper.rb +2 -8
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de02cac0480ebd0499fbf20db6a505293761e942
|
4
|
+
data.tar.gz: b8db8e52b61dc74a9c433a923f8ce8b967edb20b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c24c72fba9a8d2b91c7fe00fc30fc573692f84a901c2ec1729b6b13b21ae63148f28537827c94b2b6da8386d4acbee7c77a29ccced23757614316e035c298707
|
7
|
+
data.tar.gz: cd7d1b854da9b2e064784095347590e4bc7f946c64e87a6a8f57d73efd441b473a93304abed0e3bcfdbbee23eeae9189c8a757856ef0b767cf8037eede4fe7a1
|
data/README.md
CHANGED
@@ -19,13 +19,13 @@ initialize spec direcotries and create skeleton-specfiles.
|
|
19
19
|
|
20
20
|
Edit your [spec-files](http://serverspec.org/resource_types.html).
|
21
21
|
|
22
|
-
$ vim /path/to/your_serverspec_root/test_name/
|
22
|
+
$ vim /path/to/your_serverspec_root/test_name/test_sub_name/your_serverspec_test.rb
|
23
23
|
|
24
24
|
Edit your infrastructure or middleware tests scenario to "scenario.yml".
|
25
25
|
|
26
26
|
```
|
27
|
-
test_name: # test directory name
|
28
|
-
|
27
|
+
test_name: # test directory name
|
28
|
+
test_sub_name: # test sub directory name(not required)
|
29
29
|
- servername # ssh-accessible ip address or fqdn. or alias
|
30
30
|
- :
|
31
31
|
- :
|
@@ -33,7 +33,11 @@ test_name: # test directory name(required)
|
|
33
33
|
---
|
34
34
|
servername: # alias name(not required)
|
35
35
|
host: 192.168.0.11 # ssh-accessible ip address or fqdn(required if alias exist)
|
36
|
-
|
36
|
+
ssh_opts: # ssh options(not required)
|
37
|
+
port: 22 # ssh port option(not required)
|
38
|
+
user: "anyone" # ssh user option(not required)
|
39
|
+
: # any other Net::SSH Options(not required)
|
40
|
+
any_attribute: "aaa" # host attributes. left example available to get "property[:servername][:any_attribute]" from code(not required)
|
37
41
|
:
|
38
42
|
:
|
39
43
|
```
|
@@ -42,7 +46,11 @@ do tests.
|
|
42
46
|
|
43
47
|
$ serverspec-runner -r /path/to/your_serverspec_root -s /path/to/your_scenario.yml
|
44
48
|
|
45
|
-
|
49
|
+
or
|
50
|
+
|
51
|
+
$ cd /path/to/your_serverspec_root && serverspec-runner
|
52
|
+
|
53
|
+
You can also specify [ssh_options.yml](http://net-ssh.github.io/ssh/v2/api/classes/Net/SSH/Config.html)(Net::SSH options) file by "-o" option for default ssh options.
|
46
54
|
|
47
55
|
$ serverspec-runner -s /path/to/your_scenario.yml -o /path/to/your_ssh_options.yml
|
48
56
|
|
data/Rakefile
CHANGED
data/serverspec-runner.gemspec
CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.add_runtime_dependency "serverspec"
|
22
22
|
spec.add_runtime_dependency "net-ssh"
|
23
23
|
spec.add_runtime_dependency "net-ssh-shell"
|
24
|
-
spec.
|
25
|
-
spec.
|
24
|
+
spec.add_development_dependency "rake"
|
25
|
+
spec.add_development_dependency "rspec-core"
|
26
26
|
spec.add_development_dependency "bundler", "~> 1.3"
|
27
27
|
end
|
data/spec/example/default.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -5,7 +5,7 @@ require 'yaml'
|
|
5
5
|
require 'csv'
|
6
6
|
require 'serverspec-runner/util/hash'
|
7
7
|
|
8
|
-
|
8
|
+
set :backend, :exec
|
9
9
|
|
10
10
|
ssh_opts_default = YAML.load_file(ENV['ssh_options'])
|
11
11
|
csv_path = ENV['result_csv']
|
@@ -37,19 +37,13 @@ RSpec.configure do |c|
|
|
37
37
|
|
38
38
|
set_property (YAML.load_file(ENV['platforms_tmp']))[ENV['TARGET_HOST'].to_sym]
|
39
39
|
|
40
|
-
if ENV['TARGET_SSH_HOST']
|
41
|
-
include Serverspec::Helper::Exec
|
42
|
-
c.os = backend(Serverspec::Commands::Base).check_os
|
43
|
-
else
|
44
|
-
include SpecInfra::Helper::Ssh
|
45
|
-
|
40
|
+
if ENV['TARGET_SSH_HOST'] !~ /localhost|127\.0\.0\.1/
|
46
41
|
c.host = ENV['TARGET_SSH_HOST']
|
47
42
|
options = Net::SSH::Config.for(c.host, files=["~/.ssh/config"])
|
48
43
|
ssh_opts ||= ssh_opts_default
|
49
44
|
property[:ssh_opts].each { |k, v| ssh_opts[k.to_sym] = v } if property[:ssh_opts]
|
50
45
|
user = options[:user] || ssh_opts[:user] || Etc.getlogin
|
51
46
|
c.ssh = Net::SSH.start(c.host, user, options.merge(ssh_opts))
|
52
|
-
c.os = backend.check_os
|
53
47
|
end
|
54
48
|
|
55
49
|
c.before(:suite) do
|
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: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- hiracy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: serverspec
|
@@ -59,7 +59,7 @@ dependencies:
|
|
59
59
|
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
|
-
type: :
|
62
|
+
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
@@ -70,16 +70,16 @@ dependencies:
|
|
70
70
|
name: rspec-core
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
76
|
-
type: :
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: bundler
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|