vagrant 0.7.8 → 0.8.1
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 +39 -0
- data/Gemfile +1 -7
- data/Rakefile +0 -11
- data/bin/vagrant +4 -0
- data/config/default.rb +1 -2
- data/lib/vagrant.rb +7 -5
- data/lib/vagrant/action.rb +5 -1
- data/lib/vagrant/action/builtin.rb +4 -1
- data/lib/vagrant/action/general/package.rb +6 -2
- data/lib/vagrant/action/vm.rb +2 -0
- data/lib/vagrant/action/vm/clear_forwarded_ports.rb +9 -22
- data/lib/vagrant/action/vm/clear_shared_folders.rb +9 -14
- data/lib/vagrant/action/vm/customize.rb +9 -4
- data/lib/vagrant/action/vm/forward_ports.rb +10 -11
- data/lib/vagrant/action/vm/match_mac_address.rb +8 -3
- data/lib/vagrant/action/vm/modify.rb +37 -0
- data/lib/vagrant/action/vm/network.rb +9 -2
- data/lib/vagrant/action/vm/provision.rb +10 -17
- data/lib/vagrant/action/vm/provisioner_cleanup.rb +26 -0
- data/lib/vagrant/action/vm/share_folders.rb +16 -8
- data/lib/vagrant/action/warden.rb +8 -2
- data/lib/vagrant/command/ssh.rb +4 -4
- data/lib/vagrant/command/ssh_config.rb +4 -2
- data/lib/vagrant/config/ssh.rb +3 -0
- data/lib/vagrant/config/vm.rb +16 -12
- data/lib/vagrant/downloaders/http.rb +2 -0
- data/lib/vagrant/environment.rb +136 -12
- data/lib/vagrant/errors.rb +15 -0
- data/lib/vagrant/provisioners.rb +1 -1
- data/lib/vagrant/provisioners/base.rb +4 -0
- data/lib/vagrant/provisioners/chef.rb +13 -11
- data/lib/vagrant/provisioners/{chef_server.rb → chef_client.rb} +5 -5
- data/lib/vagrant/provisioners/chef_solo.rb +48 -89
- data/lib/vagrant/provisioners/shell.rb +47 -12
- data/lib/vagrant/ssh.rb +61 -27
- data/lib/vagrant/systems.rb +1 -0
- data/lib/vagrant/systems/base.rb +1 -1
- data/lib/vagrant/systems/linux.rb +7 -9
- data/lib/vagrant/systems/redhat.rb +12 -4
- data/lib/vagrant/systems/solaris.rb +9 -4
- data/lib/vagrant/systems/suse.rb +9 -0
- data/lib/vagrant/ui.rb +12 -5
- data/lib/vagrant/util.rb +2 -2
- data/lib/vagrant/util/counter.rb +22 -0
- data/lib/vagrant/util/platform.rb +1 -2
- data/lib/vagrant/util/safe_exec.rb +28 -0
- data/lib/vagrant/version.rb +1 -1
- data/lib/vagrant/vm.rb +2 -0
- data/templates/chef_solo_solo.erb +4 -4
- data/templates/commands/init/Vagrantfile.erb +4 -0
- data/templates/locales/en.yml +31 -8
- data/templates/ssh_config.erb +6 -0
- data/test/test_helper.rb +5 -3
- data/test/vagrant/action/builder_test.rb +4 -0
- data/test/vagrant/action/vm/clear_forwarded_ports_test.rb +18 -38
- data/test/vagrant/action/vm/clear_shared_folders_test.rb +7 -16
- data/test/vagrant/action/vm/customize_test.rb +12 -5
- data/test/vagrant/action/vm/forward_ports_test.rb +12 -7
- data/test/vagrant/action/vm/match_mac_address_test.rb +5 -1
- data/test/vagrant/action/vm/modify_test.rb +38 -0
- data/test/vagrant/action/vm/provision_test.rb +13 -38
- data/test/vagrant/action/vm/provisioner_cleanup_test.rb +56 -0
- data/test/vagrant/action/vm/share_folders_test.rb +10 -5
- data/test/vagrant/action/warden_test.rb +13 -7
- data/test/vagrant/config/vm_test.rb +0 -22
- data/test/vagrant/downloaders/http_test.rb +2 -0
- data/test/vagrant/environment_test.rb +110 -20
- data/test/vagrant/provisioners/{chef_server_test.rb → chef_client_test.rb} +2 -2
- data/test/vagrant/provisioners/chef_solo_test.rb +16 -173
- data/test/vagrant/ssh_test.rb +8 -43
- data/test/vagrant/systems/linux_test.rb +9 -19
- data/test/vagrant/util/counter_test.rb +29 -0
- data/test/vagrant/util/platform_test.rb +2 -2
- data/vagrant.gemspec +1 -2
- metadata +114 -84
- data/lib/vagrant/util/plain_logger.rb +0 -25
- data/lib/vagrant/util/resource_logger.rb +0 -63
- data/test/vagrant/util/plain_logger_test.rb +0 -17
- data/test/vagrant/util/resource_logger_test.rb +0 -78
@@ -8,53 +8,18 @@ class ClearForwardedPortsVMActionTest < Test::Unit::TestCase
|
|
8
8
|
@vm = mock("vm")
|
9
9
|
@vm.stubs(:name).returns("foo")
|
10
10
|
@env["vm"] = @vm
|
11
|
+
@env["vm.modify"] = mock("proc")
|
11
12
|
|
12
13
|
@instance = @klass.new(@app, @env)
|
13
14
|
end
|
14
15
|
|
15
16
|
context "calling" do
|
16
|
-
should "call the proper methods and continue chain" do
|
17
|
-
seq = sequence('seq')
|
18
|
-
@instance.expects(:clear).in_sequence(seq)
|
19
|
-
@app.expects(:call).with(@env).in_sequence(seq)
|
20
|
-
@instance.call(@env)
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
context "clearing forwarded ports" do
|
25
|
-
setup do
|
26
|
-
@instance.stubs(:used_ports).returns([:a])
|
27
|
-
@instance.stubs(:clear_ports)
|
28
|
-
end
|
29
|
-
|
30
|
-
should "call destroy on all forwarded ports" do
|
31
|
-
@instance.expects(:clear_ports).once
|
32
|
-
@vm.expects(:reload!)
|
33
|
-
@instance.clear
|
34
|
-
end
|
35
|
-
|
36
|
-
should "do nothing if there are no forwarded ports" do
|
37
|
-
@instance.stubs(:used_ports).returns([])
|
38
|
-
@vm.expects(:reload!).never
|
39
|
-
@instance.clear
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
context "clearing ports" do
|
44
17
|
def mock_fp
|
45
18
|
fp = mock("fp")
|
46
19
|
fp.expects(:destroy).once
|
47
20
|
fp
|
48
21
|
end
|
49
22
|
|
50
|
-
setup do
|
51
|
-
VirtualBox.stubs(:version).returns("3.2.8")
|
52
|
-
@adapters = []
|
53
|
-
@internal_vm = mock("internal_vm")
|
54
|
-
@internal_vm.stubs(:network_adapters).returns(@adapters)
|
55
|
-
@vm.stubs(:vm).returns(@internal_vm)
|
56
|
-
end
|
57
|
-
|
58
23
|
def mock_adapter
|
59
24
|
na = mock("adapter")
|
60
25
|
engine = mock("engine")
|
@@ -63,10 +28,25 @@ class ClearForwardedPortsVMActionTest < Test::Unit::TestCase
|
|
63
28
|
na
|
64
29
|
end
|
65
30
|
|
66
|
-
|
31
|
+
setup do
|
32
|
+
VirtualBox.stubs(:version).returns("3.2.8")
|
33
|
+
@adapters = []
|
34
|
+
@internal_vm = mock("internal_vm")
|
35
|
+
@internal_vm.stubs(:network_adapters).returns(@adapters)
|
36
|
+
@vm.stubs(:vm).returns(@internal_vm)
|
37
|
+
end
|
38
|
+
|
39
|
+
should "call the proper methods and continue chain" do
|
67
40
|
@adapters << mock_adapter
|
68
41
|
@adapters << mock_adapter
|
69
|
-
|
42
|
+
|
43
|
+
@env["vm.modify"].expects(:call).with() do |proc|
|
44
|
+
proc.call(@internal_vm)
|
45
|
+
true
|
46
|
+
end
|
47
|
+
|
48
|
+
@app.expects(:call).with(@env)
|
49
|
+
@instance.call(@env)
|
70
50
|
end
|
71
51
|
end
|
72
52
|
end
|
@@ -7,6 +7,7 @@ class ClearSharedFoldersVMActionTest < Test::Unit::TestCase
|
|
7
7
|
|
8
8
|
@vm = mock("vm")
|
9
9
|
@env["vm"] = @vm
|
10
|
+
@env["vm.modify"] = mock("proc")
|
10
11
|
|
11
12
|
@internal_vm = mock("internal")
|
12
13
|
@vm.stubs(:vm).returns(@internal_vm)
|
@@ -15,15 +16,6 @@ class ClearSharedFoldersVMActionTest < Test::Unit::TestCase
|
|
15
16
|
end
|
16
17
|
|
17
18
|
context "calling" do
|
18
|
-
should "call the proper methods in sequence" do
|
19
|
-
seq = sequence("seq")
|
20
|
-
@instance.expects(:clear_shared_folders).once.in_sequence(seq)
|
21
|
-
@app.expects(:call).with(@env).once
|
22
|
-
@instance.call(@env)
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
context "clearing shared folders" do
|
27
19
|
setup do
|
28
20
|
@shared_folder = mock("shared_folder")
|
29
21
|
@shared_folders = [@shared_folder]
|
@@ -36,14 +28,13 @@ class ClearSharedFoldersVMActionTest < Test::Unit::TestCase
|
|
36
28
|
sf.expects(:destroy).once.in_sequence(destroy_seq)
|
37
29
|
end
|
38
30
|
|
39
|
-
@vm.expects(:
|
40
|
-
|
41
|
-
|
31
|
+
@env["vm.modify"].expects(:call).with() do |proc|
|
32
|
+
proc.call(@internal_vm)
|
33
|
+
true
|
34
|
+
end
|
42
35
|
|
43
|
-
|
44
|
-
@
|
45
|
-
@vm.expects(:reload!).never
|
46
|
-
@instance.clear_shared_folders
|
36
|
+
@app.expects(:call).with(@env).once
|
37
|
+
@instance.call(@env)
|
47
38
|
end
|
48
39
|
end
|
49
40
|
end
|
@@ -8,22 +8,29 @@ class CustomizeVMActionTest < Test::Unit::TestCase
|
|
8
8
|
|
9
9
|
@vm = mock("vm")
|
10
10
|
@env["vm"] = @vm
|
11
|
+
@env["vm.modify"] = mock("proc")
|
11
12
|
|
12
13
|
@internal_vm = mock("internal")
|
13
14
|
@vm.stubs(:vm).returns(@internal_vm)
|
14
15
|
end
|
15
16
|
|
16
17
|
should "not run anything if no customize blocks exist" do
|
17
|
-
@env
|
18
|
-
@
|
18
|
+
@env["config"].vm.proc_stack.clear
|
19
|
+
@env["vm.modify"].expects(:call).never
|
19
20
|
@app.expects(:call).with(@env).once
|
20
21
|
@instance.call(@env)
|
21
22
|
end
|
22
23
|
|
23
24
|
should "run the VM customization procs then save the VM" do
|
24
|
-
|
25
|
-
@env
|
26
|
-
@
|
25
|
+
ran = false
|
26
|
+
@env["config"].vm.customize { |vm| }
|
27
|
+
@env["config"].vm.expects(:run_procs!).with(@internal_vm)
|
28
|
+
|
29
|
+
@env["vm.modify"].expects(:call).with() do |proc|
|
30
|
+
proc.call(@internal_vm)
|
31
|
+
true
|
32
|
+
end
|
33
|
+
|
27
34
|
@app.expects(:call).with(@env).once
|
28
35
|
@instance.call(@env)
|
29
36
|
end
|
@@ -8,6 +8,7 @@ class ForwardPortsVMActionTest < Test::Unit::TestCase
|
|
8
8
|
@vm = mock("vm")
|
9
9
|
@vm.stubs(:name).returns("foo")
|
10
10
|
@env["vm"] = @vm
|
11
|
+
@env["vm.modify"] = mock("proc")
|
11
12
|
end
|
12
13
|
|
13
14
|
context "initializing" do
|
@@ -123,6 +124,12 @@ class ForwardPortsVMActionTest < Test::Unit::TestCase
|
|
123
124
|
context "calling" do
|
124
125
|
should "clear all previous ports and forward new ports" do
|
125
126
|
exec_seq = sequence("exec_seq")
|
127
|
+
|
128
|
+
@env["vm.modify"].expects(:call).with() do |proc|
|
129
|
+
proc.call(@internal_vm)
|
130
|
+
true
|
131
|
+
end
|
132
|
+
|
126
133
|
@instance.expects(:forward_ports).once.in_sequence(exec_seq)
|
127
134
|
@app.expects(:call).once.with(@env).in_sequence(exec_seq)
|
128
135
|
@instance.call(@env)
|
@@ -143,9 +150,8 @@ class ForwardPortsVMActionTest < Test::Unit::TestCase
|
|
143
150
|
network_adapter.expects(:attachment_type).returns(:nat)
|
144
151
|
|
145
152
|
@instance.expects(:forward_port).once
|
146
|
-
|
147
|
-
@
|
148
|
-
@instance.forward_ports
|
153
|
+
|
154
|
+
@instance.forward_ports(@internal_vm)
|
149
155
|
end
|
150
156
|
|
151
157
|
should "not port forward for non NAT interfaces" do
|
@@ -154,9 +160,8 @@ class ForwardPortsVMActionTest < Test::Unit::TestCase
|
|
154
160
|
|
155
161
|
@internal_vm.expects(:network_adapters).returns([network_adapter])
|
156
162
|
network_adapter.expects(:attachment_type).returns(:host_only)
|
157
|
-
|
158
|
-
@
|
159
|
-
@instance.forward_ports
|
163
|
+
|
164
|
+
@instance.forward_ports(@internal_vm)
|
160
165
|
end
|
161
166
|
end
|
162
167
|
|
@@ -188,7 +193,7 @@ class ForwardPortsVMActionTest < Test::Unit::TestCase
|
|
188
193
|
adapters[opts[:adapter]] = adapter
|
189
194
|
@internal_vm.stubs(:network_adapters).returns(adapters)
|
190
195
|
|
191
|
-
@instance.forward_port(name, opts)
|
196
|
+
@instance.forward_port(@internal_vm, name, opts)
|
192
197
|
end
|
193
198
|
end
|
194
199
|
end
|
@@ -20,9 +20,13 @@ class MatchMACAddressVMActionTest < Test::Unit::TestCase
|
|
20
20
|
|
21
21
|
update_seq = sequence("update_seq")
|
22
22
|
@internal_vm.expects(:network_adapters).returns([nic]).once.in_sequence(update_seq)
|
23
|
-
@internal_vm.expects(:save).once.in_sequence(update_seq)
|
24
23
|
@app.expects(:call).with(@env).once.in_sequence(update_seq)
|
25
24
|
|
25
|
+
@env["vm.modify"].expects(:call).with() do |proc|
|
26
|
+
proc.call(@internal_vm)
|
27
|
+
true
|
28
|
+
end
|
29
|
+
|
26
30
|
@instance.call(@env)
|
27
31
|
end
|
28
32
|
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require "test_helper"
|
2
|
+
|
3
|
+
class ModifyVMActionTest < Test::Unit::TestCase
|
4
|
+
setup do
|
5
|
+
@klass = Vagrant::Action::VM::Modify
|
6
|
+
@app, @env = action_env
|
7
|
+
|
8
|
+
@vm = mock("vm")
|
9
|
+
@vm.stubs(:ssh).returns(mock("ssh"))
|
10
|
+
@env["vm"] = @vm
|
11
|
+
|
12
|
+
@internal_vm = mock("internal")
|
13
|
+
@vm.stubs(:vm).returns(@internal_vm)
|
14
|
+
|
15
|
+
@instance = @klass.new(@app, @env)
|
16
|
+
end
|
17
|
+
|
18
|
+
context "initialization" do
|
19
|
+
should "have the vm.modify function setup in the environment" do
|
20
|
+
assert @env.has_key?("vm.modify")
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
context "calling" do
|
25
|
+
should "run the procs with the VM as an argument and save the VM" do
|
26
|
+
seq = sequence("procseq")
|
27
|
+
|
28
|
+
proc = Proc.new { |vm| }
|
29
|
+
@env["vm.modify"].call(proc)
|
30
|
+
|
31
|
+
proc.expects(:call).with(@internal_vm).once.in_sequence(seq)
|
32
|
+
@internal_vm.expects(:save).once.in_sequence(seq)
|
33
|
+
@vm.expects(:reload!).once.in_sequence(seq)
|
34
|
+
|
35
|
+
@instance.call(@env)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -15,29 +15,6 @@ class ProvisionVMActionTest < Test::Unit::TestCase
|
|
15
15
|
@vm.stubs(:vm).returns(@internal_vm)
|
16
16
|
end
|
17
17
|
|
18
|
-
context "initializing" do
|
19
|
-
setup do
|
20
|
-
@klass.any_instance.stubs(:load_provisioners)
|
21
|
-
end
|
22
|
-
|
23
|
-
should "load provisioner if provisioning enabled" do
|
24
|
-
@env["config"].vm.provision :chef_solo
|
25
|
-
@klass.any_instance.expects(:load_provisioners).once
|
26
|
-
@klass.new(@app, @env)
|
27
|
-
end
|
28
|
-
|
29
|
-
should "not load provisioner if disabled" do
|
30
|
-
@klass.any_instance.expects(:load_provisioners).never
|
31
|
-
@klass.new(@app, @env)
|
32
|
-
end
|
33
|
-
|
34
|
-
should "not load provisioner if disabled through env hash" do
|
35
|
-
@env["provision.enabled"] = false
|
36
|
-
@klass.any_instance.expects(:load_provisioners).never
|
37
|
-
@klass.new(@app, @env)
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
18
|
context "with an instance" do
|
42
19
|
setup do
|
43
20
|
# Set provisioner to nil so the provisioner isn't loaded on init
|
@@ -46,16 +23,12 @@ class ProvisionVMActionTest < Test::Unit::TestCase
|
|
46
23
|
end
|
47
24
|
|
48
25
|
context "loading a provisioner" do
|
49
|
-
setup do
|
50
|
-
Vagrant::Provisioners::ChefSolo.any_instance.expects(:prepare).at_least(0)
|
51
|
-
end
|
52
|
-
|
53
26
|
should "instantiate and prepare each provisioner" do
|
54
27
|
@env["config"].vm.provision :chef_solo
|
55
28
|
@env["config"].vm.provision :chef_solo
|
56
|
-
@instance.
|
29
|
+
provisioners = @instance.enabled_provisioners
|
57
30
|
|
58
|
-
assert_equal 2,
|
31
|
+
assert_equal 2, provisioners.length
|
59
32
|
end
|
60
33
|
|
61
34
|
should "set the config for each provisioner" do
|
@@ -63,23 +36,25 @@ class ProvisionVMActionTest < Test::Unit::TestCase
|
|
63
36
|
chef.cookbooks_path = "foo"
|
64
37
|
end
|
65
38
|
|
66
|
-
@instance.
|
39
|
+
provisioners = @instance.enabled_provisioners
|
67
40
|
|
68
|
-
assert_equal "foo",
|
41
|
+
assert_equal "foo", provisioners.first.config.cookbooks_path
|
69
42
|
end
|
70
43
|
end
|
71
44
|
|
72
45
|
context "calling" do
|
73
|
-
setup do
|
74
|
-
Vagrant::Provisioners::ChefSolo.any_instance.stubs(:prepare)
|
75
|
-
@env["config"].vm.provision :chef_solo
|
76
|
-
@instance.load_provisioners
|
77
|
-
end
|
78
|
-
|
79
46
|
should "provision and continue chain" do
|
47
|
+
provisioners = [mock("one"), mock("two")]
|
80
48
|
seq = sequence("seq")
|
49
|
+
@instance.stubs(:enabled_provisioners).returns(provisioners)
|
50
|
+
|
51
|
+
provisioners.each do |prov|
|
52
|
+
prov.expects(:prepare).in_sequence(seq)
|
53
|
+
end
|
54
|
+
|
81
55
|
@app.expects(:call).with(@env).in_sequence(seq)
|
82
|
-
|
56
|
+
|
57
|
+
provisioners.each do |prov|
|
83
58
|
prov.expects(:provision!).in_sequence(seq)
|
84
59
|
end
|
85
60
|
|
@@ -0,0 +1,56 @@
|
|
1
|
+
require "test_helper"
|
2
|
+
|
3
|
+
class ProvisionerCleanupVMActionTest < Test::Unit::TestCase
|
4
|
+
setup do
|
5
|
+
@klass = Vagrant::Action::VM::ProvisionerCleanup
|
6
|
+
@app, @env = action_env
|
7
|
+
|
8
|
+
@vm = mock("vm")
|
9
|
+
@env["vm"] = @vm
|
10
|
+
|
11
|
+
@internal_vm = mock("internal")
|
12
|
+
@vm.stubs(:vm).returns(@internal_vm)
|
13
|
+
end
|
14
|
+
|
15
|
+
context "with an instance" do
|
16
|
+
setup do
|
17
|
+
# Set provisioner to nil so the provisioner isn't loaded on init
|
18
|
+
@env["config"].vm.provisioners.clear
|
19
|
+
@instance = @klass.new(@app, @env)
|
20
|
+
end
|
21
|
+
|
22
|
+
context "loading a provisioner" do
|
23
|
+
should "instantiate and prepare each provisioner" do
|
24
|
+
@env["config"].vm.provision :chef_solo
|
25
|
+
@env["config"].vm.provision :chef_solo
|
26
|
+
provisioners = @instance.enabled_provisioners
|
27
|
+
|
28
|
+
assert_equal 2, provisioners.length
|
29
|
+
end
|
30
|
+
|
31
|
+
should "set the config for each provisioner" do
|
32
|
+
@env["config"].vm.provision :chef_solo do |chef|
|
33
|
+
chef.cookbooks_path = "foo"
|
34
|
+
end
|
35
|
+
|
36
|
+
provisioners = @instance.enabled_provisioners
|
37
|
+
|
38
|
+
assert_equal "foo", provisioners.first.config.cookbooks_path
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
context "calling" do
|
43
|
+
should "provision and continue chain" do
|
44
|
+
provisioners = [mock("one"), mock("two")]
|
45
|
+
seq = sequence("seq")
|
46
|
+
@instance.stubs(:enabled_provisioners).returns(provisioners)
|
47
|
+
provisioners.each do |prov|
|
48
|
+
prov.expects(:cleanup).in_sequence(seq)
|
49
|
+
end
|
50
|
+
@app.expects(:call).with(@env).in_sequence(seq)
|
51
|
+
|
52
|
+
@instance.call(@env)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -10,6 +10,7 @@ class ShareFoldersVMActionTest < Test::Unit::TestCase
|
|
10
10
|
@vm.stubs(:ssh).returns(mock("ssh"))
|
11
11
|
@vm.stubs(:system).returns(mock("system"))
|
12
12
|
@env["vm"] = @vm
|
13
|
+
@env["vm.modify"] = mock("proc")
|
13
14
|
|
14
15
|
@internal_vm = mock("internal")
|
15
16
|
@vm.stubs(:vm).returns(@internal_vm)
|
@@ -105,7 +106,11 @@ class ShareFoldersVMActionTest < Test::Unit::TestCase
|
|
105
106
|
end
|
106
107
|
|
107
108
|
@internal_vm.stubs(:shared_folders).returns(shared_folders)
|
108
|
-
|
109
|
+
|
110
|
+
@env["vm.modify"].expects(:call).with() do |proc|
|
111
|
+
proc.call(@internal_vm)
|
112
|
+
true
|
113
|
+
end
|
109
114
|
|
110
115
|
@instance.create_metadata
|
111
116
|
end
|
@@ -114,8 +119,8 @@ class ShareFoldersVMActionTest < Test::Unit::TestCase
|
|
114
119
|
context "mounting the shared folders" do
|
115
120
|
setup do
|
116
121
|
@folders = stub_shared_folders(<<-sf)
|
117
|
-
config.vm.share_folder("foo", "fooguest", "foohost")
|
118
|
-
config.vm.share_folder("bar", "barguest", "barhost")
|
122
|
+
config.vm.share_folder("foo", "fooguest", "foohost", :owner => "yo", :group => "fo")
|
123
|
+
config.vm.share_folder("bar", "barguest", "barhost", :owner => "foo", :group => "bar")
|
119
124
|
config.vm.share_folder("foo_no_mount", nil, "foohost2")
|
120
125
|
sf
|
121
126
|
@ssh = mock("ssh")
|
@@ -127,9 +132,9 @@ class ShareFoldersVMActionTest < Test::Unit::TestCase
|
|
127
132
|
mount_seq = sequence("mount_seq")
|
128
133
|
@folders.each do |name, data|
|
129
134
|
if data[:guestpath]
|
130
|
-
@vm.system.expects(:mount_shared_folder).with(@ssh, name, data[:guestpath]).in_sequence(mount_seq)
|
135
|
+
@vm.system.expects(:mount_shared_folder).with(@ssh, name, data[:guestpath], data[:owner], data[:group]).in_sequence(mount_seq)
|
131
136
|
else
|
132
|
-
@vm.system.expects(:mount_shared_folder).with(@ssh, name, anything).never
|
137
|
+
@vm.system.expects(:mount_shared_folder).with(@ssh, name, anything, anything, anything).never
|
133
138
|
end
|
134
139
|
end
|
135
140
|
|