cuken 0.1.2 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. data/README.md +5 -5
  2. data/VERSION +1 -1
  3. data/cucumber.yml +1 -1
  4. data/cuken.gemspec +25 -14
  5. data/features/.nav +28 -0
  6. data/features/about.md +41 -0
  7. data/features/{chef/cookbooks/cookbook.feature → chef_examples/cookbooks_cookbook.feature} +4 -4
  8. data/features/{chef/cookbooks/metadata.feature → chef_examples/cookbooks_metadata.feature} +5 -5
  9. data/features/{chef/cookbooks/repo.feature → chef_examples/cookbooks_repo.feature} +4 -4
  10. data/features/chef_steps/common_steps.feature +25 -0
  11. data/features/chef_steps/cookbook_steps.feature +24 -0
  12. data/features/{chef/knife.feature → chef_steps/knife_admin_client.feature} +51 -46
  13. data/features/chef_steps/knife_steps.feature +19 -0
  14. data/features/chef_steps/node_steps.feature +14 -0
  15. data/features/{command_steps.feature → command_steps/command_steps.feature} +1 -1
  16. data/features/data/repositories/cookbooks/attribute_include/README.rdoc +8 -0
  17. data/features/data/repositories/cookbooks/attribute_include/attributes/a.rb +4 -0
  18. data/features/data/repositories/cookbooks/attribute_include/attributes/b.rb +2 -0
  19. data/features/data/repositories/cookbooks/attribute_include/metadata.rb +6 -0
  20. data/features/data/repositories/cookbooks/attribute_include/recipes/default.rb +23 -0
  21. data/features/{files.feature → file_examples/files.feature} +2 -2
  22. data/features/{file_steps.feature → file_steps/file_steps.feature} +9 -21
  23. data/features/{ssh.feature → ssh_examples/ssh.feature} +1 -1
  24. data/features/{ssh_steps.feature → ssh_steps/ssh_steps.feature} +1 -1
  25. data/lib/cuken/api/chef/common.rb +4 -0
  26. data/lib/cuken/api/chef.rb +40 -8
  27. data/lib/cuken/cucumber/chef/common.rb +10 -7
  28. data/lib/cuken/cucumber/chef/cookbook.rb +11 -5
  29. data/lib/cuken/cucumber/chef/knife.rb +1 -1
  30. data/lib/cuken/cucumber/chef/node.rb +8 -0
  31. data/lib/cuken/cucumber/chef/role.rb +7 -0
  32. data/lib/cuken/cucumber/chef.rb +2 -0
  33. data/lib/cuken/cucumber/common.rb +4 -0
  34. data/lib/cuken/cucumber/file.rb +16 -0
  35. metadata +26 -15
  36. data/features/chef/knife_steps.feature +0 -19
  37. /data/features/{commands.feature → command_examples/commands.feature} +0 -0
  38. /data/features/{common_steps.feature → generic_steps/generic_steps.feature} +0 -0
data/README.md CHANGED
@@ -1,9 +1,9 @@
1
- = Cuken
1
+ # Cuken
2
2
 
3
3
  Reusable Cucumber steps and API for Nagios systems testing.
4
4
  Pronounced: Cookin'
5
5
 
6
- == Usage
6
+ ## Usage
7
7
 
8
8
  Typically you will require this library in Cucumber's support folder:
9
9
  features/support/env.rb
@@ -14,7 +14,7 @@ For example usage see the [Cucumber-Nagios][0] gem.
14
14
  This library structure is modeled on Aruba, and infact
15
15
  largely uses Aruba's steps.
16
16
 
17
- == Contributing to cuken
17
+ ## Contributing to cuken
18
18
 
19
19
  * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
20
20
  * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
@@ -24,8 +24,8 @@ largely uses Aruba's steps.
24
24
  * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
25
25
  * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
26
26
 
27
- == Copyright
27
+ ## Copyright
28
28
 
29
- Copyright (c) 2011 Hedgehog. See LICENSE.txt for
29
+ Copyright (c) 2011 Hedgehog. See LICENSE and NOTICE for
30
30
  further details.
31
31
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.4
data/cucumber.yml CHANGED
@@ -2,7 +2,7 @@
2
2
  default: --format progress <%= common %>
3
3
  ok: --format pretty <%= common %>
4
4
  usage: --format usage <%= common %>
5
- wip: --format pretty --tags @wip --strict -r features
5
+ wip: --format pretty --exclude data/ --tags @wip --strict -r features
6
6
 
7
7
  html_report: --format html --out=features_report.html <%= common %>
