Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add setting nfs_force_v3 to force NFS 3
Change-Id: Ie6a28e128ee06a3b2a02d0b8c83dff2b62050e26
  • Loading branch information
scfc authored and bd808 committed Jul 6, 2016
1 parent 9e5bd79 commit 13708c3
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Expand Up @@ -24,7 +24,7 @@ GIT
PATH
remote: .
specs:
mediawiki-vagrant (0.13.2)
mediawiki-vagrant (0.14.0)

GEM
remote: https://rubygems.org/
Expand Down
1 change: 1 addition & 0 deletions Vagrantfile
Expand Up @@ -145,6 +145,7 @@ Vagrant.configure('2') do |config|
root_share_options[:type] = :nfs
root_share_options[:mount_options] = ['noatime', 'rsize=32767', 'wsize=32767', 'async']
root_share_options[:mount_options] << 'fsc' if settings[:nfs_cache]
root_share_options[:mount_options] << 'vers=3' if settings[:nfs_force_v3]
config.nfs.map_uid = Process.uid
config.nfs.map_gid = Process.gid
else
Expand Down
3 changes: 3 additions & 0 deletions features/config.feature
Expand Up @@ -29,6 +29,7 @@ Feature: Command line configuration
| http_port |
| https_port |
| nfs_shares |
| nfs_force_v3 |
| forward_agent |
| forward_x11 |

Expand Down Expand Up @@ -77,6 +78,7 @@ Feature: Command line configuration
| https_port | 4433 |
| host_ip | 0.0.0.0 |
| nfs_shares | no |
| nfs_force_v3 | no |
| nfs_cache | yes |
| forward_agent | yes |
| forward_x11 | no |
Expand All @@ -90,6 +92,7 @@ Feature: Command line configuration
| https_port | 4433 |
| host_ip | 0.0.0.0 |
| nfs_shares | no |
| nfs_force_v3 | no |
| nfs_cache | yes |
| forward_agent | yes |
| forward_x11 | no |
Expand Down
6 changes: 6 additions & 0 deletions lib/mediawiki-vagrant/settings/definitions.rb
Expand Up @@ -47,6 +47,12 @@ module MediaWikiVagrant
default: defined?(Vagrant::Util::Platform) ? !Vagrant::Util::Platform.windows? : true,
coercion: ->(_setting, new) { !!(new.to_s =~ /^(true|t|yes|y|1)$/i) }

setting :nfs_force_v3,
description: 'Use NFS version 3',
help: "Enter 'yes' or 'no'.",
default: false,
coercion: ->(_setting, new) { !!(new.to_s =~ /^(true|t|yes|y|1)$/i) }

setting :nfs_cache,
description: 'Use cachefilesd to speed up NFS file access (EXPERIMENTAL)',
help: "Enter 'yes' or 'no'. If your VM is currently running, reload it after changing this setting.",
Expand Down
2 changes: 1 addition & 1 deletion lib/mediawiki-vagrant/version.rb
@@ -1,3 +1,3 @@
module MediaWikiVagrant
VERSION = '0.13.3'
VERSION = '0.14.0'
end
20 changes: 20 additions & 0 deletions spec/mediawiki_vagrant/settings/definitions_spec.rb
Expand Up @@ -127,6 +127,26 @@ module MediaWikiVagrant
end
end

describe 'nfs_force_v3' do
subject { definitions[:nfs_force_v3] }

context 'when a new value is set' do
it 'considers values "true", "t", "yes", "y", "1" all to be true' do
%w(true t yes y 1).each do |value|
subject.value = value
expect(subject.value).to be(true), "expected #{value} to be considered true"
end
end

it 'considers values "false", "f", "no", "n", "0" to be false' do
%w(false f no n 0).each do |value|
subject.value = value
expect(subject.value).to be(false), "expected #{value} to be considered false"
end
end
end
end

describe 'forward_agent' do
subject { definitions[:forward_agent] }

Expand Down

0 comments on commit 13708c3

Please sign in to comment.