Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Commit

Permalink
Merge pull request #14 from sedan07/mount_naming
Browse files Browse the repository at this point in the history
Changes to mount name param defined by server export class to remove spaces
  • Loading branch information
dwerder committed Mar 27, 2015
2 parents 6efe4e4 + a0d9461 commit f530cfe
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 8 deletions.
6 changes: 4 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
source 'https://rubygems.org'

puppetversion = ENV.key?('PUPPET_VERSION') ? "= #{ENV['PUPPET_VERSION']}" : ['>= 3.3']
puppetversion = ENV.key?('PUPPET_GEM_VERSION') ? "#{ENV['PUPPET_GEM_VERSION']}" : ['>= 3.3']
facterversion = ENV.key?('FACTER_GEM_VERSION') ? "#{ENV['FACTER_GEM_VERSION']}" : ['>= 1.7']
gem 'puppet', puppetversion
gem 'puppetlabs_spec_helper', '>= 0.1.0'
gem 'puppet-lint', '>= 0.3.2'
gem 'facter', '>= 1.7.0'
gem 'facter', facterversion
gem 'rspec', '< 3.2.0'
8 changes: 7 additions & 1 deletion manifests/server/export.pp
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,15 @@
clients => $clients,
}
if $mount == undef {
$_mount = $v3_export_name
} else {
$_mount = $mount
}
@@nfs::client::mount {"shared ${v3_export_name} by ${::clientcert}":
ensure => $ensure,
mount => $mount,
mount => $_mount,
remounts => $remounts,
atboot => $atboot,
options => $options,
Expand Down
30 changes: 25 additions & 5 deletions spec/defines/client_spec.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,30 @@
require 'spec_helper'

describe 'nfs::client::mount', :type => :define do
let(:title) { '/srv/test' }
let(:facts) { { :operatingsystem => 'ubuntu' } }
let(:params) {{ :server => 'nfs.int.net', :share => '/srv/share' } }
it do
should contain_class('nfs::client')
context "Mount created by exported resource" do
let(:title) { 'shared /srv/test by nfs.int.net' }
let(:facts) { { :operatingsystem => 'ubuntu', :clientcert => 'test.example.com' } }
let(:params) {{
:server => 'nfs.int.net',
:share => '/srv/share',
:mount => '/srv/share'
}}
it do
should compile
should contain_class('nfs::client')
should contain_mount('shared nfs.int.net:/srv/share by test.example.com /srv/share')
end
end

context "Mount manually set" do
let(:title) { '/srv/test' }
let(:facts) { { :operatingsystem => 'ubuntu', :clientcert => 'test.example.com' } }
let(:params) {{ :server => 'nfs.int.net', :share => '/srv/share' } }
it do
should compile
should contain_class('nfs::client')
should contain_mount('shared nfs.int.net:/srv/share by test.example.com /srv/test')
#should contain_mount('/srv/test')
end
end
end
6 changes: 6 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
require 'puppetlabs_spec_helper/module_spec_helper'

class Undef
def inspect
'undef'
end
end

0 comments on commit f530cfe

Please sign in to comment.