From 5ebb548be9914a00c6a72e64fd8a48502e47ab8c Mon Sep 17 00:00:00 2001 From: Brian Cain Date: Tue, 18 Sep 2018 13:38:57 -0700 Subject: [PATCH] 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. --- test/unit/plugins/guests/windows/cap/mount_shared_folder_test.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/test/unit/plugins/guests/windows/cap/mount_shared_folder_test.rb b/test/unit/plugins/guests/windows/cap/mount_shared_folder_test.rb index 021805629..7c02ad6e8 100644 --- a/test/unit/plugins/guests/windows/cap/mount_shared_folder_test.rb +++ b/test/unit/plugins/guests/windows/cap/mount_shared_folder_test.rb @@ -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