vagrant 0.7.8 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. data/CHANGELOG.md +39 -0
  2. data/Gemfile +1 -7
  3. data/Rakefile +0 -11
  4. data/bin/vagrant +4 -0
  5. data/config/default.rb +1 -2
  6. data/lib/vagrant.rb +7 -5
  7. data/lib/vagrant/action.rb +5 -1
  8. data/lib/vagrant/action/builtin.rb +4 -1
  9. data/lib/vagrant/action/general/package.rb +6 -2
  10. data/lib/vagrant/action/vm.rb +2 -0
  11. data/lib/vagrant/action/vm/clear_forwarded_ports.rb +9 -22
  12. data/lib/vagrant/action/vm/clear_shared_folders.rb +9 -14
  13. data/lib/vagrant/action/vm/customize.rb +9 -4
  14. data/lib/vagrant/action/vm/forward_ports.rb +10 -11
  15. data/lib/vagrant/action/vm/match_mac_address.rb +8 -3
  16. data/lib/vagrant/action/vm/modify.rb +37 -0
  17. data/lib/vagrant/action/vm/network.rb +9 -2
  18. data/lib/vagrant/action/vm/provision.rb +10 -17
  19. data/lib/vagrant/action/vm/provisioner_cleanup.rb +26 -0
  20. data/lib/vagrant/action/vm/share_folders.rb +16 -8
  21. data/lib/vagrant/action/warden.rb +8 -2
  22. data/lib/vagrant/command/ssh.rb +4 -4
  23. data/lib/vagrant/command/ssh_config.rb +4 -2
  24. data/lib/vagrant/config/ssh.rb +3 -0
  25. data/lib/vagrant/config/vm.rb +16 -12
  26. data/lib/vagrant/downloaders/http.rb +2 -0
  27. data/lib/vagrant/environment.rb +136 -12
  28. data/lib/vagrant/errors.rb +15 -0
  29. data/lib/vagrant/provisioners.rb +1 -1
  30. data/lib/vagrant/provisioners/base.rb +4 -0
  31. data/lib/vagrant/provisioners/chef.rb +13 -11
  32. data/lib/vagrant/provisioners/{chef_server.rb → chef_client.rb} +5 -5
  33. data/lib/vagrant/provisioners/chef_solo.rb +48 -89
  34. data/lib/vagrant/provisioners/shell.rb +47 -12
  35. data/lib/vagrant/ssh.rb +61 -27
  36. data/lib/vagrant/systems.rb +1 -0
  37. data/lib/vagrant/systems/base.rb +1 -1
  38. data/lib/vagrant/systems/linux.rb +7 -9
  39. data/lib/vagrant/systems/redhat.rb +12 -4
  40. data/lib/vagrant/systems/solaris.rb +9 -4
  41. data/lib/vagrant/systems/suse.rb +9 -0
  42. data/lib/vagrant/ui.rb +12 -5
  43. data/lib/vagrant/util.rb +2 -2
  44. data/lib/vagrant/util/counter.rb +22 -0
  45. data/lib/vagrant/util/platform.rb +1 -2
  46. data/lib/vagrant/util/safe_exec.rb +28 -0
  47. data/lib/vagrant/version.rb +1 -1
  48. data/lib/vagrant/vm.rb +2 -0
  49. data/templates/chef_solo_solo.erb +4 -4
  50. data/templates/commands/init/Vagrantfile.erb +4 -0
  51. data/templates/locales/en.yml +31 -8
  52. data/templates/ssh_config.erb +6 -0
  53. data/test/test_helper.rb +5 -3
  54. data/test/vagrant/action/builder_test.rb +4 -0
  55. data/test/vagrant/action/vm/clear_forwarded_ports_test.rb +18 -38
  56. data/test/vagrant/action/vm/clear_shared_folders_test.rb +7 -16
  57. data/test/vagrant/action/vm/customize_test.rb +12 -5
  58. data/test/vagrant/action/vm/forward_ports_test.rb +12 -7
  59. data/test/vagrant/action/vm/match_mac_address_test.rb +5 -1
  60. data/test/vagrant/action/vm/modify_test.rb +38 -0
  61. data/test/vagrant/action/vm/provision_test.rb +13 -38
  62. data/test/vagrant/action/vm/provisioner_cleanup_test.rb +56 -0
  63. data/test/vagrant/action/vm/share_folders_test.rb +10 -5
  64. data/test/vagrant/action/warden_test.rb +13 -7
  65. data/test/vagrant/config/vm_test.rb +0 -22
  66. data/test/vagrant/downloaders/http_test.rb +2 -0
  67. data/test/vagrant/environment_test.rb +110 -20
  68. data/test/vagrant/provisioners/{chef_server_test.rb → chef_client_test.rb} +2 -2
  69. data/test/vagrant/provisioners/chef_solo_test.rb +16 -173
  70. data/test/vagrant/ssh_test.rb +8 -43
  71. data/test/vagrant/systems/linux_test.rb +9 -19
  72. data/test/vagrant/util/counter_test.rb +29 -0
  73. data/test/vagrant/util/platform_test.rb +2 -2
  74. data/vagrant.gemspec +1 -2
  75. metadata +114 -84
  76. data/lib/vagrant/util/plain_logger.rb +0 -25
  77. data/lib/vagrant/util/resource_logger.rb +0 -63
  78. data/test/vagrant/util/plain_logger_test.rb +0 -17
  79. data/test/vagrant/util/resource_logger_test.rb +0 -78
@@ -1,4 +1,5 @@
1
1
  require "test_helper"
2
+ require "logger"
2
3
 
3
4
  class ActionWardenTest < Test::Unit::TestCase
4
5
  setup do
@@ -8,11 +9,12 @@ class ActionWardenTest < Test::Unit::TestCase
8
9
 
9
10
  context "initializing" do
10
11
  should "finalize the middleware" do
12
+ env = new_env
11
13
  middleware = [1,2,3]
12
14
  middleware.each do |m|
13
- @klass.any_instance.expects(:finalize_action).with(m, {}).returns(m)
15
+ @klass.any_instance.expects(:finalize_action).with(m, env).returns(m)
14
16
  end
15
- @warden = @klass.new(middleware, new_env)
17
+ @warden = @klass.new(middleware, env)
16
18
  assert_equal @warden.actions, [1,2,3]
17
19
  end
18
20
  end
@@ -48,10 +50,11 @@ class ActionWardenTest < Test::Unit::TestCase
48
50
  end
49
51
 
50
52
  should "call the next action" do
53
+ env = new_env
51
54
  action = mock('action')
52
- action.expects(:call).with({})
55
+ action.expects(:call).with(env)
53
56
  @instance.actions << action
54
- @instance.call(new_env)
57
+ @instance.call(env)
55
58
  end
56
59
 
57
60
  should "begin recovery sequence when the called action raises an exception" do
@@ -97,18 +100,21 @@ class ActionWardenTest < Test::Unit::TestCase
97
100
 
98
101
  context "recover" do
99
102
  should "call recover on all items in the stack" do
103
+ env = new_env
100
104
  seq = sequence("sequence")
101
105
  @instance.stack = [rescueable_mock("action"), rescueable_mock("another")]
102
106
  @instance.stack.each do |action|
103
- action.expects(:recover).with(new_env).in_sequence(seq)
107
+ action.expects(:recover).with(env).in_sequence(seq)
104
108
  end
105
109
 
106
- @instance.begin_rescue(new_env)
110
+ @instance.begin_rescue(env)
107
111
  end
108
112
  end
109
113
 
110
114
  def new_env
111
- Vagrant::Action::Environment.new(nil)
115
+ env = Vagrant::Action::Environment.new(nil)
116
+ env["logger"] = Logger.new(nil)
117
+ env
112
118
  end
113
119
 
114
120
  def rescueable_mock(name)
@@ -54,28 +54,6 @@ class ConfigVMTest < Test::Unit::TestCase
54
54
  end
55
55
  end
56
56
 
57
- context "uid/gid" do
58
- should "return the shared folder UID if set" do
59
- @config.shared_folder_uid = "foo"
60
- assert_equal "foo", @config.shared_folder_uid
61
- end
62
-
63
- should "return the SSH username if UID not set" do
64
- @config.shared_folder_uid = nil
65
- assert_equal @username, @config.shared_folder_uid
66
- end
67
-
68
- should "return the shared folder GID if set" do
69
- @config.shared_folder_gid = "foo"
70
- assert_equal "foo", @config.shared_folder_gid
71
- end
72
-
73
- should "return the SSH username if GID not set" do
74
- @config.shared_folder_gid = nil
75
- assert_equal @username, @config.shared_folder_gid
76
- end
77
- end
78
-
79
57
  context "deprecated config" do
80
58
  should "raise an error for provisioner=" do
