berkshelf 2.0.0.beta → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +19 -1
- data/CONTRIBUTING.md +1 -3
- data/Gemfile +0 -20
- data/Guardfile +3 -3
- data/LICENSE +6 -5
- data/README.md +1 -0
- data/Thorfile +48 -67
- data/berkshelf.gemspec +48 -37
- data/features/apply_command.feature +17 -11
- data/features/config.feature +11 -11
- data/features/configure_command.feature +8 -8
- data/features/contingent_command.feature +37 -8
- data/features/cookbook_command.feature +17 -14
- data/features/groups_install.feature +24 -20
- data/features/install_command.feature +24 -33
- data/features/licenses.feature +112 -0
- data/features/list_command.feature +17 -5
- data/features/lockfile.feature +307 -188
- data/features/outdated_command.feature +1 -4
- data/features/package_command.feature +41 -19
- data/features/shelf/list.feature +39 -0
- data/features/shelf/show.feature +152 -0
- data/features/shelf/uninstall.feature +103 -0
- data/features/show_command.feature +49 -17
- data/features/step_definitions/filesystem_steps.rb +12 -3
- data/features/step_definitions/utility_steps.rb +0 -1
- data/features/support/env.rb +11 -4
- data/features/update_command.feature +22 -10
- data/features/upload_command.feature +174 -127
- data/features/vendor_install.feature +6 -6
- data/generator_files/Berksfile.erb +1 -1
- data/generator_files/metadata.rb.erb +7 -7
- data/lib/berkshelf.rb +39 -27
- data/lib/berkshelf/base_generator.rb +2 -3
- data/lib/berkshelf/berksfile.rb +69 -17
- data/lib/berkshelf/cached_cookbook.rb +17 -1
- data/lib/berkshelf/chef.rb +2 -4
- data/lib/berkshelf/chef/config.rb +51 -75
- data/lib/berkshelf/chef/cookbook.rb +1 -2
- data/lib/berkshelf/chef/cookbook/chefignore.rb +1 -1
- data/lib/berkshelf/cli.rb +144 -194
- data/lib/berkshelf/command.rb +11 -12
- data/lib/berkshelf/commands/shelf.rb +130 -0
- data/lib/berkshelf/commands/test_command.rb +11 -0
- data/lib/berkshelf/community_rest.rb +1 -2
- data/lib/berkshelf/config.rb +14 -10
- data/lib/berkshelf/cookbook_generator.rb +30 -24
- data/lib/berkshelf/cookbook_source.rb +1 -1
- data/lib/berkshelf/cookbook_store.rb +0 -1
- data/lib/berkshelf/core_ext.rb +1 -1
- data/lib/berkshelf/core_ext/file.rb +1 -1
- data/lib/berkshelf/downloader.rb +3 -1
- data/lib/berkshelf/errors.rb +128 -53
- data/lib/berkshelf/formatters.rb +2 -6
- data/lib/berkshelf/formatters/human_readable.rb +8 -2
- data/lib/berkshelf/formatters/json.rb +7 -1
- data/lib/berkshelf/formatters/null.rb +0 -1
- data/lib/berkshelf/git.rb +16 -16
- data/lib/berkshelf/init_generator.rb +28 -26
- data/lib/berkshelf/location.rb +12 -11
- data/lib/berkshelf/locations/chef_api_location.rb +2 -2
- data/lib/berkshelf/locations/git_location.rb +0 -1
- data/lib/berkshelf/locations/github_location.rb +0 -1
- data/lib/berkshelf/locations/path_location.rb +1 -2
- data/lib/berkshelf/locations/site_location.rb +3 -2
- data/lib/berkshelf/lockfile.rb +29 -10
- data/lib/berkshelf/mixin/config.rb +155 -0
- data/lib/berkshelf/mixin/logging.rb +0 -1
- data/lib/berkshelf/mixin/shellout.rb +71 -0
- data/lib/berkshelf/resolver.rb +7 -4
- data/lib/berkshelf/test.rb +1 -3
- data/lib/berkshelf/ui.rb +8 -4
- data/lib/berkshelf/version.rb +1 -1
- data/lib/thor/monkies/shell.rb +0 -1
- data/spec/config/berkshelf.pem +27 -0
- data/spec/config/knife.rb +12 -0
- data/spec/config/validator.pem +27 -0
- data/spec/spec_helper.rb +4 -8
- data/spec/support/chef_api.rb +14 -9
- data/spec/support/chef_server.rb +3 -4
- data/spec/unit/berkshelf/berksfile_spec.rb +1 -1
- data/spec/unit/berkshelf/cookbook_generator_spec.rb +12 -6
- data/spec/unit/berkshelf/cookbook_source_spec.rb +13 -1
- data/spec/unit/berkshelf/init_generator_spec.rb +5 -0
- data/spec/unit/chef/config_spec.rb +9 -10
- metadata +216 -93
- data/features/info_command.feature +0 -39
- data/features/open_command.feature +0 -36
- data/lib/berkshelf/cli_commands/test_command.rb +0 -11
- data/lib/berkshelf/mixin.rb +0 -10
- data/lib/berkshelf/mixin/path_helpers.rb +0 -30
- data/spec/support/knife.rb +0 -18
@@ -3,6 +3,15 @@ require 'aruba/api'
|
|
3
3
|
World(Aruba::Api)
|
4
4
|
World(Berkshelf::RSpec::ChefAPI)
|
5
5
|
|
6
|
+
Given /^I dynamically write to "(.+)" with:$/ do |file, contents|
|
7
|
+
steps %{
|
8
|
+
Given I write to "#{file}" with:
|
9
|
+
"""
|
10
|
+
#{ERB.new(contents).result(binding)}
|
11
|
+
"""
|
12
|
+
}
|
13
|
+
end
|
14
|
+
|
6
15
|
Given /^a cookbook named "(.*?)"$/ do |name|
|
7
16
|
steps %{
|
8
17
|
Given a directory named "#{name}"
|
@@ -42,8 +51,8 @@ Given /^the cookbook "(.*?)" has the file "(.*?)" with:$/ do |cookbook_name, fil
|
|
42
51
|
end
|
43
52
|
|
44
53
|
Given /^the cookbook store has the cookbooks:$/ do |cookbooks|
|
45
|
-
cookbooks.raw.each do |name, version|
|
46
|
-
generate_cookbook(cookbook_store, name, version)
|
54
|
+
cookbooks.raw.each do |name, version, license|
|
55
|
+
generate_cookbook(cookbook_store, name, version, license: license)
|
47
56
|
end
|
48
57
|
end
|
49
58
|
|
@@ -126,7 +135,7 @@ Then /^I should have a new cookbook skeleton "(.*?)" with Chef-Minitest support$
|
|
126
135
|
cb_path = Pathname.new(current_dir).join(name)
|
127
136
|
expect(cb_path).to have_structure {
|
128
137
|
file "Berksfile" do
|
129
|
-
contains "cookbook
|
138
|
+
contains "cookbook 'minitest-handler'"
|
130
139
|
end
|
131
140
|
file "Vagrantfile" do
|
132
141
|
contains "recipe[minitest-handler::default]"
|
@@ -22,7 +22,6 @@ Then /^the output should be the same as \`(.+)\`$/ do |command|
|
|
22
22
|
end
|
23
23
|
|
24
24
|
# The built-in regex matcher does not support multi-line matching :(
|
25
|
-
# @author Seth Vargo <sethvargo@gmail.com>
|
26
25
|
Then /^the output should match multiline:$/ do |expected|
|
27
26
|
regex = Regexp.new(expected.strip, Regexp::MULTILINE)
|
28
27
|
expect(regex).to match(all_output)
|
data/features/support/env.rb
CHANGED
@@ -11,7 +11,7 @@ Spork.prefork do
|
|
11
11
|
|
12
12
|
ENV['RUBY_ENV'] = 'test'
|
13
13
|
ENV['BERKSHELF_PATH'] = File.join(APP_ROOT, 'tmp', 'berkshelf')
|
14
|
-
ENV['BERKSHELF_CHEF_CONFIG'] = File.join(APP_ROOT, 'spec', 'knife.rb')
|
14
|
+
ENV['BERKSHELF_CHEF_CONFIG'] = File.join(APP_ROOT, 'spec', 'config', 'knife.rb')
|
15
15
|
|
16
16
|
# Workaround for RSA Fingerprint prompt in Travis CI
|
17
17
|
git_ssh_path = '/tmp/git_ssh.sh'
|
@@ -34,7 +34,7 @@ Spork.prefork do
|
|
34
34
|
clean_cookbook_store
|
35
35
|
generate_berks_config(File.join(ENV['BERKSHELF_PATH'], 'config.json'))
|
36
36
|
@aruba_io_wait_seconds = 5
|
37
|
-
@aruba_timeout_seconds =
|
37
|
+
@aruba_timeout_seconds = 30
|
38
38
|
end
|
39
39
|
|
40
40
|
Before('@slow_process') do
|
@@ -42,6 +42,15 @@ Spork.prefork do
|
|
42
42
|
@aruba_io_wait_seconds = 30
|
43
43
|
end
|
44
44
|
|
45
|
+
# Chef Zero
|
46
|
+
require 'chef_zero/server'
|
47
|
+
@server = ChefZero::Server.new(port: 4000, generate_real_keys: false)
|
48
|
+
@server.start_background
|
49
|
+
|
50
|
+
at_exit do
|
51
|
+
@server.stop if @server && @server.running?
|
52
|
+
end
|
53
|
+
|
45
54
|
def cookbook_store
|
46
55
|
Pathname.new(File.join(ENV['BERKSHELF_PATH'], 'cookbooks'))
|
47
56
|
end
|
@@ -65,7 +74,5 @@ Spork.prefork do
|
|
65
74
|
end
|
66
75
|
|
67
76
|
Spork.each_run do
|
68
|
-
Berkshelf::RSpec::Knife.load_knife_config(File.join(APP_ROOT, 'spec/knife.rb'))
|
69
|
-
|
70
77
|
require 'berkshelf'
|
71
78
|
end
|
@@ -1,15 +1,17 @@
|
|
1
|
-
Feature:
|
1
|
+
Feature: Updating a cookbook defined by a Berksfile
|
2
2
|
As a user
|
3
3
|
I want a way to update the versions without clearing out the files I've downloaded
|
4
4
|
So that I can update faster than a clean install
|
5
5
|
|
6
|
-
Scenario:
|
7
|
-
Given
|
6
|
+
Scenario: With the old lockfile format
|
7
|
+
Given the cookbook store has the cookbooks:
|
8
|
+
| berkshelf-cookbook-fixture | 0.1.0 |
|
9
|
+
And I write to "Berksfile" with:
|
8
10
|
"""
|
9
11
|
site :opscode
|
10
12
|
cookbook 'berkshelf-cookbook-fixture', '~> 0.1'
|
11
13
|
"""
|
12
|
-
|
14
|
+
And I write to "Berksfile.lock" with:
|
13
15
|
"""
|
14
16
|
cookbook 'berkshelf-cookbook-fixture', :locked_version => '0.1.0'
|
15
17
|
"""
|
@@ -21,21 +23,25 @@ Feature: update command
|
|
21
23
|
"sha":"b2714a4f9bdf500cb20267067160a0b3c1d8404c",
|
22
24
|
"sources":{
|
23
25
|
"berkshelf-cookbook-fixture":{
|
24
|
-
"locked_version":"0.
|
26
|
+
"locked_version":"0.1.0",
|
25
27
|
"constraint":"~> 0.1"
|
26
28
|
}
|
27
29
|
}
|
28
30
|
}
|
29
31
|
"""
|
30
32
|
|
31
|
-
Scenario:
|
32
|
-
Given
|
33
|
+
Scenario: Without a cookbook specified
|
34
|
+
Given the cookbook store has the cookbooks:
|
35
|
+
| berkshelf-cookbook-fixture | 0.1.0 |
|
36
|
+
| berkshelf-cookbook-fixture | 0.2.0 |
|
37
|
+
| hostsfile | 1.0.1 |
|
38
|
+
And I write to "Berksfile" with:
|
33
39
|
"""
|
34
40
|
site :opscode
|
35
41
|
cookbook 'berkshelf-cookbook-fixture', '~> 0.1'
|
36
42
|
cookbook 'hostsfile', '~> 1.0.0'
|
37
43
|
"""
|
38
|
-
|
44
|
+
And I write to "Berksfile.lock" with:
|
39
45
|
"""
|
40
46
|
{
|
41
47
|
"sha":"9d10199aa2652f9e965149c4346db20c78e97553",
|
@@ -69,7 +75,11 @@ Feature: update command
|
|
69
75
|
}
|
70
76
|
"""
|
71
77
|
|
72
|
-
Scenario:
|
78
|
+
Scenario: With a single cookbook specified
|
79
|
+
Given the cookbook store has the cookbooks:
|
80
|
+
| berkshelf-cookbook-fixture | 0.1.0 |
|
81
|
+
| berkshelf-cookbook-fixture | 0.2.0 |
|
82
|
+
| hostsfile | 1.0.1 |
|
73
83
|
Given I write to "Berksfile" with:
|
74
84
|
"""
|
75
85
|
site :opscode
|
@@ -110,7 +120,9 @@ Feature: update command
|
|
110
120
|
}
|
111
121
|
"""
|
112
122
|
|
113
|
-
Scenario:
|
123
|
+
Scenario: With a cookbook that does not exist
|
124
|
+
Given the cookbook store has the cookbooks:
|
125
|
+
| berkshelf-cookbook-fixture | 0.1.0 |
|
114
126
|
Given I write to "Berksfile" with:
|
115
127
|
"""
|
116
128
|
site :opscode
|
@@ -1,117 +1,125 @@
|
|
1
|
-
Feature:
|
1
|
+
Feature: Uploading cookbooks to a Chef Server
|
2
2
|
As a Berkshelf CLI user
|
3
3
|
I need a way to upload cookbooks to a Chef server that I have installed into my Bookshelf
|
4
4
|
So they are available to Chef clients
|
5
5
|
|
6
|
-
@
|
7
|
-
Scenario:
|
8
|
-
Given
|
6
|
+
@chef_server @slow_process
|
7
|
+
Scenario: With no arguments
|
8
|
+
Given the cookbook store has the cookbooks:
|
9
|
+
| fake | 1.0.0 |
|
10
|
+
| ekaf | 2.0.0 |
|
11
|
+
And I write to "Berksfile" with:
|
9
12
|
"""
|
10
|
-
cookbook
|
13
|
+
cookbook 'fake', '1.0.0'
|
14
|
+
cookbook 'ekaf', '2.0.0'
|
11
15
|
"""
|
12
16
|
And the Chef server does not have the cookbooks:
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
16
|
-
|
17
|
-
Then the output should not contain "Using mysql (1.2.4)"
|
18
|
-
And the output should not contain "Using openssl (1.0.0)"
|
19
|
-
And the output should contain "Uploading mysql (1.2.4) to:"
|
20
|
-
And the output should contain "Uploading openssl (1.0.0) to:"
|
21
|
-
And the Chef server should have the cookbooks:
|
22
|
-
| mysql | 1.2.4 |
|
23
|
-
| openssl | 1.0.0 |
|
24
|
-
And the exit status should be 0
|
25
|
-
|
26
|
-
@chef_server @slow_process
|
27
|
-
Scenario: running the upload command when the Sources in the Berksfile have not been installed
|
28
|
-
Given I write to "Berksfile" with:
|
17
|
+
| fake | 1.0.0 |
|
18
|
+
| ekaf | 2.0.0 |
|
19
|
+
When I successfully run `berks upload`
|
20
|
+
Then the output should contain:
|
29
21
|
"""
|
30
|
-
|
31
|
-
|
22
|
+
Uploading fake (1.0.0) to: 'http://localhost:4000/'
|
23
|
+
Uploading ekaf (2.0.0) to: 'http://localhost:4000/'
|
32
24
|
"""
|
33
|
-
And the Chef server does not have the cookbooks:
|
34
|
-
| mysql | 1.2.4 |
|
35
|
-
| openssl | 1.0.0 |
|
36
|
-
When I run the upload command
|
37
|
-
Then the output should contain "Installing mysql (1.2.4) from site:"
|
38
|
-
And the output should contain "Installing openssl (1.0.0) from site:"
|
39
|
-
And the output should contain "Uploading mysql (1.2.4) to:"
|
40
|
-
And the output should contain "Uploading openssl (1.0.0) to:"
|
41
25
|
And the Chef server should have the cookbooks:
|
42
|
-
|
|
43
|
-
|
|
26
|
+
| fake | 1.0.0 |
|
27
|
+
| ekaf | 2.0.0 |
|
44
28
|
And the exit status should be 0
|
45
29
|
|
46
30
|
@chef_server
|
47
|
-
Scenario:
|
48
|
-
Given a
|
49
|
-
|
31
|
+
Scenario: With a path location in the Berksfile
|
32
|
+
Given a cookbook named "fake"
|
33
|
+
And I write to "Berksfile" with:
|
34
|
+
"""
|
35
|
+
cookbook 'fake', path: './fake'
|
36
|
+
"""
|
50
37
|
And the Chef server does not have the cookbooks:
|
51
|
-
|
|
52
|
-
When I run
|
53
|
-
Then the output should contain
|
54
|
-
|
38
|
+
| fake | 0.0.0 |
|
39
|
+
When I successfully run `berks upload`
|
40
|
+
Then the output should contain:
|
41
|
+
"""
|
42
|
+
Uploading fake (0.0.0) to: 'http://localhost:4000/'
|
43
|
+
"""
|
55
44
|
And the Chef server should have the cookbooks:
|
56
|
-
|
|
45
|
+
| fake | 0.0.0 |
|
57
46
|
And the exit status should be 0
|
58
47
|
|
59
48
|
@chef_server
|
60
|
-
Scenario:
|
61
|
-
Given
|
49
|
+
Scenario: With a git location in the Berksfile
|
50
|
+
Given the cookbook store has the cookbooks:
|
51
|
+
| berkshelf-cookbook-fixture | 0.1.0 |
|
52
|
+
And I write to "Berksfile" with:
|
62
53
|
"""
|
63
|
-
cookbook
|
54
|
+
cookbook 'berkshelf-cookbook-fixture', ref: 'v0.1.0'
|
64
55
|
"""
|
65
56
|
And the Chef server does not have the cookbooks:
|
66
|
-
|
|
67
|
-
When I run
|
68
|
-
Then the output should contain
|
69
|
-
|
57
|
+
| berkshelf-cookbook-fixture | 0.1.0 |
|
58
|
+
When I successfully run `berks upload`
|
59
|
+
Then the output should contain:
|
60
|
+
"""
|
61
|
+
Uploading berkshelf-cookbook-fixture (0.1.0) to: 'http://localhost:4000/'
|
62
|
+
"""
|
70
63
|
And the Chef server should have the cookbooks:
|
71
|
-
|
|
64
|
+
| berkshelf-cookbook-fixture | 0.1.0 |
|
72
65
|
And the exit status should be 0
|
73
66
|
|
74
67
|
@chef_server @slow_process
|
75
|
-
Scenario:
|
76
|
-
Given
|
68
|
+
Scenario: With a single cookbook
|
69
|
+
Given the cookbook store has the cookbooks:
|
70
|
+
| fake | 1.0.0 |
|
71
|
+
| ekaf | 2.0.0 |
|
72
|
+
And the cookbook store contains a cookbook "reset" "3.4.5" with dependencies:
|
73
|
+
| fake | ~> 1.0.0 |
|
74
|
+
And I write to "Berksfile" with:
|
77
75
|
"""
|
78
|
-
cookbook
|
79
|
-
cookbook
|
80
|
-
cookbook
|
76
|
+
cookbook 'fake', '1.0.0'
|
77
|
+
cookbook 'ekaf', '2.0.0'
|
78
|
+
cookbook 'reset', '3.4.5'
|
81
79
|
"""
|
82
|
-
And I successfully run `berks install`
|
83
80
|
And the Chef server does not have the cookbooks:
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
When I run `berks upload
|
88
|
-
Then the output should contain
|
89
|
-
|
90
|
-
|
81
|
+
| fake | 1.0.0 |
|
82
|
+
| ekaf | 2.0.0 |
|
83
|
+
| reset | 3.4.5 |
|
84
|
+
When I successfully run `berks upload reset`
|
85
|
+
Then the output should contain:
|
86
|
+
"""
|
87
|
+
Uploading reset (3.4.5) to: 'http://localhost:4000/'
|
88
|
+
Uploading fake (1.0.0) to: 'http://localhost:4000/'
|
89
|
+
"""
|
91
90
|
And the Chef server should have the cookbooks:
|
92
|
-
|
|
93
|
-
|
|
91
|
+
| reset | 3.4.5 |
|
92
|
+
| fake | 1.0.0 |
|
94
93
|
And the Chef server should not have the cookbooks:
|
95
|
-
|
|
94
|
+
| ekaf | 2.0.0 |
|
96
95
|
And the exit status should be 0
|
97
96
|
|
98
97
|
@chef_server @slow_process
|
99
|
-
Scenario:
|
98
|
+
Scenario: With multiple cookbooks
|
99
|
+
Given the cookbook store has the cookbooks:
|
100
|
+
| ntp | 1.0.0 |
|
101
|
+
| vim | 1.0.0 |
|
102
|
+
| apt | 1.0.0 |
|
100
103
|
Given I write to "Berksfile" with:
|
101
104
|
"""
|
102
|
-
cookbook
|
103
|
-
cookbook
|
104
|
-
cookbook
|
105
|
+
cookbook 'ntp', '1.0.0'
|
106
|
+
cookbook 'vim', '1.0.0'
|
107
|
+
cookbook 'apt', '1.0.0'
|
105
108
|
"""
|
106
|
-
And I successfully run `berks install`
|
107
109
|
And the Chef server does not have the cookbooks:
|
108
110
|
| ntp |
|
109
111
|
| vim |
|
110
112
|
| apt |
|
111
|
-
When I run `berks upload ntp vim`
|
112
|
-
Then the output should contain
|
113
|
-
|
114
|
-
|
113
|
+
When I successfully run `berks upload ntp vim`
|
114
|
+
Then the output should contain:
|
115
|
+
"""
|
116
|
+
Uploading ntp (1.0.0) to: 'http://localhost:4000/'
|
117
|
+
Uploading vim (1.0.0) to: 'http://localhost:4000/'
|
118
|
+
"""
|
119
|
+
And the output should not contain:
|
120
|
+
"""
|
121
|
+
Uploading apt (1.0.0) to: 'http://localhost:4000/'
|
122
|
+
"""
|
115
123
|
And the Chef server should have the cookbooks:
|
116
124
|
| ntp |
|
117
125
|
| vim |
|
@@ -120,99 +128,138 @@ Feature: upload command
|
|
120
128
|
And the exit status should be 0
|
121
129
|
|
122
130
|
@chef_server @slow_process
|
123
|
-
Scenario:
|
131
|
+
Scenario: With the --only flag
|
132
|
+
Given the cookbook store has the cookbooks:
|
133
|
+
| core | 1.0.0 |
|
134
|
+
| system | 1.0.0 |
|
124
135
|
Given I write to "Berksfile" with:
|
125
136
|
"""
|
126
|
-
group :
|
127
|
-
cookbook
|
137
|
+
group :group_a do
|
138
|
+
cookbook 'core', '1.0.0'
|
128
139
|
end
|
129
140
|
|
130
|
-
group :
|
131
|
-
cookbook
|
141
|
+
group :group_b do
|
142
|
+
cookbook 'system', '1.0.0'
|
132
143
|
end
|
133
144
|
"""
|
134
|
-
And I successfully run `berks install`
|
135
145
|
And the Chef server does not have the cookbooks:
|
136
|
-
|
|
137
|
-
|
|
138
|
-
When I run `berks upload --only
|
139
|
-
Then the output should contain
|
140
|
-
|
146
|
+
| core | 1.0.0 |
|
147
|
+
| system | 1.0.0 |
|
148
|
+
When I successfully run `berks upload --only group_a`
|
149
|
+
Then the output should contain:
|
150
|
+
"""
|
151
|
+
Uploading core (1.0.0) to: 'http://localhost:4000/'
|
152
|
+
"""
|
153
|
+
And the output should not contain:
|
154
|
+
"""
|
155
|
+
Uploading system (1.0.0) to: 'http://localhost:4000/'
|
156
|
+
"""
|
141
157
|
And the Chef server should have the cookbooks:
|
142
|
-
|
|
158
|
+
| core | 1.0.0 |
|
143
159
|
And the Chef server should not have the cookbooks:
|
144
|
-
|
|
160
|
+
| system | 1.0.0 |
|
145
161
|
And the exit status should be 0
|
146
162
|
|
147
163
|
@chef_server @slow_process
|
148
|
-
Scenario:
|
164
|
+
Scenario: With the --only flag specifying multiple groups
|
165
|
+
Given the cookbook store has the cookbooks:
|
166
|
+
| core | 1.0.0 |
|
167
|
+
| system | 1.0.0 |
|
149
168
|
Given I write to "Berksfile" with:
|
150
169
|
"""
|
151
|
-
group :
|
152
|
-
cookbook
|
170
|
+
group :group_a do
|
171
|
+
cookbook 'core', '1.0.0'
|
153
172
|
end
|
154
173
|
|
155
|
-
group :
|
156
|
-
cookbook
|
174
|
+
group :group_b do
|
175
|
+
cookbook 'system', '1.0.0'
|
157
176
|
end
|
158
177
|
"""
|
159
|
-
And I successfully run `berks install`
|
160
178
|
And the Chef server does not have the cookbooks:
|
161
|
-
|
|
162
|
-
|
|
163
|
-
When I run `berks upload --only
|
164
|
-
Then the output should contain
|
165
|
-
|
179
|
+
| core | 1.0.0 |
|
180
|
+
| system | 1.0.0 |
|
181
|
+
When I successfully run `berks upload --only group_a group_b`
|
182
|
+
Then the output should contain:
|
183
|
+
"""
|
184
|
+
Uploading core (1.0.0) to: 'http://localhost:4000/'
|
185
|
+
Uploading system (1.0.0) to: 'http://localhost:4000/'
|
186
|
+
"""
|
166
187
|
And the Chef server should have the cookbooks:
|
167
|
-
|
|
168
|
-
|
|
188
|
+
| core | 1.0.0 |
|
189
|
+
| system | 1.0.0 |
|
169
190
|
And the exit status should be 0
|
170
191
|
|
171
192
|
@chef_server @slow_process
|
172
|
-
Scenario:
|
193
|
+
Scenario: With the --except flag
|
194
|
+
Given the cookbook store has the cookbooks:
|
195
|
+
| core | 1.0.0 |
|
196
|
+
| system | 1.0.0 |
|
173
197
|
Given I write to "Berksfile" with:
|
174
198
|
"""
|
175
|
-
group :
|
176
|
-
cookbook
|
199
|
+
group :group_a do
|
200
|
+
cookbook 'core', '1.0.0'
|
177
201
|
end
|
178
202
|
|
179
|
-
group :
|
180
|
-
cookbook
|
203
|
+
group :group_b do
|
204
|
+
cookbook 'system', '1.0.0'
|
181
205
|
end
|
182
206
|
"""
|
183
|
-
And I successfully run `berks install`
|
184
207
|
And the Chef server does not have the cookbooks:
|
185
|
-
|
|
186
|
-
|
|
187
|
-
When I run `berks upload --except
|
188
|
-
Then the output should
|
189
|
-
|
190
|
-
|
191
|
-
|
208
|
+
| core | 1.0.0 |
|
209
|
+
| system | 1.0.0 |
|
210
|
+
When I successfully run `berks upload --except group_b`
|
211
|
+
Then the output should contain:
|
212
|
+
"""
|
213
|
+
Uploading core (1.0.0) to: 'http://localhost:4000/'
|
214
|
+
"""
|
215
|
+
And the output should not contain:
|
216
|
+
"""
|
217
|
+
Uploading system (1.0.0) to: 'http://localhost:4000/'
|
218
|
+
"""
|
192
219
|
And the Chef server should have the cookbooks:
|
193
|
-
|
|
220
|
+
| core | 1.0.0 |
|
221
|
+
And the Chef server should not have the cookbooks:
|
222
|
+
| system | 1.0.0 |
|
194
223
|
And the exit status should be 0
|
195
224
|
|
196
225
|
@chef_server @slow_process
|
197
|
-
Scenario:
|
226
|
+
Scenario: With the --except flag specifying multiple groups
|
227
|
+
Given the cookbook store has the cookbooks:
|
228
|
+
| core | 1.0.0 |
|
229
|
+
| system | 1.0.0 |
|
198
230
|
Given I write to "Berksfile" with:
|
199
231
|
"""
|
200
|
-
group :
|
201
|
-
cookbook
|
232
|
+
group :group_a do
|
233
|
+
cookbook 'core', '1.0.0'
|
202
234
|
end
|
203
235
|
|
204
|
-
group :
|
205
|
-
cookbook
|
236
|
+
group :group_b do
|
237
|
+
cookbook 'system', '1.0.0'
|
206
238
|
end
|
207
239
|
"""
|
208
|
-
And I successfully run `berks install`
|
209
240
|
And the Chef server does not have the cookbooks:
|
210
|
-
|
|
211
|
-
|
|
212
|
-
When I run `berks upload --except
|
213
|
-
Then the output should not contain
|
214
|
-
|
241
|
+
| core | 1.0.0 |
|
242
|
+
| system | 1.0.0 |
|
243
|
+
When I successfully run `berks upload --except group_a group_b`
|
244
|
+
Then the output should not contain:
|
245
|
+
"""
|
246
|
+
Uploading core (1.0.0) to: 'http://localhost:4000/'
|
247
|
+
Uploading system (1.0.0) to: 'http://localhost:4000/'
|
248
|
+
"""
|
215
249
|
And the Chef server should not have the cookbooks:
|
216
|
-
|
|
217
|
-
|
|
250
|
+
| core | 1.0.0 |
|
251
|
+
| system | 1.0.0 |
|
218
252
|
And the exit status should be 0
|
253
|
+
|
254
|
+
Scenario: With an invalid cookbook
|
255
|
+
Given a cookbook named "cookbook with spaces"
|
256
|
+
And I write to "Berksfile" with:
|
257
|
+
"""
|
258
|
+
cookbook 'cookbook with spaces', path: './cookbook with spaces'
|
259
|
+
"""
|
260
|
+
When I run `berks upload`
|
261
|
+
Then the output should contain:
|
262
|
+
"""
|
263
|
+
The cookbook 'cookbook with spaces' has invalid filenames:
|
264
|
+
"""
|
265
|
+
And the CLI should exit with the status code for error "InvalidCookbookFiles"
|