8
8
  pdf_report: --format pdf --out=features_report.pdf <%= common %>
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.2"
8
+ s.version = "0.1.4"
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-03-24}
12
+ s.date = %q{2011-03-29}
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 = [
@@ -29,14 +29,18 @@ Gem::Specification.new do |s|
29
29
  "cucumber.yml",
30
30
  "cuken.gemspec",
31
31
  "examples/chef/features/support/env.rb",
32
- "features/chef/cookbooks/cookbook.feature",
33
- "features/chef/cookbooks/metadata.feature",
34
- "features/chef/cookbooks/repo.feature",
35
- "features/chef/knife.feature",
36
- "features/chef/knife_steps.feature",
37
- "features/command_steps.feature",
38
- "features/commands.feature",
39
- "features/common_steps.feature",
32
+ "features/.nav",
33
+ "features/about.md",
34
+ "features/chef_examples/cookbooks_cookbook.feature",
35
+ "features/chef_examples/cookbooks_metadata.feature",
36
+ "features/chef_examples/cookbooks_repo.feature",
37
+ "features/chef_steps/common_steps.feature",
38
+ "features/chef_steps/cookbook_steps.feature",
39
+ "features/chef_steps/knife_admin_client.feature",
40
+ "features/chef_steps/knife_steps.feature",
41
+ "features/chef_steps/node_steps.feature",
42
+ "features/command_examples/commands.feature",
43
+ "features/command_steps/command_steps.feature",
40
44
  "features/cuken.feature",
41
45
  "features/data/Rakefile",
42
46
  "features/data/apt/chef-integration-test-1.0/debian/changelog",
@@ -368,6 +372,11 @@ Gem::Specification.new do |s|
368
372
  "features/data/repositories/chef-repo/cookbooks/README.md",
369
373
  "features/data/repositories/chef-repo/data_bags/README.md",
370
374
  "features/data/repositories/chef-repo/roles/README.md",
375
+ "features/data/repositories/cookbooks/attribute_include/README.rdoc",
376
+ "features/data/repositories/cookbooks/attribute_include/attributes/a.rb",
377
+ "features/data/repositories/cookbooks/attribute_include/attributes/b.rb",
378
+ "features/data/repositories/cookbooks/attribute_include/metadata.rb",
379
+ "features/data/repositories/cookbooks/attribute_include/recipes/default.rb",
371
380
  "features/data/repositories/cookbooks/hosts/attributes/hosts.rb",
372
381
  "features/data/repositories/cookbooks/hosts/cc.gemspec",
373
382
  "features/data/repositories/cookbooks/hosts/metadata.json",
@@ -377,10 +386,11 @@ Gem::Specification.new do |s|
377
386
  "features/data/search-tests/do_knife_search_test.rb",
378
387
  "features/data/search-tests/search-test-nodes.rb",
379
388
  "features/data/test_git_repo.tar.gz",
380
- "features/file_steps.feature",
381
- "features/files.feature",
382
- "features/ssh.feature",
383
- "features/ssh_steps.feature",
389
+ "features/file_examples/files.feature",
390
+ "features/file_steps/file_steps.feature",
391
+ "features/generic_steps/generic_steps.feature",
392
+ "features/ssh_examples/ssh.feature",
393
+ "features/ssh_steps/ssh_steps.feature",
384
394
  "features/step_definitions/cuken_steps.rb",
385
395
  "features/support/env.rb",
386
396
  "lib/cuken.rb",
@@ -412,6 +422,7 @@ Gem::Specification.new do |s|
412
422
  "lib/cuken/cucumber/chef/request_steps.rb",
413
423
  "lib/cuken/cucumber/chef/response_steps.rb",
414
424
  "lib/cuken/cucumber/chef/result_steps.rb",
425
+ "lib/cuken/cucumber/chef/role.rb",
415
426
  "lib/cuken/cucumber/chef/run_client_steps.rb",
416
427
  "lib/cuken/cucumber/chef/run_solo.rb",
417
428
  "lib/cuken/cucumber/chef/sandbox_steps.rb",
data/features/.nav ADDED
@@ -0,0 +1,28 @@
1
+ - getting_started.md (Getting Started)
2
+ - about.md (About Cuken's Reusable Steps)
3
+ - LICENSE (License)
4
+ - NOTICE (Notice)
5
+ - generic_steps:
6
+ - generic_steps.feature
7
+ - file_steps:
8
+ - file_steps.feature
9
+ - command_steps:
10
+ - command_steps.feature
11
+ - ssh_steps:
12
+ - ssh_steps.feature
13
+ - chef_steps:
14
+ - common_steps.feature
15
+ - knife_steps.feature
16
+ - cookbook_steps.feature
17
+ - node_steps.feature
18
+ - file_examples:
19
+ - files.feature
20
+ - command_examples:
21
+ - commands.feature
22
+ - ssh_examples:
23
+ - ssh.feature
24
+ - chef_examples:
25
+ - cookbooks_metadata.feature
26
+ - cookbooks_repo.feature
27
+ - cookbooks_cookbook.feature
28
+
data/features/about.md ADDED
@@ -0,0 +1,41 @@
1
+ # About Cuken's Reusable Steps
2
+
3
+ These [Cucumber][0] features summarise the steps defined in
4
+ [Cuken][1] and [Aruba][2]. Cuken's step+API structure is modeled on Aruba, and
5
+ largely uses Aruba's steps and API.
6
+
7
+ Cucumber features where these steps might be useful have been variously described as:
8
+ - Infrastructure integration tests
9
+ - Post-convergence system integration
10
+
11
+ Cuken grew out of refactoring the [Cucumber-Nagios][3] library.
12
+ The example features are executable documentation for usage of Cuken.
13
+ The SSH steps assume passwordless logins are accepted on `localhost:22`.
14
+ The Chef steps assume you have Chef server accessible on `localhost:4040`.
15
+
16
+ If you have ideas to clarify or improve any of these cucumber features,
17
+ please submit an [issue][9] or [pull request][8].
18
+
19
+ ## Step contributions:
20
+ - Ideally the API methods should be covered by RSpec (I've been slack
21
+ on this simply because I'm trying to get over the initial backlog of
22
+ steps to port).
23
+ - Have a feature/scenario that illustrates its use.
24
+
25
+ ## Prior Art:
26
+ - [Aruba][2] confirmed the utility of reusable steps.
27
+ - [Auxesis' Cucumber-Nagios][4] served as launch pad.
28
+ - [Chef][5] steps are being ported.
29
+ - [Virtualbox][6] steps are planned to be ported.
30
+ - [SSH-Forever][7] served as API-base for passwordless SSH steps.
31
+
32
+ [0]: https://github.com/aslakhellesoy/cucumber
33
+ [1]: https://github.com/hedgehog/cuken
34
+ [2]: https://github.com/aslakhellesoy/aruba
35
+ [3]: https://github.com/hedgehog/cucumber-nagios
36
+ [4]: https://github.com/auxesis/cucumber-nagios
37
+ [5]: https://github.com/opscode/chef
38
+ [6]: https://github.com/mitchellh/virtualbox
39
+ [7]: https://github.com/mattwynne/ssh-forever
40
+ [8]: http://help.github.com/pull-requests
41
+ [9]: https://github.com/hedgehog/cuken/issues
@@ -5,10 +5,10 @@ Feature: Cookbook Validity
5
5
  I want to automatically confirm cookbook existence and validity
6
6
 
7
7
  Background:
8
- Given a default base chef repository in "ckbk/scratch/myapp"
8
+ Given a default base Chef repository in "ckbk/scratch/myapp"
9
9
 
10
10
  Scenario: Clone a cookbook repository
11
- And the remote cookbook repository "features/data/repositories/cookbooks/hosts/.git"
12
- When I clone the remote cookbook repository branch "master" to "tmp/aruba/ckbk/scratch/myapp/cookbooks/hosts"
13
- Then the local cookbook repository exists
11
+ And the remote Cookbook repository "features/data/repositories/cookbooks/hosts/.git"
12
+ When I clone the remote Cookbook repository branch "master" to "ckbk/scratch/myapp/cookbooks/hosts"
13
+ Then the local Cookbook repository exists
14
14
  And the local cookbook "hosts" exists
@@ -5,8 +5,8 @@ Feature: Cookbook Metadata
5
5
  I want to automatically generate metadata about cookbooks
6
6
 
7
7
  Background:
8
- Given a default base chef repository in "ckbk/scratch/myapp"
9
- And the local chef repository exists
8
+ Given a default base Chef repository in "ckbk/scratch/myapp"
9
+ And the local Chef repository exists
10
10
  And a file named "ckbk/scratch/myapp/.chef/knife.rb" with:
11
11
  """
12
12
  current_dir = File.dirname(__FILE__)
@@ -20,9 +20,9 @@ Feature: Cookbook Metadata
20
20
  cookbook_path ["#{current_dir}/../cookbooks","#{current_dir}/../site-cookbooks"]
21
21
 
22
22
  """
23
- And the remote cookbook repository "features/data/repositories/cookbooks/hosts/.git"
24
- And I clone the remote cookbook repository branch "master" to "ckbk/scratch/myapp/cookbooks/hosts"
25
- And the local cookbook repository exists
23
+ And the remote Cookbook repository "features/data/repositories/cookbooks/hosts/.git"
24
+ And I clone the remote Cookbook repository branch "master" to "ckbk/scratch/myapp/cookbooks/hosts"
25
+ And the local Cookbook repository exists
26
26
 
27
27
  Scenario: Generate metadata for all cookbooks
28
28
  When I successfully generate all cookbook metadata
@@ -5,9 +5,9 @@ Feature: Base Chef repository for cookbooks
5
5
  I want to automatically clone a generic base Chef repository
6
6
 
7
7
  Background:
8
- Given a directory named "ckbk/scratch"
8
+ Given a directory named "ckbk/scratch"
9
9
 
10
10
  Scenario: Clone a Chef skeleton repository
11
- And the remote chef repository "features/data/repositories/chef-repo/.git"
12
- When I clone the remote chef repository branch "master" to "tmp/aruba/ckbk/scratch/myapp"
13
- Then the local chef repository exists
11
+ And the remote Chef repository "features/data/repositories/chef-repo/.git"
12
+ When I clone the remote Chef repository branch "master" to "tmp/aruba/ckbk/scratch/myapp"
13
+ Then the local Chef repository exists
@@ -0,0 +1,25 @@
1
+ @chef @common @step_features
2
+ Feature: Listing common steps
3
+ In order to test automated Chef deployments.
4
+ As an administrator.
5
+ I want to know what generic steps are available.
6
+
7
+ Background:
8
+ Given that "cuken/chef" has been required
9
+
10
+ Scenario: Common Chef
11
+ Then these steps are defined for "cuken/cucumber/chef/common.rb":
12
+ | step |
13
+ |a default base Chef repository in "([^"]*)" |
14
+ |I clone the remote Chef repository branch "([^"]*)" to "([^"]*)" |
15
+ |the Chef server URI "([^"]*)" |
16
+ |the Chef client "([^"]*)" |
17
+ |the Chef admin client "([^"]*)" |
18
+ |the Chef client private key path "([^"]*)" |
19
+
20
+ Scenario: Local and remote Chef repository commands
21
+ Then these steps are defined for "cuken/cucumber/chef/common.rb":
22
+ | step |
23
+ |the local Chef repository "([^"]*)" |
24
+ |the local Chef repository exists |
25
+ |the remote Chef repository "([^"]*)" |
@@ -0,0 +1,24 @@
1
+ @chef @cookbook @step_features
2
+ Feature: Listing Cookbook steps
3
+ In order to test automated Chef deployments
4
+ As an administrator
5
+ I want to know what Cookbook steps are available
6
+
7
+ Background:
8
+ Given that "cuken/chef" has been required
9
+
10
+ Scenario: Common Chef
11
+ Then these steps are defined for "cuken/cucumber/chef/cookbook.rb":
12
+ | step |
13
+ |a cookbook path "([^"]*)" |
14
+ |I clone the remote Cookbook repository branch "([^"]*)" to "([^"]*)" |
15
+ |I successfully generate all cookbook metadata |
16
+ |I successfully generate cookbook "([^"]*)" metadata |
17
+ |the local cookbook "([^"]*)" exists |
18
+
19
+ Scenario: Local and remote Cookbook repository commands
20
+ Then these steps are defined for "cuken/cucumber/chef/cookbook.rb":
21
+ | step |
22
+ |the local Cookbook repository "([^"]*)" |
23
+ |the local Cookbook repository exists |
24
+ |the remote Cookbook repository "([^"]*)" |
@@ -6,7 +6,7 @@
6
6
  # If you wish to mock a Chef server, see the Chef project's