81
59
  assert_raises(Vagrant::Errors::VagrantError) {
@@ -42,6 +42,8 @@ class HttpDownloaderTest < Test::Unit::TestCase
42
42
  h = mock("http")
43
43
  response = mock("response")
44
44
  response.stubs(:content_length)
45
+ response.stubs(:is_a?).with(anything).returns(false)
46
+ response.stubs(:is_a?).with(Net::HTTPOK).returns(true)
45
47
  segment = mock("segment")
46
48
  segment.stubs(:length).returns(7)
47
49
 
@@ -1,5 +1,6 @@
1
1
  require "test_helper"
2
2
  require "pathname"
3
+ require "tempfile"
3
4
 
4
5
  class EnvironmentTest < Test::Unit::TestCase
5
6
  setup do
@@ -57,6 +58,12 @@ class EnvironmentTest < Test::Unit::TestCase
57
58
  context "home path" do
58
59
  setup do
59
60
  @env = @klass.new
61
+
62
+ # Make a fake home directory for helping with tests
63
+ @home_path = tmp_path.join("home")
64
+ ENV["HOME"] = @home_path.to_s
65
+ FileUtils.rm_rf(@home_path)
66
+ FileUtils.mkdir_p(@home_path)
60
67
  end
61
68
 
62
69
  should "return the home path if it loaded" do
@@ -72,6 +79,36 @@ class EnvironmentTest < Test::Unit::TestCase
72
79
  expected = Pathname.new(File.expand_path(ENV["VAGRANT_HOME"]))
73
80
  assert_equal expected, @env.home_path
74
81
  end
82
+
83
+ should "move the old home directory to the new location" do
84
+ new_path = @home_path.join(".vagrant.d")
85
+ old_path = @home_path.join(".vagrant")
86
+ old_path.mkdir
87
+
88
+ # Get the home path
89
+ ENV["VAGRANT_HOME"] = new_path.to_s
90
+
91
+ assert !new_path.exist?
92
+ assert_equal new_path, @env.home_path
93
+ assert !old_path.exist?
94
+ assert new_path.exist?
95
+ end
96
+
97
+ should "not move the old home directory if the new one already exists" do
98
+ new_path = @home_path.join(".vagrant.d")
99
+ new_path.mkdir
100
+
101
+ old_path = @home_path.join(".vagrant")
102
+ old_path.mkdir
103
+
104
+ # Get the home path
105
+ ENV["VAGRANT_HOME"] = new_path.to_s
106
+
107
+ assert new_path.exist?
108
+ assert_equal new_path, @env.home_path
109
+ assert old_path.exist?
110
+ assert new_path.exist?
111
+ end
75
112
  end
76
113
 
77
114
  context "temp path" do
@@ -219,12 +256,9 @@ class EnvironmentTest < Test::Unit::TestCase
219
256
 
220
257
  context "loading logger" do
221
258
  should "lazy load the logger only once" do
222
- result = Vagrant::Util::ResourceLogger.new("vagrant", vagrant_env)
223
- Vagrant::Util::ResourceLogger.expects(:new).returns(result).once
224
259
  env = vagrant_env
225
- assert_equal result, env.logger
226
- assert_equal result, env.logger
227
- assert_equal result, env.logger
260
+ result = env.logger
261
+ assert result === env.logger
228
262
  end
229
263
 
230
264
  should "return the parent's logger if a parent exists" do
@@ -233,10 +267,7 @@ class EnvironmentTest < Test::Unit::TestCase
233
267
  config.vm.define :db
234
268
  vf
235
269
 
236
- result = env.logger
237
-
238
- Vagrant::Util::ResourceLogger.expects(:new).never
239
- assert env.vms[:web].env.logger.equal?(result)
270
+ assert env.logger === env.vms[:web].env.logger
240
271
  end
241
272
  end
242
273
 
@@ -248,20 +279,23 @@ class EnvironmentTest < Test::Unit::TestCase
248
279
  Pathname.new("/")
249
280
  ]
250
281
 
282
+ rootfile = "Foo"
283
+
251
284
  search_seq = sequence("search_seq")
252
285
  paths.each do |path|
253
- File.expects(:exist?).with(path.join(@klass::ROOTFILE_NAME).to_s).returns(false).in_sequence(search_seq)
286
+ File.expects(:exist?).with(path.join(rootfile).to_s).returns(false).in_sequence(search_seq)
254
287
  File.expects(:exist?).with(path).returns(true).in_sequence(search_seq) if !path.root?
255
288
  end
256
289
 
257
- assert !@klass.new(:cwd => paths.first).root_path
290
+ assert !@klass.new(:cwd => paths.first, :vagrantfile_name => rootfile).root_path
258
291
  end
