Add test for SMB mount_shared_folder function

This commit ensures that the command that adds the smb username and
password properly quotes the password given by the user.
This commit is contained in:
Brian Cain 2018-09-18 13:38:57 -07:00
parent b7d702ab5f
commit 5ebb548be9
No known key found for this signature in database
GPG Key ID: 43D51080D357A001
1 changed files with 1 additions and 0 deletions

View File

@ -98,6 +98,7 @@ describe "VagrantPlugins::GuestWindows::Cap::MountSharedFolder" do
share_name: "name",
vm_provider_unc_path: "\\\\host\\name",
})
expect(machine.communicate).to receive(:execute).with("cmdkey /add:host /user:user /pass:\"pass\"", {:shell=>:powershell, :elevated=>true})
described_class.mount_smb_shared_folder(machine, 'name', 'guestpath', {:smb_username => "user", :smb_password => "pass", :smb_host => "host"})
end
end