7
7
  # features setup.
8
8
  #
9
- @announce @knife @steps
9
+ @announce @knife @cookbook_upload
10
10
  Feature: Reusable Chef Knife steps
11
11
  In order to write Chef features describing post-convergence system integration
12
12
  As a Chef user
@@ -14,36 +14,36 @@ Feature: Reusable Chef Knife steps
14
14
 
15
15
  Background:
16
16
  Given the Chef server URI "http://localhost:4000"
17
- And the Chef admin client "bobo"
17
+ And the Chef admin client "bobo-admin"
18
18
  Given a directory named "foo/bar"
19
- And a file named "foo/bar/bobo.pem" with:
19
+ And a file named "foo/bar/bobo-admin.pem" with:
20
20
  """
21
21
  -----BEGIN RSA PRIVATE KEY-----
22
- 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
- xt+Xqq5bm2LS2zDbwK0lAWDAJTr/PHRPt9+4rMlYZt9bZWcLy/AeHHc3XePzaPIZ
24
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 8aOVyHB0KjLeDcf6aqe9aAr7amDrHoIqPT4wmOECgYA+x1HqLdgRSgsxp3hetSGT
39
- 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
- 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
- +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
- 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
- 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
- 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
- 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
- 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
47
47
  -----END RSA PRIVATE KEY-----
48
48
  """
49
49
  And a file named "foo/bar/.chef/knife.rb" with:
@@ -51,8 +51,8 @@ Feature: Reusable Chef Knife steps
51
51
  current_dir = File.dirname(__FILE__)
52
52
  log_level :debug
53
53
  log_location $stdout
54
- node_name "bobo"
55
- client_key "#{File.dirname(current_dir)}/bobo.pem"
54
+ node_name "bobo-admin"
55
+ client_key "#{File.dirname(current_dir)}/bobo-admin.pem"
56
56
  chef_server_url "http://localhost:4000"
57
57
  cache_type 'Memory'
58
58
  cache_options( :path => "#{ENV['HOME']}/.chef/checksums" )
@@ -65,8 +65,7 @@ Feature: Reusable Chef Knife steps
65
65
  When I successfully run `knife node list`
66
66
  When the output should contain:
67
67
  """
68
- DEBUG: Using configuration from /usr/src/cuken/tmp/aruba/foo/bar/.chef/knife.rb
69
- DEBUG: Signing the request as bobo
68
+ DEBUG: Signing the request as bobo-admin
70
69
  DEBUG: Sending HTTP Request via GET to localhost:4000/nodes
71
70
  [
72
71
  """
@@ -76,31 +75,37 @@ Feature: Reusable Chef Knife steps
76
75
  When I successfully run Knife's "node list"
77
76
  When the output should contain:
78
77
  """
79
- DEBUG: Using configuration from /usr/src/cuken/tmp/aruba/foo/bar/.chef/knife.rb
80
- DEBUG: Signing the request as bobo
78
+ DEBUG: Signing the request as bobo-admin
81
79
  DEBUG: Sending HTTP Request via GET to localhost:4000/nodes
82
80
  [
83
81
  """
84
82
 
85
- Scenario: Upload a cookbook with path to knife.rb created earlier
83
+ Scenario: Upload a non-Git managed cookbook with path to knife.rb created earlier
86
84
  Given the Knife file "foo/bar/.chef/knife.rb"
87
85
  And I cd to "./../../"
88
86
  And a cookbook path "features/data/cookbooks_not_uploaded_at_feature_start"
89
87
  When I successfully run Knife's "cookbook upload version_updated"
90
88
  Then the output should contain:
91
89
  """
92
- DEBUG: Signing the request as bobo
93
- DEBUG: Sending HTTP Request via PUT to localhost:4000/cookbooks/version_updated/2.0.0
94
- INFO: Upload complete!
90
+ ERROR: Could not find cookbook version_updated in your cookbook path, skipping it
95
91
 
96
92
  """
97
93
 
94
+ Scenario: Upload a Git managed cookbook with path to knife.rb created earlier
95
+ Given the Knife file "foo/bar/.chef/knife.rb"
96
+ And I cd to "./../../"
97
+ And a cookbook path "features/data/repositories/cookbooks_not_uploaded_at_feature_start/version_updated"
98
+ When I successfully run Knife's "cookbook upload version_updated"
99
+ Then the output should contain "INFO: Uploading files"
100
+ And the output should contain "DEBUG: Committing sandbox"
101
+ And the output should contain "INFO: Upload complete!"
102
+
98
103
  Scenario: Verify a cookbook with path to knife.rb created earlier
99
104
  Given the Knife file "foo/bar/.chef/knife.rb"
100
105
  And I successfully run Knife's "cookbook show version_updated"
101
106
  And the output should contain:
102
107
  """
103
- DEBUG: Signing the request as bobo
108
+ DEBUG: Signing the request as bobo-admin
104
109
  DEBUG: Sending HTTP Request via GET to localhost:4000/cookbooks/version_updated
105
110
  {
106
111
  "version_updated": [
@@ -117,9 +122,9 @@ Feature: Reusable Chef Knife steps
117
122
  And wait "5" seconds
118
123
  Then the output should contain:
119
124
  """
120
- DEBUG: Signing the request as bobo
125
+ DEBUG: Signing the request as bobo-admin
121
126
  DEBUG: Sending HTTP Request via GET to localhost:4000/cookbooks/version_updated
122
- Do you really want to delete version_updated version 2.0.0? (Y/N) DEBUG: Signing the request as bobo
127
+ Do you really want to delete version_updated version 2.0.0? (Y/N) DEBUG: Signing the request as bobo-admin
123
128
  DEBUG: Sending HTTP Request via DELETE to localhost:4000/cookbooks/version_updated/2.0.0
124
129
  Deleted cookbook[version_updated version 2.0.0]!
125
130
  """
@@ -127,14 +132,14 @@ Feature: Reusable Chef Knife steps
127
132
  Scenario: Auto upload and Delete a cookbook with path to knife.rb created earlier
128
133
  Given the Knife file "foo/bar/.chef/knife.rb"
129
134
  And I cd to "./../../"
130
- And a cookbook path "features/data/cookbooks_not_uploaded_at_feature_start"
135
+ And a cookbooks path "features/data/repositories/cookbooks_not_uploaded_at_feature_start"
131
136
  When I successfully run Knife's "cookbook upload version_updated"
132
- When I successfully run Knife's "cookbook delete version_updated 2.0.0"
137
+ And I interactively run Knife's "cookbook delete version_updated 2.0.0"
138
+ And I type "Y"
139
+ And wait "5" seconds
133
140
  Then the output should contain:
134
141
  """
135
- DEBUG: Signing the request as bobo
136
- DEBUG: Sending HTTP Request via GET to localhost:4000/cookbooks/version_updated
137
- Do you really want to delete version_updated version 2.0.0? (Y/N) DEBUG: Signing the request as bobo
142
+ Do you really want to delete version_updated version 2.0.0? (Y/N) DEBUG: Signing the request as bobo-admin
138
143
  DEBUG: Sending HTTP Request via DELETE to localhost:4000/cookbooks/version_updated/2.0.0
139
144
  Deleted cookbook[version_updated version 2.0.0]!