259
292
 
260
293
  should "should set the path for the rootfile" do
294
+ rootfile = "Foo"
261
295
  path = Pathname.new(File.expand_path("/foo"))
262
- File.expects(:exist?).with(path.join(@klass::ROOTFILE_NAME).to_s).returns(true)
296
+ File.expects(:exist?).with(path.join(rootfile).to_s).returns(true)
263
297
 
264
- assert_equal path, @klass.new(:cwd => path).root_path
298
+ assert_equal path, @klass.new(:cwd => path, :vagrantfile_name => rootfile).root_path
265
299
  end
266
300
 
267
301
  should "not infinite loop on relative paths" do
@@ -269,8 +303,9 @@ class EnvironmentTest < Test::Unit::TestCase
269
303
  end
270
304
 
271
305
  should "only load the root path once" do
272
- env = @klass.new
273
- File.expects(:exist?).with(env.cwd.join(@klass::ROOTFILE_NAME).to_s).returns(true).once
306
+ rootfile = "foo"
307
+ env = @klass.new(:vagrantfile_name => rootfile)
308
+ File.expects(:exist?).with(env.cwd.join(rootfile).to_s).returns(true).once
274
309
 
275
310
  assert_equal env.cwd, env.root_path
276
311
  assert_equal env.cwd, env.root_path
@@ -287,6 +322,66 @@ class EnvironmentTest < Test::Unit::TestCase
287
322
  end
288
323
  end
289
324
 
325
+ context "locking" do
326
+ setup do
327
+ @instance = @klass.new(:lock_path => Tempfile.new('vagrant-test').path)
328
+ end
329
+
330
+ should "allow nesting locks" do
331
+ assert_nothing_raised do
332
+ @instance.lock do
333
+ @instance.lock do
334
+ # Nothing
335
+ end
336
+ end
337
+ end
338
+ end
339
+
340
+ should "raise an exception if an environment already has a lock" do
341
+ @another = @klass.new(:lock_path => @instance.lock_path)
342
+
343
+ # Create first locked thread which should succeed
344
+ first = Thread.new do
345
+ begin
346
+ @instance.lock do
347
+ Thread.current[:locked] = true
348
+ loop { sleep 1000 }
349
+ end
350
+ rescue Vagrant::Errors::EnvironmentLockedError
351
+ Thread.current[:locked] = false
352
+ end
353
+ end
354
+
355
+ # Wait until the first thread has acquired the lock
356
+ loop do
357
+ break if first[:locked] || !first.alive?
358
+ Thread.pass
359
+ end
360
+
361
+ # Verify that the fist got the lock
362
+ assert first[:locked]
363
+
364
+ # Create second locked thread which should fail
365
+ second = Thread.new do
366
+ begin
367
+ @another.lock do
368
+ Thread.current[:error] = false
369
+ end
370
+ rescue Vagrant::Errors::EnvironmentLockedError
371
+ Thread.current[:error] = true
372
+ end
373
+ end
374
+
375
+ # Wait for the second to end and verify it failed
376
+ second.join
377
+ assert second[:error]
378
+
379
+ # Make sure both threads are killed
380
+ first.kill
381
+ second.kill
382
+ end
383
+ end
384
+
290
385
  context "accessing the configuration" do
291
386
  should "load the environment if its not already loaded" do
292
387
  env = @klass.new(:cwd => vagrantfile)
@@ -430,11 +525,6 @@ class EnvironmentTest < Test::Unit::TestCase
430
525
  assert_equal "set", @env.vms[:web].env.config.vm.base_mac
431
526
  end
432
527
 
433
- should "reload the logger after executing" do
434
- @env.load_config!
435
- assert @env.instance_variable_get(:@logger).nil?
436
- end
437
-
438
528
  should "be able to reload config" do
439
529
  vagrantfile(@env.root_path, "config.vm.box = 'box'")
440
530
 
@@ -1,8 +1,8 @@
1
1
  require "test_helper"
2
2
 
3
- class ChefServerProvisionerTest < Test::Unit::TestCase
3
+ class ChefClientProvisionerTest < Test::Unit::TestCase
4
4
  setup do
5
- @klass = Vagrant::Provisioners::ChefServer
5
+ @klass = Vagrant::Provisioners::ChefClient
6
6
 
7
7
  @action_env = Vagrant::Action::Environment.new(vagrant_env.vms[:default].env)
8
8
 
