test-kitchen 0.7.0 → 1.0.0.alpha.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. data/.gitignore +20 -0
  2. data/.travis.yml +11 -0
  3. data/.yardopts +3 -0
  4. data/Gemfile +13 -0
  5. data/Guardfile +11 -0
  6. data/LICENSE +15 -0
  7. data/README.md +131 -0
  8. data/Rakefile +69 -0
  9. data/bin/kitchen +9 -4
  10. data/features/cli.feature +17 -0
  11. data/features/cli_init.feature +156 -0
  12. data/features/support/env.rb +14 -0
  13. data/lib/kitchen/busser.rb +166 -0
  14. data/lib/kitchen/chef_data_uploader.rb +156 -0
  15. data/lib/kitchen/cli.rb +540 -0
  16. data/lib/kitchen/collection.rb +55 -0
  17. data/lib/kitchen/color.rb +46 -0
  18. data/lib/kitchen/config.rb +223 -0
  19. data/lib/kitchen/driver/base.rb +180 -0
  20. data/lib/kitchen/driver/dummy.rb +81 -0
  21. data/lib/kitchen/driver/ssh_base.rb +192 -0
  22. data/lib/kitchen/driver.rb +42 -0
  23. data/lib/kitchen/errors.rb +52 -0
  24. data/lib/kitchen/instance.rb +327 -0
  25. data/lib/kitchen/instance_actor.rb +42 -0
  26. data/lib/kitchen/loader/yaml.rb +105 -0
  27. data/lib/kitchen/logger.rb +145 -0
  28. data/{cookbooks/test-kitchen/libraries/helpers.rb → lib/kitchen/logging.rb} +13 -9
  29. data/lib/kitchen/manager.rb +45 -0
  30. data/lib/kitchen/metadata_chopper.rb +52 -0
  31. data/lib/kitchen/platform.rb +61 -0
  32. data/lib/kitchen/rake_tasks.rb +59 -0
  33. data/lib/kitchen/shell_out.rb +65 -0
  34. data/lib/kitchen/state_file.rb +88 -0
  35. data/lib/kitchen/suite.rb +76 -0
  36. data/lib/kitchen/thor_tasks.rb +62 -0
  37. data/lib/kitchen/util.rb +79 -0
  38. data/{cookbooks/test-kitchen/recipes/erlang.rb → lib/kitchen/version.rb} +9 -6
  39. data/lib/kitchen.rb +98 -0
  40. data/lib/vendor/hash_recursive_merge.rb +74 -0
  41. data/spec/kitchen/collection_spec.rb +80 -0
  42. data/spec/kitchen/color_spec.rb +54 -0
  43. data/spec/kitchen/config_spec.rb +201 -0
  44. data/spec/kitchen/driver/dummy_spec.rb +191 -0
  45. data/spec/kitchen/instance_spec.rb +162 -0
  46. data/spec/kitchen/loader/yaml_spec.rb +243 -0
  47. data/spec/kitchen/platform_spec.rb +48 -0
  48. data/spec/kitchen/state_file_spec.rb +122 -0
  49. data/spec/kitchen/suite_spec.rb +64 -0
  50. data/spec/spec_helper.rb +47 -0
  51. data/templates/plugin/driver.rb.erb +23 -0
  52. data/templates/plugin/license_apachev2.erb +15 -0
  53. data/templates/plugin/license_gplv2.erb +18 -0
  54. data/templates/plugin/license_gplv3.erb +16 -0
  55. data/templates/plugin/license_mit.erb +22 -0
  56. data/templates/plugin/license_reserved.erb +5 -0
  57. data/templates/plugin/version.rb.erb +12 -0
  58. data/test-kitchen.gemspec +44 -0
  59. metadata +290 -82
  60. data/config/Cheffile +0 -47
  61. data/config/Kitchenfile +0 -39
  62. data/config/Vagrantfile +0 -114
  63. data/cookbooks/test-kitchen/attributes/default.rb +0 -25
  64. data/cookbooks/test-kitchen/metadata.rb +0 -27
  65. data/cookbooks/test-kitchen/recipes/chef.rb +0 -19
  66. data/cookbooks/test-kitchen/recipes/compat.rb +0 -39
  67. data/cookbooks/test-kitchen/recipes/default.rb +0 -51
  68. data/cookbooks/test-kitchen/recipes/ruby.rb +0 -29
  69. data/lib/test-kitchen/cli/destroy.rb +0 -36
  70. data/lib/test-kitchen/cli/init.rb +0 -37
  71. data/lib/test-kitchen/cli/platform_list.rb +0 -37
  72. data/lib/test-kitchen/cli/project_info.rb +0 -44
  73. data/lib/test-kitchen/cli/ssh.rb +0 -36
  74. data/lib/test-kitchen/cli/status.rb +0 -36
  75. data/lib/test-kitchen/cli/test.rb +0 -68
  76. data/lib/test-kitchen/cli.rb +0 -282
  77. data/lib/test-kitchen/dsl.rb +0 -63
  78. data/lib/test-kitchen/environment.rb +0 -166
  79. data/lib/test-kitchen/platform.rb +0 -79
  80. data/lib/test-kitchen/project/base.rb +0 -159
  81. data/lib/test-kitchen/project/cookbook.rb +0 -97
  82. data/lib/test-kitchen/project/cookbook_copy.rb +0 -58
  83. data/lib/test-kitchen/project/ruby.rb +0 -37
  84. data/lib/test-kitchen/project/supported_platforms.rb +0 -75
  85. data/lib/test-kitchen/project.rb +0 -23
  86. data/lib/test-kitchen/runner/base.rb +0 -154
  87. data/lib/test-kitchen/runner/openstack/dsl.rb +0 -39
  88. data/lib/test-kitchen/runner/openstack/environment.rb +0 -141
  89. data/lib/test-kitchen/runner/openstack.rb +0 -147
  90. data/lib/test-kitchen/runner/vagrant.rb +0 -95
  91. data/lib/test-kitchen/runner.rb +0 -21
  92. data/lib/test-kitchen/scaffold.rb +0 -88
  93. data/lib/test-kitchen/ui.rb +0 -73
  94. data/lib/test-kitchen/version.rb +0 -21
  95. data/lib/test-kitchen.rb +0 -34
metadata CHANGED
@@ -1,18 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: test-kitchen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
5
- prerelease:
4
+ version: 1.0.0.alpha.0
5
+ prerelease: 6
6
6
  platform: ruby
7
7
  authors:
8
- - Seth Chisamore
8
+ - Fletcher Nichol
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-03 00:00:00.000000000 Z
12
+ date: 2013-03-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: fog
15
+ name: celluloid
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
@@ -28,13 +28,13 @@ dependencies:
28
28
  - !ruby/object:Gem::Version
29
29
  version: '0'
30
30
  - !ruby/object:Gem::Dependency
31
- name: foodcritic
31
+ name: thor
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  none: false
34
34
  requirements:
35
35
  - - ! '>='
36
36
  - !ruby/object:Gem::Version
37
- version: 1.4.0
37
+ version: '0'
38
38
  type: :runtime
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
@@ -42,47 +42,47 @@ dependencies:
42
42
  requirements:
43
43
  - - ! '>='
44
44
  - !ruby/object:Gem::Version
45
- version: 1.4.0
45
+ version: '0'
46
46
  - !ruby/object:Gem::Dependency
47
- name: hashr
47
+ name: pry
48
48
  requirement: !ruby/object:Gem::Requirement
49
49
  none: false
50
50
  requirements:
51
- - - ~>
51
+ - - ! '>='
52
52
  - !ruby/object:Gem::Version
53
- version: 0.0.20
53
+ version: '0'
54
54
  type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  none: false
58
58
  requirements:
59
- - - ~>
59
+ - - ! '>='
60
60
  - !ruby/object:Gem::Version
61
- version: 0.0.20
61
+ version: '0'
62
62
  - !ruby/object:Gem::Dependency
