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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1bf822c5821bc96001f1be8e68b325950f87e438
4
- data.tar.gz: 34c45441230429ed4735405ff7badc369b92be6c
3
+ metadata.gz: de02cac0480ebd0499fbf20db6a505293761e942
4
+ data.tar.gz: b8db8e52b61dc74a9c433a923f8ce8b967edb20b
5
5
  SHA512:
6
- metadata.gz: 7ad19aaab1b06c714abea5d86f36731de126d382cb937c2e7953760123c1f7e48b9d5d561f550b62e36631af4b3051ce26f5aaa7d8e46ca3e4a552dcd827fa5a
7
- data.tar.gz: 4f53637233248264a55db855c87bdb90f34f58ad61fd22e02b308882b7aeeab6633290a5d8b51d6c654f258830c194f24f09f45c73a85a2deffa9f3ed5d2ecfd
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/test_detail_name/your_serverspec_test.rb
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(required)
28
- test_detail_name: # test detail directory name(not required)
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
- any_attribute: "aaa" # host attributes. left example available to get "property[:servername][:any_attribute]"
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
- 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.
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
@@ -1,4 +1,3 @@
1
- require "bundler/gem_tasks"
2
1
  require 'rake'
3
2
  require 'rspec/core/rake_task'
4
3
  require 'yaml'
@@ -1,3 +1,3 @@
1
1
  module ServerspecRunner
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -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.add_runtime_dependency "rake"
25
- spec.add_runtime_dependency "rspec-core", "~> 2.99"
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
@@ -4,7 +4,7 @@ describe "example" do
4
4
 
5
5
  describe "hostname実行" do
6
6
  describe command("hostname") do
7
- it { return_exit_status 0 }
7
+ it { eq 0 }
8
8
  end
9
9
  end
10
10
  end
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
- include Serverspec::Helper::DetectOS
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'] =~ /localhost|127\.0\.0\.1/
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.2
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-09-28 00:00:00.000000000 Z
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: :runtime
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: '2.99'
76
- type: :runtime
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: '2.99'
82
+ version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: bundler
85
85
  requirement: !ruby/object:Gem::Requirement