-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: don't test mounting user's home dir in tests
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
Showing
2 changed files
with
9 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | | ||
|
||
|
||
|