@@ -32,23 +32,6 @@ class ChefSoloProvisionerTest < Test::Unit::TestCase
32
32
  end
33
33
  end
34
34
 
35
- context "preparing" do
36
- should "share cookbook folders" do
37
- @action.expects(:share_cookbook_folders).once
38
- @action.prepare
39
- end
40
-
41
- should "share role folders" do
42
- @action.expects(:share_role_folders).once
43
- @action.prepare
44
- end
45
-
46
- should "share data bag folders" do
47
- @action.expects(:share_data_bags_folders).once
48
- @action.prepare
49
- end
50
- end
51
-
52
35
  context "provisioning" do
53
36
  should "run the proper sequence of methods in order" do
54
37
  prov_seq = sequence("prov_seq")
@@ -60,165 +43,24 @@ class ChefSoloProvisionerTest < Test::Unit::TestCase
60
43
  @action.provision!
61
44
  end
62
45
  end
63
- context "sharing cookbook folders" do
64
- setup do
65
- @host_cookbook_paths = ["foo", "bar"]
66
- @action.stubs(:host_cookbook_paths).returns(@host_cookbook_paths)
67
- end
68
-
69
- should "share each cookbook folder" do
70
- share_seq = sequence("share_seq")
71
- @host_cookbook_paths.each_with_index do |cookbook, i|
72
- @env.config.vm.expects(:share_folder).with("v-csc-#{i}", @action.cookbook_path(i), cookbook, :nfs => false).in_sequence(share_seq)
73
- end
74
-
75
- @action.share_cookbook_folders
76
- end
77
- end
78
-
79
- context "sharing role folders" do
80
- setup do
81
- @host_role_paths = ["foo", "bar"]
82
- @action.stubs(:host_role_paths).returns(@host_role_paths)
83
- end
84
-
85
- should "share each role folder" do
86
- share_seq = sequence("share_seq")
87
- @host_role_paths.each_with_index do |role, i|
88
- @env.config.vm.expects(:share_folder).with("v-csr-#{i}", @action.role_path(i), role, :nfs => false).in_sequence(share_seq)
89
- end
90
-
91
- @action.share_role_folders
92
- end
93
- end
94
-
95
- context "sharing data bag folders" do
96
- setup do
97
- @host_data_bag_paths = ["foo", "bar"]
98
- @action.stubs(:host_data_bag_paths).returns(@host_data_bag_paths)
99
- end
100
-
101
- should "share each data bag folder" do
102
- share_seq = sequence("share_seq")
103
- @host_data_bag_paths.each_with_index do |data_bag, i|
104
- @env.config.vm.expects(:share_folder).with("v-csdb-#{i}", @action.data_bag_path(i), data_bag, :nfs => false).in_sequence(share_seq)
105
- end
106
-
107
- @action.share_data_bags_folders
108
- end
109
- end
110
-
111
- context "host folder paths" do
112
- should "ignore VM paths" do
113
- assert @action.host_folder_paths([:vm, "foo"]).empty?
114
- end
115
-
116
- should "return as an array if was originally a string" do
117
- folder = "foo"
118
- File.stubs(:expand_path).returns("bar")
119
- assert_equal ["bar"], @action.host_folder_paths(folder)
120
- end
121
-
122
- should "return the array of folders if its an array" do
123
- folders = ["foo", "bar"]
124
- expand_seq = sequence('expand_seq')
125
- folders.collect! { |folder| File.expand_path(folder, @env.root_path) }
126
-
127
- assert_equal folders, @action.host_folder_paths(folders)
128
- end
129
- end
130
46
 
131
- context "host cookbooks paths" do
132
- should "get folders path for configured cookbooks path" do
133
- result = mock("result")
134
- @config.stubs(:cookbooks_path).returns("foo")
135
- @action.expects(:host_folder_paths).with(@config.cookbooks_path).returns(result)
136
- assert_equal result, @action.host_cookbook_paths
47
+ context "creating expanded folder sets" do
48
+ should "expand VM folders properly" do
49
+ assert_equal [[:vm, nil, "/foo"]], @action.expanded_folders([:vm, "/foo"])
137
50
  end
138
- end
139
-
140
- context "host roles paths" do
141
- should "get folders path for configured roles path" do
142
- result = mock("result")
143
- @config.stubs(:roles_path).returns("foo")
144
- @action.expects(:host_folder_paths).with(@config.roles_path).returns(result)
145
- assert_equal result, @action.host_role_paths
146
- end
147
- end
148
51
 