140
145
  """
@@ -0,0 +1,19 @@
1
+ @chef @knife @step_features
2
+ Feature: Listing Knife steps
3
+ In order to test automated Chef deployments
4
+ As an administrator
5
+ I want to know what Knife steps are available
6
+
7
+ Background:
8
+ Given that "cuken/chef" has been required
9
+
10
+ Scenario: Knife file
11
+ Then these steps are defined for "cuken/cucumber/chef/knife.rb":
12
+ | step |
13
+ |the Knife file "([^"]*)" |
14
+
15
+ Scenario: Knife commands
16
+ Then these steps are defined for "cuken/cucumber/chef/knife.rb":
17
+ | step |
18
+ |I successfully run Knife's "([^"]*)" |
19
+ |I interactively run Knife's "([^"]*)" |
@@ -0,0 +1,14 @@
1
+ @chef @cookbook @step_features
2
+ Feature: Listing Node steps
3
+ In order to test automated Chef deployments
4
+ As an administrator
5
+ I want to know what Cookbook steps are available
6
+
7
+ Background:
8
+ Given that "cuken/chef" has been required
9
+
10
+ Scenario: Common Node
11
+ Then these steps are defined for "cuken/cucumber/chef/node.rb":
12
+ | step |
13
+ |a validated node |
14
+ |the nodes are: |
@@ -1,5 +1,5 @@
1
1
  @step_features
2
- Feature: Listing file steps
2
+ Feature: Listing command steps
3
3
  In order to test a running system
4
4
  As an administrator
5
5
  I want to know what command steps are available
@@ -0,0 +1,8 @@
1
+ = DESCRIPTION:
2
+
3
+ = REQUIREMENTS:
4
+
5
+ = ATTRIBUTES:
6
+
7
+ = USAGE:
8
+
@@ -0,0 +1,4 @@
1
+ include_attribute 'attribute_include::b'
2
+ set[:mars_volta] = mars_volta_name
3
+ set[:mars_volta_is] = mars_volta_will_be
4
+
@@ -0,0 +1,2 @@
1
+ set[:mars_volta_name] = 'mars_volta'
2
+ set[:mars_volta_will_be] = 'dope'
@@ -0,0 +1,6 @@
1
+ maintainer "Opscode"
2
+ maintainer_email "do_not_reply@opscode.com"
3
+ license "Apache 2.0"
4
+ description "Installs/Configures recipe_include"
5
+ long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc'))
6
+ version "0.1"
@@ -0,0 +1,23 @@
1
+ #
2
+ # Cookbook Name:: recipe_include
3
+ # Recipe:: second
4
+ #
5
+ # Copyright 2009, Opscode
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+ #
19
+
20
+ execute "append to #{node[:tmpdir]}/mars_volta" do
21
+ command "echo '#{node.mars_volta} is #{node.mars_volta_is}' >> #{node[:tmpdir]}/mars_volta"
22
+ end
23
+
@@ -21,7 +21,7 @@ Feature: Examining files
21
21
  @steps
22
22
  Scenario: Atime
23
23
  Given the empty file "foo.file"
24
- And we record the a/mtime of "foo.file"
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`
27
27
  Then the atime of "foo.file" changes
@@ -29,7 +29,7 @@ Feature: Examining files
29
29
  @steps
30
30
  Scenario: Mtime
31
31
  Given an empty file named "foo.file"
32
- And we record the a/mtime of "foo.file"
32
+ And we record the a-mtime of "foo.file"
33
33
  And I run `sleep 1`
34
34
  And I run `touch -m foo.file`
35
35
  Then the mtime of "foo.file" changes
@@ -16,20 +16,12 @@ Feature: Listing file steps
16
16
  Then these steps are defined for "cuken/cucumber/file.rb":
17
17
  | step |
18
18
  |a directory named "([^"]*)" |
19
- |a directory named "([^"]*)" should exist |
20
- |a directory named "([^"]*)" should not exist |
21
- |a file named "([^"]*)" should exist |
22
- |a file named "([^"]*)" should not exist |
23
19
  |I remove the file "([^"]*)" |
24
20
  |the directory "([^"]*)" exists |
25
21
  |the directory "([^"]*)" does not exist |
26
22
  |the file "([^"]*)" exists |
27
23
  |the file "([^"]*)" does not exist |
28
24
  |the file "([^"]*)" should not exist |
29
- |the following directories should exist: |
30
- |the following directories should not exist: |
31
- |the following files should exist: |
32
- |the following files should not exist: |
33
25
  |these files exist: |
34
26
  |these files do not exist: |
35
27
  |these directories exist: |
@@ -38,32 +30,28 @@ Feature: Listing file steps
38
30
  Scenario: File and directory properties
39
31
  Then these steps are defined for "cuken/cucumber/file.rb":
40
32
  | step |
41
- |the file "([^"]*)" has mode "([^"]*)" |
42
33
  |the directory "([^"]*)" has decimal mode "(\d+)" |
43
34
  |the directory "([^"]*)" has octal mode "(\d+)" |
44
- |the directory "(.+)" is owned by "(.+)" |
35
+ |the directory "([^"]*)" is owned by "([^"]*)" |
45
36
  |the file "([^"]*)" has decimal mode "(\d+)" |
46
37
  |the file "([^"]*)" has octal mode "(\d+)" |
47
- |the file "(.+)" is owned by "(.+)" |
48
- |the (.)time of "(.+)" changes |
49
- |we record the a-mtime of "(.+)" |
38
+ |the file "([^"]*)" is owned by "([^"]*)" |
39
+ |the (.)time of "([^"]*)" changes |
40
+ |we record the a-mtime of "([^"]*)" |
50
41
 
51
42
  Scenario: File and directory content
52
43
  Then these steps are defined for "cuken/cucumber/file.rb":
53
44
  | step |
54
- |a file named "([^"]*)" with: |
55
- |an empty file named "([^"]*)" |
56
45
  |the file "([^"]*)" with: |
57
46
  |the empty file "([^"]*)" |
58
47
  |the file "([^"]*)" contains "([^"]*)" |
59
- |the file "([^"]*)" contains "([^"]*)" exactly (\d+) times |
48
+ |the file "([^"]*)" contains \/([^\/]*)\/ |
60
49
  |the file "([^"]*)" contains exactly: |
50
+ |the file "([^"]*)" contains "([^"]*)" exactly "(\d+)" times |
51
+ |the file "([^"]*)" does not contain "([^"]*)" |
52
+ |the file "([^"]*)" does not contain \/([^\/]*)\/ |
53
+ |the file "([^"]*)" does not contain exactly: |
61
54
  |the file "([^"]*)" does not contain "([^"]*)" exactly "(\d+)" times |
62
- |the file "([^"]*)" should contain "([^"]*)" |
63
- |the file "([^"]*)" should not contain "([^"]*)" |
64
- |the file "([^"]*)" should contain exactly: |
65
- |the file "([^"]*)" should match \/([^\/]*)\/ |
66
- |the file "([^"]*)" should not match \/([^\/]*)\/ |
67
55
  |I write to "([^"]*)" with: |
68
56
  |I overwrite "([^"]*)" with: |
69
57
  |I append to "([^"]*)" with: |
@@ -2,7 +2,7 @@
2
2
  # lib/aruba/cucumber.rb
3
3
  # or https://github.com/aslakhellesoy/aruba/blob/master/lib/aruba/cucumber.rb
4
4
  @announce
5
- Feature: SSH steps
5
+ Feature: Password-less SSH
6
6
  In order to specify remote command execution
7
7
  As a developer using Cucumber
8
8
  I want to use Aruba and custom steps to describe SSH sessions
@@ -1,5 +1,5 @@
1
1
  @step_features
2
- Feature: Listing file steps
2
+ Feature: Listing SSH steps
3
3
  In order to test a running system
4
4
  As an administrator
5
5
  I want to know what SSH steps are available
@@ -38,6 +38,10 @@ module ::Cuken
38
38
  'knife '
39
39
  end
40
40
 
41
+ def knife_debug
42
+ @knife_debug ||= true
43
+ end
44
+
41
45
  def client
42
46
  @client ||= begin
43
47
  c = ::Chef::Client.new
@@ -8,36 +8,68 @@ module ::Cuken
8
8
 
9
9
  include ::Cuken::Api::Chef::Common
10
10
 
11
- def update_cookbook_paths(ckbk_path, cookbook)
12
- lp = Pathname(ckbk_path).expand_path.realdirpath
13
- lrp = lp + '.git'
11
+ def append_cookbook_path(cookbook, lp, lrp)
14
12
  if lrp.exist?
13
+ announce_or_puts(%{# Adding cookbook path: #{lp}}) if @announce_env && cookbook
15
14
  chef.cookbook_paths << lp if cookbook
15
+ announce_or_puts(%{# Adding cookbooks path: #{lp.parent}}) if @announce_env && cookbook
16
16
  chef.cookbooks_paths << lp.parent if cookbook
17
17
  lrp
18
+ else
19
+ announce_or_puts(%{# WARNING: cookbook(s) path: #{lp} is not a Git repository.}) if @announce_env && cookbook
20
+ end
21
+ end
22
+
23
+ def update_cookbook_paths(ckbk_path, cookbook)
24
+ lp = Pathname(ckbk_path).expand_path.realdirpath
25
+ lrp = lp + '.git'
26
+ if cookbook
27
+ append_cookbook_path(cookbook, lp, lrp)
28
+ else
29
+ lp.each_child do |pth|
30
+ rpth = pth + '.git'
31
+ append_cookbook_path(true, pth, rpth) if rpth.directory?
32
+ end
33
+ chef.cookbooks_paths.uniq!
34
+ if chef.cookbooks_paths.empty?
35
+ announce_or_puts(%{# WARNING: cookbooks path: #{lp} does not contain any Git repositories.}) if @announce_env
36
+ end
18
37
  end
19
38
  end
20
39
 
21
40
  def chef_clone_repo(ckbk_path, cookbook = false, repo = chef.remote_chef_repo, brnch = 'master')
22
41
  in_current_dir do
42
+ gritty = ::Grit::Git.new(current_dir)
43
+ clone_opts = {:quiet => false, :verbose => true, :progress => true, :branch => brnch}
23
44
  if Dir.exists?(ckbk_path)
24
- update_cookbook_paths(ckbk_path, cookbook)
45
+ $stdout.puts "Pulling: #{repo} into #{ckbk_path}"
46
+ gritty.pull(clone_opts, repo, ckbk_path)
25
47
  else
26
- clone_opts = {:quiet => false, :verbose => true, :progress => true, :branch => brnch}
27
- gritty = ::Grit::Git.new(current_dir)
48
+ $stdout.puts "Cloning: #{repo} into #{ckbk_path}"
28
49
  gritty.clone(clone_opts, repo, ckbk_path)
29
- update_cookbook_paths(ckbk_path, cookbook)
30
50
  end
51
+ update_cookbook_paths(ckbk_path, cookbook)
52
+ Pathname(ckbk_path)
31
53
  end
32
54
  end
33
55
 
34
56
  def run_knife_command(cmd, interactive=false)
57
+ no_ckbk_pth_opt = ['cookbook delete'].each{|str| break true if cmd[/#{str}/]}
58
+ no_ckbk_pth = chef.cookbooks_paths.empty?
59
+ if no_ckbk_pth
60
+ ckbk_pth_opt = false
61
+ else
62
+ ckbk_pth = (chef.cookbooks_paths.collect { |pn| pn.expand_path.to_s }).join(':')
63
+ ckbk_pth_opt = true
64
+ end
65
+ ckbk_pth_opt = false if no_ckbk_pth_opt.is_a? TrueClass
35
66
  in_current_dir do
36
67
  unless chef.client_knife_path
37
68
  chef.client_knife_path = Pathname(chef.local_chef_repo).ascend { |d| h=d+'.chef'+'knife.rb'; break h if h.file? }
38
69
  end
70
+ raise(RuntimeError, "chef.client_knife_path is required", caller) unless chef.client_knife_path
39
71
  cmd += " -c #{chef.client_knife_path.expand_path.to_s}" if chef.client_knife_path.expand_path.exist?
40
- cmd += " -o #{(chef.cookbooks_paths.collect { |pn| pn.expand_path.to_s }).join(':')}" unless chef.cookbooks_paths.empty?
72
+ cmd += " -o #{ckbk_pth}" if ckbk_pth_opt
41
73
  cmd += " --log_level debug" if chef.knife_debug
42
74
  if interactive
43
75
  run_interactive(unescape("#{chef.knife}" + cmd))
@@ -38,29 +38,32 @@ Given /^the Chef client private key path "([^"]*)"$/ do |path|
38
38
  end
39
39
  end
40
40
 
41
- Given /^the remote chef repository "([^"]*)"$/ do |chf_pth|
41
+ Given /^the remote Chef repository "([^"]*)"$/ do |chf_pth|
42
42
  in_current_dir do
43
- chef.remote_chef_repo = Pathname(chf_pth).expand_path.realdirpath
43
+ if Pathname(chf_pth).exist?
44
+ chef.remote_chef_repo = Pathname(chf_pth).expand_path.realdirpath
45
+ else
46
+ chef.remote_chef_repo = chf_pth
47
+ end
44
48
  end
45
49
  end
46
50
 
47
- Given /^the local chef repository "([^"]*)"$/ do |chf_pth|
51
+ Given /^the local Chef repository "([^"]*)"$/ do |chf_pth|
48
52
  in_current_dir do
49
53
  chef.local_chef_repo = Pathname(chf_pth).expand_path.realdirpath
50
54
  end
51
55
  end
52
56
 
53
- Then /^the local chef repository exists$/ do
57
+ Then /^the local Chef repository exists$/ do
54
58
  chef.local_chef_repo.exist?.should be_true
55
59
  #TODO: check_file_presence([file], true), etc.
56
60
  end
57
61
 
58
- Given /^I clone the remote chef repository branch "([^"]*)" to "([^"]*)"$/ do |brnch, path|
59
- @chef_repo_path = "We are here..."
62
+ Given /^I clone the remote Chef repository branch "([^"]*)" to "([^"]*)"$/ do |brnch, path|
60
63
  chef.local_chef_repo = chef_clone_repo(path, false, chef.remote_chef_repo, brnch)
61
64
  end
62
65
 
63
- Given /^a default base chef repository in "([^"]*)"$/ do |path|
66
+ Given /^a default base Chef repository in "([^"]*)"$/ do |path|
64
67
  chef.local_chef_repo = chef_clone_repo(path)
65
68
  chef.local_chef_repo.exist?.should be_true
66
69
  end
@@ -23,26 +23,32 @@
23
23
  # limitations under the License.
24
24
  #
25
25
 
26
- Given /^the remote cookbook repository "([^"]*)"$/ do |ckbk_repo|
26
+ Given /^the remote Cookbook repository "([^"]*)"$/ do |ckbk_repo|
27
27
  in_current_dir do
28
28
  chef.remote_cookbook_repo = Pathname(ckbk_repo).expand_path.realdirpath
29
29
  end
30
30
  end
31
31
 
32
- Given /^the local cookbook repository "([^"]*)"$/ do |ckbk_repo|
32
+ Given /^the local Cookbook repository "([^"]*)"$/ do |ckbk_repo|
33
33
  in_current_dir do
34
34
  chef.local_cookbook_repo = Pathname(ckbk_repo).expand_path.realdirpath
35
35
  end
36
36
  end
37
37
 
38
- Then /^the local cookbook repository exists$/ do
38
+ Then /^the local Cookbook repository exists$/ do
39
39
  chef.local_cookbook_repo.exist?.should be_true
40
40
  #TODO: check_file_presence([file], true), etc.
41
41
  end
42
42
 
43
43
  Given /^a cookbook path "([^"]*)"$/ do |path|
44
44
  in_current_dir do
45
- chef.cookbook_paths << Pathname(path).expand_path.realdirpath
45
+ update_cookbook_paths(path, true)
46
+ end
47
+ end
48
+
49
+ Given /^a cookbooks path "([^"]*)"$/ do |path|
50
+ in_current_dir do
51
+ update_cookbook_paths(path, false)
46
52
  end
47
53
  end
48
54
 
@@ -54,7 +60,7 @@ Then /^the local cookbook "([^"]*)" exists$/ do |ckbk|
54
60
  #TODO: check_file_presence([file], true), etc.
55
61
  end
56
62
 
57
- Given /^I clone the remote cookbook repository branch "([^"]*)" to "([^"]*)"$/ do |brnch, ckbk_path|
63
+ Given /^I clone the remote Cookbook repository branch "([^"]*)" to "([^"]*)"$/ do |brnch, ckbk_path|
58
64
  chef.local_cookbook_repo = chef_clone_repo(ckbk_path, true, chef.remote_cookbook_repo, brnch)
59
65
  end
60
66
 
@@ -26,7 +26,7 @@ Given /^the Knife file "([^"]*)"$/ do |path|
26
26
  end
27
27
 
28
28
  When /^I successfully run Knife's "([^"]*)"$/ do |cmd|
29
- run_knife_command(cmd, true)
29
+ run_knife_command(cmd, false)
30
30
  end
31
31
 
32
32
  When /^I interactively run Knife's "([^"]*)"$/ do |cmd|
@@ -25,3 +25,11 @@ Given /^a validated node$/ do
25
25
  client.build_node
26
26
  client.node.run_list << "integration_setup"
27
27
  end
28
+
29
+ ###
30
+ # Then
31
+ ###
32
+ Then /^the nodes are:$/ do |partial_output|
33
+ run_knife_command('node list')
34
+ all_stdout.should include(partial_output)
35
+ end
@@ -0,0 +1,7 @@
1
+ ###
2
+ # Then
3
+ ###
4
+ Then /^the roles are:$/ do |partial_output|
5
+ run_knife_command('role list')
6
+ all_stdout.should include(partial_output)
7
+ end
@@ -14,3 +14,5 @@ end
14
14
  require 'cuken/cucumber/chef/common'
15
15
  require 'cuken/cucumber/chef/knife'
16
16
  require 'cuken/cucumber/chef/cookbook'
17
+ require 'cuken/cucumber/chef/node'
18
+ require 'cuken/cucumber/chef/role'
@@ -2,3 +2,7 @@
2
2
  And /^wait "([^"]*)" seconds$/ do |delay|
3
3
  ::Kernel.sleep(delay.to_f)
4
4
  end
5
+
6
+ Given /^the working directory is "([^"]*)"$/ do |path|
7
+ @dirs = [path]
8
+ end
@@ -32,10 +32,26 @@ Then /^the file "([^"]*)" contains "([^"]*)"$/ do |file, content|
32
32
  Then %Q{the file "#{file}" should contain "#{content}"}
33
33
  end
34
34
 
35
+ Then /^the file "([^"]*)" does not contain "([^"]*)"$/ do |file, content|
36
+ Then %Q{the file "#{file}" should not contain "#{content}"}
37
+ end
38
+
39
+ Then /^the file "([^"]*)" contains \/([^\/]*)\/$/ do |file, re|
40
+ Then %Q{the file "#{file}" should match /#{re}/}
41
+ end
42
+
43
+ Then /^the file "([^"]*)" does not contain \/([^\/]*)\/$/ do |file, re|
44
+ Then %Q{the file "#{file}" should not match /#{re}/}
45
+ end
46
+
35
47
  Then /^the file "([^"]*)" contains exactly:$/ do |file, content|
36
48
  Then %Q{the file "#{file}" should contain exactly:}, content
37
49
  end
38
50
 
51
+ Then /^the file "([^"]*)" does not contain exactly:$/ do |file, content|
52
+ Then %Q{the file "#{file}" should not contain exactly:}, content
53
+ end
54
+
39
55
  Then /^these directories exist:$/ do |table|
40
56
  Then %Q{the following directories should exist:}, table
41
57
  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.2
5
+ version: 0.1.4
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-03-24 00:00:00 +11:00
13
+ date: 2011-03-29 00:00:00 +11:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -167,14 +167,18 @@ files:
167
167
  - cucumber.yml
168
168
  - cuken.gemspec
169
169
  - examples/chef/features/support/env.rb
170
- - features/chef/cookbooks/cookbook.feature
171
- - features/chef/cookbooks/metadata.feature
172
- - features/chef/cookbooks/repo.feature
173
- - features/chef/knife.feature
174
- - features/chef/knife_steps.feature
175
- - features/command_steps.feature
176
- - features/commands.feature
177
- - features/common_steps.feature
170
+ - features/.nav
171
+ - features/about.md
172
+ - features/chef_examples/cookbooks_cookbook.feature
173
+ - features/chef_examples/cookbooks_metadata.feature
174
+ - features/chef_examples/cookbooks_repo.feature
175
+ - features/chef_steps/common_steps.feature
176
+ - features/chef_steps/cookbook_steps.feature
177
+ - features/chef_steps/knife_admin_client.feature
178
+ - features/chef_steps/knife_steps.feature
179
+ - features/chef_steps/node_steps.feature
180
+ - features/command_examples/commands.feature
181
+ - features/command_steps/command_steps.feature
178
182
  - features/cuken.feature
179
183
  - features/data/Rakefile
180
184
  - features/data/apt/chef-integration-test-1.0/debian/changelog
@@ -506,6 +510,11 @@ files:
506
510
  - features/data/repositories/chef-repo/cookbooks/README.md
507
511
  - features/data/repositories/chef-repo/data_bags/README.md
508
512
  - features/data/repositories/chef-repo/roles/README.md
513
+ - features/data/repositories/cookbooks/attribute_include/README.rdoc
514
+ - features/data/repositories/cookbooks/attribute_include/attributes/a.rb
515
+ - features/data/repositories/cookbooks/attribute_include/attributes/b.rb
516
+ - features/data/repositories/cookbooks/attribute_include/metadata.rb
517
+ - features/data/repositories/cookbooks/attribute_include/recipes/default.rb
509
518
  - features/data/repositories/cookbooks/hosts/attributes/hosts.rb
510
519
  - features/data/repositories/cookbooks/hosts/cc.gemspec
511
520
  - features/data/repositories/cookbooks/hosts/metadata.json
@@ -515,10 +524,11 @@ files:
515
524
  - features/data/search-tests/do_knife_search_test.rb
516
525
  - features/data/search-tests/search-test-nodes.rb
517
526
  - features/data/test_git_repo.tar.gz
518
- - features/file_steps.feature
519
- - features/files.feature
520
- - features/ssh.feature
521
- - features/ssh_steps.feature
527
+ - features/file_examples/files.feature
528
+ - features/file_steps/file_steps.feature
529
+ - features/generic_steps/generic_steps.feature
530
+ - features/ssh_examples/ssh.feature
531
+ - features/ssh_steps/ssh_steps.feature
522
532
  - features/step_definitions/cuken_steps.rb
523
533
  - features/support/env.rb
524
534
  - lib/cuken.rb
@@ -550,6 +560,7 @@ files:
550
560
  - lib/cuken/cucumber/chef/request_steps.rb
551
561
  - lib/cuken/cucumber/chef/response_steps.rb
552
562
  - lib/cuken/cucumber/chef/result_steps.rb
563
+ - lib/cuken/cucumber/chef/role.rb
553
564
  - lib/cuken/cucumber/chef/run_client_steps.rb
554
565
  - lib/cuken/cucumber/chef/run_solo.rb
555
566
  - lib/cuken/cucumber/chef/sandbox_steps.rb
@@ -577,7 +588,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
577
588
  requirements:
578
589
  - - ">="
579
590
  - !ruby/object:Gem::Version
580
- hash: -2060724348231668193
591
+ hash: -277200992008000239
581
592
  segments:
582
593
  - 0
583
594
  version: "0"
@@ -1,19 +0,0 @@
1
- @knife @cookbook_upload @knife_cookbook_upload
2
- Feature: Upload Cookbooks with Knife
3
- In order to use cookbooks I have written
4
- As a knife user
5
- I want to upload my cookbooks
6
-
7
- Scenario: Uploading a new cookbook updates the metadata on the server
8
- Given I am an administrator
9
- When I upload the 'version' cookbook with knife
10
- When I 'GET' to the path '/cookbooks/version_updated'
11
- Then the inflated response should equal '{"version_updated"=>{"url"=>"http://127.0.0.1:4000/cookbooks/version_updated", "versions"=>[{"url"=>"http://127.0.0.1:4000/cookbooks/version_updated/2.0.0", "version"=>"2.0.0"}]}}'
12
-
13
- @regression
14
- Scenario: Uploading a new version updates the metadata on the server
15
- Given I am an administrator
16
- When I upload the 'version_updated' cookbook with knife
17
- When I 'GET' to the path '/cookbooks/version_updated'
18
- Then the inflated response should equal '{"version_updated"=>{"url"=>"http://127.0.0.1:4000/cookbooks/version_updated", "versions"=>[{"url"=>"http://127.0.0.1:4000/cookbooks/version_updated/2.0.0", "version"=>"2.0.0"}]}}'
19
-