Nikhil Benesch 2df36892dd synced_folders/rsync: only chown when necessary [GH-3525]
Run remote rsync as root to guarantee that rsync can write to guestpath.
This obviates the need to chown the guestpath to the SSH user prior to
sync.

This brings a substantial speedup (2x on a moderately-sized shared
folder) and properly triggers filesystem notifications on only the files
changed by a given sync.
2014-04-25 15:00:12 -04:00

35 lines
1.1 KiB
Ruby

require File.expand_path("../../../../../base", __FILE__)
describe "VagrantPlugins::VagrantPlugins::Cap::Rsync" do
let(:plugin) { VagrantPlugins::GuestSmartos::Plugin.components.guest_capabilities[:smartos].get(:rsync_installed) }
let(:machine) { double("machine") }
let(:config) { double("config", smartos: VagrantPlugins::GuestSmartos::Config.new) }
let(:communicator) { VagrantTests::DummyCommunicator::Communicator.new(machine) }
before do
machine.stub(:communicate).and_return(communicator)
machine.stub(:config).and_return(config)
end
after do
communicator.verify_expectations!
end
describe ".rsync_installed" do
describe "when rsync is in the path" do
it "is true" do
communicator.stub_command("which rsync", stdout: '/usr/bin/rsync', exit_code: 0)
expect(plugin.rsync_installed(machine)).to be true
end
end
describe "when rsync is not in the path" do
it "is false" do
communicator.stub_command("which rsync", stdout: '', exit_code: 1)
expect(plugin.rsync_installed(machine)).to be false
end
end
end
end