149
- context "host data bags paths" do
150
- should "get folders path for configured data bag path" do
151
- result = mock("result")
152
- @config.stubs(:data_bags_path).returns("foo")
153
- @action.expects(:host_folder_paths).with(@config.data_bags_path).returns(result)
154
- assert_equal result, @action.host_data_bag_paths
52
+ should "expand host folders properly" do
53
+ path = "foo"
54
+ local_path = File.expand_path(path, @env.root_path)
55
+ remote_path = "#{@action.config.provisioning_path}/chef-solo-0"
56
+ assert_equal [[:host, local_path, remote_path]], @action.expanded_folders([:host, path])
155
57
  end
156
58
  end
157
59
 
158
- context "folder path" do
159
- should "return a proper path to a single folder" do
160
- expected = File.join(@config.provisioning_path, "cookbooks-5")
161
- assert_equal expected, @action.folder_path("cookbooks", 5)
162
- end
163
-
164
- should "return array-representation of folder paths if multiple" do
165
- @folders = (0..5).to_a
166
- @cookbooks = @folders.inject([]) do |acc, i|
167
- acc << @action.cookbook_path(i)
168
- end
169
-
170
- assert_equal @cookbooks, @action.folders_path(@folders, "cookbooks")
171
- end
172
-
173
- should "return a single string representation if folder paths is single" do
174
- @folder = "cookbooks"
175
- @cookbooks = @action.folder_path(@folder, 0)
176
-
177
- assert_equal @cookbooks, @action.folders_path([0], @folder)
178
- end
179
-
180
- should "properly format VM folder paths" do
181
- @config.provisioning_path = "/foo"
182
- assert_equal "/foo/bar", @action.folders_path([:vm, "bar"], nil)
183
- end
184
- end
185
-
186
- context "cookbooks path" do
187
- should "return a proper path to a single cookbook" do
188
- expected = File.join(@config.provisioning_path, "cookbooks-5")
189
- assert_equal expected, @action.cookbook_path(5)
190
- end
191
-
192
- should "properly call folders path and return result" do
193
- result = [:a, :b, :c]
194
- @action.expects(:folders_path).with(@config.cookbooks_path, "cookbooks").once.returns(result)
195
- assert_equal result.to_json, @action.cookbooks_path
196
- end
197
- end
198
-
199
- context "roles path" do
200
- should "return a proper path to a single role" do
201
- expected = File.join(@config.provisioning_path, "roles-5")
202
- assert_equal expected, @action.role_path(5)
203
- end
204
-
205
- should "properly call folders path and return result" do
206
- result = [:a, :b, :c]
207
- @action.expects(:folders_path).with(@config.roles_path, "roles").once.returns(result)
208
- assert_equal result.to_json, @action.roles_path
209
- end
210
- end
211
-
212
- context "data bags path" do
213
- should "return a proper path to a single data bag" do
214
- expected = File.join(@config.provisioning_path, "data_bags-5")
215
- assert_equal expected, @action.data_bag_path(5)
216
- end
217
-
218
- should "properly call folders path and return result" do
219
- result = [:a, :b, :c]
220
- @action.expects(:folders_path).with(@config.data_bags_path, "data_bags").once.returns(result)
221
- assert_equal result.to_json, @action.data_bags_path
60
+ context "guest paths" do
61
+ should "extract the parts properly" do
62
+ structure = [[1,2,3],[1,2,3]]
63
+ assert_equal [3,3], @action.guest_paths(structure)
222
64
  end
223
65
  end
224
66
 
@@ -227,16 +69,17 @@ class ChefSoloProvisionerTest < Test::Unit::TestCase
227
69
  @vm.ssh.stubs(:upload!)
228
70
 
229
71
  @config.recipe_url = "foo/bar/baz"
72
+ @action.prepare
230
73
  end
231
74
 
232
75
  should "call setup_config with proper variables" do
233
76
  @action.expects(:setup_config).with("chef_solo_solo", "solo.rb", {
234
77
  :node_name => @config.node_name,
235
78
  :provisioning_path => @config.provisioning_path,
236
- :cookbooks_path => @action.cookbooks_path,
79
+ :cookbooks_path => @action.guest_paths(@action.cookbook_folders),
237
80
  :recipe_url => @config.recipe_url,
238
- :roles_path => @action.roles_path,
239
- :data_bags_path => @action.data_bags_path
81
+ :roles_path => @action.guest_paths(@action.role_folders),
82
+ :data_bags_path => @action.guest_paths(@action.data_bags_folders)
240
83
  })
241
84
 
242
85
  @action.setup_solo_config