63
- name: mixlib-cli
63
+ name: net-ssh
64
64
  requirement: !ruby/object:Gem::Requirement
65
65
  none: false
66
66
  requirements:
67
- - - ~>
67
+ - - ! '>='
68
68
  - !ruby/object:Gem::Version
69
- version: 1.2.2
69
+ version: '0'
70
70
  type: :runtime
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
73
73
  none: false
74
74
  requirements:
75
- - - ~>
75
+ - - ! '>='
76
76
  - !ruby/object:Gem::Version
77
- version: 1.2.2
77
+ version: '0'
78
78
  - !ruby/object:Gem::Dependency
79
- name: highline
79
+ name: net-scp
80
80
  requirement: !ruby/object:Gem::Requirement
81
81
  none: false
82
82
  requirements:
83
83
  - - ! '>='
84
84
  - !ruby/object:Gem::Version
85
- version: 1.6.9
85
+ version: '0'
86
86
  type: :runtime
87
87
  prerelease: false
88
88
  version_requirements: !ruby/object:Gem::Requirement
@@ -90,105 +90,300 @@ dependencies:
90
90
  requirements:
91
91
  - - ! '>='
92
92
  - !ruby/object:Gem::Version
93
- version: 1.6.9
93
+ version: '0'
94
94
  - !ruby/object:Gem::Dependency
95
- name: vagrant
95
+ name: mixlib-shellout
96
96
  requirement: !ruby/object:Gem::Requirement
97
97
  none: false
98
98
  requirements:
99
- - - ~>
99
+ - - ! '>='
100
100
  - !ruby/object:Gem::Version
101
- version: 1.0.2
101
+ version: '0'
102
102
  type: :runtime
103
103
  prerelease: false
104
104
  version_requirements: !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
- - - ~>
107
+ - - ! '>='
108
108
  - !ruby/object:Gem::Version
109
- version: 1.0.2
109
+ version: '0'
110
110
  - !ruby/object:Gem::Dependency
111
- name: yajl-ruby
111
+ name: safe_yaml
112
112
  requirement: !ruby/object:Gem::Requirement
113
113
  none: false
114
114
  requirements:
115
- - - ~>
115
+ - - ! '>='
116
116
  - !ruby/object:Gem::Version
117
- version: 1.1.0
117
+ version: '0'
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  none: false
122
122
  requirements:
123
- - - ~>
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
126
+ - !ruby/object:Gem::Dependency
127
+ name: minitest
128
+ requirement: !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ! '>='
132
+ - !ruby/object:Gem::Version
133
+ version: '0'
134
+ type: :development
135
+ prerelease: false
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ! '>='
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
142
+ - !ruby/object:Gem::Dependency
143
+ name: mocha
144
+ requirement: !ruby/object:Gem::Requirement
145
+ none: false
146
+ requirements:
147
+ - - ! '>='
148
+ - !ruby/object:Gem::Version
149
+ version: '0'
150
+ type: :development
151
+ prerelease: false
152
+ version_requirements: !ruby/object:Gem::Requirement
153
+ none: false
154
+ requirements:
155
+ - - ! '>='
156
+ - !ruby/object:Gem::Version
157
+ version: '0'
158
+ - !ruby/object:Gem::Dependency
159
+ name: fakefs
160
+ requirement: !ruby/object:Gem::Requirement
161
+ none: false
162
+ requirements:
163
+ - - ! '>='
164
+ - !ruby/object:Gem::Version
165
+ version: '0'
166
+ type: :development
167
+ prerelease: false
168
+ version_requirements: !ruby/object:Gem::Requirement
169
+ none: false
170
+ requirements:
171
+ - - ! '>='
124
172
  - !ruby/object:Gem::Version
125
- version: 1.1.0
173
+ version: '0'
126
174
  - !ruby/object:Gem::Dependency
