cuken 0.1.7 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +2 -1
- data/Gemfile.lock +5 -3
- data/VERSION +1 -1
- data/cuken.gemspec +8 -5
- data/features/chef_examples/cookbooks_cookbook.feature +10 -7
- data/features/chef_examples/cookbooks_metadata.feature +4 -3
- data/features/chef_examples/knife_admin_client.feature +8 -5
- data/features/chef_examples/knife_client_create.feature +5 -5
- data/features/chef_steps/cookbook_steps.feature +5 -5
- data/features/chef_steps/node_steps.feature +4 -3
- data/features/file_examples/files.feature +2 -2
- data/features/step_definitions/cuken_steps.rb +1 -1
- data/lib/cuken/api/chef/common.rb +1 -1
- data/lib/cuken/api/chef/knife.rb +50 -0
- data/lib/cuken/api/chef.rb +19 -6
- data/lib/cuken/api/ssh.rb +1 -1
- data/lib/cuken/cucumber/chef/common.rb +2 -2
- data/lib/cuken/cucumber/chef/cookbook.rb +9 -6
- data/lib/cuken/cucumber/chef/node.rb +21 -0
- data/lib/cuken/cucumber/common.rb +12 -0
- metadata +35 -24
data/Gemfile
CHANGED
@@ -3,10 +3,11 @@ source "http://rubygems.org"
|
|
3
3
|
# Example:
|
4
4
|
# gem "activesupport", ">= 2.3.5"
|
5
5
|
group :default do
|
6
|
-
gem 'aruba', "~> 0.3.
|
6
|
+
gem 'aruba', "~> 0.3.6"
|
7
7
|
gem 'chef', "~>0.9.12"
|
8
8
|
gem 'grit', "~>2.4.1"
|
9
9
|
gem 'rvm', "~>1.5.2"
|
10
|
+
gem 'open4'
|
10
11
|
end
|
11
12
|
# Add dependencies to develop your gem here.
|
12
13
|
# Include everything needed to run rake, tests, features, etc.
|
data/Gemfile.lock
CHANGED
@@ -12,14 +12,14 @@ GEM
|
|
12
12
|
erubis
|
13
13
|
extlib
|
14
14
|
highline
|
15
|
-
json (
|
15
|
+
json (<= 1.4.6, >= 1.4.4)
|
16
16
|
mixlib-authentication (>= 1.1.0)
|
17
17
|
mixlib-cli (>= 1.1.0)
|
18
18
|
mixlib-config (>= 1.1.2)
|
19
19
|
mixlib-log (>= 1.2.0)
|
20
20
|
moneta
|
21
21
|
ohai (>= 0.5.7)
|
22
|
-
rest-client (
|
22
|
+
rest-client (< 1.7.0, >= 1.0.4)
|
23
23
|
uuidtools
|
24
24
|
childprocess (0.1.8)
|
25
25
|
ffi (~> 1.0.6)
|
@@ -60,6 +60,7 @@ GEM
|
|
60
60
|
mixlib-log
|
61
61
|
systemu
|
62
62
|
yajl-ruby
|
63
|
+
open4 (1.0.1)
|
63
64
|
rake (0.8.7)
|
64
65
|
rcov (0.9.9)
|
65
66
|
reek (1.2.8)
|
@@ -96,13 +97,14 @@ PLATFORMS
|
|
96
97
|
ruby
|
97
98
|
|
98
99
|
DEPENDENCIES
|
99
|
-
aruba (~> 0.3.
|
100
|
+
aruba (~> 0.3.6)
|
100
101
|
bundler (~> 1.0.11)
|
101
102
|
chef (~> 0.9.12)
|
102
103
|
cucumber
|
103
104
|
fakefs (~> 0.3.1)
|
104
105
|
grit (~> 2.4.1)
|
105
106
|
jeweler (~> 1.5.2)
|
107
|
+
open4
|
106
108
|
rcov
|
107
109
|
reek (~> 1.2.8)
|
108
110
|
roodi (~> 2.1.0)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.8
|
data/cuken.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{cuken}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.8"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Hedgehog"]
|
12
|
-
s.date = %q{2011-04-
|
12
|
+
s.date = %q{2011-04-18}
|
13
13
|
s.description = %q{Reusable Cucumber steps and API for post-convergence system integration descriptions}
|
14
14
|
s.email = %q{hedgehogshiatus@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -469,10 +469,11 @@ Gem::Specification.new do |s|
|
|
469
469
|
s.specification_version = 3
|
470
470
|
|
471
471
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
472
|
-
s.add_runtime_dependency(%q<aruba>, ["~> 0.3.
|
472
|
+
s.add_runtime_dependency(%q<aruba>, ["~> 0.3.6"])
|
473
473
|
s.add_runtime_dependency(%q<chef>, ["~> 0.9.12"])
|
474
474
|
s.add_runtime_dependency(%q<grit>, ["~> 2.4.1"])
|
475
475
|
s.add_runtime_dependency(%q<rvm>, ["~> 1.5.2"])
|
476
|
+
s.add_runtime_dependency(%q<open4>, [">= 0"])
|
476
477
|
s.add_development_dependency(%q<rr>, ["~> 1.0.2"])
|
477
478
|
s.add_development_dependency(%q<rspec>, ["~> 2.5.0"])
|
478
479
|
s.add_development_dependency(%q<yard>, ["~> 0.6.0"])
|
@@ -484,10 +485,11 @@ Gem::Specification.new do |s|
|
|
484
485
|
s.add_development_dependency(%q<roodi>, ["~> 2.1.0"])
|
485
486
|
s.add_development_dependency(%q<fakefs>, ["~> 0.3.1"])
|
486
487
|
else
|
487
|
-
s.add_dependency(%q<aruba>, ["~> 0.3.
|
488
|
+
s.add_dependency(%q<aruba>, ["~> 0.3.6"])
|
488
489
|
s.add_dependency(%q<chef>, ["~> 0.9.12"])
|
489
490
|
s.add_dependency(%q<grit>, ["~> 2.4.1"])
|
490
491
|
s.add_dependency(%q<rvm>, ["~> 1.5.2"])
|
492
|
+
s.add_dependency(%q<open4>, [">= 0"])
|
491
493
|
s.add_dependency(%q<rr>, ["~> 1.0.2"])
|
492
494
|
s.add_dependency(%q<rspec>, ["~> 2.5.0"])
|
493
495
|
s.add_dependency(%q<yard>, ["~> 0.6.0"])
|
@@ -500,10 +502,11 @@ Gem::Specification.new do |s|
|
|
500
502
|
s.add_dependency(%q<fakefs>, ["~> 0.3.1"])
|
501
503
|
end
|
502
504
|
else
|
503
|
-
s.add_dependency(%q<aruba>, ["~> 0.3.
|
505
|
+
s.add_dependency(%q<aruba>, ["~> 0.3.6"])
|
504
506
|
s.add_dependency(%q<chef>, ["~> 0.9.12"])
|
505
507
|
s.add_dependency(%q<grit>, ["~> 2.4.1"])
|
506
508
|
s.add_dependency(%q<rvm>, ["~> 1.5.2"])
|
509
|
+
s.add_dependency(%q<open4>, [">= 0"])
|
507
510
|
s.add_dependency(%q<rr>, ["~> 1.0.2"])
|
508
511
|
s.add_dependency(%q<rspec>, ["~> 2.5.0"])
|
509
512
|
s.add_dependency(%q<yard>, ["~> 0.6.0"])
|
@@ -8,7 +8,8 @@ Feature: Cookbook Validity
|
|
8
8
|
Given a default base Chef repository in "ckbk/scratch/myapp"
|
9
9
|
|
10
10
|
Scenario: Clone from a Cookbook repository
|
11
|
-
Given
|
11
|
+
Given Explanation: Next we step up two levels to escape Aruba's working folder
|
12
|
+
And the remote Cookbook repository "./../../features/data/repositories/cookbooks/hosts/.git"
|
12
13
|
When I clone the remote Cookbook repository branch "master" to "ckbk/scratch/myapp/cookbooks/hosts"
|
13
14
|
Then the local Cookbook repository exists
|
14
15
|
And the local Cookbook "hosts" exists
|
@@ -28,13 +29,15 @@ Feature: Cookbook Validity
|
|
28
29
|
Scenario: Clone multiple Cookbooks from a Cookbooks URI
|
29
30
|
Given the remote Cookbooks URI "git://github.com/cookbooks/"
|
30
31
|
When I clone the Cookbooks:
|
31
|
-
|cookbook | branch | destination |
|
32
|
-
| hosts
|
33
|
-
| users
|
32
|
+
| cookbook | branch | tag | ref | destination |
|
33
|
+
| hosts | | 37s.0.1.0 | | ckbk/scratch/myapp/cookbooks/hosts3 |
|
34
|
+
| users | 37s | | | ckbk/scratch/myapp/cookbooks/users |
|
35
|
+
| xml | master | | b7a11ea4eb | ckbk/scratch/myapp/cookbooks/xml |
|
34
36
|
And these local Cookbooks exist:
|
35
|
-
|cookbook |
|
36
|
-
| hosts3
|
37
|
-
| users
|
37
|
+
| cookbook |
|
38
|
+
| hosts3 |
|
39
|
+
| users |
|
40
|
+
| xml |
|
38
41
|
|
39
42
|
Scenario: Clone multiple Site-Cookbooks from a Cookbooks URI
|
40
43
|
Given the remote Cookbooks URI "git://github.com/cookbooks/"
|
@@ -20,19 +20,20 @@ Feature: Cookbook Metadata
|
|
20
20
|
cookbook_path ["#{current_dir}/../cookbooks","#{current_dir}/../site-cookbooks"]
|
21
21
|
|
22
22
|
"""
|
23
|
-
And
|
23
|
+
And Explanation: Next we step up two levels to escape Aruba's working folder
|
24
|
+
And the remote Cookbook repository "./../../features/data/repositories/cookbooks/hosts/.git"
|
24
25
|
And I clone the remote Cookbook repository branch "master" to "ckbk/scratch/myapp/cookbooks/hosts"
|
25
26
|
And the local Cookbook repository exists
|
26
27
|
|
27
28
|
Scenario: Generate metadata for all cookbooks
|
28
|
-
When I successfully generate all
|
29
|
+
When I successfully generate all Cookbook metadata
|
29
30
|
And the output should contain "DEBUG: Generated "
|
30
31
|
And the output should not contain "DEBUG: No "
|
31
32
|
Then the file "ckbk/scratch/myapp/cookbooks/hosts/metadata.json" exists
|
32
33
|
|
33
34
|
Scenario: Generate metadata for a specific cookbook
|
34
35
|
When we record the a-mtime of "ckbk/scratch/myapp/cookbooks/hosts/metadata.json"
|
35
|
-
And I successfully generate
|
36
|
+
And I successfully generate Cookbook "hosts" metadata
|
36
37
|
And the output should contain "DEBUG: Generated "
|
37
38
|
And the output should not contain "DEBUG: No "
|
38
39
|
Then the file "ckbk/scratch/myapp/cookbooks/hosts/metadata.json" exists
|
@@ -72,8 +72,11 @@ Feature: Reusable Chef Knife steps
|
|
72
72
|
|
73
73
|
Scenario: Knife steps with path to knife.rb created earlier
|
74
74
|
Given the Knife file "foo/bar/.chef/knife.rb"
|
75
|
-
|
76
|
-
When the
|
75
|
+
And Explanation: to check a list of Chef nodes
|
76
|
+
When the Nodes are:
|
77
|
+
| node |
|
78
|
+
| |
|
79
|
+
Then the output should contain:
|
77
80
|
"""
|
78
81
|
DEBUG: Signing the request as bobo-admin
|
79
82
|
DEBUG: Sending HTTP Request via GET to localhost:4000/nodes
|
@@ -83,7 +86,7 @@ Feature: Reusable Chef Knife steps
|
|
83
86
|
Scenario: Upload a non-Git managed cookbook with path to knife.rb created earlier
|
84
87
|
Given the Knife file "foo/bar/.chef/knife.rb"
|
85
88
|
And I cd to "./../../"
|
86
|
-
And a
|
89
|
+
And a Cookbook path "features/data/cookbooks_not_uploaded_at_feature_start"
|
87
90
|
When I successfully run Knife's "cookbook upload version_updated"
|
88
91
|
Then the output should contain:
|
89
92
|
"""
|
@@ -94,7 +97,7 @@ Feature: Reusable Chef Knife steps
|
|
94
97
|
Scenario: Upload a Git managed cookbook with path to knife.rb created earlier
|
95
98
|
Given the Knife file "foo/bar/.chef/knife.rb"
|
96
99
|
And I cd to "./../../"
|
97
|
-
And a
|
100
|
+
And a Cookbook path "features/data/repositories/cookbooks_not_uploaded_at_feature_start/version_updated"
|
98
101
|
When I successfully run Knife's "cookbook upload version_updated"
|
99
102
|
Then the output should contain "INFO: Uploading files"
|
100
103
|
And the output should contain "DEBUG: Committing sandbox"
|
@@ -132,7 +135,7 @@ Feature: Reusable Chef Knife steps
|
|
132
135
|
Scenario: Auto upload and Delete a cookbook with path to knife.rb created earlier
|
133
136
|
Given the Knife file "foo/bar/.chef/knife.rb"
|
134
137
|
And I cd to "./../../"
|
135
|
-
And a
|
138
|
+
And a Cookbooks path "features/data/repositories/cookbooks_not_uploaded_at_feature_start"
|
136
139
|
When I successfully run Knife's "cookbook upload version_updated"
|
137
140
|
And I interactively run Knife's "cookbook delete version_updated 2.0.0"
|
138
141
|
And I type "Y"
|
@@ -6,8 +6,8 @@
|
|
6
6
|
# If you wish to mock a Chef server, see the Chef project's
|
7
7
|
# features setup.
|
8
8
|
#
|
9
|
-
|
10
|
-
Background:
|
11
|
-
Given the Chef server URI "http://localhost:4000"
|
12
|
-
And the Chef admin client "bobo-admin" exists
|
13
|
-
And a directory named "foo/bar"
|
9
|
+
#@announce @knife
|
10
|
+
#Background:
|
11
|
+
# Given the Chef server URI "http://localhost:4000"
|
12
|
+
# And the Chef admin client "bobo-admin" exists
|
13
|
+
# And a directory named "foo/bar"
|
@@ -10,11 +10,11 @@ Feature: Listing Cookbook steps
|
|
10
10
|
Scenario: Common Chef
|
11
11
|
Then these steps are defined for "cuken/cucumber/chef/cookbook.rb":
|
12
12
|
| step |
|
13
|
-
|a
|
14
|
-
|a
|
15
|
-
|I successfully generate all
|
16
|
-
|I successfully generate
|
17
|
-
|the local
|
13
|
+
|a Cookbook path "([^"]*)" |
|
14
|
+
|a Cookbooks path "([^"]*)" |
|
15
|
+
|I successfully generate all Cookbook metadata |
|
16
|
+
|I successfully generate Cookbook "([^"]*)" metadata |
|
17
|
+
|the local Cookbook "([^"]*)" exists |
|
18
18
|
|
19
19
|
Scenario: Local and remote Cookbook repository commands
|
20
20
|
Then these steps are defined for "cuken/cucumber/chef/cookbook.rb":
|
@@ -9,6 +9,7 @@ Feature: Listing Node steps
|
|
9
9
|
|
10
10
|
Scenario: Common Node
|
11
11
|
Then these steps are defined for "cuken/cucumber/chef/node.rb":
|
12
|
-
| step
|
13
|
-
|a validated
|
14
|
-
|the
|
12
|
+
| step |
|
13
|
+
| a validated Node |
|
14
|
+
| the Node "([^"]*)" exists |
|
15
|
+
| the Nodes are: |
|
@@ -11,7 +11,7 @@ Feature: Examining files
|
|
11
11
|
|
12
12
|
@steps
|
13
13
|
Scenario: File exists
|
14
|
-
Given the
|
14
|
+
Given the file "foo.file" contains nothing
|
15
15
|
Then the file "foo.file" exists
|
16
16
|
|
17
17
|
@steps
|
@@ -20,7 +20,7 @@ Feature: Examining files
|
|
20
20
|
|
21
21
|
@steps
|
22
22
|
Scenario: Atime
|
23
|
-
Given the
|
23
|
+
Given the file "foo.file" contains nothing
|
24
24
|
And we record the a-mtime of "foo.file"
|
25
25
|
And I run `sleep 1`
|
26
26
|
And I run `touch -a foo.file`
|
@@ -8,7 +8,7 @@ end
|
|
8
8
|
|
9
9
|
Then /^these steps are defined for "([^\"]*)":$/ do |file, table|
|
10
10
|
rsc = ::Cucumber::Runtime::SupportCode.new 'ui', :autoload_code_paths => 'lib/cuken/cucumber'
|
11
|
-
rsc.load_files! ["lib/#{file}", "#{ENV['GEM_HOME']}/gems/aruba-0.3.
|
11
|
+
rsc.load_files! ["lib/#{file}", "#{ENV['GEM_HOME']}/gems/aruba-0.3.6/lib/aruba/cucumber.rb"]
|
12
12
|
sd_array = rsc.step_definitions
|
13
13
|
#sd_array.each{|sd| puts sd.regexp_source}
|
14
14
|
table.hashes.each do |hsh|
|
@@ -49,7 +49,7 @@ module ::Cuken
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def chef
|
52
|
-
@remote_chef_repo ||= "git://github.com/
|
52
|
+
@remote_chef_repo ||= "git://github.com/cookbooks/chef-repo.git"
|
53
53
|
@knife_debug = true if @knife_debug.nil?
|
54
54
|
@cookbooks_paths ||= []
|
55
55
|
@cookbook_paths ||= []
|
data/lib/cuken/api/chef/knife.rb
CHANGED
@@ -99,6 +99,56 @@ module ::Cuken
|
|
99
99
|
end
|
100
100
|
end
|
101
101
|
|
102
|
+
def ensure_node_presence(node_name, expect_presence = true)
|
103
|
+
nd = node_show(node_name)
|
104
|
+
unless nd.class.to_s == 'Chef::Node' && nd.name == node_name
|
105
|
+
node_create(node_name)
|
106
|
+
end
|
107
|
+
nd = node_show(node_name)
|
108
|
+
nd.should be_an_instance_of(::Chef::Node)
|
109
|
+
nd.name.should == node_name
|
110
|
+
end
|
111
|
+
|
112
|
+
def node_show(node_name, attr = :all)
|
113
|
+
Pathname(chef.config_file).exist?.should be_true
|
114
|
+
argv = ['node', 'show', node_name, '--no-editor', '--config', chef.config_file]
|
115
|
+
unless attr == :all
|
116
|
+
argv << '--attribute' << attr
|
117
|
+
end
|
118
|
+
if Pathname(chef.config_file).exist?
|
119
|
+
with_args *argv do
|
120
|
+
::Chef::Application::Knife.new.run
|
121
|
+
end
|
122
|
+
else
|
123
|
+
# TODO: no config file error handling
|
124
|
+
end
|
125
|
+
::Chef::Knife.cuken
|
126
|
+
end
|
127
|
+
|
128
|
+
def node_role_load(hsh)
|
129
|
+
argv = ['node', 'run_list', 'add', hsh[:node], "role[#{hsh[:role]}]", '--no-editor', '--config', chef.config_file]
|
130
|
+
if Pathname(chef.config_file).exist?
|
131
|
+
with_args *argv do
|
132
|
+
::Chef::Application::Knife.new.run
|
133
|
+
end
|
134
|
+
else
|
135
|
+
# TODO: no config file error handling
|
136
|
+
end
|
137
|
+
::Chef::Knife.cuken
|
138
|
+
end
|
139
|
+
|
140
|
+
def node_create(node_name)
|
141
|
+
argv = ['node', 'create', node_name, '--no-editor', '--config', chef.config_file]
|
142
|
+
if Pathname(chef.config_file).exist?
|
143
|
+
with_args *argv do
|
144
|
+
::Chef::Application::Knife.new.run
|
145
|
+
end
|
146
|
+
else
|
147
|
+
# TODO: no config file error handling
|
148
|
+
end
|
149
|
+
::Chef::Knife.cuken
|
150
|
+
end
|
151
|
+
|
102
152
|
end # class knife
|
103
153
|
|
104
154
|
end # module Chef
|
data/lib/cuken/api/chef.rb
CHANGED
@@ -23,6 +23,7 @@ module ::Cuken
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
+
|
26
27
|
def update_cookbook_paths(ckbk_path, cookbook)
|
27
28
|
lp = Pathname(ckbk_path).expand_path.realdirpath
|
28
29
|
lrp = lp + '.git'
|
@@ -40,20 +41,32 @@ module ::Cuken
|
|
40
41
|
end
|
41
42
|
end
|
42
43
|
|
43
|
-
def chef_clone_repo(ckbk_path, cookbook = false, repo = chef.remote_chef_repo,
|
44
|
+
def chef_clone_repo(ckbk_path, cookbook = false, repo = chef.remote_chef_repo, type = {'branch' => 'master'})
|
44
45
|
in_current_dir do
|
45
46
|
pth = Pathname(ckbk_path).expand_path
|
46
47
|
gritty = ::Grit::Git.new(current_dir)
|
47
|
-
|
48
|
-
clone_opts = {:quiet => false, :verbose => true, :progress => true
|
48
|
+
announce_or_puts gritty.inspect
|
49
|
+
clone_opts = {:quiet => false, :verbose => true, :progress => true}
|
50
|
+
clone_opts[:branch] = type['branch'].empty? ? 'master' : type['branch']
|
51
|
+
type['tag'] = type['tag'].nil? ? '' : type['tag']
|
52
|
+
type['ref'] = type['ref'].nil? ? '' : type['ref']
|
49
53
|
if pth.directory?
|
50
|
-
|
51
|
-
gritty.pull(clone_opts, repo, pth.to_s)
|
54
|
+
announce_or_puts "Pulling: #{repo} into #{pth}"
|
55
|
+
res = gritty.pull(clone_opts, repo, pth.to_s)
|
52
56
|
else
|
53
|
-
|
57
|
+
announce_or_puts "Cloning: #{repo} into #{pth}"
|
54
58
|
res = gritty.clone(clone_opts, repo, pth.to_s)
|
55
59
|
end
|
56
60
|
update_cookbook_paths(pth, cookbook)
|
61
|
+
unless chef.cookbooks_paths.empty? # is empty after cloning default chef-repo
|
62
|
+
grotty = ::Grit::Git.new((pth + '.git').to_s)
|
63
|
+
grotty.checkout( { :b => true }, clone_opts[:branch] )
|
64
|
+
if !type['tag'].empty? || !type['ref'].empty?
|
65
|
+
grotty.checkout( { :B => true }, 'cuken', type['tag']||type['ref'] )
|
66
|
+
else
|
67
|
+
grotty.checkout( { :B => true }, 'cuken' )
|
68
|
+
end
|
69
|
+
end
|
57
70
|
pth
|
58
71
|
end
|
59
72
|
end
|
data/lib/cuken/api/ssh.rb
CHANGED
@@ -28,7 +28,7 @@ Given /^the Chef client "([^"]*)" exists$/ do |name|
|
|
28
28
|
chef.client_name = name
|
29
29
|
end
|
30
30
|
|
31
|
-
Given /^the Chef admin client "([^"]*) exists
|
31
|
+
Given /^the Chef admin client "([^"]*)" exists$/ do |name|
|
32
32
|
chef.show_client(:name => name)
|
33
33
|
chef.admin_client_name = name
|
34
34
|
end
|
@@ -61,7 +61,7 @@ Then /^the local Chef repository exists$/ do
|
|
61
61
|
end
|
62
62
|
|
63
63
|
Given /^I clone the remote Chef repository branch "([^"]*)" to "([^"]*)"$/ do |brnch, path|
|
64
|
-
chef.local_chef_repo = chef_clone_repo(path, false, chef.remote_chef_repo, brnch)
|
64
|
+
chef.local_chef_repo = chef_clone_repo(path, false, chef.remote_chef_repo, {'branch' => brnch})
|
65
65
|
chef.local_chef_repo.exist?.should be_true
|
66
66
|
end
|
67
67
|
|
@@ -116,25 +116,28 @@ end
|
|
116
116
|
|
117
117
|
Given /^I clone the remote Cookbook repository branch "([^"]*)" to "([^"]*)"$/ do |brnch, ckbk_path|
|
118
118
|
if ckbk_path[/\/cookbooks\//]
|
119
|
-
chef.local_cookbook_repo = chef_clone_repo(ckbk_path, true, chef.remote_cookbook_repo, brnch)
|
119
|
+
chef.local_cookbook_repo = chef_clone_repo(ckbk_path, true, chef.remote_cookbook_repo, {'branch' => brnch})
|
120
120
|
elsif ckbk_path[/\/site-cookbooks\//]
|
121
|
-
chef.local_site_cookbook_repo = chef_clone_repo(ckbk_path, true, chef.remote_cookbook_repo, brnch)
|
121
|
+
chef.local_site_cookbook_repo = chef_clone_repo(ckbk_path, true, chef.remote_cookbook_repo, {'branch' => brnch})
|
122
122
|
end
|
123
123
|
end
|
124
124
|
|
125
125
|
Given /^I clone the Cookbook "([^"]*)" branch "([^"]*)" to "([^"]*)"$/ do |ckbk, brnch, ckbk_path|
|
126
126
|
if ckbk_path[/\/cookbooks\//]
|
127
|
-
chef.local_cookbook_repo = chef_clone_repo(ckbk_path, true, chef.cookbooks_uri + ckbk + '.git', brnch)
|
127
|
+
chef.local_cookbook_repo = chef_clone_repo(ckbk_path, true, chef.cookbooks_uri + ckbk + '.git', {'branch' => brnch})
|
128
128
|
elsif ckbk_path[/\/site-cookbooks\//]
|
129
|
-
chef.local_site_cookbook_repo = chef_clone_repo(ckbk_path, true, chef.cookbooks_uri + ckbk + '.git', brnch)
|
129
|
+
chef.local_site_cookbook_repo = chef_clone_repo(ckbk_path, true, chef.cookbooks_uri + ckbk + '.git', {'branch' => brnch})
|
130
130
|
end
|
131
131
|
end
|
132
132
|
|
133
133
|
When /^I clone the Cookbooks:$/ do |table|
|
134
134
|
# table is a Cucumber::Ast::Table
|
135
135
|
table.hashes.each do |hsh|
|
136
|
-
|
137
|
-
|
136
|
+
src = {}
|
137
|
+
src['branch'] = hsh['branch'] if hsh['branch']
|
138
|
+
src['tag'] = hsh['tag'] if hsh['tag']
|
139
|
+
src['ref'] = hsh['ref'] if hsh['ref']
|
140
|
+
local_repo = chef_clone_repo(hsh['destination'], true, chef.cookbooks_uri + hsh['cookbook'] + '.git', src )
|
138
141
|
Pathname(local_repo).exist?.should be_true
|
139
142
|
end
|
140
143
|
end
|
@@ -26,6 +26,27 @@ Given /^a validated Node$/ do
|
|
26
26
|
client.node.run_list << "integration_setup"
|
27
27
|
end
|
28
28
|
|
29
|
+
Given /^the Node "([^"]*)" exists$/ do |node_name|
|
30
|
+
ensure_node_presence(node_name)
|
31
|
+
end
|
32
|
+
|
33
|
+
###
|
34
|
+
# When
|
35
|
+
###
|
36
|
+
When /^I add these Roles to the Nodes:$/ do |table|
|
37
|
+
table.hashes.each do |hsh|
|
38
|
+
node_role_load(hsh)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
###
|
43
|
+
# Then
|
44
|
+
###
|
45
|
+
Then /^the Nodes are:$/ do |partial_output|
|
46
|
+
run_knife_command('node list')
|
47
|
+
all_stdout.should include(partial_output)
|
48
|
+
end
|
49
|
+
|
29
50
|
#Given /^a Node "([^"]*)"$/ do |arg1|
|
30
51
|
# pending # express the regexp above with the code you wish you had
|
31
52
|
#end
|
@@ -1,4 +1,16 @@
|
|
1
1
|
|
2
|
+
Given /^Assumption: (.*)$/ do |msg|
|
3
|
+
announce_or_puts(msg)
|
4
|
+
end
|
5
|
+
|
6
|
+
Given /^Explanation: (.*)$/ do |msg|
|
7
|
+
announce_or_puts(msg)
|
8
|
+
end
|
9
|
+
|
10
|
+
Given /^Instruction: (.*)$/ do |msg|
|
11
|
+
announce_or_puts(msg)
|
12
|
+
end
|
13
|
+
|
2
14
|
And /^wait "([^"]*)" seconds$/ do |delay|
|
3
15
|
::Kernel.sleep(delay.to_f)
|
4
16
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: cuken
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.1.
|
5
|
+
version: 0.1.8
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Hedgehog
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-04-
|
13
|
+
date: 2011-04-18 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: aruba
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
requirements:
|
20
20
|
- - ~>
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 0.3.
|
22
|
+
version: 0.3.6
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: *id001
|
@@ -57,8 +57,19 @@ dependencies:
|
|
57
57
|
prerelease: false
|
58
58
|
version_requirements: *id004
|
59
59
|
- !ruby/object:Gem::Dependency
|
60
|
-
name:
|
60
|
+
name: open4
|
61
61
|
requirement: &id005 !ruby/object:Gem::Requirement
|
62
|
+
none: false
|
63
|
+
requirements:
|
64
|
+
- - ">="
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: "0"
|
67
|
+
type: :runtime
|
68
|
+
prerelease: false
|
69
|
+
version_requirements: *id005
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: rr
|
72
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
62
73
|
none: false
|
63
74
|
requirements:
|
64
75
|
- - ~>
|
@@ -66,10 +77,10 @@ dependencies:
|
|
66
77
|
version: 1.0.2
|
67
78
|
type: :development
|
68
79
|
prerelease: false
|
69
|
-
version_requirements: *
|
80
|
+
version_requirements: *id006
|
70
81
|
- !ruby/object:Gem::Dependency
|
71
82
|
name: rspec
|
72
|
-
requirement: &
|
83
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
73
84
|
none: false
|
74
85
|
requirements:
|
75
86
|
- - ~>
|
@@ -77,10 +88,10 @@ dependencies:
|
|
77
88
|
version: 2.5.0
|
78
89
|
type: :development
|
79
90
|
prerelease: false
|
80
|
-
version_requirements: *
|
91
|
+
version_requirements: *id007
|
81
92
|
- !ruby/object:Gem::Dependency
|
82
93
|
name: yard
|
83
|
-
requirement: &
|
94
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
84
95
|
none: false
|
85
96
|
requirements:
|
86
97
|
- - ~>
|
@@ -88,10 +99,10 @@ dependencies:
|
|
88
99
|
version: 0.6.0
|
89
100
|
type: :development
|
90
101
|
prerelease: false
|
91
|
-
version_requirements: *
|
102
|
+
version_requirements: *id008
|
92
103
|
- !ruby/object:Gem::Dependency
|
93
104
|
name: cucumber
|
94
|
-
requirement: &
|
105
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
95
106
|
none: false
|
96
107
|
requirements:
|
97
108
|
- - ">="
|
@@ -99,10 +110,10 @@ dependencies:
|
|
99
110
|
version: "0"
|
100
111
|
type: :development
|
101
112
|
prerelease: false
|
102
|
-
version_requirements: *
|
113
|
+
version_requirements: *id009
|
103
114
|
- !ruby/object:Gem::Dependency
|
104
115
|
name: bundler
|
105
|
-
requirement: &
|
116
|
+
requirement: &id010 !ruby/object:Gem::Requirement
|
106
117
|
none: false
|
107
118
|
requirements:
|
108
119
|
- - ~>
|
@@ -110,10 +121,10 @@ dependencies:
|
|
110
121
|
version: 1.0.11
|
111
122
|
type: :development
|
112
123
|
prerelease: false
|
113
|
-
version_requirements: *
|
124
|
+
version_requirements: *id010
|
114
125
|
- !ruby/object:Gem::Dependency
|
115
126
|
name: jeweler
|
116
|
-
requirement: &
|
127
|
+
requirement: &id011 !ruby/object:Gem::Requirement
|
117
128
|
none: false
|
118
129
|
requirements:
|
119
130
|
- - ~>
|
@@ -121,10 +132,10 @@ dependencies:
|
|
121
132
|
version: 1.5.2
|
122
133
|
type: :development
|
123
134
|
prerelease: false
|
124
|
-
version_requirements: *
|
135
|
+
version_requirements: *id011
|
125
136
|
- !ruby/object:Gem::Dependency
|
126
137
|
name: rcov
|
127
|
-
requirement: &
|
138
|
+
requirement: &id012 !ruby/object:Gem::Requirement
|
128
139
|
none: false
|
129
140
|
requirements:
|
130
141
|
- - ">="
|
@@ -132,10 +143,10 @@ dependencies:
|
|
132
143
|
version: "0"
|
133
144
|
type: :development
|
134
145
|
prerelease: false
|
135
|
-
version_requirements: *
|
146
|
+
version_requirements: *id012
|
136
147
|
- !ruby/object:Gem::Dependency
|
137
148
|
name: reek
|
138
|
-
requirement: &
|
149
|
+
requirement: &id013 !ruby/object:Gem::Requirement
|
139
150
|
none: false
|
140
151
|
requirements:
|
141
152
|
- - ~>
|
@@ -143,10 +154,10 @@ dependencies:
|
|
143
154
|
version: 1.2.8
|
144
155
|
type: :development
|
145
156
|
prerelease: false
|
146
|
-
version_requirements: *
|
157
|
+
version_requirements: *id013
|
147
158
|
- !ruby/object:Gem::Dependency
|
148
159
|
name: roodi
|
149
|
-
requirement: &
|
160
|
+
requirement: &id014 !ruby/object:Gem::Requirement
|
150
161
|
none: false
|
151
162
|
requirements:
|
152
163
|
- - ~>
|
@@ -154,10 +165,10 @@ dependencies:
|
|
154
165
|
version: 2.1.0
|
155
166
|
type: :development
|
156
167
|
prerelease: false
|
157
|
-
version_requirements: *
|
168
|
+
version_requirements: *id014
|
158
169
|
- !ruby/object:Gem::Dependency
|
159
170
|
name: fakefs
|
160
|
-
requirement: &
|
171
|
+
requirement: &id015 !ruby/object:Gem::Requirement
|
161
172
|
none: false
|
162
173
|
requirements:
|
163
174
|
- - ~>
|
@@ -165,7 +176,7 @@ dependencies:
|
|
165
176
|
version: 0.3.1
|
166
177
|
type: :development
|
167
178
|
prerelease: false
|
168
|
-
version_requirements: *
|
179
|
+
version_requirements: *id015
|
169
180
|
description: Reusable Cucumber steps and API for post-convergence system integration descriptions
|
170
181
|
email: hedgehogshiatus@gmail.com
|
171
182
|
executables: []
|
@@ -622,7 +633,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
622
633
|
requirements:
|
623
634
|
- - ">="
|
624
635
|
- !ruby/object:Gem::Version
|
625
|
-
hash:
|
636
|
+
hash: 1162902324164620948
|
626
637
|
segments:
|
627
638
|
- 0
|
628
639
|
version: "0"
|