knife-solo 0.0.15 → 0.1.0.pre1
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/CHANGELOG.md +216 -0
- data/LICENSE +7 -0
- data/README.rdoc +127 -0
- data/Rakefile +31 -0
- data/lib/chef/knife/cook.rb +4 -131
- data/lib/chef/knife/kitchen.rb +4 -49
- data/lib/chef/knife/prepare.rb +4 -50
- data/lib/chef/knife/solo_bootstrap.rb +51 -0
- data/lib/chef/knife/solo_clean.rb +25 -0
- data/lib/chef/knife/solo_cook.rb +137 -0
- data/lib/chef/knife/solo_init.rb +59 -0
- data/lib/chef/knife/solo_prepare.rb +56 -0
- data/lib/chef/knife/wash_up.rb +4 -15
- data/lib/knife-solo/bootstraps.rb +1 -1
- data/lib/knife-solo/bootstraps/linux.rb +6 -4
- data/lib/knife-solo/bootstraps/sun_os.rb +9 -0
- data/lib/knife-solo/deprecated_command.rb +19 -0
- data/lib/knife-solo/info.rb +1 -1
- data/lib/knife-solo/kitchen_command.rb +5 -10
- data/lib/knife-solo/node_config_command.rb +17 -3
- data/lib/knife-solo/ssh_command.rb +3 -3
- data/test/bootstraps_test.rb +90 -0
- data/test/deprecated_command_test.rb +46 -0
- data/test/integration/cases/apache2_bootstrap.rb +15 -0
- data/test/integration/cases/apache2_cook.rb +28 -0
- data/test/integration/cases/empty_cook.rb +8 -0
- data/test/integration/cases/encrypted_data_bag.rb +27 -0
- data/test/integration/centos5_6_test.rb +19 -0
- data/test/integration/gentoo2011_test.rb +18 -0
- data/test/integration/omnios_r151004_test.rb +14 -0
- data/test/integration/scientific_linux_63_test.rb +15 -0
- data/test/integration/sles_11_test.rb +14 -0
- data/test/integration/ubuntu10_04_test.rb +15 -0
- data/test/integration/ubuntu12_04_bootstrap_test.rb +17 -0
- data/test/integration/ubuntu12_04_test.rb +15 -0
- data/test/integration_helper.rb +16 -0
- data/test/kitchen_command_test.rb +31 -0
- data/test/minitest/parallel.rb +41 -0
- data/test/node_config_command_test.rb +101 -0
- data/test/solo_bootstrap_test.rb +32 -0
- data/test/solo_clean_test.rb +12 -0
- data/test/solo_cook_test.rb +67 -0
- data/test/solo_init_test.rb +40 -0
- data/test/solo_prepare_test.rb +50 -0
- data/test/ssh_command_test.rb +100 -0
- data/test/support/config.yml.example +4 -0
- data/test/support/data_bag_key +1 -0
- data/test/support/ec2_runner.rb +122 -0
- data/test/support/integration_test.rb +94 -0
- data/test/support/issue_files/gentoo2011 +3 -0
- data/test/support/issue_files/sles11-sp1 +4 -0
- data/test/support/issue_files/ubuntu +2 -0
- data/test/support/kitchen_helper.rb +22 -0
- data/test/support/loggable.rb +18 -0
- data/test/support/secret_cookbook/metadata.rb +5 -0
- data/test/support/secret_cookbook/recipes/default.rb +8 -0
- data/test/support/ssh_config +3 -0
- data/test/support/test_case.rb +24 -0
- data/test/support/validation_helper.rb +39 -0
- data/test/test_helper.rb +7 -0
- metadata +99 -11
- data/lib/knife-solo/knife_solo_error.rb +0 -3
@@ -0,0 +1,24 @@
|
|
1
|
+
class TestCase < MiniTest::Unit::TestCase
|
2
|
+
def default_test
|
3
|
+
super unless self.class == TestCase
|
4
|
+
end
|
5
|
+
|
6
|
+
def knife_command(cmd_class, *args)
|
7
|
+
cmd_class.load_deps
|
8
|
+
command = cmd_class.new(args)
|
9
|
+
command.ui.stubs(:msg)
|
10
|
+
command.ui.stubs(:err)
|
11
|
+
command
|
12
|
+
end
|
13
|
+
|
14
|
+
# Assert that the specified command or block raises SystemExit
|
15
|
+
def assert_exits(command = nil)
|
16
|
+
assert_raises SystemExit do
|
17
|
+
if command
|
18
|
+
command.run
|
19
|
+
else
|
20
|
+
yield
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'support/kitchen_helper'
|
2
|
+
|
3
|
+
module ValidationHelper
|
4
|
+
|
5
|
+
module SshCommandTests
|
6
|
+
include KitchenHelper
|
7
|
+
|
8
|
+
def test_barks_without_atleast_a_hostname
|
9
|
+
cmd = command
|
10
|
+
cmd.ui.expects(:err).with(regexp_matches(/hostname.*argument/))
|
11
|
+
$stdout.stubs(:puts)
|
12
|
+
in_kitchen do
|
13
|
+
assert_exits cmd
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
module KitchenCommandTests
|
19
|
+
include KitchenHelper
|
20
|
+
|
21
|
+
def test_barks_outside_of_the_kitchen
|
22
|
+
cmd = default_command
|
23
|
+
cmd.ui.expects(:err).with(regexp_matches(/must be run inside .* kitchen/))
|
24
|
+
outside_kitchen do
|
25
|
+
assert_exits cmd
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
# Returns a Knife instance that shoud run without other validation errors.
|
30
|
+
def default_command
|
31
|
+
command("somehost")
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
module ValidationTests
|
36
|
+
include SshCommandTests
|
37
|
+
include KitchenCommandTests
|
38
|
+
end
|
39
|
+
end
|
data/test/test_helper.rb
ADDED
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knife-solo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.1.0.pre1
|
5
|
+
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Mat Schaffer
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-12-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -103,24 +103,73 @@ executables: []
|
|
103
103
|
extensions: []
|
104
104
|
extra_rdoc_files: []
|
105
105
|
files:
|
106
|
+
- CHANGELOG.md
|
107
|
+
- LICENSE
|
108
|
+
- README.rdoc
|
109
|
+
- Rakefile
|
106
110
|
- lib/chef/knife/cook.rb
|
107
111
|
- lib/chef/knife/kitchen.rb
|
108
112
|
- lib/chef/knife/patches/parser.rb
|
109
113
|
- lib/chef/knife/patches/search_patch.rb
|
110
114
|
- lib/chef/knife/prepare.rb
|
115
|
+
- lib/chef/knife/solo_bootstrap.rb
|
116
|
+
- lib/chef/knife/solo_clean.rb
|
117
|
+
- lib/chef/knife/solo_cook.rb
|
118
|
+
- lib/chef/knife/solo_init.rb
|
119
|
+
- lib/chef/knife/solo_prepare.rb
|
111
120
|
- lib/chef/knife/wash_up.rb
|
121
|
+
- lib/knife-solo.rb
|
122
|
+
- lib/knife-solo/bootstraps.rb
|
112
123
|
- lib/knife-solo/bootstraps/darwin.rb
|
113
124
|
- lib/knife-solo/bootstraps/freebsd.rb
|
114
125
|
- lib/knife-solo/bootstraps/linux.rb
|
115
|
-
- lib/knife-solo/bootstraps.rb
|
126
|
+
- lib/knife-solo/bootstraps/sun_os.rb
|
127
|
+
- lib/knife-solo/deprecated_command.rb
|
116
128
|
- lib/knife-solo/info.rb
|
117
129
|
- lib/knife-solo/kitchen_command.rb
|
118
|
-
- lib/knife-solo/knife_solo_error.rb
|
119
130
|
- lib/knife-solo/node_config_command.rb
|
120
131
|
- lib/knife-solo/ssh_command.rb
|
121
132
|
- lib/knife-solo/tools.rb
|
122
|
-
-
|
123
|
-
|
133
|
+
- test/bootstraps_test.rb
|
134
|
+
- test/deprecated_command_test.rb
|
135
|
+
- test/integration/cases/apache2_bootstrap.rb
|
136
|
+
- test/integration/cases/apache2_cook.rb
|
137
|
+
- test/integration/cases/empty_cook.rb
|
138
|
+
- test/integration/cases/encrypted_data_bag.rb
|
139
|
+
- test/integration/centos5_6_test.rb
|
140
|
+
- test/integration/gentoo2011_test.rb
|
141
|
+
- test/integration/omnios_r151004_test.rb
|
142
|
+
- test/integration/scientific_linux_63_test.rb
|
143
|
+
- test/integration/sles_11_test.rb
|
144
|
+
- test/integration/ubuntu10_04_test.rb
|
145
|
+
- test/integration/ubuntu12_04_bootstrap_test.rb
|
146
|
+
- test/integration/ubuntu12_04_test.rb
|
147
|
+
- test/integration_helper.rb
|
148
|
+
- test/kitchen_command_test.rb
|
149
|
+
- test/minitest/parallel.rb
|
150
|
+
- test/node_config_command_test.rb
|
151
|
+
- test/solo_bootstrap_test.rb
|
152
|
+
- test/solo_clean_test.rb
|
153
|
+
- test/solo_cook_test.rb
|
154
|
+
- test/solo_init_test.rb
|
155
|
+
- test/solo_prepare_test.rb
|
156
|
+
- test/ssh_command_test.rb
|
157
|
+
- test/support/config.yml.example
|
158
|
+
- test/support/data_bag_key
|
159
|
+
- test/support/ec2_runner.rb
|
160
|
+
- test/support/integration_test.rb
|
161
|
+
- test/support/issue_files/gentoo2011
|
162
|
+
- test/support/issue_files/sles11-sp1
|
163
|
+
- test/support/issue_files/ubuntu
|
164
|
+
- test/support/kitchen_helper.rb
|
165
|
+
- test/support/loggable.rb
|
166
|
+
- test/support/secret_cookbook/metadata.rb
|
167
|
+
- test/support/secret_cookbook/recipes/default.rb
|
168
|
+
- test/support/ssh_config
|
169
|
+
- test/support/test_case.rb
|
170
|
+
- test/support/validation_helper.rb
|
171
|
+
- test/test_helper.rb
|
172
|
+
homepage: http://matschaffer.github.com/knife-solo/
|
124
173
|
licenses: []
|
125
174
|
post_install_message:
|
126
175
|
rdoc_options: []
|
@@ -135,13 +184,52 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
135
184
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
136
185
|
none: false
|
137
186
|
requirements:
|
138
|
-
- - ! '
|
187
|
+
- - ! '>'
|
139
188
|
- !ruby/object:Gem::Version
|
140
|
-
version:
|
189
|
+
version: 1.3.1
|
141
190
|
requirements: []
|
142
|
-
rubyforge_project:
|
191
|
+
rubyforge_project:
|
143
192
|
rubygems_version: 1.8.24
|
144
193
|
signing_key:
|
145
194
|
specification_version: 3
|
146
195
|
summary: A collection of knife plugins for dealing with chef solo
|
147
|
-
test_files:
|
196
|
+
test_files:
|
197
|
+
- test/bootstraps_test.rb
|
198
|
+
- test/deprecated_command_test.rb
|
199
|
+
- test/integration/cases/apache2_bootstrap.rb
|
200
|
+
- test/integration/cases/apache2_cook.rb
|
201
|
+
- test/integration/cases/empty_cook.rb
|
202
|
+
- test/integration/cases/encrypted_data_bag.rb
|
203
|
+
- test/integration/centos5_6_test.rb
|
204
|
+
- test/integration/gentoo2011_test.rb
|
205
|
+
- test/integration/omnios_r151004_test.rb
|
206
|
+
- test/integration/scientific_linux_63_test.rb
|
207
|
+
- test/integration/sles_11_test.rb
|
208
|
+
- test/integration/ubuntu10_04_test.rb
|
209
|
+
- test/integration/ubuntu12_04_bootstrap_test.rb
|
210
|
+
- test/integration/ubuntu12_04_test.rb
|
211
|
+
- test/integration_helper.rb
|
212
|
+
- test/kitchen_command_test.rb
|
213
|
+
- test/minitest/parallel.rb
|
214
|
+
- test/node_config_command_test.rb
|
215
|
+
- test/solo_bootstrap_test.rb
|
216
|
+
- test/solo_clean_test.rb
|
217
|
+
- test/solo_cook_test.rb
|
218
|
+
- test/solo_init_test.rb
|
219
|
+
- test/solo_prepare_test.rb
|
220
|
+
- test/ssh_command_test.rb
|
221
|
+
- test/support/config.yml.example
|
222
|
+
- test/support/data_bag_key
|
223
|
+
- test/support/ec2_runner.rb
|
224
|
+
- test/support/integration_test.rb
|
225
|
+
- test/support/issue_files/gentoo2011
|
226
|
+
- test/support/issue_files/sles11-sp1
|
227
|
+
- test/support/issue_files/ubuntu
|
228
|
+
- test/support/kitchen_helper.rb
|
229
|
+
- test/support/loggable.rb
|
230
|
+
- test/support/secret_cookbook/metadata.rb
|
231
|
+
- test/support/secret_cookbook/recipes/default.rb
|
232
|
+
- test/support/ssh_config
|
233
|
+
- test/support/test_case.rb
|
234
|
+
- test/support/validation_helper.rb
|
235
|
+
- test/test_helper.rb
|