Sha256: 4e29f99cc4ee4c80cfd1a0ab169e9bfd584754efc5ab20284c668e83217ffe12

Contents?: true

Size: 1.11 KB

Versions: 7

Compression:

Stored size: 1.11 KB

Contents

require File.expand_path("../../../../../base", __FILE__)

describe "VagrantPlugins::VagrantPlugins::Cap::MountNFS" do
  let(:plugin) { VagrantPlugins::GuestSmartos::Plugin.components.guest_capabilities[:smartos].get(:mount_nfs_folder) }
  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 ".mount_nfs_folder" do
    it "creates the directory mount point" do
      communicator.expect_command(%Q(pfexec mkdir -p /mountpoint))
      plugin.mount_nfs_folder(machine, '1.1.1.1', {'nfs' => {guestpath: '/mountpoint'}})
    end

    it "mounts the NFS share" do
      communicator.expect_command(%Q(pfexec /usr/sbin/mount -F nfs '1.1.1.1:/some/share' '/mountpoint'))
      plugin.mount_nfs_folder(machine, '1.1.1.1', {'nfs' => {guestpath: '/mountpoint', hostpath: '/some/share'}})
    end
  end
end

Version data entries

7 entries across 4 versions & 3 rubygems

Version Path
vagrant-unbundled-1.8.1.2 test/unit/plugins/guests/smartos/cap/mount_nfs_test.rb
vagrant-unbundled-1.8.1.1 test/unit/plugins/guests/smartos/cap/mount_nfs_test.rb
vagrant-cloudstack-1.1.0 vendor/bundle/bundler/gems/vagrant-272fb27e0536/test/unit/plugins/guests/smartos/cap/mount_nfs_test.rb
vagrant-cloudstack-1.1.0 vendor/bundle/bundler/gems/vagrant-b421af58e8b3/test/unit/plugins/guests/smartos/cap/mount_nfs_test.rb
vagrant-cloudstack-1.1.0 vendor/bundle/bundler/gems/vagrant-309e896975d1/test/unit/plugins/guests/smartos/cap/mount_nfs_test.rb
vagrant-cloudstack-1.1.0 vendor/bundle/bundler/gems/vagrant-1cf2a8db4ccb/test/unit/plugins/guests/smartos/cap/mount_nfs_test.rb
vagrant-tiktalik-0.0.3 vendor/bundle/ruby/2.0.0/bundler/gems/vagrant-1e28f1ac31e7/test/unit/plugins/guests/smartos/cap/mount_nfs_test.rb