127
- name: librarian
175
+ name: guard-minitest
176
+ requirement: !ruby/object:Gem::Requirement
177
+ none: false
178
+ requirements:
179
+ - - ! '>='
180
+ - !ruby/object:Gem::Version
181
+ version: '0'
182
+ type: :development
183
+ prerelease: false
184
+ version_requirements: !ruby/object:Gem::Requirement
185
+ none: false
186
+ requirements:
187
+ - - ! '>='
188
+ - !ruby/object:Gem::Version
189
+ version: '0'
190
+ - !ruby/object:Gem::Dependency
191
+ name: aruba
128
192
  requirement: !ruby/object:Gem::Requirement
129
193
  none: false
130
194
  requirements:
131
195
  - - ~>
132
196
  - !ruby/object:Gem::Version
133
- version: 0.0.20
134
- type: :runtime
197
+ version: '0.5'
198
+ type: :development
135
199
  prerelease: false
136
200
  version_requirements: !ruby/object:Gem::Requirement
137
201
  none: false
138
202
  requirements:
139
203
  - - ~>
140
204
  - !ruby/object:Gem::Version
141
- version: 0.0.20
142
- description: Easily provision test environments for integration testing with Chef.
205
+ version: '0.5'
206
+ - !ruby/object:Gem::Dependency
207
+ name: guard-cucumber
208
+ requirement: !ruby/object:Gem::Requirement
209
+ none: false
210
+ requirements:
211
+ - - ! '>='
212
+ - !ruby/object:Gem::Version
213
+ version: '0'
214
+ type: :development
215
+ prerelease: false
216
+ version_requirements: !ruby/object:Gem::Requirement
217
+ none: false
218
+ requirements:
219
+ - - ! '>='
220
+ - !ruby/object:Gem::Version
221
+ version: '0'
222
+ - !ruby/object:Gem::Dependency
223
+ name: yard
224
+ requirement: !ruby/object:Gem::Requirement
225
+ none: false
226
+ requirements:
227
+ - - ! '>='
228
+ - !ruby/object:Gem::Version
229
+ version: '0'
230
+ type: :development
231
+ prerelease: false
232
+ version_requirements: !ruby/object:Gem::Requirement
233
+ none: false
234
+ requirements:
235
+ - - ! '>='
236
+ - !ruby/object:Gem::Version
237
+ version: '0'
238
+ - !ruby/object:Gem::Dependency
239
+ name: maruku
240
+ requirement: !ruby/object:Gem::Requirement
241
+ none: false
242
+ requirements:
243
+ - - ! '>='
244
+ - !ruby/object:Gem::Version
245
+ version: '0'
246
+ type: :development
247
+ prerelease: false
248
+ version_requirements: !ruby/object:Gem::Requirement
249
+ none: false
250
+ requirements:
251
+ - - ! '>='
252
+ - !ruby/object:Gem::Version
253
+ version: '0'
254
+ - !ruby/object:Gem::Dependency
255
+ name: cane
256
+ requirement: !ruby/object:Gem::Requirement
257
+ none: false
258
+ requirements:
259
+ - - ! '>='
260
+ - !ruby/object:Gem::Version
261
+ version: '0'
262
+ type: :development
263
+ prerelease: false
264
+ version_requirements: !ruby/object:Gem::Requirement
265
+ none: false
266
+ requirements:
267
+ - - ! '>='
268
+ - !ruby/object:Gem::Version
269
+ version: '0'
270
+ - !ruby/object:Gem::Dependency
271
+ name: tailor
272
+ requirement: !ruby/object:Gem::Requirement
273
+ none: false
274
+ requirements:
275
+ - - ! '>='
276
+ - !ruby/object:Gem::Version
277
+ version: '0'
278
+ type: :development
279
+ prerelease: false
280
+ version_requirements: !ruby/object:Gem::Requirement
281
+ none: false
282
+ requirements:
283
+ - - ! '>='
284
+ - !ruby/object:Gem::Version
285
+ version: '0'
286
+ - !ruby/object:Gem::Dependency
287
+ name: simplecov
288
+ requirement: !ruby/object:Gem::Requirement
289
+ none: false
290
+ requirements:
291
+ - - ! '>='
292
+ - !ruby/object:Gem::Version
293
+ version: '0'
294
+ type: :development
295
+ prerelease: false
296
+ version_requirements: !ruby/object:Gem::Requirement
297
+ none: false
298
+ requirements:
299
+ - - ! '>='
300
+ - !ruby/object:Gem::Version
301
+ version: '0'
302
+ - !ruby/object:Gem::Dependency
303
+ name: countloc
304
+ requirement: !ruby/object:Gem::Requirement
305
+ none: false
306
+ requirements:
307
+ - - ! '>='
308
+ - !ruby/object:Gem::Version
309
+ version: '0'
310
+ type: :development
311
+ prerelease: false
312
+ version_requirements: !ruby/object:Gem::Requirement
313
+ none: false
314
+ requirements:
315
+ - - ! '>='
316
+ - !ruby/object:Gem::Version
317
+ version: '0'
318
+ description: A Chef convergence integration test harness
143
319
  email:
144
- - schisamo@opscode.com
320
+ - fnichol@nichol.ca
145
321
  executables:
146
322
  - kitchen
147
323
  extensions: []
148
324
  extra_rdoc_files: []
149
325
  files:
326
+ - .gitignore
327
+ - .travis.yml
328
+ - .yardopts
329
+ - Gemfile
330
+ - Guardfile
331
+ - LICENSE
332
+ - README.md
333
+ - Rakefile
150
334
  - bin/kitchen
151
- - config/Cheffile
152
- - config/Kitchenfile
153
- - config/Vagrantfile
154
- - cookbooks/test-kitchen/attributes/default.rb
155
- - cookbooks/test-kitchen/libraries/helpers.rb
156
- - cookbooks/test-kitchen/metadata.rb
157
- - cookbooks/test-kitchen/recipes/chef.rb
158
- - cookbooks/test-kitchen/recipes/compat.rb
159
- - cookbooks/test-kitchen/recipes/default.rb
160
- - cookbooks/test-kitchen/recipes/erlang.rb
161
- - cookbooks/test-kitchen/recipes/ruby.rb
162
- - lib/test-kitchen/cli/destroy.rb
163
- - lib/test-kitchen/cli/init.rb
164
- - lib/test-kitchen/cli/platform_list.rb
165
- - lib/test-kitchen/cli/project_info.rb
166
- - lib/test-kitchen/cli/ssh.rb
167
- - lib/test-kitchen/cli/status.rb
168
- - lib/test-kitchen/cli/test.rb
169
- - lib/test-kitchen/cli.rb
170
- - lib/test-kitchen/dsl.rb
171
- - lib/test-kitchen/environment.rb
172
- - lib/test-kitchen/platform.rb
173
- - lib/test-kitchen/project/base.rb
174
- - lib/test-kitchen/project/cookbook.rb
175
- - lib/test-kitchen/project/cookbook_copy.rb
176
- - lib/test-kitchen/project/ruby.rb
177
- - lib/test-kitchen/project/supported_platforms.rb
178
- - lib/test-kitchen/project.rb
179
- - lib/test-kitchen/runner/base.rb
180
- - lib/test-kitchen/runner/openstack/dsl.rb
181
- - lib/test-kitchen/runner/openstack/environment.rb
182
- - lib/test-kitchen/runner/openstack.rb
183
- - lib/test-kitchen/runner/vagrant.rb
184
- - lib/test-kitchen/runner.rb
185
- - lib/test-kitchen/scaffold.rb
186
- - lib/test-kitchen/ui.rb
187
- - lib/test-kitchen/version.rb
188
- - lib/test-kitchen.rb
335
+ - features/cli.feature
336
+ - features/cli_init.feature
337
+ - features/support/env.rb
338
+ - lib/kitchen.rb
339
+ - lib/kitchen/busser.rb
340
+ - lib/kitchen/chef_data_uploader.rb
341
+ - lib/kitchen/cli.rb
342
+ - lib/kitchen/collection.rb
343
+ - lib/kitchen/color.rb
344
+ - lib/kitchen/config.rb
345
+ - lib/kitchen/driver.rb
346
+ - lib/kitchen/driver/base.rb
347
+ - lib/kitchen/driver/dummy.rb
348
+ - lib/kitchen/driver/ssh_base.rb
349
+ - lib/kitchen/errors.rb
350
+ - lib/kitchen/instance.rb
351
+ - lib/kitchen/instance_actor.rb
352
+ - lib/kitchen/loader/yaml.rb
353
+ - lib/kitchen/logger.rb
354
+ - lib/kitchen/logging.rb
355
+ - lib/kitchen/manager.rb
356
+ - lib/kitchen/metadata_chopper.rb
357
+ - lib/kitchen/platform.rb
358
+ - lib/kitchen/rake_tasks.rb
359
+ - lib/kitchen/shell_out.rb
360
+ - lib/kitchen/state_file.rb
361
+ - lib/kitchen/suite.rb
362
+ - lib/kitchen/thor_tasks.rb
363
+ - lib/kitchen/util.rb
364
+ - lib/kitchen/version.rb
365
+ - lib/vendor/hash_recursive_merge.rb
366
+ - spec/kitchen/collection_spec.rb
367
+ - spec/kitchen/color_spec.rb
368
+ - spec/kitchen/config_spec.rb
369
+ - spec/kitchen/driver/dummy_spec.rb
370
+ - spec/kitchen/instance_spec.rb
371
+ - spec/kitchen/loader/yaml_spec.rb
372
+ - spec/kitchen/platform_spec.rb
373
+ - spec/kitchen/state_file_spec.rb
374
+ - spec/kitchen/suite_spec.rb
375
+ - spec/spec_helper.rb
376
+ - templates/plugin/driver.rb.erb
377
+ - templates/plugin/license_apachev2.erb
378
+ - templates/plugin/license_gplv2.erb
379
+ - templates/plugin/license_gplv3.erb
380
+ - templates/plugin/license_mit.erb
381
+ - templates/plugin/license_reserved.erb
382
+ - templates/plugin/version.rb.erb
383
+ - test-kitchen.gemspec
189
384
  homepage: https://github.com/opscode/test-kitchen
