Skip to content

Commit

Permalink
tests: don't test mounting user's home dir in tests
Browse files Browse the repository at this point in the history
Testing the user's home dir is problemativ when testing vagrant in
vagrant using nested virtualization. This is because we essentially
end up trying to mount /home/vagrant from the first host over top of
/home/vagrant in the second host. We'll just stil with a simple mount
of './' for now and then check to make sure the Vagrantfile that was
used to bring up the machine is present.
  • Loading branch information
dustymabe committed Jul 20, 2016
1 parent 2442e77 commit aa0f6a9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
4 changes: 2 additions & 2 deletions features/step_definitions/user_home_dir_mount_steps.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
And(/^user's home directory should be mounted$/) do
run("vagrant ssh -c \"ls #{ENV['HOME']}\"")
And(/^vagrant current working directory should be mounted$/) do
run("vagrant ssh -c 'ls /testdir/Vagrantfile'")
expect(last_command_started).to have_exit_status(0)
end
17 changes: 7 additions & 10 deletions features/user_home_dir_mount.feature
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
Feature: Mount of user home directory
Feature: SSHFS mount of vagrant current working directory

Scenario Outline: Mounting the user's home directory
Scenario Outline: SSHFS mounting of vagrant cwd
Given a file named "Vagrantfile" with:
"""
Vagrant.configure('2') do |config|
config.vm.box = '<box>'
# Disable the default rsync
config.vm.synced_folder '.', '/vagrant', disabled: true
if Vagrant::Util::Platform.windows?
target_path = ENV['USERPROFILE'].gsub(/\\/,'/').gsub(/[[:alpha:]]{1}:/){|s|'/' + s.downcase.sub(':', '')}
config.vm.synced_folder ENV['USERPROFILE'], target_path, type: 'sshfs', sshfs_opts_append: '-o umask=000 -o uid=1000 -o gid=1000'
else
config.vm.synced_folder ENV['HOME'], ENV['HOME'], type: 'sshfs', sshfs_opts_append: '-o umask=000 -o uid=1000 -o gid=1000'
end
# Mount up the current dir. It will have the Vagrantfile in there.
config.vm.synced_folder './', '/testdir', type: 'sshfs'
end
"""
When I successfully run `bundle exec vagrant up`
Then stdout from "bundle exec vagrant up" should contain "Installing SSHFS client..."
And stdout from "bundle exec vagrant up" should contain "Mounting SSHFS shared folder..."
And stdout from "bundle exec vagrant up" should contain "Folder Successfully Mounted!"
And user's home directory should be mounted
And vagrant current working directory should be mounted

Examples:
| box |
| centos/7 |



0 comments on commit aa0f6a9

Please sign in to comment.