Check :verify_host_key value for :never or if falsey
This commit is contained in:
parent
38d48ba153
commit
d48b95ffaf
|
@ -101,7 +101,7 @@ module VagrantPlugins
|
||||||
end
|
end
|
||||||
|
|
||||||
# no strict hostkey checking unless paranoid
|
# no strict hostkey checking unless paranoid
|
||||||
if ! ssh_info[:verify_host_key]
|
if ssh_info[:verify_host_key] == :never || !ssh_info[:verify_host_key]
|
||||||
rsh += [
|
rsh += [
|
||||||
"-o", "StrictHostKeyChecking=no",
|
"-o", "StrictHostKeyChecking=no",
|
||||||
"-o", "UserKnownHostsFile=/dev/null"]
|
"-o", "UserKnownHostsFile=/dev/null"]
|
||||||
|
|
|
@ -263,6 +263,26 @@ describe VagrantPlugins::SyncedFolderRSync::RsyncHelper do
|
||||||
subject.rsync_single(machine, ssh_info, opts)
|
subject.rsync_single(machine, ssh_info, opts)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "includes StrictHostKeyChecking, and UserKnownHostsFile when verify_host_key is false" do
|
||||||
|
expect(Vagrant::Util::Subprocess).to receive(:execute).with(any_args) { |*args|
|
||||||
|
expect(args[9]).to include('StrictHostKeyChecking')
|
||||||
|
expect(args[9]).to include('UserKnownHostsFile')
|
||||||
|
}.and_return(result)
|
||||||
|
|
||||||
|
subject.rsync_single(machine, ssh_info, opts)
|
||||||
|
end
|
||||||
|
|
||||||
|
it "includes StrictHostKeyChecking, and UserKnownHostsFile when verify_host_key is :never" do
|
||||||
|
ssh_info[:verify_host_key] = :never
|
||||||
|
|
||||||
|
expect(Vagrant::Util::Subprocess).to receive(:execute).with(any_args) { |*args|
|
||||||
|
expect(args[9]).to include('StrictHostKeyChecking')
|
||||||
|
expect(args[9]).to include('UserKnownHostsFile')
|
||||||
|
}.and_return(result)
|
||||||
|
|
||||||
|
subject.rsync_single(machine, ssh_info, opts)
|
||||||
|
end
|
||||||
|
|
||||||
it "omits IdentitiesOnly with keys_only = false" do
|
it "omits IdentitiesOnly with keys_only = false" do
|
||||||
ssh_info[:keys_only] = false
|
ssh_info[:keys_only] = false
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue