cucumber-chef 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +4 -11
- data/Rakefile +8 -26
- data/VERSION +1 -1
- data/bin/cucumber-chef +5 -17
- data/cucumber-chef.gemspec +25 -20
- data/features/steps/setup_steps.rb +1 -0
- data/lib/cucumber/chef/config.rb +1 -3
- data/lib/cucumber/chef/provisioner.rb +2 -2
- data/lib/cucumber/chef/test_lab.rb +8 -10
- data/lib/cucumber/chef.rb +8 -7
- data/spec/{unit → cucumber/chef}/config_spec.rb +1 -3
- data/spec/{unit → cucumber/chef}/provisioner_spec.rb +2 -55
- data/spec/{unit → cucumber/chef}/test_lab_spec.rb +11 -24
- data/spec/spec_helper.rb +28 -0
- metadata +133 -117
- data/spec/unit/cucumber_chef_spec.rb +0 -4
- data/spec/unit/test_runner_spec.rb +0 -10
data/Gemfile
CHANGED
@@ -1,21 +1,14 @@
|
|
1
1
|
source "http://rubygems.org"
|
2
|
-
# Add dependencies required to use your gem here.
|
3
|
-
# Example:
|
4
|
-
# gem "activesupport", ">= 2.3.5"
|
5
|
-
|
6
|
-
# Add dependencies to develop your gem here.
|
7
|
-
# Include everything needed to run rake, tests, features, etc.
|
8
2
|
|
3
|
+
gemspec
|
9
4
|
gem "chef", ">= 0.10.0"
|
10
|
-
gem "cucumber", ">= 0"
|
11
|
-
gem "cucumber-nagios", ">= 0"
|
12
|
-
gem "rspec", ">= 0"
|
13
5
|
gem "fog", ">= 0"
|
14
6
|
gem "thor", ">= 0"
|
15
|
-
gem "awesome_print", ">= 0"
|
16
|
-
gem "net-scp", ">= 0"
|
17
7
|
|
18
8
|
group :development do
|
9
|
+
gem "cucumber", ">= 0"
|
10
|
+
gem "cucumber-nagios", ">= 0"
|
11
|
+
gem "rspec", ">= 0"
|
19
12
|
gem "bundler", "~> 1.0.0"
|
20
13
|
gem "jeweler", "~> 1.6.2"
|
21
14
|
gem "rcov", ">= 0"
|
data/Rakefile
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
require 'bundler'
|
3
|
-
|
4
|
-
Bundler.setup(:default, :development)
|
5
|
-
rescue Bundler::BundlerError => e
|
6
|
-
$stderr.puts e.message
|
7
|
-
$stderr.puts "Run `bundle install` to install missing gems"
|
8
|
-
exit e.status_code
|
9
|
-
end
|
3
|
+
Bundler.setup(:default, :development)
|
10
4
|
require 'rake'
|
11
5
|
|
6
|
+
require 'rspec/core/rake_task'
|
7
|
+
RSpec::Core::RakeTask.new(:spec)
|
8
|
+
task :default => :spec
|
9
|
+
|
10
|
+
require 'cucumber/rake/task'
|
11
|
+
Cucumber::Rake::Task.new(:cucumber)
|
12
|
+
|
12
13
|
require 'jeweler'
|
13
14
|
Jeweler::Tasks.new do |gem|
|
14
15
|
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
@@ -26,28 +27,9 @@ Jeweler::Tasks.new do |gem|
|
|
26
27
|
end
|
27
28
|
Jeweler::RubygemsDotOrgTasks.new
|
28
29
|
|
29
|
-
require 'rake/testtask'
|
30
|
-
Rake::TestTask.new(:test) do |test|
|
31
|
-
test.libs << 'lib' << 'test'
|
32
|
-
test.pattern = 'test/**/test_*.rb'
|
33
|
-
test.verbose = true
|
34
|
-
end
|
35
|
-
|
36
30
|
require 'rcov/rcovtask'
|
37
31
|
Rcov::RcovTask.new do |test|
|
38
32
|
test.libs << 'test'
|
39
33
|
test.pattern = 'test/**/test_*.rb'
|
40
34
|
test.verbose = true
|
41
35
|
end
|
42
|
-
|
43
|
-
task :default => :test
|
44
|
-
|
45
|
-
require 'rdoc/task'
|
46
|
-
Rake::RDocTask.new do |rdoc|
|
47
|
-
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
48
|
-
|
49
|
-
rdoc.rdoc_dir = 'rdoc'
|
50
|
-
rdoc.title = "cucumber-chef #{version}"
|
51
|
-
rdoc.rdoc_files.include('README*')
|
52
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
53
|
-
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.2
|
data/bin/cucumber-chef
CHANGED
@@ -1,25 +1,14 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
require 'pathname'
|
3
|
+
require 'fileutils'
|
2
4
|
|
3
5
|
require 'rubygems'
|
6
|
+
require 'bundler/setup'
|
4
7
|
require 'thor'
|
5
|
-
require 'pathname'
|
6
|
-
require 'fileutils'
|
7
|
-
require 'yaml'
|
8
|
-
require 'awesome_print'
|
9
|
-
require 'chef'
|
10
|
-
require 'chef/knife'
|
11
|
-
require 'chef/knife/bootstrap'
|
12
|
-
require 'chef/knife/ssh'
|
13
|
-
require 'socket'
|
14
|
-
require 'net/ssh/multi'
|
15
|
-
require 'readline'
|
16
|
-
require 'stringio'
|
17
8
|
|
18
9
|
$LOAD_PATH << File.join(File.dirname(__FILE__), '../lib')
|
19
10
|
require 'cucumber-chef'
|
20
11
|
|
21
|
-
GEM_DIR = Gem.default_dir
|
22
|
-
|
23
12
|
class CucumberChef < Thor
|
24
13
|
include Thor::Actions
|
25
14
|
|
@@ -32,6 +21,7 @@ class CucumberChef < Thor
|
|
32
21
|
|
33
22
|
def generate_project_skeleton(project_dir)
|
34
23
|
template_dir = Pathname.new(__FILE__).parent.parent + 'lib' + 'cucumber' + 'chef' + 'templates'
|
24
|
+
CucumberChef.source_root template_dir.realpath
|
35
25
|
templates = {
|
36
26
|
"readme.erb" => 'README',
|
37
27
|
"example_feature.erb" => 'features/example.feature',
|
@@ -39,8 +29,7 @@ class CucumberChef < Thor
|
|
39
29
|
"env.rb" => "features/support/env.rb"
|
40
30
|
}
|
41
31
|
templates.each do |filename, destination|
|
42
|
-
template(
|
43
|
-
project_dir + destination)
|
32
|
+
template(filename, project_dir + destination)
|
44
33
|
end
|
45
34
|
end
|
46
35
|
|
@@ -79,7 +68,6 @@ class CucumberChef < Thor
|
|
79
68
|
rescue ::Cucumber::Chef::Error => err
|
80
69
|
error(err.message)
|
81
70
|
end
|
82
|
-
|
83
71
|
end
|
84
72
|
|
85
73
|
desc "connect", "Connect to a container in your test lab"
|
data/cucumber-chef.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{cucumber-chef}
|
8
|
-
s.version = "1.0.
|
8
|
+
s.version = "1.0.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Stephen Nelson-Smith"]
|
12
|
-
s.date = %q{2011-06-
|
12
|
+
s.date = %q{2011-06-24}
|
13
13
|
s.default_executable = %q{cucumber-chef}
|
14
14
|
s.description = %q{Framework for behaviour-drive infrastructure development.}
|
15
15
|
s.email = %q{stephen@atalanta-systems.com}
|
@@ -72,11 +72,10 @@ Gem::Specification.new do |s|
|
|
72
72
|
"lib/cucumber/chef/test_runner.rb",
|
73
73
|
"lib/cucumber/chef/version.rb",
|
74
74
|
"lib/cucumber/ec2_server_create.rb",
|
75
|
-
"spec/
|
76
|
-
"spec/
|
77
|
-
"spec/
|
78
|
-
"spec/
|
79
|
-
"spec/unit/test_runner_spec.rb"
|
75
|
+
"spec/cucumber/chef/config_spec.rb",
|
76
|
+
"spec/cucumber/chef/provisioner_spec.rb",
|
77
|
+
"spec/cucumber/chef/test_lab_spec.rb",
|
78
|
+
"spec/spec_helper.rb"
|
80
79
|
]
|
81
80
|
s.homepage = %q{http://cucumber-chef.org}
|
82
81
|
s.licenses = ["Apache v2"]
|
@@ -88,39 +87,45 @@ Gem::Specification.new do |s|
|
|
88
87
|
s.specification_version = 3
|
89
88
|
|
90
89
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
90
|
+
s.add_runtime_dependency(%q<cucumber-chef>, [">= 0"])
|
91
91
|
s.add_runtime_dependency(%q<chef>, [">= 0.10.0"])
|
92
|
-
s.add_runtime_dependency(%q<cucumber>, [">= 0"])
|
93
|
-
s.add_runtime_dependency(%q<cucumber-nagios>, [">= 0"])
|
94
|
-
s.add_runtime_dependency(%q<rspec>, [">= 0"])
|
95
92
|
s.add_runtime_dependency(%q<fog>, [">= 0"])
|
96
93
|
s.add_runtime_dependency(%q<thor>, [">= 0"])
|
97
|
-
s.
|
98
|
-
s.
|
94
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
95
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.6.2"])
|
96
|
+
s.add_development_dependency(%q<rcov>, [">= 0"])
|
97
|
+
s.add_development_dependency(%q<cucumber>, [">= 0"])
|
98
|
+
s.add_development_dependency(%q<cucumber-nagios>, [">= 0"])
|
99
|
+
s.add_development_dependency(%q<rspec>, [">= 0"])
|
99
100
|
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
100
101
|
s.add_development_dependency(%q<jeweler>, ["~> 1.6.2"])
|
101
102
|
s.add_development_dependency(%q<rcov>, [">= 0"])
|
102
103
|
else
|
104
|
+
s.add_dependency(%q<cucumber-chef>, [">= 0"])
|
103
105
|
s.add_dependency(%q<chef>, [">= 0.10.0"])
|
106
|
+
s.add_dependency(%q<fog>, [">= 0"])
|
107
|
+
s.add_dependency(%q<thor>, [">= 0"])
|
108
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
109
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.2"])
|
110
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
104
111
|
s.add_dependency(%q<cucumber>, [">= 0"])
|
105
112
|
s.add_dependency(%q<cucumber-nagios>, [">= 0"])
|
106
113
|
s.add_dependency(%q<rspec>, [">= 0"])
|
107
|
-
s.add_dependency(%q<fog>, [">= 0"])
|
108
|
-
s.add_dependency(%q<thor>, [">= 0"])
|
109
|
-
s.add_dependency(%q<awesome_print>, [">= 0"])
|
110
|
-
s.add_dependency(%q<net-scp>, [">= 0"])
|
111
114
|
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
112
115
|
s.add_dependency(%q<jeweler>, ["~> 1.6.2"])
|
113
116
|
s.add_dependency(%q<rcov>, [">= 0"])
|
114
117
|
end
|
115
118
|
else
|
119
|
+
s.add_dependency(%q<cucumber-chef>, [">= 0"])
|
116
120
|
s.add_dependency(%q<chef>, [">= 0.10.0"])
|
121
|
+
s.add_dependency(%q<fog>, [">= 0"])
|
122
|
+
s.add_dependency(%q<thor>, [">= 0"])
|
123
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
124
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.2"])
|
125
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
117
126
|
s.add_dependency(%q<cucumber>, [">= 0"])
|
118
127
|
s.add_dependency(%q<cucumber-nagios>, [">= 0"])
|
119
128
|
s.add_dependency(%q<rspec>, [">= 0"])
|
120
|
-
s.add_dependency(%q<fog>, [">= 0"])
|
121
|
-
s.add_dependency(%q<thor>, [">= 0"])
|
122
|
-
s.add_dependency(%q<awesome_print>, [">= 0"])
|
123
|
-
s.add_dependency(%q<net-scp>, [">= 0"])
|
124
129
|
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
125
130
|
s.add_dependency(%q<jeweler>, ["~> 1.6.2"])
|
126
131
|
s.add_dependency(%q<rcov>, [">= 0"])
|
data/lib/cucumber/chef/config.rb
CHANGED
@@ -4,14 +4,12 @@ module Cucumber
|
|
4
4
|
|
5
5
|
class Config
|
6
6
|
KEYS = %w[mode node_name chef_server_url client_key validation_key validation_client_name]
|
7
|
-
KNIFE_KEYS = %w[aws_access_key_id aws_secret_access_key region availability_zone aws_ssh_key_id identity_file]
|
7
|
+
KNIFE_KEYS = %w[aws_access_key_id aws_secret_access_key region aws_image_id availability_zone aws_ssh_key_id identity_file]
|
8
8
|
|
9
9
|
def initialize
|
10
10
|
config[:mode] = "user"
|
11
11
|
end
|
12
12
|
|
13
|
-
|
14
|
-
|
15
13
|
def self.mode
|
16
14
|
config.test_mode? ? 'test' : 'user'
|
17
15
|
end
|
@@ -26,7 +26,6 @@ module Cucumber
|
|
26
26
|
bootstrap.config[:validation_client_name] = config["validation_client_name"]
|
27
27
|
bootstrap.config[:validation_key] = config["validation_key"]
|
28
28
|
bootstrap.config[:chef_server_url] = config["chef_server_url"]
|
29
|
-
bootstrap
|
30
29
|
bootstrap.run
|
31
30
|
tag_node(config)
|
32
31
|
end
|
@@ -46,7 +45,8 @@ module Cucumber
|
|
46
45
|
bootstrap.config[:validation_client_name] = config["validation_client_name"]
|
47
46
|
bootstrap.config[:validation_key] = config["validation_key"]
|
48
47
|
bootstrap.config[:chef_server_url] = config["chef_server_url"]
|
49
|
-
|
48
|
+
bootstrap.run
|
49
|
+
bootstrap
|
50
50
|
end
|
51
51
|
|
52
52
|
def upload_cookbook(config)
|
@@ -38,12 +38,12 @@ module Cucumber
|
|
38
38
|
|
39
39
|
def destroy
|
40
40
|
running_labs.each do |server|
|
41
|
-
#server.
|
42
|
-
|
41
|
+
puts "Destroying Server: #{server.public_ip_address}"
|
42
|
+
server.destroy
|
43
43
|
end
|
44
44
|
nodes.each do |node|
|
45
|
-
#
|
46
|
-
|
45
|
+
puts "Destroying Node: #{node[:cloud][:public_ipv4]}"
|
46
|
+
node.destroy
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
@@ -52,21 +52,19 @@ module Cucumber
|
|
52
52
|
end
|
53
53
|
|
54
54
|
def info
|
55
|
-
|
55
|
+
(exists? && running_labs.first.public_ip_address) || ""
|
56
56
|
end
|
57
57
|
|
58
58
|
def public_hostname
|
59
|
-
|
59
|
+
nodes.first.cloud.public_hostname
|
60
60
|
end
|
61
61
|
|
62
|
-
def
|
63
|
-
@node ||= begin
|
62
|
+
def nodes
|
64
63
|
search = ::Chef::Search::Query.new
|
65
64
|
mode = @config[:mode]
|
66
65
|
query = "roles:test_lab_test AND tags:#{mode}"
|
67
66
|
nodes, offset, total = search.search("node", URI.escape(query))
|
68
|
-
nodes.compact
|
69
|
-
end
|
67
|
+
nodes.compact
|
70
68
|
end
|
71
69
|
|
72
70
|
def running_labs
|
data/lib/cucumber/chef.rb
CHANGED
@@ -1,15 +1,16 @@
|
|
1
|
-
require
|
2
|
-
require
|
1
|
+
require 'readline'
|
2
|
+
require 'socket'
|
3
|
+
require 'stringio'
|
4
|
+
|
5
|
+
require 'chef'
|
6
|
+
require 'chef/cookbook_uploader'
|
3
7
|
require 'chef/knife'
|
4
8
|
require 'chef/knife/bootstrap'
|
5
9
|
require 'chef/knife/core/bootstrap_context'
|
6
10
|
require 'chef/knife/ssh'
|
7
|
-
require '
|
8
|
-
require 'net/ssh/multi'
|
11
|
+
require 'fog'
|
9
12
|
require 'net/scp'
|
10
|
-
require
|
11
|
-
require 'readline'
|
12
|
-
require 'stringio'
|
13
|
+
require 'net/ssh/multi'
|
13
14
|
|
14
15
|
module Cucumber
|
15
16
|
module Chef
|
@@ -1,24 +1,4 @@
|
|
1
|
-
require "
|
2
|
-
require "bundler/setup"
|
3
|
-
require File.join(File.dirname(__FILE__), "../../lib/cucumber-chef")
|
4
|
-
|
5
|
-
def tcp_test_ssh(hostname)
|
6
|
-
tcp_socket = TCPSocket.new(hostname, 22)
|
7
|
-
IO.select([tcp_socket], nil, nil, 5)
|
8
|
-
rescue Errno::ETIMEDOUT
|
9
|
-
false
|
10
|
-
rescue Errno::EPERM
|
11
|
-
false
|
12
|
-
rescue Errno::ECONNREFUSED
|
13
|
-
sleep 2
|
14
|
-
false
|
15
|
-
# This happens on EC2 quite often
|
16
|
-
rescue Errno::EHOSTUNREACH
|
17
|
-
sleep 2
|
18
|
-
false
|
19
|
-
ensure
|
20
|
-
tcp_socket && tcp_socket.close
|
21
|
-
end
|
1
|
+
require File.join(File.dirname(__FILE__), "../../spec_helper.rb")
|
22
2
|
|
23
3
|
describe Cucumber::Chef::Provisioner do
|
24
4
|
before(:all) do
|
@@ -78,43 +58,10 @@ describe Cucumber::Chef::Provisioner do
|
|
78
58
|
end
|
79
59
|
|
80
60
|
it "should assign a random name to the node" do
|
81
|
-
|
82
|
-
bootstrapper.run
|
61
|
+
subject.bootstrap_node(@dns_name, @config)
|
83
62
|
@test_lab.nodes.detect do |node|
|
84
63
|
node.name.match /^cucumber-chef-[0-9a-f]{8}$/
|
85
64
|
end.should be
|
86
65
|
end
|
87
66
|
end
|
88
|
-
|
89
|
-
describe "build_controller" do
|
90
|
-
|
91
|
-
before(:each) do
|
92
|
-
server = subject.build_test_lab(@config, StringIO.new)
|
93
|
-
@dns_name = server.dns_name
|
94
|
-
puts "Hanging around..." until tcp_test_ssh(server.public_ip_address)
|
95
|
-
puts "Got ssh..."
|
96
|
-
sleep(10)
|
97
|
-
subject.upload_cookbook(@config)
|
98
|
-
subject.upload_role(@config)
|
99
|
-
subject.bootstrap_node(@dns_name, @config).run
|
100
|
-
end
|
101
|
-
|
102
|
-
after(:each) do
|
103
|
-
config = @config[:knife]
|
104
|
-
connection = Fog::Compute.new(:provider => 'AWS',
|
105
|
-
:aws_access_key_id => config[:aws_access_key_id],
|
106
|
-
:aws_secret_access_key => config[:aws_secret_access_key],
|
107
|
-
:region => config[:region])
|
108
|
-
connection.servers.each do |s|
|
109
|
-
s.destroy if s.tags['cucumber-chef'] == 'test' && s.state == 'running'
|
110
|
-
end
|
111
|
-
end
|
112
|
-
|
113
|
-
it "should build a cucumber-chef controller" do
|
114
|
-
controller_builder = subject.build_controller(@dns_name, @config)
|
115
|
-
controller_builder.run
|
116
|
-
puts controller_builder.ui.stdout.string
|
117
|
-
end
|
118
|
-
|
119
|
-
end
|
120
67
|
end
|
@@ -1,6 +1,4 @@
|
|
1
|
-
require "
|
2
|
-
require "bundler/setup"
|
3
|
-
require File.join(File.dirname(__FILE__), "../../lib/cucumber-chef")
|
1
|
+
require File.join(File.dirname(__FILE__), "../../spec_helper.rb")
|
4
2
|
|
5
3
|
describe Cucumber::Chef::TestLab do
|
6
4
|
before(:all) do
|
@@ -9,6 +7,12 @@ describe Cucumber::Chef::TestLab do
|
|
9
7
|
|
10
8
|
subject { Cucumber::Chef::TestLab.new(@config) }
|
11
9
|
|
10
|
+
describe "with no running labs" do
|
11
|
+
it "should not return any info" do
|
12
|
+
subject.info.should == ""
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
12
16
|
describe "build" do
|
13
17
|
after(:each) { subject.destroy }
|
14
18
|
|
@@ -26,6 +30,10 @@ describe Cucumber::Chef::TestLab do
|
|
26
30
|
}.to raise_error(Cucumber::Chef::TestLabError)
|
27
31
|
end
|
28
32
|
|
33
|
+
it "should report its public ip address", :slow => true do
|
34
|
+
server = subject.build(StringIO.new)
|
35
|
+
subject.info.should == server.public_ip_address
|
36
|
+
end
|
29
37
|
end
|
30
38
|
|
31
39
|
describe "destroy" do
|
@@ -35,26 +43,5 @@ describe Cucumber::Chef::TestLab do
|
|
35
43
|
subject.exists?.should_not be
|
36
44
|
end
|
37
45
|
end
|
38
|
-
|
39
|
-
describe "against a bootstrapped lab" do
|
40
|
-
before(:each) do
|
41
|
-
provisioner = Cucumber::Chef::Provisioner.new
|
42
|
-
server = provisioner.build_test_lab(@config, StringIO.new)
|
43
|
-
@dns_name = server.dns_name
|
44
|
-
@public_ip_address = server.public_ip_address
|
45
|
-
puts "Hanging around..." until tcp_test_ssh(server.public_ip_address)
|
46
|
-
puts "Got ssh..."
|
47
|
-
sleep(10)
|
48
|
-
provisioner.upload_cookbook(@config)
|
49
|
-
provisioner.upload_role(@config)
|
50
|
-
provisioner.bootstrap_node(@dns_name, @config).run
|
51
|
-
end
|
52
|
-
|
53
|
-
after(:each) { subject.destroy }
|
54
|
-
|
55
|
-
it "should report its public ip address", :slow => true do
|
56
|
-
subject.info.should match(/#{@public_ip_address}/)
|
57
|
-
end
|
58
|
-
end
|
59
46
|
end
|
60
47
|
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
require "rubygems"
|
2
|
+
require "bundler/setup"
|
3
|
+
require File.join(File.dirname(__FILE__), "../lib/cucumber-chef")
|
4
|
+
|
5
|
+
def tcp_test_ssh(hostname)
|
6
|
+
tcp_socket = TCPSocket.new(hostname, 22)
|
7
|
+
IO.select([tcp_socket], nil, nil, 5)
|
8
|
+
rescue Errno::ETIMEDOUT
|
9
|
+
false
|
10
|
+
rescue Errno::EPERM
|
11
|
+
false
|
12
|
+
rescue Errno::ECONNREFUSED
|
13
|
+
sleep 2
|
14
|
+
false
|
15
|
+
# This happens on EC2 quite often
|
16
|
+
rescue Errno::EHOSTUNREACH
|
17
|
+
sleep 2
|
18
|
+
false
|
19
|
+
ensure
|
20
|
+
tcp_socket && tcp_socket.close
|
21
|
+
end
|
22
|
+
|
23
|
+
%w{ORGNAME OPSCODE_USER}.each do |var|
|
24
|
+
if ENV[var].nil? || ENV[var].empty?
|
25
|
+
warn "Specs require the environment variables $ORGNAME and $OPSCODE_USER to be set."
|
26
|
+
exit 1
|
27
|
+
end
|
28
|
+
end
|
metadata
CHANGED
@@ -1,149 +1,169 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: cucumber-chef
|
3
|
-
version: !ruby/object:Gem::Version
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.2
|
4
5
|
prerelease:
|
5
|
-
version: 1.0.1
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- Stephen Nelson-Smith
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
date: 2011-06-21 00:00:00 +01:00
|
12
|
+
date: 2011-06-24 00:00:00.000000000 +00:00
|
14
13
|
default_executable: cucumber-chef
|
15
|
-
dependencies:
|
16
|
-
- !ruby/object:Gem::Dependency
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: cucumber-chef
|
17
|
+
requirement: &10132060 !ruby/object:Gem::Requirement
|
18
|
+
none: false
|
19
|
+
requirements:
|
20
|
+
- - ! '>='
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '0'
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: *10132060
|
26
|
+
- !ruby/object:Gem::Dependency
|
17
27
|
name: chef
|
18
|
-
requirement: &
|
28
|
+
requirement: &10131440 !ruby/object:Gem::Requirement
|
19
29
|
none: false
|
20
|
-
requirements:
|
21
|
-
- -
|
22
|
-
- !ruby/object:Gem::Version
|
30
|
+
requirements:
|
31
|
+
- - ! '>='
|
32
|
+
- !ruby/object:Gem::Version
|
23
33
|
version: 0.10.0
|
24
34
|
type: :runtime
|
25
35
|
prerelease: false
|
26
|
-
version_requirements: *
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
29
|
-
requirement: &
|
36
|
+
version_requirements: *10131440
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: fog
|
39
|
+
requirement: &10130880 !ruby/object:Gem::Requirement
|
30
40
|
none: false
|
31
|
-
requirements:
|
32
|
-
- -
|
33
|
-
- !ruby/object:Gem::Version
|
34
|
-
version:
|
41
|
+
requirements:
|
42
|
+
- - ! '>='
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: '0'
|
35
45
|
type: :runtime
|
36
46
|
prerelease: false
|
37
|
-
version_requirements: *
|
38
|
-
- !ruby/object:Gem::Dependency
|
39
|
-
name:
|
40
|
-
requirement: &
|
47
|
+
version_requirements: *10130880
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: thor
|
50
|
+
requirement: &10130260 !ruby/object:Gem::Requirement
|
41
51
|
none: false
|
42
|
-
requirements:
|
43
|
-
- -
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
version:
|
52
|
+
requirements:
|
53
|
+
- - ! '>='
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
46
56
|
type: :runtime
|
47
57
|
prerelease: false
|
48
|
-
version_requirements: *
|
49
|
-
- !ruby/object:Gem::Dependency
|
50
|
-
name:
|
51
|
-
requirement: &
|
58
|
+
version_requirements: *10130260
|
59
|
+
- !ruby/object:Gem::Dependency
|
60
|
+
name: bundler
|
61
|
+
requirement: &10129500 !ruby/object:Gem::Requirement
|
52
62
|
none: false
|
53
|
-
requirements:
|
54
|
-
- -
|
55
|
-
- !ruby/object:Gem::Version
|
56
|
-
version:
|
57
|
-
type: :
|
63
|
+
requirements:
|
64
|
+
- - ~>
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: 1.0.0
|
67
|
+
type: :development
|
58
68
|
prerelease: false
|
59
|
-
version_requirements: *
|
60
|
-
- !ruby/object:Gem::Dependency
|
61
|
-
name:
|
62
|
-
requirement: &
|
69
|
+
version_requirements: *10129500
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: jeweler
|
72
|
+
requirement: &10128800 !ruby/object:Gem::Requirement
|
63
73
|
none: false
|
64
|
-
requirements:
|
65
|
-
- -
|
66
|
-
- !ruby/object:Gem::Version
|
67
|
-
version:
|
68
|
-
type: :
|
74
|
+
requirements:
|
75
|
+
- - ~>
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 1.6.2
|
78
|
+
type: :development
|
69
79
|
prerelease: false
|
70
|
-
version_requirements: *
|
71
|
-
- !ruby/object:Gem::Dependency
|
72
|
-
name:
|
73
|
-
requirement: &
|
80
|
+
version_requirements: *10128800
|
81
|
+
- !ruby/object:Gem::Dependency
|
82
|
+
name: rcov
|
83
|
+
requirement: &10128080 !ruby/object:Gem::Requirement
|
74
84
|
none: false
|
75
|
-
requirements:
|
76
|
-
- -
|
77
|
-
- !ruby/object:Gem::Version
|
78
|
-
version:
|
79
|
-
type: :
|
85
|
+
requirements:
|
86
|
+
- - ! '>='
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
89
|
+
type: :development
|
80
90
|
prerelease: false
|
81
|
-
version_requirements: *
|
82
|
-
- !ruby/object:Gem::Dependency
|
83
|
-
name:
|
84
|
-
requirement: &
|
91
|
+
version_requirements: *10128080
|
92
|
+
- !ruby/object:Gem::Dependency
|
93
|
+
name: cucumber
|
94
|
+
requirement: &10127360 !ruby/object:Gem::Requirement
|
85
95
|
none: false
|
86
|
-
requirements:
|
87
|
-
- -
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version:
|
90
|
-
type: :
|
96
|
+
requirements:
|
97
|
+
- - ! '>='
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '0'
|
100
|
+
type: :development
|
91
101
|
prerelease: false
|
92
|
-
version_requirements: *
|
93
|
-
- !ruby/object:Gem::Dependency
|
94
|
-
name:
|
95
|
-
requirement: &
|
102
|
+
version_requirements: *10127360
|
103
|
+
- !ruby/object:Gem::Dependency
|
104
|
+
name: cucumber-nagios
|
105
|
+
requirement: &10126640 !ruby/object:Gem::Requirement
|
96
106
|
none: false
|
97
|
-
requirements:
|
98
|
-
- -
|
99
|
-
- !ruby/object:Gem::Version
|
100
|
-
version:
|
101
|
-
type: :
|
107
|
+
requirements:
|
108
|
+
- - ! '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
type: :development
|
112
|
+
prerelease: false
|
113
|
+
version_requirements: *10126640
|
114
|
+
- !ruby/object:Gem::Dependency
|
115
|
+
name: rspec
|
116
|
+
requirement: &10125940 !ruby/object:Gem::Requirement
|
117
|
+
none: false
|
118
|
+
requirements:
|
119
|
+
- - ! '>='
|
120
|
+
- !ruby/object:Gem::Version
|
121
|
+
version: '0'
|
122
|
+
type: :development
|
102
123
|
prerelease: false
|
103
|
-
version_requirements: *
|
104
|
-
- !ruby/object:Gem::Dependency
|
124
|
+
version_requirements: *10125940
|
125
|
+
- !ruby/object:Gem::Dependency
|
105
126
|
name: bundler
|
106
|
-
requirement: &
|
127
|
+
requirement: &10125160 !ruby/object:Gem::Requirement
|
107
128
|
none: false
|
108
|
-
requirements:
|
129
|
+
requirements:
|
109
130
|
- - ~>
|
110
|
-
- !ruby/object:Gem::Version
|
131
|
+
- !ruby/object:Gem::Version
|
111
132
|
version: 1.0.0
|
112
133
|
type: :development
|
113
134
|
prerelease: false
|
114
|
-
version_requirements: *
|
115
|
-
- !ruby/object:Gem::Dependency
|
135
|
+
version_requirements: *10125160
|
136
|
+
- !ruby/object:Gem::Dependency
|
116
137
|
name: jeweler
|
117
|
-
requirement: &
|
138
|
+
requirement: &10124400 !ruby/object:Gem::Requirement
|
118
139
|
none: false
|
119
|
-
requirements:
|
140
|
+
requirements:
|
120
141
|
- - ~>
|
121
|
-
- !ruby/object:Gem::Version
|
142
|
+
- !ruby/object:Gem::Version
|
122
143
|
version: 1.6.2
|
123
144
|
type: :development
|
124
145
|
prerelease: false
|
125
|
-
version_requirements: *
|
126
|
-
- !ruby/object:Gem::Dependency
|
146
|
+
version_requirements: *10124400
|
147
|
+
- !ruby/object:Gem::Dependency
|
127
148
|
name: rcov
|
128
|
-
requirement: &
|
149
|
+
requirement: &10123740 !ruby/object:Gem::Requirement
|
129
150
|
none: false
|
130
|
-
requirements:
|
131
|
-
- -
|
132
|
-
- !ruby/object:Gem::Version
|
133
|
-
version:
|
151
|
+
requirements:
|
152
|
+
- - ! '>='
|
153
|
+
- !ruby/object:Gem::Version
|
154
|
+
version: '0'
|
134
155
|
type: :development
|
135
156
|
prerelease: false
|
136
|
-
version_requirements: *
|
157
|
+
version_requirements: *10123740
|
137
158
|
description: Framework for behaviour-drive infrastructure development.
|
138
159
|
email: stephen@atalanta-systems.com
|
139
|
-
executables:
|
160
|
+
executables:
|
140
161
|
- cucumber-chef
|
141
162
|
extensions: []
|
142
|
-
|
143
|
-
extra_rdoc_files:
|
163
|
+
extra_rdoc_files:
|
144
164
|
- LICENSE
|
145
165
|
- README.md
|
146
|
-
files:
|
166
|
+
files:
|
147
167
|
- .document
|
148
168
|
- .gitignore
|
149
169
|
- Gemfile
|
@@ -197,41 +217,37 @@ files:
|
|
197
217
|
- lib/cucumber/chef/test_runner.rb
|
198
218
|
- lib/cucumber/chef/version.rb
|
199
219
|
- lib/cucumber/ec2_server_create.rb
|
200
|
-
- spec/
|
201
|
-
- spec/
|
202
|
-
- spec/
|
203
|
-
- spec/
|
204
|
-
- spec/unit/test_runner_spec.rb
|
220
|
+
- spec/cucumber/chef/config_spec.rb
|
221
|
+
- spec/cucumber/chef/provisioner_spec.rb
|
222
|
+
- spec/cucumber/chef/test_lab_spec.rb
|
223
|
+
- spec/spec_helper.rb
|
205
224
|
has_rdoc: true
|
206
225
|
homepage: http://cucumber-chef.org
|
207
|
-
licenses:
|
226
|
+
licenses:
|
208
227
|
- Apache v2
|
209
228
|
post_install_message:
|
210
229
|
rdoc_options: []
|
211
|
-
|
212
|
-
require_paths:
|
230
|
+
require_paths:
|
213
231
|
- lib
|
214
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
232
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
215
233
|
none: false
|
216
|
-
requirements:
|
217
|
-
- -
|
218
|
-
- !ruby/object:Gem::Version
|
219
|
-
|
220
|
-
segments:
|
234
|
+
requirements:
|
235
|
+
- - ! '>='
|
236
|
+
- !ruby/object:Gem::Version
|
237
|
+
version: '0'
|
238
|
+
segments:
|
221
239
|
- 0
|
222
|
-
|
223
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
240
|
+
hash: -3978124826109230454
|
241
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
224
242
|
none: false
|
225
|
-
requirements:
|
226
|
-
- -
|
227
|
-
- !ruby/object:Gem::Version
|
228
|
-
version:
|
243
|
+
requirements:
|
244
|
+
- - ! '>='
|
245
|
+
- !ruby/object:Gem::Version
|
246
|
+
version: '0'
|
229
247
|
requirements: []
|
230
|
-
|
231
248
|
rubyforge_project:
|
232
249
|
rubygems_version: 1.6.2
|
233
250
|
signing_key:
|
234
251
|
specification_version: 3
|
235
252
|
summary: Tests Chef-built infrastructure
|
236
253
|
test_files: []
|
237
|
-
|