190
385
  licenses:
191
- - Apache
386
+ - Apache 2.0
192
387
  post_install_message:
193
388
  rdoc_options: []
194
389
  require_paths:
@@ -198,18 +393,31 @@ required_ruby_version: !ruby/object:Gem::Requirement
198
393
  requirements:
199
394
  - - ! '>='
200
395
  - !ruby/object:Gem::Version
201
- version: '0'
396
+ version: 1.9.1
202
397
  required_rubygems_version: !ruby/object:Gem::Requirement
203
398
  none: false
204
399
  requirements:
205
- - - ! '>='
400
+ - - ! '>'
206
401
  - !ruby/object:Gem::Version
207
- version: '0'
402
+ version: 1.3.1
208
403
  requirements: []
209
404
  rubyforge_project:
210
- rubygems_version: 1.8.23
405
+ rubygems_version: 1.8.24
211
406
  signing_key:
212
407
  specification_version: 3
213
- summary: Easily provision test environments for integration testing with Chef.
214
- test_files: []
408
+ summary: A Chef convergence integration test harness
409
+ test_files:
410
+ - features/cli.feature
411
+ - features/cli_init.feature
412
+ - features/support/env.rb
413
+ - spec/kitchen/collection_spec.rb
414
+ - spec/kitchen/color_spec.rb
415
+ - spec/kitchen/config_spec.rb
416
+ - spec/kitchen/driver/dummy_spec.rb
417
+ - spec/kitchen/instance_spec.rb
418
+ - spec/kitchen/loader/yaml_spec.rb
419
+ - spec/kitchen/platform_spec.rb
420
+ - spec/kitchen/state_file_spec.rb
421
+ - spec/kitchen/suite_spec.rb
422
+ - spec/spec_helper.rb
215
423
  has_rdoc:
