From 1cf0e6240031e5332218ddc077cbf073f38fa129 Mon Sep 17 00:00:00 2001 From: Jose Luis Duran Date: Thu, 28 Mar 2019 02:25:43 -0300 Subject: [PATCH] BSD: VirtualBox shared folders naming convention This is a follow-up of #10717 to use the same naming convention as on Linux guests, in order to reduce the diffs. Also adds the missing capability to `unmount_virtualbox_shared_folder` on FreeBSD guests. --- .../{virtualbox.rb => mount_virtualbox_shared_folder.rb} | 2 +- plugins/guests/bsd/plugin.rb | 4 ++-- .../{virtualbox.rb => mount_virtualbox_shared_folder.rb} | 2 +- plugins/guests/freebsd/plugin.rb | 9 +++++++-- ...x_test.rb => mount_virtual_box_shared_folder_test.rb} | 2 +- ...x_test.rb => mount_virtual_box_shared_folder_test.rb} | 2 +- 6 files changed, 13 insertions(+), 8 deletions(-) rename plugins/guests/bsd/cap/{virtualbox.rb => mount_virtualbox_shared_folder.rb} (93%) rename plugins/guests/freebsd/cap/{virtualbox.rb => mount_virtualbox_shared_folder.rb} (98%) rename test/unit/plugins/guests/bsd/cap/{virtualbox_test.rb => mount_virtual_box_shared_folder_test.rb} (93%) rename test/unit/plugins/guests/freebsd/cap/{virtualbox_test.rb => mount_virtual_box_shared_folder_test.rb} (99%) diff --git a/plugins/guests/bsd/cap/virtualbox.rb b/plugins/guests/bsd/cap/mount_virtualbox_shared_folder.rb similarity index 93% rename from plugins/guests/bsd/cap/virtualbox.rb rename to plugins/guests/bsd/cap/mount_virtualbox_shared_folder.rb index 14406c534..83bb26699 100644 --- a/plugins/guests/bsd/cap/virtualbox.rb +++ b/plugins/guests/bsd/cap/mount_virtualbox_shared_folder.rb @@ -1,7 +1,7 @@ module VagrantPlugins module GuestBSD module Cap - class VirtualBox + class MountVirtualBoxSharedFolder # BSD-based guests do not currently support VirtualBox synced folders. # Instead of raising an error about a missing capability, this defines # the capability and then provides a more detailed error message, diff --git a/plugins/guests/bsd/plugin.rb b/plugins/guests/bsd/plugin.rb index 9a726cfdc..9bd2ae7a3 100644 --- a/plugins/guests/bsd/plugin.rb +++ b/plugins/guests/bsd/plugin.rb @@ -42,8 +42,8 @@ module VagrantPlugins end guest_capability(:bsd, :mount_virtualbox_shared_folder) do - require_relative "cap/virtualbox" - Cap::VirtualBox + require_relative "cap/mount_virtualbox_shared_folder" + Cap::MountVirtualBoxSharedFolder end guest_capability(:bsd, :remove_public_key) do diff --git a/plugins/guests/freebsd/cap/virtualbox.rb b/plugins/guests/freebsd/cap/mount_virtualbox_shared_folder.rb similarity index 98% rename from plugins/guests/freebsd/cap/virtualbox.rb rename to plugins/guests/freebsd/cap/mount_virtualbox_shared_folder.rb index df1e91437..1ee10a53d 100644 --- a/plugins/guests/freebsd/cap/virtualbox.rb +++ b/plugins/guests/freebsd/cap/mount_virtualbox_shared_folder.rb @@ -3,7 +3,7 @@ require_relative "../../../synced_folders/unix_mount_helpers" module VagrantPlugins module GuestFreeBSD module Cap - class VirtualBox + class MountVirtualBoxSharedFolder extend SyncedFolder::UnixMountHelpers def self.mount_virtualbox_shared_folder(machine, name, guestpath, options) diff --git a/plugins/guests/freebsd/plugin.rb b/plugins/guests/freebsd/plugin.rb index 9234bf402..4e571de82 100644 --- a/plugins/guests/freebsd/plugin.rb +++ b/plugins/guests/freebsd/plugin.rb @@ -52,8 +52,13 @@ module VagrantPlugins end guest_capability(:freebsd, :mount_virtualbox_shared_folder) do - require_relative "cap/virtualbox" - Cap::VirtualBox + require_relative "cap/mount_virtualbox_shared_folder" + Cap::MountVirtualBoxSharedFolder + end + + guest_capability(:freebsd, :unmount_virtualbox_shared_folder) do + require_relative "cap/mount_virtualbox_shared_folder" + Cap::MountVirtualBoxSharedFolder end end end diff --git a/test/unit/plugins/guests/bsd/cap/virtualbox_test.rb b/test/unit/plugins/guests/bsd/cap/mount_virtual_box_shared_folder_test.rb similarity index 93% rename from test/unit/plugins/guests/bsd/cap/virtualbox_test.rb rename to test/unit/plugins/guests/bsd/cap/mount_virtual_box_shared_folder_test.rb index e8ed3d0d3..7d232654f 100644 --- a/test/unit/plugins/guests/bsd/cap/virtualbox_test.rb +++ b/test/unit/plugins/guests/bsd/cap/mount_virtual_box_shared_folder_test.rb @@ -1,6 +1,6 @@ require_relative "../../../../base" -describe "VagrantPlugins::GuestBSD::Cap::VirtualBox" do +describe "VagrantPlugins::GuestBSD::Cap::MountVirtualBoxSharedFolder" do let(:caps) do VagrantPlugins::GuestBSD::Plugin .components diff --git a/test/unit/plugins/guests/freebsd/cap/virtualbox_test.rb b/test/unit/plugins/guests/freebsd/cap/mount_virtual_box_shared_folder_test.rb similarity index 99% rename from test/unit/plugins/guests/freebsd/cap/virtualbox_test.rb rename to test/unit/plugins/guests/freebsd/cap/mount_virtual_box_shared_folder_test.rb index 062b9e4c1..ba6bf6b26 100644 --- a/test/unit/plugins/guests/freebsd/cap/virtualbox_test.rb +++ b/test/unit/plugins/guests/freebsd/cap/mount_virtual_box_shared_folder_test.rb @@ -1,6 +1,6 @@ require_relative "../../../../base" -describe "VagrantPlugins::GuestFreeBSD::Cap::VirtualBox" do +describe "VagrantPlugins::GuestFreeBSD::Cap::MountVirtualBoxSharedFolder" do let(:caps) do VagrantPlugins::GuestFreeBSD::Plugin .components