data/config/Cheffile DELETED
@@ -1,47 +0,0 @@
1
- #
2
- # Author:: Seth Chisamore (<schisamo@opscode.com>)
3
- # Copyright:: Copyright (c) 2012 Opscode, Inc.
4
- # License:: Apache License, Version 2.0
5
- #
6
- # Licensed under the Apache License, Version 2.0 (the "License");
7
- # you may not use this file except in compliance with the License.
8
- # You may obtain a copy of the License at
9
- #
10
- # http://www.apache.org/licenses/LICENSE-2.0
11
- #
12
- # Unless required by applicable law or agreed to in writing, software
13
- # distributed under the License is distributed on an "AS IS" BASIS,
14
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- # See the License for the specific language governing permissions and
16
- # limitations under the License.
17
- #
18
-
19
- require 'test-kitchen'
20
-
21
- site 'http://community.opscode.com/api/v1'
22
-
23
- # base test-kitchen cookbooks
24
- cookbook 'test-kitchen',
25
- :path => TestKitchen.source_root.join('cookbooks', 'test-kitchen').to_s
26
-
27
- env = TestKitchen::Environment.new
28
- env.load!
29
-
30
- # include cookbook being tested if this is a cookbook project
31
- if env.project.respond_to?(:cookbook_path)
32
- cookbook env.project.name, :path => env.project.cookbook_path(env.root_path, env.tmp_path)
33
- end
34
-
35
- if env.project.run_list.include? 'recipe[minitest-handler]'
36
- cookbook 'minitest-handler'
37
- end
38
-
39
- # include user-provided cookbooks
40
- if env.root_path.join('cookbooks').exist?
41
- env.root_path.join('cookbooks').children.select(&:directory?).each do |c|
42
- cookbook c.basename.to_s, :path => env.root_path.join('cookbooks', c.basename.to_s).to_s
43
- end
44
- if env.root_path.join('cookbooks', 'Cheffile').exist?
45
- eval(File.read(env.root_path.join('cookbooks', 'Cheffile')))
46
- end
47
- end
data/config/Kitchenfile DELETED
@@ -1,39 +0,0 @@
1
- #
2
- # Author:: Seth Chisamore (<schisamo@opscode.com>)
3
- # Copyright:: Copyright (c) 2012 Opscode, Inc.
4
- # License:: Apache License, Version 2.0
5
- #
6
- # Licensed under the Apache License, Version 2.0 (the "License");
7
- # you may not use this file except in compliance with the License.
8
- # You may obtain a copy of the License at
9
- #
10
- # http://www.apache.org/licenses/LICENSE-2.0
11
- #
12
- # Unless required by applicable law or agreed to in writing, software
13
- # distributed under the License is distributed on an "AS IS" BASIS,
14
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- # See the License for the specific language governing permissions and
16
- # limitations under the License.
17
- #
18
-
19
- platform :centos do
20
- version '5.8' do
21
- box "opscode-centos-5.8"
22
- box_url "https://opscode-vm.s3.amazonaws.com/vagrant/boxes/opscode-centos-5.8.box"
23
- end
24
- version '6.3' do
25
- box "opscode-centos-6.3"
26
- box_url "https://opscode-vm.s3.amazonaws.com/vagrant/boxes/opscode-centos-6.3.box"
27
- end
28
- end
29
-
30
- platform :ubuntu do
31
- version '10.04' do
32
- box "opscode-ubuntu-10.04"
33
- box_url "https://opscode-vm.s3.amazonaws.com/vagrant/boxes/opscode-ubuntu-10.04.box"
34
- end
35
- version '12.04' do
36
- box "opscode-ubuntu-12.04"
37
- box_url "https://opscode-vm.s3.amazonaws.com/vagrant/boxes/opscode-ubuntu-12.04.box"
38
- end
39
- end
data/config/Vagrantfile DELETED
@@ -1,114 +0,0 @@
1
- #
2
- # Author:: Seth Chisamore (<schisamo@opscode.com>)
3
- # Copyright:: Copyright (c) 2012 Opscode, Inc.
4
- # License:: Apache License, Version 2.0
5
- #
6
- # Licensed under the Apache License, Version 2.0 (the "License");
7
- # you may not use this file except in compliance with the License.
8
- # You may obtain a copy of the License at
9
- #
10
- # http://www.apache.org/licenses/LICENSE-2.0
11
- #
12
- # Unless required by applicable law or agreed to in writing, software
13
- # distributed under the License is distributed on an "AS IS" BASIS,
14
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- # See the License for the specific language governing permissions and
16
- # limitations under the License.
17
- #
18
-
19
- require 'test-kitchen'
20
-
21
- def recipe_exists?(cookbook_path, recipe_name)
22
- File.exists?(File.join(cookbook_path, "#{recipe_name}.rb".split('::').insert(1, 'recipes')))
23
- end
24
-
25
- def build_run_list(cookbook_paths, test_recipe_name)
26
- run_list = []
27
- if test_recipe_name
28
- [test_recipe_name, test_recipe_name.sub('_test', '')].uniq.each do |recipe_name|
29
- if cookbook_paths.any? {|path| recipe_exists?(path, recipe_name)}
30
- run_list << recipe_name
31
- end
32
- end
33
- end
34
- run_list
35
- end
36
-
37
- tk_env = TestKitchen::Environment.new
38
- tk_env.load!
39
- tk_config = tk_env.config
40
- project = tk_env.project
41
-
42
- ::Vagrant::Config.run do |vagrant_config|
43
-
44
- tk_env.platforms.values.each do |platform|
45
-
46
- platform.versions.values.each do |version|
47
-
48
- name = "#{platform.name}-#{version.name}"
49
-
50
- vagrant_config.vm.define name do |vm_config|
51
-
52
- host_name = name.gsub(/\./, '-')
53
-
54
- vm_config.vm.customize [
55
- "modifyvm", :id,
56
- "--name", host_name,
57
- "--memory", (project.memory || "256"),
58
- "--cpus", "1",
59
- "--nictype1", "82545EM",
60
- "--nictype2", "82545EM",
61
- "--audio", "none",
62
- "--natdnsproxy1", "on",
63
- "--usb", "off",
64
- "--usbehci", "off"
65
- ]
66
-
67
- # Enable the host IO cache on the sata controller. Note that
68
- # if this fails then its not a big deal, so we don't raise any
69
- # errors. The Host IO cache vastly improves disk IO performance
70
- # for VMs.
71
- vm_config.vm.customize [
72
- "storagectl", :id,
73
- "--name", "SATA Controller",
74
- "--hostiocache", "on"
75
- ]
76
-
77
- vm_config.vm.host_name = host_name
78
- vm_config.vm.box = version.box
79
- vm_config.vm.box_url = version.box_url
80
-
81
- # Enable SSH agent forwarding for git clones
82
- vm_config.ssh.forward_agent = true
83
-
84
- # mount the local code checkout up in the VM for testing
85
- vm_config.vm.share_folder "project", project.guest_source_root, project.root_path
86
-
87
- # default chef attribute json
88
- chef_json = {
89
- 'test-kitchen' => {
90
- 'project' => project.to_hash.merge(
91
- 'source_root' => project.guest_source_root,
92
- 'test_root' => project.guest_test_root
93
- )
94
- },
95
- }
96
-
97
- vm_config.vm.provision :chef_solo do |chef|
98
- chef.cookbooks_path = tk_env.cookbook_paths
99
-
100
- if project.data_bags_path && File.exists?(project.data_bags_path)
101
- chef.data_bags_path = project.data_bags_path
102
- end
103
-
104
- chef.run_list = project.run_list + build_run_list(tk_env.cookbook_paths, test_recipe_name)
105
- chef.json = chef_json
106
- chef.log_level = :info
107
- end
108
-
109
- end
110
-
111
- end
112
- end
113
-
114
- end